/* =============================================
   ECOVUELA · ARCHIVOS DEL EQUIPO
   Basado en la identidad del sitio (css/style.css):
   verde oliva #7A8C35, Lato + Playfair Display.
   ============================================= */

:root {
    --primary: #7A8C35;
    --primary-dark: #5a6b28;
    --primary-light: #9aad4a;
    --primary-soft: #eef2dc;
    --accent: #e8a020;
    --danger: #c2491f;
    --danger-soft: #fdece4;
    --success: #3d7a2a;
    --success-soft: #e6f2df;
    --warning: #9a6a00;
    --warning-soft: #fff4d6;
    --info: #2f6d86;
    --info-soft: #e3f1f7;

    --bg: #faf8f2;
    --bg-alt: #f5f2e8;
    --surface: #ffffff;
    --surface-2: #f8f7f1;
    --border: #e6e8da;
    --border-strong: #d6dbc2;
    --text: #2c3318;
    --text-mid: #4a5a28;
    --text-muted: #6b7a40;
    --focus: rgba(122, 140, 53, .28);
    --shadow: 0 4px 24px rgba(122, 140, 53, .10);
    --shadow-lg: 0 18px 50px rgba(44, 51, 24, .18);
    --overlay: rgba(32, 38, 16, .45);

    --radius: 14px;
    --radius-sm: 8px;
    --transition: .2s cubic-bezier(.4, 0, .2, 1);
    --font-body: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --primary: #a3b85a;
    --primary-dark: #c3d68a;
    --primary-light: #b8cc70;
    --primary-soft: #2b331a;
    --danger: #f08a62;
    --danger-soft: #3a2119;
    --success: #9fd07f;
    --success-soft: #1f2f19;
    --warning: #f0c460;
    --warning-soft: #36301a;
    --info: #86c5df;
    --info-soft: #182d36;

    --bg: #12150d;
    --bg-alt: #181c12;
    --surface: #1d2215;
    --surface-2: #232919;
    --border: #2f3622;
    --border-strong: #3d4630;
    --text: #eceedf;
    --text-mid: #cfd5b6;
    --text-muted: #9ea781;
    --focus: rgba(163, 184, 90, .35);
    --shadow: 0 4px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
    --overlay: rgba(0, 0, 0, .6);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; margin: 0; }
