*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1a56db;
    --primary-dark: #1e429f;
    --sidebar-bg: #1e2a3a;
    --sidebar-hover: #2d3f55;
    --sidebar-active: #1a56db;
    --text: #111928;
    --text-muted: #6b7280;
    --bg: #f3f4f6;
    --white: #ffffff;
    --border: #e5e7eb;
    --danger: #f05252;
    --success: #0e9f6e;
    --blue: #1a56db;
    --green: #0e9f6e;
    --purple: #7e3af2;
    --orange: #ff5a1f;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); background: var(--bg); }

/* ── LOGIN ─────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: #f7fafc;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
}

.login-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    color: white;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(8, 24, 43, .97) 0%, rgba(12, 65, 78, .86) 48%, rgba(15, 118, 110, .34) 100%),
        url('../imgs/pexels-ai25studioai-5214962.jpg') center / cover no-repeat;
}

.login-hero-content {
    width: min(680px, 100%);
    padding: clamp(2rem, 5vw, 4.5rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    width: min(260px, 100%);
}

.login-brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    backdrop-filter: blur(10px);
}

.login-brand-mark img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.login-brand-logo {
    width: 100%;
    max-height: 76px;
    object-fit: contain;
    object-position: left center;
    display: block;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,.32));
}

.login-hero-copy { max-width: 610px; }
.login-kicker {
    display: inline-block;
    margin-bottom: 1rem;
    color: #b9f3df;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.login-hero-copy h1 {
    font-size: clamp(2rem, 4.5vw, 4rem);
    line-height: 1.02;
    font-weight: 750;
    margin-bottom: 1.25rem;
}

.login-hero-copy p {
    max-width: 540px;
    color: rgba(255,255,255,.82);
    font-size: 1.05rem;
    line-height: 1.65;
}

.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
}

.login-feature-grid div {
    min-height: 120px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(12px);
}

.login-feature-grid strong {
    display: block;
    margin-bottom: .45rem;
    color: #ffffff;
    font-size: .92rem;
}

.login-feature-grid span {
    display: block;
    color: rgba(255,255,255,.72);
    font-size: .78rem;
    line-height: 1.45;
}

.login-panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 4vw, 3rem);
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,249,252,.98)),
        radial-gradient(circle at 84% 12%, rgba(20, 184, 166, .16), transparent 30%);
}

.login-container { width: 100%; max-width: 430px; }

.login-card {
    background: var(--white);
    border: 1px solid rgba(17, 25, 40, .08);
    border-radius: 8px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: 0 24px 80px rgba(15, 23, 42, .12);
}

.login-header { margin-bottom: 2rem; }

.login-logo {
    width: 210px; height: auto;
    background: transparent;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    margin-bottom: 1.35rem;
    box-shadow: none;
}
.login-logo img {
    width: 100%;
    max-height: 96px;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.login-header h2 { font-size: 1.85rem; font-weight: 750; color: var(--text); }
.login-header p  { font-size: .94rem; color: var(--text-muted); margin-top: .35rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 650; margin-bottom: .45rem; color: #374151; }
.form-group input,
.form-group select {
    width: 100%; padding: .78rem .95rem;
    border: 1px solid #d7dee8; border-radius: 8px;
    font-size: .95rem; outline: none; transition: border-color .2s;
    background: #fbfdff;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus { border-color: #0f766e; box-shadow: 0 0 0 4px rgba(15,118,110,.12); background: white; }

.input-password { position: relative; }
.input-password input { padding-right: 2.75rem; width: 100%; }
.toggle-password {
    position: absolute; top: 50%; right: .5rem;
    transform: translateY(-50%);
    background: transparent; border: none;
    padding: .35rem; cursor: pointer;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    transition: color .15s, background .15s;
}
.toggle-password:hover { color: var(--primary); background: rgba(26,86,219,.08); }
.toggle-password svg { width: 18px; height: 18px; }

.btn-login {
    width: 100%; padding: .85rem;
    background: #1a56db; color: white;
    border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: background .2s, transform .2s, box-shadow .2s;
    box-shadow: 0 12px 26px rgba(26,86,219,.24);
}
.btn-login:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 16px 32px rgba(26,86,219,.28); }

.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem; }
.alert-error { background: #fde8e8; color: #c81e1e; border: 1px solid #f8b4b4; }

@media (max-width: 1020px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero {
        min-height: 48vh;
        background:
            linear-gradient(90deg, rgba(12, 37, 57, .94) 0%, rgba(12, 37, 57, .72) 58%, rgba(12, 37, 57, .32) 100%),
            url('../imgs/pexels-ai25studioai-5214962.jpg') center / cover no-repeat;
    }

    .login-panel {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .login-hero {
        min-height: auto;
    }

    .login-hero-content {
        padding: 1.5rem;
        gap: 2rem;
    }

    .login-hero-copy h1 {
        font-size: 2rem;
    }

    .login-hero-copy p {
        font-size: .95rem;
    }

    .login-feature-grid {
        grid-template-columns: 1fr;
    }

    .login-feature-grid div {
        min-height: auto;
    }

    .login-panel {
        padding: 1rem;
    }
}

/* ── LAYOUT DASHBOARD ───────────────────────────────────── */
.dashboard-page { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px; min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex; align-items: center; gap: .75rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-header svg { width: 28px; height: 28px; stroke: white; }
.sidebar-header span { font-size: 1.2rem; font-weight: 700; color: white; }

.sidebar-nav { flex: 1; padding: 1rem .75rem; display: flex; flex-direction: column; gap: .25rem; overflow-y: auto; min-height: 0; }

.nav-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem 1rem; border-radius: var(--radius);
    color: rgba(255,255,255,.65); text-decoration: none;
    font-size: .9rem; transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover  { background: var(--sidebar-hover); color: white; }
.nav-item.active { background: var(--sidebar-active); color: white; }
.nav-item-disabled { cursor: not-allowed; opacity: .65; }
.nav-item-disabled:hover { background: transparent; color: rgba(255,255,255,.65); }

.sidebar-footer {
    padding: 1rem .75rem;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; gap: .75rem;
}
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .95rem; flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name  { display: block; font-size: .875rem; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { display: block; font-size: .75rem; color: rgba(255,255,255,.5); }

.btn-logout {
    padding: .4rem; border-radius: 8px;
    color: rgba(255,255,255,.5); text-decoration: none;
    background: transparent; border: 0; cursor: pointer;
    transition: color .15s, background .15s;
}
.btn-logout:hover { color: var(--danger); background: rgba(240,82,82,.1); }
.btn-logout svg { width: 18px; height: 18px; display: block; }

/* ── MAIN CONTENT ───────────────────────────────────────── */
.main-content { margin-left: 260px; flex: 1; padding: 2rem; min-height: 100vh; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 2rem;
}
.topbar h2 { font-size: 1.5rem; font-weight: 700; }

.badge {
    padding: .3rem .85rem; border-radius: 999px;
    font-size: .8rem; font-weight: 600;
}
.badge-admin     { background: #e0e7ff; color: #3730a3; }
.badge-superadmin { background: #fee2e2; color: #991b1b; }
.badge-recepcion { background: #d1fae5; color: #065f46; }
.badge-enfermero { background: #fef3c7; color: #92400e; }
.badge-medico    { background: #ede9fe; color: #5b21b6; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white); border-radius: var(--radius);
    padding: 1.5rem; display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; stroke: white; }
.stat-blue   { background: var(--blue); }
.stat-green  { background: var(--green); }
.stat-purple { background: var(--purple); }
.stat-orange { background: var(--orange); }

.stat-value { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { display: block; font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

.welcome-card {
    background: var(--white); border-radius: var(--radius);
    padding: 1.75rem; box-shadow: var(--shadow);
}
.welcome-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; }
.welcome-card p  { color: var(--text-muted); font-size: .9rem; }

/* DASHBOARD REFINEMENT */
.dashboard-page {
    background: #f6f8fb;
}

.sidebar {
    background: linear-gradient(180deg, #08182b 0%, #102a3c 48%, #0c3a6b 100%);
    border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar-header {
    margin: .75rem .65rem .35rem;
    padding: .85rem .65rem;
    gap: .8rem;
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.9)),
        rgba(255,255,255,.76);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px;
    box-shadow: inset 0 0 22px rgba(15, 79, 77, .1), 0 10px 22px rgba(0,0,0,.08);
    backdrop-filter: blur(4px);
}

.sidebar-brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #0f766e;
    box-shadow: 0 10px 26px rgba(15, 118, 110, .28);
}

.sidebar-brand-mark img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

.sidebar-brand-text {
    min-width: 0;
    width: 100%;
}

.sidebar-brand-text span {
    display: block;
    color: white;
    font-size: 1rem;
    font-weight: 750;
}

.sidebar-brand-text small {
    display: block;
    margin-top: .45rem;
    color: #4b5563;
    font-size: .72rem;
    font-weight: 650;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-logo {
    width: min(224px, 100%);
    max-height: 76px;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: 0 auto;
    filter: none;
}

.sidebar-header > svg {
    display: none;
}

.nav-section {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .65rem .25rem .2rem;
    padding: 0 .75rem;
    color: rgba(255,255,255,.28);
    font-size: .65rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.nav-section::before {
    content: '';
    width: 14px;
    height: 1px;
    background: rgba(255,255,255,.18);
    flex-shrink: 0;
}

.nav-item {
    position: relative;
    min-height: 42px;
    border-radius: 8px;
}

.nav-item small {
    margin-left: auto;
    padding: .12rem .4rem;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.48);
    font-size: .68rem;
}

.nav-item.active {
    background: rgba(26, 86, 219, .95);
    box-shadow: 0 10px 24px rgba(26, 86, 219, .22);
}

.nav-dropdown {
    display: grid;
    gap: .25rem;
}

.nav-dropdown summary {
    list-style: none;
    cursor: pointer;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown-toggle {
    width: 100%;
}

.nav-chevron {
    margin-left: auto;
    width: 15px;
    height: 15px;
    transition: transform .15s;
}

.nav-dropdown[open] .nav-chevron {
    transform: rotate(180deg);
}

.nav-submenu {
    display: grid;
    gap: .18rem;
    margin-left: 1.15rem;
    padding-left: .7rem;
    border-left: 1px solid rgba(255,255,255,.1);
}

.nav-subitem {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .7rem;
    border-radius: 8px;
    color: rgba(255,255,255,.58);
    text-decoration: none;
    font-size: .82rem;
    transition: background .15s, color .15s;
}

.nav-subitem:hover {
    background: rgba(255,255,255,.08);
    color: white;
}

.nav-subitem.active {
    background: rgba(26, 86, 219, .28);
    color: white;
    font-weight: 700;
}

.nav-subitem small {
    margin-left: auto;
    padding: .1rem .35rem;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.45);
    font-size: .64rem;
}

.nav-subitem-disabled {
    cursor: not-allowed;
    opacity: .72;
}

.nav-subitem-disabled:hover {
    background: transparent;
    color: rgba(255,255,255,.58);
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); }

.sidebar-footer {
    padding: .75rem;
    background: rgba(255,255,255,.03);
}

.sidebar-dev-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s;
}
.sidebar-dev-link:hover { background: rgba(255,255,255,.06); }
.sidebar-dev-link svg {
    width: 14px; height: 14px;
    flex-shrink: 0;
    stroke: rgba(255,255,255,.35);
    transition: stroke .15s;
}
.sidebar-dev-link:hover svg { stroke: rgba(255,255,255,.6); }
.sidebar-dev-info { min-width: 0; }
.sidebar-dev-name {
    display: block;
    font-size: .8rem;
    font-weight: 650;
    color: rgba(255,255,255,.55);
    transition: color .15s;
}
.sidebar-dev-link:hover .sidebar-dev-name { color: rgba(255,255,255,.85); }
.sidebar-dev-desc {
    display: block;
    margin-top: .1rem;
    font-size: .7rem;
    color: rgba(255,255,255,.28);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-avatar {
    border-radius: 10px;
    background: #1a56db;
}

.main-content {
    padding: 2rem 2.25rem;
    padding-top: calc(52px + 1.75rem);
}

.topbar {
    align-items: flex-start;
    gap: 1rem;
}

.topbar-kicker,
.panel-kicker {
    display: block;
    margin-bottom: .25rem;
    color: #0f766e;
    font-size: .75rem;
    font-weight: 750;
    text-transform: uppercase;
}

.topbar h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 760;
    color: #111928;
}

.topbar p {
    margin: .25rem 0 0;
    color: var(--text-muted);
    font-size: .9rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-outline-action {
    min-height: 34px;
    padding: .35rem .8rem;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    background: white;
    color: #4b5563;
    font-size: .84rem;
    font-weight: 650;
    text-decoration: none;
}

.btn-outline-action:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    border: 1px solid #e5eaf1;
    border-radius: 8px;
    padding: 1.15rem;
    align-items: flex-start;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-value {
    font-size: 1.6rem;
}

.stat-label {
    color: #374151;
    font-size: .86rem;
    font-weight: 650;
}

.stat-hint {
    display: block;
    margin-top: .35rem;
    color: var(--text-muted);
    font-size: .75rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 1.25rem;
}

.dashboard-panel {
    min-height: 320px;
    background: white;
    border: 1px solid #e5eaf1;
    border-radius: 8px;
    padding: 1.35rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.panel-header h2 {
    margin: 0;
    color: #111928;
    font-size: 1.05rem;
    font-weight: 750;
}

.panel-count {
    padding: .22rem .6rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: .76rem;
    font-weight: 700;
}

.table-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.table-search {
    position: relative;
    width: min(100%, 420px);
}

.table-search svg {
    position: absolute;
    top: 50%;
    left: .85rem;
    width: 17px;
    height: 17px;
    color: #64748b;
    pointer-events: none;
    transform: translateY(-50%);
}

.table-search input {
    width: 100%;
    min-height: 40px;
    padding: .6rem .85rem .6rem 2.5rem;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: #fbfdff;
    color: var(--text);
    font: inherit;
    font-size: .88rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.table-search input:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 4px rgba(15,118,110,.12);
    background: white;
}

.table-empty-filter {
    min-height: 220px;
}

.empty-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px dashed #cfd8e3;
    border-radius: 8px;
    background: #f9fbfd;
    padding: 1.5rem;
}

.empty-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #e6f5f2;
    color: #0f766e;
    margin-bottom: 1rem;
}

.empty-icon svg {
    width: 25px;
    height: 25px;
}

.empty-state h3 {
    margin: 0 0 .45rem;
    font-size: 1rem;
    font-weight: 750;
    color: #111928;
}

.empty-state p {
    max-width: 420px;
    margin: 0;
    color: var(--text-muted);
    font-size: .88rem;
    line-height: 1.55;
}

.activity-list {
    display: grid;
    gap: .9rem;
}

.activity-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: .75rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid #eef2f7;
}

.activity-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.activity-item strong {
    display: block;
    color: #111928;
    font-size: .88rem;
    margin-bottom: .2rem;
}

.activity-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: .8rem;
    line-height: 1.45;
}

.activity-dot {
    width: 9px;
    height: 9px;
    margin-top: .28rem;
    border-radius: 50%;
    background: #cbd5e1;
}

.activity-green { background: #0e9f6e; }
.activity-blue { background: #1a56db; }
.activity-item.muted { opacity: .82; }

/* ── MENUBAR ─────────────────────────────────────────────── */
.menubar {
    position: fixed;
    top: 0; left: 260px; right: 0;
    height: 52px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: #ffffff;
    border-bottom: 1px solid #e5eaf1;
    box-shadow: 0 1px 4px rgba(15,23,42,.05);
}
.menubar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.menubar-session {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--text-muted);
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
}
.menubar-session svg { width: 13px; height: 13px; flex-shrink: 0; }
.menubar-sep { opacity: .45; }

.menubar-user {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .55rem .3rem .4rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #dde3eb;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.menubar-user:hover { background: #cdd5df; border-color: #c2cad5; }
.menubar-avatar {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .8rem;
    flex-shrink: 0;
}
.menubar-user-info {
    display: flex; align-items: center; gap: .45rem;
}
.menubar-user-name {
    font-size: .85rem; font-weight: 600; color: var(--text);
    white-space: nowrap;
}
.menubar-chevron {
    width: 14px; height: 14px;
    color: var(--text-muted);
    transition: transform .15s;
    flex-shrink: 0;
}
.menubar-user[aria-expanded="true"] .menubar-chevron { transform: rotate(180deg); }

.menubar-user-menu {
    min-width: 210px;
    padding: .3rem;
    border: 1px solid #e5eaf1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15,23,42,.1);
}
.menubar-user-header {
    padding: .45rem .75rem .4rem;
}
.menubar-user-header span {
    display: block;
    font-size: .76rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.menubar-user-menu .dropdown-item {
    display: flex; align-items: center; gap: .5rem;
    padding: .55rem .7rem;
    border-radius: 6px;
    color: var(--text);
    font-size: .85rem;
    cursor: pointer;
    transition: background .12s;
}
.menubar-user-menu .dropdown-item:hover { background: #f3f4f6; }
.menubar-user-menu .dropdown-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.menubar-user-menu .dropdown-item-logout { color: var(--danger); }
.menubar-user-menu .dropdown-item-logout:hover { background: #fde8e8; color: var(--danger); }
.menubar-user-menu .dropdown-divider { margin: .25rem .2rem; }

/* ── TEMAS ───────────────────────────────────────────────── */
.temas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}
.tema-card {
    border: 2px solid #e5eaf1;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    transition: border-color .18s, box-shadow .18s;
}
.tema-card:hover { border-color: #c0cad6; box-shadow: 0 6px 18px rgba(15,23,42,.08); }
.tema-card-activo { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(26,86,219,.12); }

.tema-preview {
    display: flex;
    height: 110px;
    background: #f6f8fb;
}
.tema-preview-sidebar {
    width: 38%;
    display: flex;
    flex-direction: column;
    padding: .5rem .35rem;
    gap: .3rem;
}
.tema-preview-logo {
    height: 10px;
    border-radius: 4px;
    background: rgba(255,255,255,.25);
    margin-bottom: .2rem;
}
.tema-preview-nav { display: flex; flex-direction: column; gap: .2rem; }
.tema-preview-nav-item { height: 7px; border-radius: 3px; opacity: .7; }
.tema-preview-nav-active { opacity: 1; }
.tema-preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: .4rem .45rem;
    gap: .35rem;
}
.tema-preview-topbar { height: 10px; border-radius: 3px; background: #e5eaf1; }
.tema-preview-body { display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.tema-preview-card { flex: 1; border-radius: 4px; background: white; border: 1px solid #e5eaf1; }
.tema-preview-btn { height: 10px; width: 55%; border-radius: 3px; align-self: flex-end; }

.tema-card-footer {
    padding: .7rem .85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    border-top: 1px solid #f0f4f8;
}
.tema-card-info { display: flex; align-items: center; gap: .45rem; }
.tema-card-nombre { font-size: .88rem; font-weight: 650; color: var(--text); }
.tema-badge-activo {
    padding: .15rem .45rem;
    border-radius: 999px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: .7rem;
    font-weight: 700;
}
.btn-tema-aplicar {
    padding: .28rem .65rem;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    white-space: nowrap;
}
.btn-tema-aplicar:hover { background: #f3f4f6; border-color: #9ca3af; }
/* ── FORMULARIO MÉDICO ───────────────────────────────────── */
.medico-toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: .55rem .9rem;
    border-radius: 8px;
    background: #1a56db;
    box-shadow: 0 6px 18px rgba(26,86,219,.28);
    width: fit-content;
    align-self: start;
}
.medico-toggle-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .85rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
}
.medico-toggle-label svg { width: 15px; height: 15px; stroke: #ffffff; }
.medico-toggle-wrap .form-check-input {
    width: 2.2em;
    height: 1.1em;
    cursor: pointer;
    border-color: rgba(255,255,255,.5);
    background-color: rgba(255,255,255,.2);
}
.medico-toggle-wrap .form-check-input:checked {
    background-color: #ffffff;
    border-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%231a56db'/%3e%3c/svg%3e");
}
.medico-toggle-wrap .form-check-input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,.3); }
.datos-medico-section {
    padding: 1rem;
    border: 1px dashed #c6d2e0;
    border-radius: 8px;
    background: #f8fafc;
}

.temas-seccion-label {
    margin: 0 0 .75rem;
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.users-panel {
    min-height: 420px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.data-table th,
.data-table td {
    padding: .9rem .85rem;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    vertical-align: middle;
    font-size: .86rem;
}

.data-table th {
    color: #64748b;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    background: #f8fafc;
}

.data-table tbody tr:hover {
    background: #fbfdff;
}

.table-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 210px;
}

.table-avatar {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #e6f5f2;
    color: #0f766e;
    font-size: .84rem;
    font-weight: 800;
    flex-shrink: 0;
}

.table-user strong {
    display: block;
    color: #111928;
    font-size: .9rem;
}

.table-user small {
    display: block;
    margin-top: .12rem;
    color: #94a3b8;
    font-size: .72rem;
}

.role-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 750;
    white-space: nowrap;
}

.role-pill {
    background: #eef2ff;
    color: #3730a3;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.company-panel {
    min-height: 520px;
}

.settings-form {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.settings-form .form-group {
    margin-bottom: 0;
}

.company-logo-section {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e5eaf1;
    border-radius: 8px;
    background: #f9fbfd;
}

.company-logo-preview {
    width: 104px;
    aspect-ratio: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: white;
    color: #0f766e;
}

.company-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .5rem;
}

.company-logo-placeholder {
    width: 34px;
    height: 34px;
}

.form-help {
    display: block;
    margin-top: .4rem;
    color: var(--text-muted);
    font-size: .76rem;
}
.select-empty-hint a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}
.select-empty-hint a:hover { color: var(--primary-dark); }
.form-group select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.settings-form textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    padding: .78rem .95rem;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: #fbfdff;
    color: var(--text);
    font: inherit;
    font-size: .95rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.settings-form textarea:focus,
.settings-form input:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 4px rgba(15,118,110,.12);
    background: white;
}

.settings-form input[readonly] {
    background: #f1f5f9;
    color: #64748b;
    cursor: default;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: .25rem;
}

.btn-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 38px;
    padding: .55rem 1rem;
    border: 0;
    border-radius: 8px;
    background: #1a56db;
    color: white;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(26,86,219,.2);
    transition: background .15s, transform .15s, box-shadow .15s;
}

.btn-primary-action:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(26,86,219,.25);
}

.btn-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
    justify-content: flex-end;
}

.inline-form {
    margin: 0;
}

.btn-table-action {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #e5eaf1;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.btn-table-action svg { width: 13px; height: 13px; }
.btn-table-text {
    width: auto;
    min-width: 72px;
    padding: 0 .6rem;
    font-size: .76rem;
    font-weight: 700;
}
.btn-view  { color: #0f766e; }
.btn-view:hover  { background: #f0fdf9; border-color: #99f6e4; }
.btn-requisicion-carro {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    text-decoration: none;
}
.btn-requisicion-carro:hover {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
    text-decoration: none;
}
.btn-edit  { color: #3b82f6; }
.btn-edit:hover  { background: #eff6ff; border-color: #bfdbfe; }
.btn-delete { color: var(--danger); }
.btn-delete:hover { background: #fde8e8; border-color: #fca5a5; }
/* ── Desglose impuesto (sección header del modal) ───────── */
.desglose-impuesto-fields {
    margin-top: .5rem;
    padding: .6rem .75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.req { color: #dc2626; font-size: .8rem; }

/* ── Toggle IVA ─────────────────────────────────────────── */
.entrada-toggle-field {
    display: flex;
}

.entrada-iva-toggle {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    cursor: pointer;
    user-select: none;
}
.entrada-iva-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}
.iva-toggle-track {
    position: relative;
    flex-shrink: 0;
    width: 38px; height: 22px;
    background: #475569;
    border: 1.5px solid #334155;
    border-radius: 22px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
    transition: background .2s, border-color .2s;
}
.iva-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.28);
    transition: transform .2s;
}
.entrada-iva-toggle input:checked ~ .iva-toggle-track {
    background: #1e40af;
    border-color: #1e3a8a;
}
.entrada-iva-toggle input:checked ~ .iva-toggle-track::after {
    background: #fff;
    transform: translateX(16px);
}

#editar-entrada-modal .iva-toggle-track {
    background: #334155;
    border-color: #1e293b;
}

#editar-entrada-modal .entrada-iva-toggle input:checked ~ .iva-toggle-track {
    background: #1e40af;
    border-color: #1e3a8a;
}

.iva-toggle-text {
    display: block;
    min-width: 0;
    color: var(--text-main);
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.25;
}
.iva-pct { color: var(--text-muted); font-size: .78rem; font-weight: 400; }

/* ── Desglose IVA por renglón ────────────────────────────── */
.entrada-iva-breakdown {
    display: none;
    gap: .4rem;
    font-size: .74rem;
    margin-top: .2rem;
    padding: .25rem .5rem;
    background: #eff6ff;
    border-left: 2px solid #93c5fd;
    border-radius: 0 4px 4px 0;
    grid-column: 3 / span 1;
}
.bd-neto  { color: #1e40af; font-weight: 600; }
.bd-sep   { color: #94a3b8; }
.bd-iva   { color: #64748b; }

.btn-pdf { color: #7c3aed; text-decoration: none; }
.btn-pdf:hover { background: #f5f3ff; border-color: #c4b5fd; color: #6d28d9; }

.entrada-pdf-body {
    height: min(78vh, 760px);
    padding: 0;
    background: #0f172a;
}

.entrada-pdf-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.btn-release-entry {
    background: #fef08a;
    border-color: #fde047;
    color: #15803d;
}
.btn-release-entry:hover {
    background: #fde047;
    border-color: #facc15;
    color: #15803d;
}

.btn-release-entry.btn-loading {
    gap: .35rem;
    cursor: wait;
    opacity: .82;
}

.btn-release-entry.btn-loading::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-release-blocked {
    background: #dcfce7;
    border-color: #86efac;
    color: #16a34a;
    cursor: default;
    pointer-events: none;
}

.empleado-detalle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .85rem 1.5rem;
}
.empleado-detalle-full { grid-column: 1 / -1; }
.empleado-detalle-item { display: flex; flex-direction: column; gap: .2rem; }
.empleado-detalle-label {
    font-size: .72rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}
.empleado-detalle-val {
    font-size: .9rem;
    color: var(--text);
    font-weight: 500;
}

.rooms-table {
    min-width: 760px;
}

.table-icon {
    width: 18px;
    height: 18px;
}

.empty-state-icon {
    width: 25px;
    height: 25px;
}

.app-modal {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .22);
}

.app-modal .modal-header,
.app-modal .modal-footer {
    border-color: #eef2f7;
}

.app-modal .modal-title {
    color: #111928;
    font-size: 1.05rem;
    font-weight: 750;
}

#producto-modal .modal-body,
#producto-edit-modal .modal-body {
    padding-top: .85rem;
    padding-bottom: .85rem;
}

#producto-modal .settings-form,
#producto-edit-modal .settings-form,
#producto-modal .form-grid,
#producto-edit-modal .form-grid {
    gap: .72rem;
}

#producto-modal .form-group label,
#producto-edit-modal .form-group label {
    margin-bottom: .28rem;
    font-size: .8rem;
}

#producto-modal .form-group input,
#producto-modal .form-group select,
#producto-edit-modal .form-group input,
#producto-edit-modal .form-group select {
    padding: .55rem .72rem;
    font-size: .88rem;
    border-radius: 7px;
}

#producto-modal .settings-form textarea,
#producto-edit-modal .settings-form textarea {
    min-height: 72px;
    padding: .55rem .72rem;
    font-size: .88rem;
    border-radius: 7px;
}

#producto-modal .form-help,
#producto-edit-modal .form-help {
    margin-top: .28rem;
    font-size: .72rem;
}

.entrada-header-grid {
    align-items: end;
}

.entrada-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    color: var(--text);
    font-size: .9rem;
    font-weight: 750;
}

.entrada-items-title {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.entrada-items-title small {
    color: var(--text-muted);
    font-size: .74rem;
    font-weight: 500;
    line-height: 1.3;
}

.entrada-items {
    display: grid;
    gap: .7rem;
    margin-top: .7rem;
}

.entrada-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) 34px;
    gap: .5rem;
    align-items: end;
    padding: .65rem .75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fbfdff;
}
.entrada-product-summary {
    grid-column: 1 / -1;
}
.entrada-row .form-group {
    min-width: 0;
}
.entrada-row .btn-table-action {
    align-self: flex-end;
}
.entrada-tax-group {
    display: contents;
}
.entrada-tax-group .form-group {
    min-width: 0;
}
.entrada-impuesto-display,
.entrada-costo-total-display {
    background: #f1f5f9 !important;
    color: #475569 !important;
    cursor: default;
}

.entrada-caducidad-group.entrada-caducidad-required label::after {
    content: " *";
    color: #dc2626;
}

.entrada-caducidad-input[readonly] {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.entrada-row .form-group label {
    margin-bottom: .2rem;
    font-size: .72rem;
}

.entrada-row .form-group input,
.entrada-row .form-group select {
    width: 100%;
    padding: .45rem .55rem;
    font-size: .84rem;
    border-radius: 6px;
}

#productos-selector-modal {
    z-index: 1070;
}

.entrada-selected-items {
    max-height: min(38vh, 360px);
    overflow: auto;
    padding-right: .15rem;
}

.entrada-empty-products {
    padding: .9rem 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: .86rem;
}

.entrada-product-summary {
    display: grid;
    gap: .2rem;
    align-self: center;
    min-width: 0;
}

.entrada-product-name {
    overflow: hidden;
    color: var(--text);
    font-size: .86rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entrada-product-stock {
    color: var(--text-muted);
    font-size: .74rem;
}

.entrada-price-warning {
    display: block;
    margin-top: .35rem;
    color: #dc2626;
    font-size: .70rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.entrada-search {
    margin-bottom: .9rem;
}

#productos-selector-modal .entrada-search {
    background: #fff;
    flex: 0 0 auto;
    padding: 0 0 .75rem;
}

#productos-selector-modal .modal-body {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 190px);
    overflow: hidden;
}

#productos-selector-modal .producto-selector-list {
    overflow-y: auto;
    padding-right: .25rem;
}

