:root {
    --bg: #ffffe6;
    --bg-soft: #fffdf1;
    --panel: rgba(255, 255, 241, 0.96);
    --line: rgba(0, 53, 117, 0.12);
    --text: #003575;
    --muted: #47698b;
    --primary: #0060ad;
    --primary-dark: #003575;
    --navy: #003575;
    --navy-soft: #0060ad;
    --support: #79b2c9;
    --success: #1f9d72;
    --warning: #f0a202;
    --danger: #d64550;
    --shadow: 0 24px 80px rgba(0, 53, 117, 0.12);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --sidebar-width: 270px;
    --sidebar-collapsed-width: 108px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(180deg, #fffef2 0%, #fffbe8 100%);
}

body.modal-open {
    overflow: hidden;
}

body.dashboard-page.modal-open .panel-main {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.03em;
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

small {
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: '';
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.stack {
    display: grid;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 999px;
    min-height: 48px;
    padding: 0.95rem 1.4rem;
    font: 600 0.95rem/1 'Outfit', sans-serif;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn i {
    font-size: 0.95em;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 18px 40px rgba(0, 96, 173, 0.24);
}

.btn-secondary {
    color: var(--navy);
    background: rgba(0, 53, 117, 0.08);
}

.btn-ghost {
    color: var(--navy-soft);
    background: transparent;
    border: 1px solid var(--line);
}

.btn-small {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.flash {
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.flash-success {
    background: rgba(31, 157, 114, 0.1);
    border-color: rgba(31, 157, 114, 0.2);
    color: #106a4b;
}

.flash-error {
    background: rgba(214, 69, 80, 0.1);
    border-color: rgba(214, 69, 80, 0.2);
    color: #9d2434;
}

.flash-warning {
    background: rgba(240, 162, 2, 0.12);
    border-color: rgba(240, 162, 2, 0.22);
    color: #8c5c00;
}

.field {
    display: grid;
    gap: 0.55rem;
}

.field span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
}

.field input,
.field select,
.table-input {
    width: 100%;
    border: 1px solid rgba(33, 48, 77, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    padding: 0.95rem 1rem;
    font: 500 0.96rem/1.2 'Outfit', sans-serif;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus,
.field select:focus,
.table-input:focus {
    border-color: rgba(0, 96, 173, 0.45);
    box-shadow: 0 0 0 4px rgba(121, 178, 201, 0.18);
}

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(90deg, #0060ad 0 50%, #ffffe6 50% 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr minmax(420px, 520px);
    gap: 4rem;
    align-items: center;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 2.5rem 4rem;
}

.login-brand {
    min-height: calc(100vh - 5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 36px;
    background: #0060ad;
    padding: 3rem;
}

.login-brand__logo {
    display: block;
    width: min(100%, 320px);
    height: auto;
}

.login-card {
    position: relative;
    width: 100%;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 241, 0.92);
    border: 1px solid rgba(0, 53, 117, 0.08);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.login-card__content {
    display: grid;
    gap: 1.25rem;
    padding: 2.75rem;
}

.login-card__content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.dashboard-shell {
    padding: 2rem;
    display: grid;
    gap: 1.5rem;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.dashboard-shell > * {
    min-width: 0;
}

.dashboard-page {
    height: 100vh;
    overflow: hidden;
}

.panel-layout {
    height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    transition: grid-template-columns 0.22s ease;
}

body.sidebar-collapsed .panel-layout {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 1.25rem;
    background: linear-gradient(180deg, #0060ad 0%, #003575 100%);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sidebar-brand {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    padding: 0.5rem 0.75rem;
}

.sidebar-brand img {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.sidebar-toggle__icon {
    font-size: 1.05rem;
    line-height: 1;
}

.sidebar-nav {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 54px;
    padding: 0.95rem 1.1rem;
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-link.is-active {
    color: #003575;
    background: #ffffe6;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.sidebar-link__icon {
    display: inline-flex;
    width: 22px;
    min-width: 22px;
    align-items: center;
    justify-content: center;
    font-size: 1.02rem;
    line-height: 1;
}

.sidebar-link__text {
    white-space: nowrap;
}

body.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    align-items: stretch;
}

body.sidebar-collapsed .sidebar-brand {
    min-height: 76px;
    padding: 0.5rem 0.35rem;
}

body.sidebar-collapsed .sidebar-brand img {
    width: 62px;
}

body.sidebar-collapsed .sidebar-toggle {
    width: 100%;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-inline: 0.85rem;
}

body.sidebar-collapsed .sidebar-link__text {
    display: none;
}

body.sidebar-collapsed .sidebar-link__icon {
    width: 24px;
    min-width: 24px;
    font-size: 1.1rem;
}

.panel-main {
    min-width: 0;
    min-height: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

.topbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    flex-wrap: wrap;
}

.topbar > div:first-child {
    min-width: 0;
}

.topbar h1 {
    margin-top: 0.5rem;
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    overflow-wrap: anywhere;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.user-chip {
    min-width: 220px;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(33, 48, 77, 0.08);
}

.user-chip__label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    padding: 1.4rem;
    min-width: 0;
    max-width: 100%;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
    min-width: 0;
    flex-wrap: wrap;
}

.panel-head > * {
    min-width: 0;
}

.panel-head-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
    max-width: 100%;
}

.panel-head h2 {
    margin-top: 0.35rem;
    font-size: 1.7rem;
}

.generated-panel {
    background:
        linear-gradient(135deg, rgba(121, 178, 201, 0.18), transparent 40%),
        var(--panel);
}

.generated-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.generated-codes span,
.code-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 0.72rem 0.95rem;
    border-radius: 999px;
    background: rgba(33, 48, 77, 0.08);
    color: var(--navy);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.code-pill-button {
    border: 0;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.code-pill-button:hover {
    background: rgba(0, 96, 173, 0.12);
    color: var(--primary-dark);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.35rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(33, 48, 77, 0.08);
    min-width: 0;
}

.stat-card span {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-card strong {
    display: block;
    margin: 0.55rem 0 0.2rem;
    font-family: 'Outfit', sans-serif;
    font-size: 2.35rem;
    color: var(--text);
}

.stat-card small {
    font-size: 0.92rem;
}

.toolbar {
    display: flex;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.toolbar .field {
    min-width: 220px;
    flex: 1;
}

.toolbar-buttons {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--line);
}

.pagination-summary {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pagination-link,
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0.7rem 0.95rem;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 600;
}

.pagination-link {
    color: var(--navy);
    background: rgba(0, 53, 117, 0.08);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.pagination-link:hover {
    transform: translateY(-1px);
    background: rgba(0, 96, 173, 0.14);
}

.pagination-link.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.pagination-ellipsis {
    color: var(--muted);
}

.table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border-radius: 18px;
    border: 1px solid var(--line);
}

.data-table {
    width: 100%;
    min-width: 1280px;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.72);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.data-table th {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--navy-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(33, 48, 77, 0.04);
}

.row-form {
    display: contents;
}

.table-input {
    min-width: 180px;
    padding: 0.8rem 0.9rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    min-height: 42px;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 0;
    font: 700 0.92rem/1 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.status-badge:hover {
    transform: translateY(-1px);
}

.status-badge.is-yes {
    color: #0e6b48;
    background: rgba(31, 157, 114, 0.16);
    box-shadow: inset 0 0 0 1px rgba(31, 157, 114, 0.22);
}

.status-badge.is-no {
    color: #a22a36;
    background: rgba(214, 69, 80, 0.14);
    box-shadow: inset 0 0 0 1px rgba(214, 69, 80, 0.2);
}

.status-badge:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(121, 178, 201, 0.2),
        inset 0 0 0 1px currentColor;
}

.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 80;
    display: grid;
    gap: 0.65rem;
    width: min(calc(100vw - 2rem), 360px);
    pointer-events: none;
}

.toast {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    color: #fff;
    font: 600 0.92rem/1.35 'Outfit', sans-serif;
    box-shadow: 0 20px 45px rgba(0, 53, 117, 0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #0060ad 0%, #003575 100%);
}

.toast-error {
    background: linear-gradient(135deg, #d64550 0%, #bb2d39 100%);
}

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state h3 {
    margin-bottom: 0.65rem;
    font-size: 1.45rem;
}

.empty-state.compact {
    padding: 1.25rem 0.5rem;
}

.users-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 1.5rem;
}

.users-table {
    min-width: 920px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.table-actions form {
    margin: 0;
}

.hidden-form {
    display: none;
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #d64550 0%, #bb2d39 100%);
}

.table-note {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}

@media (min-width: 761px) {
    .codes-panel {
        min-height: 0;
        overflow: hidden;
    }

    .codes-panel .table-wrap {
        max-height: clamp(360px, calc(100vh - 470px), 720px);
        overflow-x: scroll;
        overflow-y: auto;
        padding-bottom: 0.2rem;
        cursor: grab;
        scrollbar-color: rgba(0, 96, 173, 0.45) rgba(0, 53, 117, 0.08);
        scrollbar-gutter: stable both-edges;
    }

    .codes-panel .table-wrap.is-dragging {
        cursor: grabbing;
        user-select: none;
    }

    .codes-panel .table-wrap input,
    .codes-panel .table-wrap select {
        cursor: auto;
    }

    .codes-panel .table-wrap button,
    .codes-panel .table-wrap a {
        cursor: pointer;
    }

    .codes-panel .table-wrap::-webkit-scrollbar {
        width: 12px;
        height: 12px;
    }

    .codes-panel .table-wrap::-webkit-scrollbar-track {
        background: rgba(0, 53, 117, 0.08);
        border-radius: 999px;
    }

    .codes-panel .table-wrap::-webkit-scrollbar-thumb {
        background: rgba(0, 96, 173, 0.45);
        border: 3px solid rgba(255, 255, 241, 0.96);
        border-radius: 999px;
    }

    .codes-panel .data-table {
        width: max-content;
        min-width: 1780px;
    }

    .codes-panel .data-table th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #f8f8ee;
        box-shadow: 0 1px 0 var(--line), 0 10px 18px rgba(0, 53, 117, 0.06);
    }

    .data-table th,
    .data-table td {
        padding: 0.72rem 0.82rem;
        white-space: nowrap;
    }

    .data-table th {
        font-size: 0.76rem;
    }

    .table-input {
        min-width: 150px;
        padding: 0.62rem 0.72rem;
        border-radius: 14px;
        font-size: 0.88rem;
    }

    .data-table td[data-label="Descrição"] .table-input,
    .data-table td[data-label="Link"] .table-input,
    .data-table td[data-label="TAG NFC"] .table-input {
        min-width: 170px;
    }

    .code-pill {
        min-width: 74px;
        padding: 0.55rem 0.72rem;
        font-size: 0.82rem;
    }

    .status-badge {
        min-width: 76px;
        min-height: 36px;
        padding: 0.55rem 0.78rem;
        font-size: 0.82rem;
    }

    .table-actions {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .table-actions .btn-small {
        min-height: 40px;
        padding: 0.62rem 0.8rem;
    }

    .data-table td[data-label="Ações"] {
        min-width: 310px;
    }

    .data-table td[data-label="Última impressão"] small {
        display: block;
        margin-top: 0.2rem;
        white-space: nowrap;
    }
}

@media (min-width: 761px) and (max-width: 1500px), (min-width: 761px) and (max-height: 900px) {
    .dashboard-shell {
        gap: 1rem;
        padding: 1.2rem;
    }

    .topbar {
        align-items: center;
    }

    .topbar h1 {
        margin-top: 0.35rem;
        font-size: clamp(2rem, 3vw, 2.8rem);
    }

    .user-chip {
        min-width: 190px;
        padding: 0.72rem 0.9rem;
    }

    .stats-grid {
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.95rem 1.05rem;
        border-radius: 20px;
    }

    .stat-card strong {
        margin: 0.38rem 0 0.1rem;
        font-size: 1.9rem;
    }

    .stat-card small {
        font-size: 0.84rem;
    }

    .panel {
        padding: 1rem;
        border-radius: 24px;
    }

    .panel-head {
        margin-bottom: 0.85rem;
    }

    .panel-head h2 {
        font-size: 1.45rem;
    }

    .toolbar {
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .btn {
        min-height: 44px;
        padding: 0.78rem 1rem;
        font-size: 0.88rem;
    }
}

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

.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(33, 48, 77, 0.08);
}

.activity-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.activity-tag {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(121, 178, 201, 0.22);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    padding: 1.2rem;
    z-index: 50;
}

.modal.is-open {
    display: grid;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 25, 42, 0.46);
    backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    padding: 2rem;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 241, 0.98);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 53, 117, 0.08);
}

.modal-card h2 {
    margin: 0.5rem 0 0.8rem;
    font-size: 2rem;
}

.modal-card p {
    margin-bottom: 1.2rem;
}

.modal-card-password {
    width: min(100%, 620px);
}

.password-modal__status {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(0, 53, 117, 0.06);
    color: var(--navy);
    font-weight: 500;
}

.password-modal__status.is-loading {
    background: rgba(121, 178, 201, 0.2);
    color: var(--primary-dark);
}

.password-modal__status.is-success {
    background: rgba(31, 157, 114, 0.12);
    color: #0e6b48;
}

.password-modal__status.is-error {
    background: rgba(214, 69, 80, 0.12);
    color: #9d2434;
}

.password-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.password-field {
    display: grid;
    gap: 0.55rem;
    padding: 1rem 1.1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(0, 53, 117, 0.08);
}

.password-field span {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--navy-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.password-field strong {
    color: var(--text);
    font-size: 1.55rem;
    line-height: 1.15;
    letter-spacing: 0.06em;
    word-break: break-word;
}

.password-field small {
    font-size: 0.88rem;
    line-height: 1.45;
}

.password-field-wide {
    margin-bottom: 1rem;
}

.password-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.export-summary {
    display: grid;
    gap: 0.4rem;
    margin: 1.5rem 0;
    padding: 1rem 1.1rem;
    border-radius: 24px;
    background: rgba(0, 96, 173, 0.08);
    border: 1px solid rgba(0, 96, 173, 0.12);
}

.export-summary__label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--navy-soft);
}

.export-summary strong {
    color: var(--primary-dark);
    font-size: 1.15rem;
    line-height: 1.3;
}

.export-summary small {
    color: var(--navy-soft);
    font-size: 0.92rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.modal-close {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    border: 0;
    background: transparent;
    color: var(--navy-soft);
    font-size: 1.9rem;
    cursor: pointer;
}

@media (max-width: 1080px) {
    .panel-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    body.sidebar-collapsed .panel-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        gap: 1rem;
    }

    body.sidebar-collapsed .sidebar {
        padding-bottom: 1rem;
    }

    body.sidebar-collapsed .sidebar-header {
        flex-direction: row;
        align-items: center;
    }

    body.sidebar-collapsed .sidebar-brand {
        min-height: 92px;
        padding: 1.25rem;
    }

    body.sidebar-collapsed .sidebar-brand img {
        width: 150px;
    }

    body.sidebar-collapsed .sidebar-toggle {
        width: 48px;
    }

    .sidebar-nav {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: flex-end;
        gap: 0.65rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        margin-inline: -0.15rem;
        padding-inline: 0.15rem;
    }

    body.sidebar-collapsed .sidebar-nav {
        display: none;
    }

    .sidebar-link {
        min-height: 48px;
        white-space: nowrap;
    }

    .login-shell {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 720px;
        padding: 2rem 1.5rem;
    }

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

    .topbar {
        flex-direction: column;
        align-items: start;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .users-grid {
        grid-template-columns: 1fr;
    }

    .login-page {
        background: linear-gradient(180deg, #0060ad 0 36%, #ffffe6 36% 100%);
    }

    .login-brand {
        min-height: 260px;
    }
}

@media (max-width: 760px) {
    .dashboard-shell,
    .login-shell {
        padding: 1rem;
    }

    .sidebar {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.9rem;
    }

    .sidebar-nav {
        width: 100%;
        justify-content: flex-start;
        padding-bottom: 0.25rem;
    }

    .sidebar-brand {
        min-height: 78px;
        justify-content: flex-start;
        padding: 1rem 1.1rem;
    }

    .sidebar-toggle {
        width: 46px;
        height: 46px;
    }

    .login-card__content h1 {
        font-size: clamp(1.9rem, 9vw, 2.4rem);
    }

    .topbar-actions,
    .toolbar-buttons {
        width: 100%;
        flex-wrap: wrap;
    }

    .topbar h1 {
        font-size: clamp(2rem, 10vw, 2.7rem);
    }

    .topbar-actions .btn,
    .toolbar-buttons .btn,
    .toolbar-buttons a {
        width: 100%;
    }

    .user-chip {
        width: 100%;
        min-width: 0;
    }

    .panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .panel-head .btn {
        width: 100%;
    }

    .panel-head-actions {
        width: 100%;
    }

    .toolbar {
        gap: 0.85rem;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .toolbar .field {
        min-width: 0;
        width: 100%;
    }

    .pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-nav {
        justify-content: flex-start;
    }

    .panel,
    .login-card__content,
    .modal-card {
        padding: 1.2rem;
    }

    .login-brand {
        min-height: 200px;
        border-radius: 28px;
        padding: 2rem;
    }

    .login-brand__logo {
        width: min(100%, 220px);
    }

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

    .generated-codes span,
    .code-pill {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
    }

    .table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table {
        min-width: 0;
        background: transparent;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: grid;
        gap: 0.9rem;
    }

    .data-table tr {
        padding: 1rem;
        border-radius: 24px;
        border: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.78);
        box-shadow: 0 14px 32px rgba(0, 53, 117, 0.08);
    }

    .data-table td {
        padding: 0.8rem 0;
        border-bottom: 1px solid rgba(0, 53, 117, 0.1);
    }

    .data-table td:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .data-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.35rem;
        color: var(--navy-soft);
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .table-input,
    .users-table {
        min-width: 0;
    }

    .status-badge {
        width: 100%;
    }

    .toast-stack {
        top: auto;
        right: 1rem;
        bottom: 1rem;
    }

    .table-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions form,
    .table-actions .btn {
        width: 100%;
    }

    .modal {
        padding: 1rem;
    }

    .modal-card {
        width: min(100%, 100%);
    }

    .modal-card h2 {
        padding-right: 2rem;
        font-size: 1.65rem;
    }

    .password-grid {
        grid-template-columns: 1fr;
    }

    .password-field strong {
        font-size: 1.35rem;
    }

    .activity-item {
        flex-direction: column;
        align-items: start;
    }
}

@media (max-width: 560px) {
    .dashboard-shell {
        padding: 0.85rem;
    }

    .sidebar {
        padding: 0.85rem;
    }

    .sidebar-brand {
        min-height: 70px;
        padding: 0.95rem 1rem;
    }

    .login-page {
        background: linear-gradient(180deg, #0060ad 0 24%, #ffffe6 24% 100%);
    }

    .login-brand {
        min-height: 170px;
        padding: 1.5rem;
    }

    .login-brand__logo {
        width: min(100%, 200px);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .pagination-link {
        flex: 1 1 calc(25% - 0.45rem);
    }
}