p { margin: 0; }
code { font-family: 'Cascadia Code', Consolas, monospace; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-muted); }
.small { font-size: .8rem; }
.nowrap { white-space: nowrap; }
.eyebrow { color: var(--primary); font-weight: 900; font-size: .7rem; letter-spacing: .14em; margin-bottom: 8px; }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
:root:not([data-theme="dark"]) .only-dark,
:root[data-theme="dark"] .only-light { display: none; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--primary-dark); font-weight: 900; font-size: 1.15rem; letter-spacing: .01em; }
.brand:hover { color: var(--primary-dark); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; font-family: var(--font-display); }
.brand-text small { font-family: var(--font-body); font-weight: 400; font-size: .72rem; color: var(--text-muted); letter-spacing: .04em; margin-top: 2px; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
    background: var(--primary); color: #fff; font: 700 1.45rem/1 var(--font-display);
    box-shadow: 0 4px 14px rgba(122, 140, 53, .35);
}
:root[data-theme="dark"] .brand-mark { color: #1a1f10; }
.brand-mark-lg { width: 58px; height: 58px; font-size: 2rem; margin: 0 auto 18px; display: grid; }
.brand-logo { height: 42px; width: auto; display: block; flex: none; }
.auth-logo { display: block; width: min(210px, 62%); height: auto; margin: -6px auto 14px; }
/* En oscuro se aclara el verde oliva del logo para mantener el contraste */
:root[data-theme="dark"] .brand-logo,
:root[data-theme="dark"] .auth-logo { filter: brightness(1.3) saturate(.8); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: var(--radius-sm); padding: 10px 16px;
    font-weight: 700; font-size: .9rem; cursor: pointer; line-height: 1.2; white-space: nowrap;
    transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn[disabled] { opacity: .65; cursor: progress; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(122, 140, 53, .28); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #161a0d; }
:root[data-theme="dark"] .btn-primary:hover { color: #161a0d; }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text-mid); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #1d0f0a; }
.btn-block { width: 100%; padding: 13px 16px; font-size: .95rem; }
.btn-sm { padding: 7px 11px; font-size: .8rem; }
.icon-button {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
    border: 1px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.icon-button:hover { background: var(--primary-soft); color: var(--primary-dark); }
.icon-button.danger:hover { background: var(--danger-soft); color: var(--danger); }
.theme-toggle { border-color: var(--border); background: var(--surface); }
.link-button { border: 0; background: none; padding: 0; color: var(--primary); font-weight: 700; cursor: pointer; font-size: .88rem; }
.link-button:hover { color: var(--primary-dark); text-decoration: underline; }
.link-button[disabled] { color: var(--text-muted); cursor: default; text-decoration: none; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; font-weight: 700; font-size: .83rem; color: var(--text-mid); }
.field input, .input-wrap {
    width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field input { padding: 11px 13px; font-weight: 400; color: var(--text); outline: none; }
.input-wrap { display: flex; align-items: center; gap: 10px; padding: 0 6px 0 13px; color: var(--text-muted); }
.input-wrap input { border: 0; padding: 12px 0; background: transparent; box-shadow: none !important; flex: 1; min-width: 0; }
.field input:focus, .input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.input-action { border: 0; background: none; color: var(--text-muted); cursor: pointer; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; }
.input-action:hover { color: var(--primary-dark); background: var(--primary-soft); }
.input-action .when-shown, .input-action.is-shown .when-hidden { display: none; }
.input-action.is-shown .when-shown { display: block; }

/* ---------- Avisos ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px;
    margin: 0 0 18px; font-size: .9rem; line-height: 1.5; text-align: left; border: 1px solid transparent;
    animation: slide-in .25s ease-out;
}
.alert > .icon { margin-top: 2px; }
.alert > span { flex: 1; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.alert-close { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 0; display: grid; }
.alert-close:hover { opacity: 1; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 3px 10px; font-size: .72rem; font-weight: 900; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* =============================================
   PANTALLAS DE ACCESO
   ============================================= */
.auth-body {
    min-height: 100vh; display: flex; flex-direction: column;
    background:
        radial-gradient(1100px 520px at 12% -10%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 60%),
        radial-gradient(900px 480px at 110% 110%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
        var(--bg);
}
.auth-topbar { display: flex; justify-content: space-between; align-items: center; padding: 18px max(16px, calc((100% - 1180px) / 2)); }
.auth-shell { flex: 1; display: grid; place-items: center; padding: 16px 16px 40px; }
.auth-card {
    width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    box-shadow: var(--shadow-lg); padding: 38px 34px 30px; text-align: center; animation: rise .35s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.auth-card h1 { font-size: clamp(1.6rem, 4vw, 2rem); margin-bottom: 10px; }
.auth-card > .muted { line-height: 1.6; margin-bottom: 26px; font-size: .93rem; }
.auth-card .form { text-align: left; }
.auth-icon { width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.auth-icon .icon { width: 28px; height: 28px; }
.masked-email { color: var(--text); font-size: 1rem; letter-spacing: .02em; }
.auth-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-muted); text-align: left; line-height: 1.5; }
.auth-note .icon { color: var(--primary); margin-top: 2px; }
.auth-secondary { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 22px; color: var(--text-muted); }

.code-inputs { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-inputs input {
    width: 100%; aspect-ratio: 1 / 1.15; text-align: center; font: 700 1.5rem var(--font-body);
    border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.code-inputs input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); background: var(--surface); }
.code-inputs input.filled { border-color: var(--primary-light); background: var(--surface); }
.code-timer { text-align: center; font-size: .85rem; }
.code-timer.expired strong { color: var(--danger); }

.dev-banner {
    margin: 0 0 20px; padding: 12px 14px; border-radius: 10px; text-align: left; font-size: .85rem; line-height: 1.5;
    background: var(--warning-soft); color: var(--warning); border: 1px dashed color-mix(in srgb, var(--warning) 45%, transparent);
}
.dev-banner strong { display: block; }
.dev-banner code { font-size: 1.05rem; font-weight: 700; letter-spacing: .15em; }

.site-footer { text-align: center; color: var(--text-muted); font-size: .78rem; padding: 18px; }

/* =============================================
   APLICACIÓN
   ============================================= */
.topbar {
    position: sticky; top: 0; z-index: 30; height: 70px; display: flex; align-items: center; gap: 18px;
    padding: 0 22px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar .brand { min-width: 220px; }
.topbar-search {
    flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 42px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; color: var(--text-muted);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.topbar-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); background: var(--surface); }
.topbar-search { min-width: 0; }
.topbar-search input { flex: 1; width: 100%; border: 0; background: none; outline: none; min-width: 0; color: var(--text); }
.topbar > * { flex-shrink: 0; }
.topbar > .topbar-search { flex-shrink: 1; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-actions form { display: contents; }
.sidebar-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta strong { font-size: .85rem; }
.user-meta small { font-size: .7rem; color: var(--primary); font-weight: 700; letter-spacing: .03em; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
    background: var(--primary-soft); color: var(--primary-dark); font-weight: 900; font-size: .78rem; letter-spacing: .02em;
}
.avatar-sm { width: 26px; height: 26px; font-size: .62rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.05rem; }

.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 70px); }
.sidebar {
    position: sticky; top: 70px; height: calc(100vh - 70px); padding: 22px 16px; display: flex; flex-direction: column; gap: 18px;
    border-right: 1px solid var(--border); background: var(--bg-alt); overflow-y: auto;
}
.side-nav { display: grid; gap: 3px; }
.side-nav a {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--text-mid); font-weight: 700; font-size: .9rem;
    transition: background var(--transition), color var(--transition);
}
.side-nav a:hover { background: var(--surface); color: var(--primary-dark); }
.side-nav a.active { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(122, 140, 53, .28); }
:root[data-theme="dark"] .side-nav a.active { color: #161a0d; }
.side-label { font-size: .68rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin: 14px 12px 6px; }
.storage-card { margin-top: auto; padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 3px; }
.storage-card .side-label { margin: 0 0 4px; }
.storage-card strong { font: 700 1.35rem var(--font-display); }

.main { padding: 30px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 6px 0 6px; word-break: break-word; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: .85rem; font-weight: 700; }
.breadcrumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); padding: 2px 6px; border-radius: 6px; }
.breadcrumbs a:hover { color: var(--primary-dark); background: var(--primary-soft); }
.breadcrumbs a:last-child { color: var(--text); }
.crumb-sep { color: var(--border-strong); width: 14px; height: 14px; }

.file-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.file-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: .85rem; }
.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented a { padding: 5px 12px; border-radius: 7px; color: var(--text-muted); font-weight: 700; font-size: .8rem; }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

.file-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.file-table th {
    text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
    font-weight: 900; padding: 11px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.file-table td { padding: 10px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.file-table tbody tr { transition: background var(--transition); }
.file-table tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.file-table tbody tr:last-child td { border-bottom: 0; }
.col-name { min-width: 0; width: 46%; }
.col-size, .col-date { white-space: nowrap; }
.col-size { text-align: right; }
th.col-size { text-align: right; }
.col-actions { width: 1%; white-space: nowrap; }
.item-link { display: inline-flex; align-items: center; gap: 12px; color: var(--text); font-weight: 700; max-width: 100%; }
.item-link:hover { color: var(--primary-dark); }
.item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-path { display: block; margin: 2px 0 0 50px; }
.file-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-muted); }
.file-icon .icon { width: 20px; height: 20px; }
.kind-folder { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.kind-image { background: var(--info-soft); color: var(--info); }
.kind-pdf { background: var(--danger-soft); color: var(--danger); }
.kind-doc { background: color-mix(in srgb, #3c6fc9 14%, transparent); color: #4a7fd8; }
.kind-sheet { background: var(--success-soft); color: var(--success); }
.kind-slide { background: color-mix(in srgb, #e07b2b 15%, transparent); color: #e07b2b; }
.kind-video, .kind-audio { background: color-mix(in srgb, #8a5bd1 14%, transparent); color: #9a6be0; }
.kind-archive { background: var(--warning-soft); color: var(--warning); }
.kind-geo { background: var(--primary-soft); color: var(--primary); }
.owner { display: inline-flex; align-items: center; gap: 8px; color: var(--text-mid); white-space: nowrap; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: .85; transition: opacity var(--transition); }
.file-table tr:hover .row-actions, .row-actions:focus-within { opacity: 1; }

.empty-state { padding: 64px 20px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.empty-state h2 { font-size: 1.35rem; }
.empty-state .btn { margin-top: 12px; }
.empty-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 6px; }
.empty-icon .icon { width: 30px; height: 30px; }

/* Selección múltiple y eliminar */
.file-table th.col-check, .file-table td.col-check { width: 46px; padding-right: 0; }
.row-check { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.file-table tbody tr.is-selected { background: color-mix(in srgb, var(--primary-soft) 90%, transparent); }
.selection-bar { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.selection-bar[hidden] { display: none; }
.selection-bar strong { font-size: .85rem; margin-right: 4px; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.btn .icon { flex: none; }

/* Subidas */
.upload-panel { margin-bottom: 18px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.upload-panel-head { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 10px; }
.upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 240px; overflow: auto; }
.upload-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: .83rem; }
.upload-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-list .state { color: var(--text-muted); font-weight: 700; }
.upload-list .state.ok { color: var(--success); }
.upload-list .state.err { color: var(--danger); }
.progress { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: inherit; transition: width .15s linear; }
.drop-overlay {
    position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--overlay); backdrop-filter: blur(3px);
}
.drop-overlay > div {
    display: grid; justify-items: center; gap: 6px; padding: 42px 54px; border-radius: 20px; background: var(--surface);
    border: 2px dashed var(--primary); color: var(--text); box-shadow: var(--shadow-lg); text-align: center;
}
.drop-overlay .icon { width: 40px; height: 40px; color: var(--primary); }
.drop-overlay span { color: var(--text-muted); font-size: .9rem; }

/* Actividad / equipo */
.activity-table td { font-size: .85rem; }
.col-detail { word-break: break-word; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-bottom: 20px; }
.team-card { display: flex; gap: 14px; align-items: flex-start; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.team-card h2 { font-size: 1.1rem; }
.team-card .small { word-break: break-all; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.info-box { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--radius); background: var(--info-soft); color: var(--info); }
.info-box .icon { margin-top: 3px; }
.info-box p { margin-top: 4px; font-size: .88rem; color: var(--text-mid); }

.team-pwd { margin-top: 10px; }
.team-reset { margin-top: 10px; }

/* Perfil */
.user-chip { color: var(--text); transition: border-color var(--transition), background var(--transition); }
.user-chip:hover { color: var(--text); border-color: var(--primary); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.panel-title { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; margin-bottom: 4px; }
.panel-title .icon { color: var(--primary); }
.panel > .muted.small { margin-bottom: 18px; }
.profile-grid { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-card { display: grid; justify-items: center; text-align: center; gap: 6px; position: sticky; top: 94px; }
.profile-card h2 { font-size: 1.3rem; margin-top: 8px; }
.avatar-xl { width: 84px; height: 84px; font-size: 1.6rem; }
.profile-facts { width: 100%; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); display: grid; gap: 8px; font-size: .85rem; }
.profile-facts div { display: flex; justify-content: space-between; gap: 10px; }
.profile-facts dt { color: var(--text-muted); }
.profile-facts dd { margin: 0; font-weight: 700; }
.profile-forms { display: grid; gap: 20px; min-width: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.password-rules { margin: 0; padding: 12px 14px 12px 32px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); font-size: .8rem; line-height: 1.7; text-align: left; }

.theme-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-option { position: relative; display: grid; gap: 10px; padding: 12px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color var(--transition), background var(--transition); }
.theme-option:hover { border-color: var(--border-strong); }
.theme-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-label { font-weight: 700; font-size: .88rem; }
.theme-label small { display: block; font-weight: 400; color: var(--text-muted); font-size: .72rem; }
.theme-swatch { display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: 1fr 1fr; gap: 4px; height: 58px; padding: 6px; border-radius: 8px; }
.theme-swatch span:first-child { grid-row: 1 / 3; border-radius: 4px; }
.theme-swatch span { border-radius: 4px; }
.theme-dark .theme-swatch { background: #12150d; }
.theme-dark .theme-swatch span:nth-child(1) { background: #181c12; }
.theme-dark .theme-swatch span:nth-child(2) { background: #a3b85a; }
.theme-dark .theme-swatch span:nth-child(3) { background: #1d2215; border: 1px solid #2f3622; }
.theme-light .theme-swatch { background: #faf8f2; border: 1px solid #e6e8da; }
.theme-light .theme-swatch span:nth-child(1) { background: #f5f2e8; }
.theme-light .theme-swatch span:nth-child(2) { background: #7A8C35; }
.theme-light .theme-swatch span:nth-child(3) { background: #fff; border: 1px solid #e6e8da; }
.theme-system .theme-swatch { background: linear-gradient(135deg, #faf8f2 50%, #12150d 50%); border: 1px solid var(--border); }
.theme-system .theme-swatch span:nth-child(1) { background: linear-gradient(135deg, #f5f2e8 50%, #181c12 50%); }
.theme-system .theme-swatch span:nth-child(2) { background: linear-gradient(135deg, #7A8C35 50%, #a3b85a 50%); }
.theme-system .theme-swatch span:nth-child(3) { background: linear-gradient(135deg, #fff 50%, #1d2215 50%); }

/* Diálogos */
.dialog {
    width: min(440px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: 16px; padding: 26px;
    background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
.dialog[open] { animation: rise .2s ease-out; }
.dialog h2 { font-size: 1.3rem; word-break: break-word; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.dialog-danger-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.dialog-danger-icon .icon { width: 24px; height: 24px; }
.dialog-preview { width: min(1100px, calc(100% - 32px)); height: min(86vh, 900px); padding: 0; display: none; flex-direction: column; overflow: hidden; }
.dialog-preview[open] { display: flex; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--border); }
.preview-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-head > div { display: flex; gap: 6px; align-items: center; }
.preview-body { flex: 1; display: grid; place-items: center; background: var(--surface-2); min-height: 0; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1000px) {
    .col-owner { display: none; }
    .topbar .brand { min-width: 0; }
    .user-meta { display: none; }
    .user-chip { padding: 3px; }
}
@media (max-width: 900px) {
    .profile-grid { grid-template-columns: 1fr; }
    .profile-card { position: static; }
}
@media (max-width: 820px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar-toggle { display: inline-grid; }
    .sidebar {
        position: fixed; top: 70px; left: 0; bottom: 0; width: 270px; height: auto; z-index: 40;
        transform: translateX(-100%); transition: transform var(--transition); box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: none; }
    .brand-text small { display: none; }
}
@media (max-width: 640px) {
    .topbar { gap: 8px; padding: 0 10px; }
    .topbar .brand-text { display: none; }
    .topbar .brand-logo { height: 30px; }
    .topbar-actions { gap: 4px; }
    .topbar-search { height: 38px; padding: 0 10px; gap: 6px; }
    .user-chip { border: 0; padding: 0; background: none; }
    .col-date { display: none; }
    .file-table { table-layout: fixed; }
    .file-table th.col-size, .file-table td.col-size { width: 74px; }
    .file-table th.col-actions, .file-table td.col-actions { width: 76px; }
    .file-table th.col-check, .file-table td.col-check { width: 34px; }
    .file-toolbar.has-selection .segmented { display: none; }
    .file-table td, .file-table th { padding: 10px 10px; }
    .item-link { gap: 10px; }
    .item-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
    .file-icon { width: 34px; height: 34px; }
    .item-path { margin-left: 44px; }
    .row-actions { opacity: 1; flex-wrap: wrap; gap: 0; }
    .row-actions .icon-button { width: 32px; height: 32px; }
    .file-toolbar { padding: 10px 12px; }
    .form-row { grid-template-columns: 1fr; }
    .theme-options { grid-template-columns: 1fr; }
    .theme-option { grid-template-columns: 90px 1fr; align-items: center; }
    .theme-swatch { height: 46px; }
    .panel { padding: 18px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .auth-card { padding: 30px 20px 24px; }
    .code-inputs { gap: 6px; }
    .col-ip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