.producto-selector-list {
    display: grid;
    gap: .45rem;
}

.producto-selector-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 116px;
    gap: .65rem;
    align-items: center;
    min-height: 44px;
    padding: .55rem .65rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.producto-selector-row:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.producto-check {
    display: flex;
    align-items: center;
    justify-content: center;
}

.producto-check input {
    width: 18px;
    height: 18px;
}

.producto-selector-name {
    overflow: hidden;
    color: var(--text);
    font-size: .86rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.producto-selector-stock {
    color: #0f172a;
    font-size: .8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.error-page {
    min-height: 100vh;
    background:
        linear-gradient(120deg, rgba(8, 24, 43, .96), rgba(15, 79, 77, .9)),
        url('../imgs/pexels-ai25studioai-5214962.jpg') center / cover no-repeat;
}

.error-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.error-panel {
    width: min(520px, 100%);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 24px 80px rgba(0,0,0,.22);
    text-align: center;
}

.error-mark {
    color: #0f766e;
    font-size: 4rem;
    line-height: 1;
    font-weight: 850;
}

.error-panel h1 {
    margin: .8rem 0 .5rem;
    color: #111928;
    font-size: 1.6rem;
    font-weight: 760;
}

.error-panel p {
    margin: 0 auto 1.35rem;
    max-width: 360px;
    color: var(--text-muted);
    font-size: .94rem;
    line-height: 1.55;
}

.stock-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.stock-summary-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: .95rem 1rem;
    box-shadow: var(--shadow-sm);
}

.stock-summary-card span {
    display: block;
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 750;
    text-transform: uppercase;
}

.stock-summary-card strong {
    display: block;
    margin-top: .2rem;
    color: var(--text-main);
    font-size: 1.45rem;
    font-weight: 820;
    font-variant-numeric: tabular-nums;
}

.stock-summary-ok {
    border-color: #bbf7d0;
}

.stock-summary-low {
    border-color: #fde68a;
}

.stock-summary-empty {
    border-color: #fecaca;
}

.stock-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(160px, 200px) minmax(170px, 220px);
    gap: .85rem;
    margin-bottom: 1rem;
}

