/* ============================================================
   Pool Estudio — Sistema de Compartición de Archivos
   Paleta:  Fondo #000000 · Texto #FFFFFF · Divisiones #262626
            Texto secundario #9a9a9a · Acento #C9A961 (dorado sobrio)
            Estado correcto #4CAF6E · Estado error #E05C5C
   Tipografía: Inter/system-ui para UI · ui-monospace para datos
   técnicos (tokens, IPs, fechas de registro) — refuerza la idea
   de "bóveda segura" para transferencia de archivos.
   ============================================================ */

:root {
    --bg:        #000000;
    --panel:     #0a0a0a;
    --divider:   #262626;
    --divider-soft: #1a1a1a;
    --text:      #ffffff;
    --text-dim:  #9a9a9a;
    --text-faint:#5f5f5f;
    --accent:    #c9a961;
    --accent-dim:#8a7440;
    --ok:        #4caf6e;
    --error:     #e05c5c;
    --radius:    10px;
    --font-ui:   -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent); color: #000; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------------- Layout general del panel ---------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--panel);
    border-right: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
}

.sidebar .logo-slot {
    padding: 0 24px 24px 24px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--divider);
}

.logo-placeholder {
    width: 100%;
    height: 56px;
    border: 1px dashed var(--divider);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.logo-placeholder img { max-height: 100%; max-width: 100%; object-fit: contain; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    color: var(--text-dim);
    font-size: 14px;
    border-left: 2px solid transparent;
}
.nav-item:hover { color: var(--text); text-decoration: none; background: var(--divider-soft); }
.nav-item.active {
    color: var(--text);
    border-left-color: var(--accent);
    background: var(--divider-soft);
}
.nav-footer {
    margin-top: auto;
    padding: 16px 24px 0 24px;
    border-top: 1px solid var(--divider);
}
.nav-user {
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 10px;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 32px 40px;
}

.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -.01em;
}
.page-header .eyebrow {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
    margin-bottom: 6px;
}

/* ---------------- Tarjetas / paneles ---------------- */
.card {
    background: var(--panel);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 24px;
}
.card + .card { margin-top: 20px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-box {
    background: var(--panel);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-box .value {
    font-size: 26px;
    font-weight: 600;
    font-family: var(--font-mono);
}
.stat-box .label {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ---------------- Formularios ---------------- */
label {
    display: block;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 6px;
}
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="datetime-local"], select, textarea {
    width: 100%;
    background: #000;
    border: 1px solid var(--divider);
    color: var(--text);
    padding: 11px 13px;
    border-radius: 7px;
    font-size: 14px;
    font-family: var(--font-ui);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
.field { margin-bottom: 18px; }
.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #d9bb7a; text-decoration: none; }
.btn-secondary { background: transparent; border-color: var(--divider); color: var(--text); }
.btn-secondary:hover { border-color: var(--text-dim); text-decoration: none; }
.btn-danger { background: transparent; border-color: var(--error); color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; text-decoration: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---------------- Tablas ---------------- */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.data-table th {
    text-align: left;
    color: var(--text-dim);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 10px 12px;
    border-bottom: 1px solid var(--divider);
}
.data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--divider-soft);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}
.badge-ok { background: rgba(76,175,110,.12); color: var(--ok); }
.badge-error { background: rgba(224,92,92,.12); color: var(--error); }
.badge-neutral { background: var(--divider); color: var(--text-dim); }
.file-type-chip {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--accent);
    border: 1px solid var(--divider);
    border-radius: 5px;
    padding: 3px 6px;
    margin-right: 8px;
}

.alert {
    padding: 13px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 18px;
    border: 1px solid;
}
.alert-error { background: rgba(224,92,92,.08); border-color: rgba(224,92,92,.3); color: #f0a3a3; }
.alert-ok { background: rgba(76,175,110,.08); border-color: rgba(76,175,110,.3); color: #a7dab8; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-faint);
}
.empty-state p { margin: 6px 0 0 0; font-size: 13px; }

/* ---------------- Pantalla de login ---------------- */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    width: 100%;
    max-width: 380px;
    background: var(--panel);
    border: 1px solid var(--divider);
    border-radius: 12px;
    padding: 36px;
}
.login-box .logo-placeholder { height: 64px; margin-bottom: 24px; }
.login-box h1 {
    font-size: 17px;
    text-align: center;
    margin: 0 0 28px 0;
    color: var(--text-dim);
    font-weight: 500;
}

/* ============================================================
   Página pública de descarga (la que ve el cliente de la agencia)
   ============================================================ */
.download-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.download-card {
    width: 100%;
    max-width: 440px;
    background: var(--panel);
    border: 1px solid var(--divider);
    border-radius: 14px;
    padding: 44px 36px;
    text-align: center;
}
.download-card .logo-placeholder {
    width: 120px;
    height: 72px;
    margin: 0 auto 28px auto;
}
.download-card .file-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    word-break: break-word;
}
.download-card .file-meta {
    font-size: 12.5px;
    color: var(--text-dim);
    margin-bottom: 28px;
}
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    width: 100%;
    padding: 15px 24px;
    border-radius: 9px;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 14.5px;
    border: none;
    cursor: pointer;
}
.download-btn:hover { background: #d9bb7a; text-decoration: none; }
.download-footer {
    margin-top: 24px;
    font-size: 11px;
    color: var(--text-faint);
}
.expired-icon, .lock-icon { color: var(--text-faint); margin-bottom: 16px; }

@media (max-width: 720px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--divider); flex-direction: row; overflow-x: auto; padding: 12px; }
    .sidebar .logo-slot { display: none; }
    .nav-footer { display: none; }
    .main { padding: 20px; }
}