.stock-table td {
    vertical-align: middle;
}

.stock-qty {
    color: #0f172a;
    font-size: .95rem;
    font-weight: 820;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.stock-status {
    display: inline-flex;
    align-items: center;
    min-width: 86px;
    justify-content: center;
    border-radius: 999px;
    padding: .28rem .62rem;
    font-size: .72rem;
    font-weight: 800;
}

.stock-status-ok {
    background: #dcfce7;
    color: #166534;
}

.stock-status-bajo {
    background: #fef3c7;
    color: #92400e;
}

.stock-status-sin_stock {
    background: #fee2e2;
    color: #991b1b;
}

.stock-detail-table td {
    font-size: .84rem;
    vertical-align: middle;
}

.stock-modal-empty {
    display: none;
    margin-top: 1rem;
}

@media (max-width: 980px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .dashboard-page {
        display: block;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        align-items: flex-start;
    }

    .nav-dropdown {
        min-width: 220px;
    }

    .nav-submenu {
        margin-left: .5rem;
    }

    .sidebar-footer {
        display: none;
    }

    .menubar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem;
        padding-top: calc(52px + 1rem);
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .stock-summary-grid,
    .stock-filters {
        grid-template-columns: 1fr;
    }

    .form-grid-two,
    .form-grid-three,
    .form-grid-four {
        grid-template-columns: 1fr;
    }

    .company-logo-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .topbar {
        flex-direction: column;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .dashboard-summary {
        grid-template-columns: 1fr;
    }

    .sidebar-header {
        padding: 1rem;
    }
}
