:root {
    --bg: #eef2f5;
    --panel: #ffffff;
    --primary: #21497a;
    --primary-dark: #183657;
    --accent: #c1903b;
    --text: #1f2933;
    --muted: #5f6c7a;
    --line: #d7dde4;
    --soft: #f6f8fa;
    --danger: #b53838;
    --success: #1d7a46;
}

/* NFJ theme override: premium screen UI inspired by chaistats */
:root {
    --bg: #f7efe9;
    --panel: rgba(255, 255, 255, 0.78);
    --panel-strong: #fffaf7;
    --primary: #75163d;
    --primary-dark: #54102c;
    --accent: #d4a95d;
    --accent-soft: rgba(212, 169, 93, 0.16);
    --text: #241b18;
    --muted: #756764;
    --line: rgba(117, 22, 61, 0.14);
    --soft: rgba(255, 255, 255, 0.62);
    --danger: #b53f4b;
    --success: #2e7b57;
    --shadow-soft: 0 18px 48px rgba(62, 24, 31, 0.08);
    --shadow-strong: 0 30px 90px rgba(82, 21, 42, 0.16);
}

body {
    font-family: "Segoe UI", Manrope, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(212, 169, 93, 0.22), transparent 26%),
        radial-gradient(circle at top right, rgba(117, 22, 61, 0.18), transparent 24%),
        linear-gradient(180deg, #fffaf7 0%, #f6eeea 44%, #f2e8e3 100%);
    color: var(--text);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
    filter: blur(10px);
}

body::before {
    top: -110px;
    right: -90px;
    background: radial-gradient(circle, rgba(212, 169, 93, 0.3), transparent 70%);
}

body::after {
    bottom: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(117, 22, 61, 0.18), transparent 70%);
}

.auth-card,
.card,
.session-panel,
.message,
.photo-card,
.upload-card,
.signature-preview-card,
.sheet-meta-card,
.history-item,
.report-card,
.role-group,
.permissions-menu,
.signature-panel,
.account-summary-item {
    backdrop-filter: blur(18px);
}

.auth-card {
    width: min(100%, 560px);
    background: linear-gradient(180deg, rgba(255, 250, 247, 0.94), rgba(255, 255, 255, 0.82));
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 30px;
    box-shadow: var(--shadow-strong);
    padding: 34px 34px 30px;
}

.auth-brand h1,
.hero h1,
.section-title,
.role-group-head h3,
.report-title,
.sheet-title,
.sheet-table-title,
.session-name {
    font-family: "Georgia", "Times New Roman", serif;
    letter-spacing: 0.01em;
}

.auth-brand h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.auth-form {
    gap: 18px;
}

.auth-signoff {
    color: rgba(84, 16, 44, 0.78);
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}

.shell {
    max-width: 1320px;
    padding: 34px 24px 56px;
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 34px 36px;
    background:
        radial-gradient(circle at 14% 18%, rgba(212, 169, 93, 0.18), transparent 20%),
        radial-gradient(circle at 88% 8%, rgba(255, 255, 255, 0.1), transparent 16%),
        linear-gradient(135deg, #57102d 0%, #75163d 52%, #8f244d 100%);
    box-shadow: var(--shadow-strong);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 240px;
    height: 240px;
    border-radius: 48px;
    transform: rotate(20deg);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(212, 169, 93, 0.12));
}

.hero h1 {
    font-size: clamp(1.9rem, 3vw, 2.85rem);
    line-height: 1.02;
    max-width: 12ch;
}

.hero p {
    margin: 8px 0 0;
    max-width: 54ch;
    color: rgba(255, 247, 242, 0.8);
    line-height: 1.55;
}

.hero-logo {
    height: 46px;
    margin-bottom: 14px;
}

.hero-topbar {
    align-items: stretch;
    gap: 28px;
}

.session-panel {
    min-width: 295px;
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.session-name {
    font-size: 1.35rem;
    line-height: 1.1;
}

.session-role {
    margin-top: 6px;
    font-size: 0.92rem;
    color: rgba(255, 243, 238, 0.82);
}

.session-actions {
    gap: 8px;
    margin-top: 16px;
}

.layout {
    margin-top: 28px;
    gap: 26px;
    align-items: start;
}

.card {
    background: linear-gradient(180deg, rgba(255, 251, 248, 0.82), rgba(255, 255, 255, 0.72));
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 28px;
    box-shadow: var(--shadow-soft);
}

.card-inner {
    padding: 28px;
}

.section-title {
    margin-bottom: 18px;
    color: var(--primary-dark);
    font-size: 1.45rem;
}

.field,
.field-full {
    gap: 9px;
}

label {
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.01em;
}

input,
select,
textarea {
    border: 1px solid rgba(117, 22, 61, 0.12);
    border-radius: 18px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(117, 22, 61, 0.34);
    box-shadow: 0 0 0 4px rgba(117, 22, 61, 0.08);
}

input[readonly],
textarea[readonly] {
    background: rgba(249, 241, 235, 0.72);
    color: rgba(36, 27, 24, 0.9);
}

.date-period-row {
    grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr);
    gap: 18px;
}

.date-range-toggle-center {
    min-height: 54px;
    margin-top: 24px;
}

.date-range-toggle-center input[type="checkbox"] {
    width: 18px;
    min-width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.table-head,
.table-row {
    gap: 12px;
}

.table-head {
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(117, 22, 61, 0.08), rgba(212, 169, 93, 0.12));
    color: var(--primary-dark);
    font-weight: 700;
}

.table-row {
    padding: 12px 0 0;
}

.hint,
.report-meta,
.upload-text,
.signature-panel-title {
    color: var(--muted);
}

.button,
.button-primary,
.button-secondary,
.button-light,
.button-danger {
    border-radius: 999px;
    padding: 11px 18px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    box-shadow: 0 12px 28px rgba(83, 25, 41, 0.1);
}

.button-primary,
.button-secondary {
    background: linear-gradient(135deg, #57102d, #7f2148 58%, #d4a95d 150%);
    color: #fff;
}

.button-light {
    background: rgba(255, 251, 248, 0.88);
    border-color: rgba(117, 22, 61, 0.12);
    color: var(--primary-dark);
}

.button-danger {
    background: linear-gradient(135deg, #9d2836, #c24d59);
    color: #fff;
}

.button:hover,
.button-primary:hover,
.button-secondary:hover,
.button-light:hover,
.button-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(83, 25, 41, 0.16);
}

.message {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow-soft);
}

.message-success {
    background: rgba(46, 123, 87, 0.1);
    color: #1d5c40;
}

.message-error {
    background: rgba(181, 63, 75, 0.1);
    color: #852f38;
}

.report-card,
.sheet-meta-card,
.history-item,
.role-group,
.signature-preview-card,
.upload-card,
.photo-card,
.permissions-menu,
.account-summary-item {
    background: linear-gradient(180deg, rgba(255, 251, 248, 0.9), rgba(255, 255, 255, 0.75));
    border: 1px solid rgba(117, 22, 61, 0.1);
    box-shadow: var(--shadow-soft);
}

.report-card {
    border-radius: 22px;
}

.report-title {
    color: var(--primary-dark);
    font-size: 1.3rem;
}

.report-card .button,
.report-card .button-light,
.report-card .button-secondary {
    margin-top: 2px;
}

.dashboard-grid {
    gap: 24px;
    margin-top: 28px;
}

.sheet-meta {
    gap: 16px;
}

.sheet-meta-card {
    border-radius: 22px;
    padding: 18px 18px 16px;
}

.sheet-label {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
}

.sheet-value {
    color: var(--primary-dark);
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 1.45rem;
}

.history-list {
    gap: 14px;
}

.history-item {
    border-radius: 20px;
    padding: 16px 18px;
}

.history-item strong {
    color: var(--primary-dark);
}

.role-groups {
    gap: 20px;
}

.role-group {
    border-radius: 24px;
    padding: 18px;
}

.role-group-admin {
    background: linear-gradient(180deg, rgba(117, 22, 61, 0.09), rgba(255, 255, 255, 0.78));
}

.role-group-manager {
    background: linear-gradient(180deg, rgba(212, 169, 93, 0.16), rgba(255, 255, 255, 0.78));
}

.role-group-user {
    background: linear-gradient(180deg, rgba(91, 136, 110, 0.12), rgba(255, 255, 255, 0.78));
}

.role-group-head {
    align-items: center;
}

.role-group-head h3 {
    font-size: 1.6rem;
}

.role-count,
.role-badge {
    border-radius: 999px;
    background: rgba(117, 22, 61, 0.09);
    color: var(--primary-dark);
    font-weight: 700;
}

.permissions-menu {
    border-radius: 18px;
}

.permissions-menu summary {
    color: var(--primary-dark);
    font-weight: 700;
}

.permission-option {
    border-radius: 16px;
    background: rgba(117, 22, 61, 0.04);
}

.signature-panel,
.dashboard-backup-grid,
.account-summary {
    gap: 18px;
}

.signature-preview-card {
    border-radius: 24px;
    min-height: 190px;
}

.upload-card {
    border-radius: 24px;
    min-height: 176px;
}

.upload-card:hover {
    border-color: rgba(117, 22, 61, 0.22);
    transform: translateY(-2px);
}

.upload-badge {
    background: linear-gradient(135deg, #57102d, #9f6a2f);
    color: #fff;
}

.photo-card {
    border-radius: 24px;
    padding: 16px;
}

.photo-label {
    color: var(--primary-dark);
    font-weight: 700;
}

.photo-card img,
.signature-preview-image {
    border-radius: 18px;
}

.account-summary-item span {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.account-summary-item strong {
    color: var(--primary-dark);
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 1.18rem;
}

.sheet-hero,
.sheet,
.sheet-table-block,
.sheet-notes,
.photo-slot-circle,
.photo-card-task-large,
.page-attachment,
.page-attachment-inner {
    backdrop-filter: none;
}

@media (max-width: 980px) {
    .shell {
        padding: 22px 16px 34px;
    }

    .hero {
        padding: 24px 22px;
    }

    .hero-topbar {
        flex-direction: column;
    }

    .session-panel {
        width: 100%;
        min-width: 0;
    }

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

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    display: none;
}

.sidebar-brand {
    display: block;
    margin-bottom: 40px;
}

.sidebar-brand-logo {
    display: block;
    width: 100%;
    max-width: 240px;
    max-height: 110px;
    object-fit: contain;
}

.sidebar-brand-fallback {
    display: inline-flex;
    min-height: 64px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 24px 60px rgba(87, 16, 45, 0.22);
    color: white;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.sidebar-section {
    margin-top: 22px;
}

.sidebar-label,
.eyebrow,
.panel-kicker,
.metric-kicker,
.page-overline {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-weight: 700;
}

.sidebar-label {
    color: #a53a60;
    margin-bottom: 10px;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 20px;
    color: var(--primary-dark);
    text-decoration: none;
    background: transparent;
    border: 0;
    transition: background 0.18s ease, transform 0.18s ease;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    background: rgba(255, 255, 255, 0.82);
}

.sidebar-link.is-active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 24px 60px rgba(87, 16, 45, 0.22);
}

.sidebar-pill {
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.72rem;
    color: inherit;
    background: rgba(117, 22, 61, 0.08);
}

.sidebar-link.is-active .sidebar-pill {
    background: rgba(255, 255, 255, 0.14);
    color: white;
}

.sidebar-company {
    margin-bottom: 28px;
    border-radius: 24px;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 72%, black));
    color: white;
    box-shadow: 0 24px 60px rgba(87, 16, 45, 0.22);
}

.sidebar-company .sidebar-label {
    color: rgba(255, 243, 238, 0.7);
    margin-bottom: 8px;
}

.sidebar-company strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-company .sidebar-label {
    display: none !important;
}

.sidebar-company span {
    display: block;
    margin-top: 4px;
    color: rgba(255, 243, 238, 0.84);
    font-size: 0.92rem;
}

.sidebar-user-card {
    margin-top: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.sidebar-user-card strong {
    display: block;
    font-size: 1rem;
    color: var(--primary-dark);
    line-height: 1.35;
    word-break: break-word;
}

.sidebar-user-card span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.88rem;
}

.sidebar-user-card .button-light {
    width: 100%;
    justify-content: center;
    margin-top: 0;
    background: rgba(255, 255, 255, 0.92);
}

.app-main {
    min-width: 0;
    padding: 16px 16px 32px;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.topbar-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.74);
    box-shadow: var(--shadow-soft);
}

.topbar-copy strong {
    display: block;
    color: var(--primary-dark);
}

.topbar-copy span {
    color: var(--muted);
    font-size: 0.88rem;
}

.topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.75fr);
    gap: 24px;
    align-items: end;
}

.hero-note {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-note-value {
    display: block;
    margin-top: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
}

.hero-note-copy {
    color: rgba(255, 247, 242, 0.76);
    line-height: 1.55;
}

.metrics-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.metric-card {
    padding: 18px 18px 16px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 251, 248, 0.88), rgba(255, 255, 255, 0.72));
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-soft);
}

.metric-kicker {
    color: var(--muted);
}

.metric-value {
    display: block;
    margin-top: 10px;
    color: var(--primary-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    line-height: 1;
}

.metric-text {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.module-panel {
    position: relative;
}

.module-panel::before {
    content: "";
    position: absolute;
    top: 22px;
    left: 28px;
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.module-panel .card-inner {
    padding-top: 40px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.panel-copy p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.status-badge,
.inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.status-badge {
    background: rgba(117, 22, 61, 0.08);
    color: var(--primary-dark);
}

.status-badge.is-success {
    background: rgba(46, 123, 87, 0.12);
    color: #1c6141;
}

.status-badge.is-warning {
    background: rgba(212, 169, 93, 0.18);
    color: #8e611a;
}

.status-badge.is-danger {
    background: rgba(181, 63, 75, 0.12);
    color: #8f2e39;
}

.filters-panel {
    margin-bottom: 18px;
}

.report-item,
.admin-user-card {
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 251, 248, 0.86), rgba(255, 255, 255, 0.72));
    border: 1px solid rgba(117, 22, 61, 0.1);
    box-shadow: var(--shadow-soft);
}

.report-item h3,
.admin-user-head h3 {
    margin: 0;
    color: var(--primary-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.28rem;
}

.report-meta {
    margin: 10px 0 0;
    line-height: 1.6;
    color: var(--muted);
}

.report-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.report-filters {
    padding: 18px;
    border-radius: 22px;
    background: rgba(117, 22, 61, 0.04);
    border: 1px solid rgba(117, 22, 61, 0.08);
}

.page-header-card {
    margin-bottom: 22px;
}

.detail-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 18px;
}

.detail-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.detail-stat {
    padding: 16px;
    border-radius: 22px;
    background: rgba(117, 22, 61, 0.05);
    border: 1px solid rgba(117, 22, 61, 0.08);
}

.detail-stat strong {
    display: block;
    margin-top: 8px;
    color: var(--primary-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
}

.stack-lg {
    display: grid;
    gap: 22px;
}

@media (max-width: 1180px) {
    .app-main {
        padding: 18px;
    }

    .metrics-strip,
    .detail-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-layout,
    .signature-panel {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 780px) {
    .app-topbar,
    .panel-head,
    .hero-grid,
    .detail-hero-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .metrics-strip,
    .detail-stat-grid {
        grid-template-columns: 1fr;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-actions .button,
    .report-links .button,
    .actions .button,
    .actions button {
        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 1181px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        display: flex;
        flex-direction: column;
        width: 288px;
        height: 100vh;
        padding: 24px;
        border-right: 1px solid rgba(255, 255, 255, 0.4);
        background: rgba(255, 255, 255, 0.6);
        backdrop-filter: blur(24px);
    }

    .app-main {
        padding-left: 320px;
        padding-right: 24px;
        padding-top: 24px;
        padding-bottom: 32px;
    }

    .app-topbar {
        display: none;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background:
        radial-gradient(circle at top right, rgba(193, 144, 59, 0.18), transparent 28%),
        linear-gradient(180deg, #f7f8fa 0%, #ecf1f4 100%);
    color: var(--text);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(212, 169, 93, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(117, 22, 61, 0.12), transparent 26%),
        linear-gradient(180deg, #fffaf7 0%, #f8f1ec 100%);
}

.auth-card {
    width: min(100%, 520px);
    position: relative;
    background: linear-gradient(180deg, rgba(255, 251, 248, 0.95), rgba(255, 255, 255, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 32px;
    box-shadow: 0 30px 60px rgba(16, 33, 51, 0.16);
    padding: 32px 30px 28px;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #2b7a63 0%, #d4a95d 100%);
}

.auth-brand h1 {
    margin: 6px 0 10px;
    color: var(--primary-dark);
    font-size: 2.1rem;
}

.auth-logo {
    display: block;
    height: 54px;
    width: auto;
    max-width: 220px;
    margin: 0 auto 14px;
}

.auth-brand,
.auth-signoff,
.hint {
    color: var(--muted);
}

.auth-brand {
    text-align: center;
}

.auth-kicker {
    display: inline-block;
    color: rgba(117, 22, 61, 0.68);
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.72rem;
    font-weight: 700;
}

.auth-intro {
    max-width: 34ch;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.6;
}

.auth-signoff,
.hint {
    line-height: 1.5;
}

.auth-form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.auth-form .actions {
    justify-content: center;
}

.auth-signoff {
    margin: 20px 0 0;
    text-align: center;
    font-size: 0.92rem;
}

.shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.hero {
    background: linear-gradient(135deg, rgba(33, 73, 122, 0.96), rgba(24, 54, 87, 0.96));
    color: #fff;
    border-radius: 24px;
    padding: 28px 30px;
    box-shadow: 0 22px 48px rgba(16, 33, 51, 0.18);
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.45rem, 2.8vw, 2.1rem);
    letter-spacing: 0.04em;
}

.hero-logo {
    display: block;
    height: 40px;
    width: auto;
    max-width: 190px;
    margin-bottom: 10px;
    filter: brightness(0) invert(1);
}

.hero-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.session-panel {
    min-width: 240px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.session-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.session-role {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.85);
}

.session-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.session-actions .button,
.session-actions button {
    padding: 9px 14px;
    font-size: 0.9rem;
    border-radius: 16px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 24px;
    margin-top: 26px;
}

.card {
    background: var(--panel);
    border: 1px solid rgba(33, 73, 122, 0.08);
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(18, 34, 48, 0.08);
}

.card-inner {
    padding: 24px;
}

.section-title {
    margin: 0 0 18px;
    font-size: 1.2rem;
    color: var(--primary-dark);
}

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

.field,
.field-full {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
    color: var(--primary-dark);
}

.date-period-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
    align-items: end;
    gap: 16px;
}

.date-range-toggle-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: 28px;
    cursor: pointer;
}

.date-range-field {
    transition: opacity 0.18s ease;
}

.date-range-field.is-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.date-range-toggle-center input[type="checkbox"] {
    appearance: auto;
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    outline: none;
    box-shadow: none;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    font: inherit;
    color: var(--text);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(33, 73, 122, 0.14);
    border-color: rgba(33, 73, 122, 0.48);
}

.table-grid {
    display: grid;
    gap: 12px;
}

.table-head,
.table-row {
    display: grid;
    grid-template-columns: 3.1fr 0.8fr 0.85fr 0.7fr 0.85fr;
    gap: 10px;
}

.table-head {
    font-weight: 700;
    color: var(--primary-dark);
    padding: 0 4px;
}

.table-row {
    padding: 12px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.detail-actions {
    gap: 14px;
    align-items: center;
}

.action-pill {
    min-height: 46px;
    padding: 11px 18px;
    border-radius: 999px;
    box-shadow: 0 14px 28px rgba(83, 25, 41, 0.1);
}

.action-pill-back {
    background: linear-gradient(180deg, #f8fbff, #eef3f8);
}

.action-pill-pdf {
    background: linear-gradient(135deg, rgba(117, 22, 61, 0.08), rgba(212, 169, 93, 0.18));
    border-color: rgba(117, 22, 61, 0.08);
}

.th-metric-field input {
    font-weight: 800;
    color: var(--primary-dark);
}

.actions-compact {
    margin-top: 12px;
}

.button,
button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 13px 20px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.button-primary {
    background: linear-gradient(135deg, var(--accent), #ddb76d);
    color: #fff;
    box-shadow: 0 14px 24px rgba(193, 144, 59, 0.28);
}

.button-secondary {
    background: var(--primary);
    color: #fff;
}

.button-light {
    background: #edf3f9;
    color: var(--primary-dark);
}

.button-compact {
    padding: 8px 14px;
    font-size: 0.85rem;
    box-shadow: 0 8px 18px rgba(83, 25, 41, 0.08);
}

.button-danger {
    background: #b53838;
    color: #fff;
}

.report-links form,
.actions form {
    margin: 0;
}

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

.message {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-weight: 700;
}

.message-error {
    background: rgba(181, 56, 56, 0.1);
    color: var(--danger);
}

.message-success {
    background: rgba(29, 122, 70, 0.12);
    color: var(--success);
}

.stack {
    display: grid;
    gap: 16px;
}

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

.account-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.account-overview-card {
    grid-column: 1 / -1;
}

.admin-users-card {
    grid-column: 1 / -1;
}

.admin-layout > .module-panel:first-child {
    grid-column: 1 / -1;
}

.provisioning-panel .card-inner {
    padding-bottom: 22px;
}

.provisioning-form {
    display: grid;
    gap: 18px;
}

.provisioning-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
}

.provisioning-grid > .field-full {
    grid-column: 1 / -1;
}

.provisioning-grid .field-password {
    min-width: 0;
}

.provisioning-grid .field-password input {
    min-width: 0;
}

.provisioning-panel .permissions-headline {
    margin-bottom: 10px;
}

.provisioning-panel .permissions-grid-open {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px !important;
    margin-top: 8px !important;
}

.provisioning-panel .permission-option {
    grid-template-columns: 16px minmax(0, 1fr) !important;
    gap: 9px !important;
    padding: 10px 11px !important;
    border-radius: 14px !important;
}

.provisioning-panel .permission-option-copy {
    gap: 1px;
}

.provisioning-panel .permission-option-copy strong {
    font-size: 0.83rem;
    line-height: 1.18;
}

.provisioning-panel .permission-option-copy small {
    display: none;
}

.provisioning-panel .permission-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-top: 1px;
}

.provisioning-actions {
    margin-top: 4px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 26px;
}

.dashboard-backup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0;
}

.dashboard-meta .sheet-meta-card {
    min-height: 72px;
}

.month-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f9fbfd);
}

.account-card {
    background:
        linear-gradient(180deg, rgba(33, 73, 122, 0.03), rgba(33, 73, 122, 0)),
        #ffffff;
    display: grid;
    gap: 18px;
    height: 100%;
}

.account-card .panel-head {
    margin-bottom: 0;
    align-items: flex-start;
}

.account-card .panel-copy p {
    max-width: 58ch;
}

.account-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.account-summary-item {
    padding: 16px 18px;
    border: 1px solid rgba(33, 73, 122, 0.09);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.92)),
        #ffffff;
    box-shadow: 0 18px 40px rgba(35, 34, 68, 0.08);
}

.account-summary-item span {
    display: block;
    font-size: 0.82rem;
    color: rgba(103, 104, 132, 0.92);
    margin-bottom: 8px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.account-summary-item strong {
    color: var(--primary-dark);
    font-size: 1.08rem;
}

.account-form {
    padding-top: 4px;
    display: grid;
    gap: 18px;
    align-content: start;
}

.account-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.account-field-full {
    grid-column: 1 / -1;
}

.account-actions {
    margin-top: 18px;
}

.signature-panel {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.signature-upload-form {
    display: grid;
    gap: 16px;
    align-content: start;
}

.signature-panel-title {
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--primary-dark);
}

.signature-preview-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    padding: 20px;
    border: 1px solid rgba(33, 73, 122, 0.1);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(212, 169, 93, 0.12), transparent 40%),
        linear-gradient(180deg, #fff, #f7fafc);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.account-layout > .module-panel {
    height: 100%;
}

.account-layout > .module-panel .card-inner {
    height: 100%;
}

.signature-preview-card-empty,
.signature-preview-empty {
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.signature-preview-image {
    display: block;
    max-width: 100%;
    max-height: 86px;
    object-fit: contain;
}

.signature-preview-card-sheet {
    min-height: 100px;
    justify-content: flex-end;
}

.signature-upload-form,
.signature-remove-form {
    margin-top: 0;
}

.signature-upload-form input[type="file"] {
    width: 100%;
    min-width: 0;
}

.signature-upload-form .actions,
.signature-remove-form.actions-compact {
    justify-content: flex-start;
}

.signature-upload-form .button,
.signature-remove-form .button {
    width: auto;
    min-width: 220px;
}

.permissions-grid {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.permissions-menu {
    border: 1px solid rgba(117, 22, 61, 0.12);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 251, 248, 0.94), rgba(255, 255, 255, 0.9));
    padding: 14px 16px;
    box-shadow: 0 14px 32px rgba(83, 25, 41, 0.08);
}

.permissions-menu summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
    color: var(--primary-dark);
    list-style: none;
}

.permissions-menu summary::-webkit-details-marker {
    display: none;
}

.permissions-menu summary::after {
    content: "▾";
    float: right;
    color: var(--muted);
}

.permissions-menu[open] summary::after {
    content: "▴";
}

.permission-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(33, 73, 122, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    font-weight: 400;
    color: var(--text);
}

.permission-option input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin: 0;
}

.permission-option span {
    line-height: 1.35;
}

.report-item {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg, #fff, #fbfcfd);
}

.report-item h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.report-meta {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.5;
}

.report-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.report-filters {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfcfe, #f4f8fb);
}

.report-filters-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.report-filters-actions {
    margin-top: 14px;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-item {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f7fafc);
    color: var(--text);
}

.history-item .button {
    justify-self: start;
}

.admin-user-card {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.role-groups {
    gap: 22px;
}

.users-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (5 * 14px)) / 6);
    align-items: start;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(117, 22, 61, 0.32) transparent;
}

.users-grid::-webkit-scrollbar {
    height: 8px;
}

.users-grid::-webkit-scrollbar-track {
    background: transparent;
}

.users-grid::-webkit-scrollbar-thumb {
    background: rgba(117, 22, 61, 0.22);
    border-radius: 999px;
}

.users-grid > * {
    min-width: 0;
    scroll-snap-align: start;
}

.role-group {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
}

.role-group-admin {
    background: linear-gradient(180deg, #fff6e7, #fffdf8);
}

.role-group-manager {
    background: linear-gradient(180deg, #edf4ff, #fbfdff);
}

.role-group-user {
    background: linear-gradient(180deg, #eef9f2, #fbfefc);
}

.role-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.role-group-head-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.role-group-head h3 {
    margin: 0;
    color: var(--primary-dark);
}

.role-group-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-slider-button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(117, 22, 61, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-dark);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(83, 25, 41, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.role-slider-button:hover {
    transform: translateY(-1px);
    border-color: rgba(117, 22, 61, 0.24);
    box-shadow: 0 16px 28px rgba(83, 25, 41, 0.12);
}

.role-count {
    min-width: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(24, 54, 87, 0.1);
    color: var(--primary-dark);
    font-weight: 700;
    text-align: center;
}

.admin-user-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-user-head h3 {
    margin: 0;
    font-size: 1rem;
}

.role-pill {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.role-pill-admin {
    background: #f4d59a;
    color: #6f4a00;
}

.role-pill-manager {
    background: #cfe0ff;
    color: #234a8a;
}

.role-pill-user {
    background: #cfead8;
    color: #206341;
}

.admin-user-card-admin {
    background: linear-gradient(180deg, #fffef9, #fff8ea);
}

.admin-user-card-manager {
    background: linear-gradient(180deg, #ffffff, #eef5ff);
}

.admin-user-card-user {
    background: linear-gradient(180deg, #ffffff, #f1faf4);
}

.admin-user-card-empty {
    color: var(--muted);
    text-align: center;
}

.admin-user-card.report-item-clickable {
    text-decoration: none;
    color: inherit;
}

.admin-user-card.report-item-clickable .report-meta {
    margin-bottom: 0;
}

.admin-user-card.is-selected {
    border-color: rgba(117, 22, 61, 0.24) !important;
    box-shadow: 0 18px 34px rgba(83, 25, 41, 0.12) !important;
    background: linear-gradient(180deg, rgba(117, 22, 61, 0.06), rgba(255, 255, 255, 0.94)) !important;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.photo-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

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

.upload-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 160px;
    padding: 18px;
    border: 1px dashed rgba(33, 73, 122, 0.28);
    border-radius: 20px;
    background: linear-gradient(180deg, #f9fbfd, #f1f5f8);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.upload-card:hover {
    transform: translateY(-1px);
    border-color: rgba(33, 73, 122, 0.52);
    box-shadow: 0 16px 26px rgba(18, 34, 48, 0.08);
}

.upload-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.upload-title {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.upload-text {
    color: var(--muted);
    line-height: 1.5;
    word-break: break-word;
}

.upload-input {
    margin-top: auto;
}

.photo-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.photo-label {
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--primary-dark);
}

.photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--line);
}

.hint {
    color: var(--muted);
    line-height: 1.6;
}

.card .hint {
    font-size: 0.88rem;
}

.print-body {
    background: #fff;
}

.print-shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.print-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 18px;
}

.sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: #fff;
    padding: 10mm;
    box-shadow: 0 30px 60px rgba(12, 28, 46, 0.18);
}

.sheet-hero {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 18px;
    align-items: stretch;
    padding: 14px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, #21497a, #17334f);
    color: #fff;
}

.sheet-logo {
    display: block;
    height: 34px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    margin-bottom: 6px;
    filter: brightness(0) invert(1);
}

.sheet-company {
    font-size: 0.88rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.9;
}

.sheet-hero h1 {
    margin: 4px 0 2px;
    font-size: 1.58rem;
}

.sheet-date {
    background: linear-gradient(180deg, #d0a354, #bd8430);
    border-radius: 18px;
    padding: 7px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.sheet-date span {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.sheet-date strong {
    margin-top: 10px;
    font-size: 1.08rem;
}

.sheet-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.sheet-meta-print {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sheet-meta-print-top {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sheet-meta-print-bottom {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sheet-meta-card {
    min-height: 68px;
    border: 1px solid #d9e0e8;
    border-radius: 16px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #f9fbfd, #f1f5f8);
}

.sheet-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #47607b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sheet-value {
    margin-top: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #243443;
}

.sheet-photo-layout,
.sheet-table-block,
.sheet-notes {
    margin-top: 7px;
}

.sheet-signature-block {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    width: 100%;
    min-height: 78px;
    margin-top: 10px;
}

.sheet-signature-image {
    display: block;
    width: 260px;
    max-width: 100%;
    max-height: 72px;
    margin-left: auto;
    object-fit: contain;
}

.sheet-photo-layout {
    position: relative;
    height: 330px;
}

.sheet-photo-layout-two {
    height: 360px;
}

.photo-slot {
    position: absolute;
    overflow: hidden;
    background: #5a76bc;
    border: 3px solid #243d70;
    box-shadow: 0 14px 28px rgba(20, 38, 64, 0.12);
}

.photo-slot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-slot-circle {
    width: 165px;
    height: 165px;
    border-radius: 50%;
    top: 8px;
}

.photo-slot-left {
    left: 28px;
}

.photo-slot-right {
    right: 28px;
}

.photo-slot-two-left {
    left: 18px;
}

.photo-slot-two-right {
    right: 18px;
}

.photo-slot-rect {
    width: 360px;
    height: 170px;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    border-radius: 34px;
}

.photo-slot-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #fff;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
}

.sheet-photo-layout-two .photo-slot-circle {
    width: 340px;
    height: 320px;
    top: 16px;
    border-radius: 42px;
    background: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: none;
}

.sheet-photo-layout-two .photo-slot img {
    object-fit: cover;
    background: #ffffff;
    padding: 0;
    object-position: center center;
}

.sheet-table-title {
    margin-bottom: 10px;
    padding: 12px 16px;
    border-radius: 16px;
    background: #21497a;
    color: #fff;
    font-weight: 700;
    font-size: 0.94rem;
}

.sheet-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid #d7dfe7;
}

.sheet-table th,
.sheet-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #d7dfe7;
    text-align: left;
    font-size: 0.92rem;
}

.sheet-table th {
    background: #eef4f8;
    color: #1b395d;
}

.sheet-table tr:nth-child(even) td {
    background: #fafcfd;
}

.sheet-table th:nth-child(1),
.sheet-table td:nth-child(1) {
    width: 48%;
}

.sheet-table th:nth-child(2),
.sheet-table td:nth-child(2) {
    width: 10%;
}

.sheet-table th:nth-child(3),
.sheet-table td:nth-child(3) {
    width: 13%;
}

.sheet-table th:nth-child(4),
.sheet-table td:nth-child(4) {
    width: 11%;
}

.sheet-table th:nth-child(5),
.sheet-table td:nth-child(5) {
    width: 18%;
}

.sheet-table th:nth-child(4),
.sheet-table th:nth-child(5),
.sheet-table td:nth-child(4),
.sheet-table td:nth-child(5) {
    text-align: center;
}

.sheet-table th:nth-child(3),
.sheet-table th:nth-child(4),
.sheet-table th:nth-child(5) {
    white-space: nowrap;
}

.recent-filter-row {
    grid-template-columns: 1.6fr 1fr 1fr auto auto !important;
    align-items: end;
}

.recent-filter-actions {
    align-self: end;
}

.sheet-note-box {
    min-height: 90px;
    padding: 14px 16px;
    border: 1px solid #d7dfe7;
    border-radius: 18px;
    background: #f9fbfd;
    line-height: 1.6;
    font-size: 0.93rem;
}

.sheet-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7c8d;
    font-weight: 700;
    text-align: center;
    padding: 12px;
}

.sheet-task-photo-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: 150mm;
    aspect-ratio: auto;
    object-fit: contain;
    margin: 0 auto;
}

.print-page-break {
    page-break-before: always;
    break-before: page;
    page-break-inside: avoid;
    break-inside: avoid-page;
}

.page-attachment {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 30px 60px rgba(12, 28, 46, 0.18);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10mm;
}

.page-attachment-inner {
    width: 100%;
    min-height: calc(297mm - 20mm);
    background: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.page-attachment .sheet-task-photo-image {
    margin: 0 auto;
}

@media (max-width: 920px) {
    .layout,
    .grid,
    .table-head,
    .table-row {
        grid-template-columns: 1fr;
    }

    .date-period-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .date-range-toggle-center {
        min-height: auto;
        margin-top: 0;
        justify-content: flex-start;
    }

    .hero {
        padding: 24px 22px;
    }

    .hero-topbar {
        flex-direction: column;
    }

    .session-panel {
        width: 100%;
        min-width: 0;
    }

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

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

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

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

    .dashboard-backup-grid,
    .report-filters-grid,
    .account-layout,
    .account-summary,
    .account-form-grid,
    .signature-panel {
        grid-template-columns: 1fr;
    }

    .session-actions,
    .report-links,
    .actions {
        width: 100%;
    }

    .session-actions .button,
    .report-links .button,
    .actions .button,
    .actions button {
        width: 100%;
        justify-content: center;
    }

    .signature-upload-form .actions,
    .signature-remove-form.actions-compact {
        width: auto;
    }

    .signature-upload-form .button,
    .signature-remove-form .button {
        width: auto;
        min-width: min(220px, 100%);
    }

    .history-item {
        grid-template-columns: 1fr;
    }

    .sheet {
        width: 100%;
        min-height: auto;
        padding: 18px;
    }

    .sheet-hero,
    .sheet-meta {
        grid-template-columns: 1fr;
    }

    .recent-filter-row {
        grid-template-columns: 1fr !important;
    }

    .sheet-photo-layout {
        height: auto;
        display: grid;
        gap: 16px;
    }

    .sheet-photo-layout-two {
        height: auto;
    }

    .photo-slot {
        position: relative;
    }

    .photo-slot-circle,
    .photo-slot-rect {
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100%;
        height: 220px;
        transform: none;
        border-radius: 24px;
    }
}

@media print {
    @page {
        size: A4;
        margin: 6mm;
    }

    html,
    body {
        background: #fff;
        width: 210mm;
        min-width: 210mm;
        margin: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }

    .print-toolbar {
        display: none;
    }

    .print-page-only {
        min-height: auto;
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }

    .print-shell {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .sheet {
        box-shadow: none;
        width: 100%;
        min-height: auto;
        padding: 6mm 6mm 5mm;
    }

    .sheet-hero {
        display: grid;
        grid-template-columns: 1fr 150px;
        gap: 14px;
        background: linear-gradient(135deg, #21497a, #17334f) !important;
        color: #fff !important;
    }

    .sheet-date {
        background: linear-gradient(180deg, #d0a354, #bd8430) !important;
        color: #fff !important;
    }

    .sheet-meta {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .sheet-meta-print-top {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sheet-meta-print-bottom {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .sheet-meta-print .sheet-meta-card {
        min-width: 0;
    }

    .sheet-meta-print .sheet-value {
        font-size: 0.88rem;
        overflow-wrap: anywhere;
    }

    .sheet-meta-print .sheet-label {
        font-size: 0.72rem;
    }

    .sheet-meta-card {
        background: linear-gradient(180deg, #f9fbfd, #f1f5f8) !important;
        break-inside: avoid;
    }

    .sheet-photo-layout-two {
        position: relative;
        display: block;
        height: 340px;
        break-inside: avoid;
    }

    .photo-slot {
        position: absolute;
    }

    .photo-slot-two-left {
        left: 4px;
    }

    .photo-slot-two-right {
        right: 4px;
    }

    .sheet-photo-layout-two .photo-slot-circle {
        width: 328px;
        height: 296px;
        top: 4px;
        border-radius: 56px;
    }

    .sheet-table-title {
        background: #21497a !important;
        color: #fff !important;
    }

    .sheet-table-block,
    .sheet-notes {
        break-inside: avoid;
    }

    .sheet-table th {
        background: #eef4f8 !important;
    }

    .sheet-table th,
    .sheet-table td {
        padding: 7px 9px;
        font-size: 0.84rem;
    }

    .sheet-note-box {
        min-height: 56px;
        padding: 8px 10px;
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .sheet-signature-block {
        min-height: 38px;
        margin-top: 4px;
        width: 100%;
        text-align: right;
    }

    .sheet-signature-image {
        width: 220px;
        max-height: 48px;
        margin-left: auto;
        margin-right: -4mm;
    }

    .sheet-task-photo-image {
        height: 150mm;
        width: auto;
        max-width: 100%;
        aspect-ratio: auto;
        margin: 0 auto;
    }

    .page-attachment {
        width: 100%;
        min-height: auto;
        margin: 0;
        padding: 6mm;
        box-shadow: none;
        background: #fff;
    }

    .page-attachment-inner {
        min-height: calc(297mm - 12mm);
        background: #fff;
    }

    .page-attachment .sheet-task-photo-image {
        page-break-inside: avoid;
        break-inside: avoid-page;
        margin: 0 auto;
    }
}

/* NFJ shell override aligned closer to chaiStats navigation/template */
.app-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) repeat(4, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.topbar-card,
.topbar-stat {
    min-width: 0;
    padding: 18px 18px 16px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 42px rgba(94, 38, 55, 0.08);
    text-decoration: none;
}

.topbar-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-actions {
    display: contents;
}

.topbar-copy span,
.topbar-stat-label {
    display: block;
    color: #cb93a7;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.28em;
}

.topbar-copy strong {
    display: block;
    margin-top: 8px;
    color: #5d2037;
    font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    font-size: 3.1rem;
    font-weight: 600;
    line-height: 0.95;
}

.topbar-stat-value {
    display: block;
    margin-top: 10px;
    color: #5d2037;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.25;
}

.topbar-stat-alert {
    background: rgba(255, 245, 245, 0.9);
    border-color: rgba(235, 198, 198, 0.9);
}

.topbar-stat-alert .topbar-stat-label,
.topbar-stat-alert .topbar-stat-value {
    color: #d1424f;
}

.hero {
    display: none;
}

.metrics-strip {
    margin-top: 0;
}

.metric-card {
    border-radius: 30px;
}

.report-filters {
    border-radius: 28px;
}

.app-sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.66);
    backdrop-filter: blur(26px);
}

.sidebar-brand {
    margin-bottom: 18px;
}

.sidebar-brand-logo {
    max-width: 220px;
    max-height: 92px;
}

.sidebar-brand-fallback {
    min-height: 52px;
    padding: 0 16px;
    border-radius: 20px;
    box-shadow: none;
    font-size: 1.1rem;
}

.sidebar-company {
    background: linear-gradient(135deg, #195a4a, #1f6b58);
    color: white;
    border-radius: 24px;
    box-shadow: none;
}

.sidebar-company .sidebar-label,
.sidebar-company span {
    color: rgba(255, 255, 255, 0.72);
}

.sidebar-company strong {
    font-size: 1.15rem;
}

.sidebar-link {
    padding: 10px 12px;
    border-radius: 18px;
    font-size: 0.95rem;
}

.sidebar-link.is-active {
    background: linear-gradient(135deg, #1f6b58, #d4a95d);
    box-shadow: none;
}

.sidebar-pill {
    background: transparent;
    color: #8d596d;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    padding: 0;
}

.sidebar-link.is-active .sidebar-pill {
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
}

.sidebar-user-card {
    border-radius: 26px;
}

@media (max-width: 1180px) {
    .app-topbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar-card {
        grid-column: 1 / -1;
    }

    .users-grid {
        grid-auto-columns: calc((100% - (3 * 14px)) / 4);
    }
}

@media (max-width: 780px) {
    .app-topbar {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .topbar-copy strong {
        font-size: 2.3rem;
    }

    .topbar-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .topbar-card,
    .topbar-stat {
        padding: 14px 14px 12px !important;
        border-radius: 20px !important;
    }

    .topbar-stat {
        min-height: 0 !important;
    }

    .topbar-stat-label {
        font-size: 0.68rem !important;
    }

    .topbar-stat-value {
        font-size: 1.05rem !important;
    }
}

/* Final shell lock: force chaiStats-like layout */
body {
    font-family: "Manrope", ui-sans-serif, system-ui, sans-serif !important;
    background:
        radial-gradient(circle at top left, rgba(212, 169, 93, 0.12), transparent 30%),
        radial-gradient(circle at top right, rgba(165, 58, 96, 0.14), transparent 28%),
        linear-gradient(180deg, #fffaf7 0%, #f8f0ed 45%, #f3ece8 100%) !important;
}

@media (min-width: 1181px) {
    .app-shell {
        min-height: 100vh !important;
    }

    .app-sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        width: 288px !important;
        height: 100vh !important;
        padding: 24px !important;
        border-right: 1px solid rgba(255, 255, 255, 0.4) !important;
        background: rgba(255, 255, 255, 0.6) !important;
        backdrop-filter: blur(24px) !important;
        z-index: 10 !important;
    }

    .app-main {
        padding-left: 320px !important;
        padding-right: 24px !important;
        padding-top: 24px !important;
        padding-bottom: 32px !important;
    }

    .app-topbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1.8fr) repeat(4, minmax(150px, 1fr)) !important;
        gap: 14px !important;
        margin-bottom: 22px !important;
    }
}

.hero {
    display: none !important;
}

.topbar-card,
.topbar-stat {
    min-width: 0 !important;
    padding: 18px 18px 16px !important;
    border-radius: 28px !important;
    background: rgba(255, 255, 255, 0.76) !important;
    border: 1px solid rgba(255, 255, 255, 0.82) !important;
    box-shadow: 0 18px 42px rgba(94, 38, 55, 0.08) !important;
    text-decoration: none !important;
}

.topbar-actions {
    display: contents !important;
}

.topbar-copy span,
.topbar-stat-label {
    display: block !important;
    color: #cb93a7 !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.28em !important;
}

.topbar-copy strong {
    display: block !important;
    margin-top: 8px !important;
    color: #5d2037 !important;
    font-family: "Cormorant Garamond", serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 0.95 !important;
}

.topbar-stat-value {
    display: block !important;
    margin-top: 10px !important;
    color: #5d2037 !important;
    font-size: 1.08rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
}

.topbar-stat-alert {
    background: rgba(255, 245, 245, 0.9) !important;
    border-color: rgba(235, 198, 198, 0.9) !important;
}

.topbar-stat-alert .topbar-stat-label,
.topbar-stat-alert .topbar-stat-value {
    color: #d1424f !important;
}

.sidebar-brand-logo {
    max-width: 220px !important;
    max-height: 92px !important;
}

.sidebar-brand-fallback {
    min-height: 52px !important;
    padding: 0 16px !important;
    border-radius: 20px !important;
    box-shadow: none !important;
    font-size: 1.1rem !important;
}

.sidebar-company {
    background: linear-gradient(135deg, #195a4a, #1f6b58) !important;
    color: white !important;
    border-radius: 24px !important;
    box-shadow: none !important;
}

.sidebar-company .sidebar-label,
.sidebar-company span {
    color: rgba(255, 255, 255, 0.72) !important;
}

.sidebar-company strong {
    font-size: 1.15rem !important;
}

.sidebar-link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 12px !important;
    border-radius: 18px !important;
    font-size: 0.95rem !important;
    color: #4a2434 !important;
    text-decoration: none !important;
}

.sidebar-link.is-active {
    background: linear-gradient(135deg, #1f6b58, #d4a95d) !important;
    color: white !important;
    box-shadow: none !important;
}

.sidebar-pill {
    background: transparent !important;
    color: #8d596d !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.22em !important;
    padding: 0 !important;
}

.sidebar-link.is-active .sidebar-pill {
    color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar-link-new {
    background: rgba(117, 22, 61, 0.06) !important;
    border: 1px dashed rgba(117, 22, 61, 0.18) !important;
}

.sidebar-link-new:hover,
.sidebar-link-new:focus-visible {
    background: rgba(117, 22, 61, 0.1) !important;
    outline: none !important;
}

.metrics-strip {
    margin-top: 0 !important;
}

.metric-card {
    border-radius: 30px !important;
}

.report-item-clickable {
    position: relative;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.report-item-clickable:hover,
.report-item-clickable:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(117, 22, 61, 0.18) !important;
    box-shadow: 0 24px 48px rgba(94, 38, 55, 0.12) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(252, 246, 241, 0.86)) !important;
    outline: none;
}

.report-item-clickable h3 {
    margin-bottom: 10px !important;
}

.report-item-clickable .report-links {
    margin-top: 18px !important;
}

@media (min-width: 980px) {
    .report-list-two {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

@media (min-width: 1280px) {
    .report-list-two {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px;
    }
}

.app-main > .app-topbar,
.app-main > .metrics-strip,
.app-main > .dashboard-grid,
.app-main > .layout,
.app-main > .print-shell,
.app-main > .message {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.dashboard-topbar {
    grid-template-columns: minmax(0, 1.8fr) repeat(2, minmax(180px, 1fr)) !important;
}

.sidebar-brand.is-brand-clickable,
.sidebar-company.is-brand-clickable {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.sidebar-brand.is-brand-clickable {
    transition: none !important;
}

.sidebar-brand.is-brand-clickable:hover,
.sidebar-company.is-brand-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(83, 25, 41, 0.14);
}

.sidebar-brand.is-brand-clickable:hover {
    transform: none !important;
    box-shadow: none !important;
}

.brand-modal {
    width: min(760px, calc(100vw - 32px));
    border: 0;
    padding: 0;
    background: transparent;
}

.brand-modal::backdrop {
    background: rgba(33, 18, 24, 0.42);
    backdrop-filter: blur(8px);
}

.brand-modal-card {
    position: relative;
    border-radius: 32px;
    padding: 30px;
    background: linear-gradient(180deg, rgba(255, 251, 248, 0.96), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.88);
    box-shadow: 0 30px 80px rgba(70, 26, 38, 0.22);
}

.brand-modal-backdrop,
.brand-modal-dismiss {
    display: none;
}

.brand-modal-form {
    display: grid;
    gap: 20px;
}

.brand-modal-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.brand-modal-aside {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(248, 240, 237, 0.9), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(117, 22, 61, 0.08);
}

.brand-modal-main {
    display: grid;
    gap: 18px;
}

.brand-modal-group {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(117, 22, 61, 0.08);
}

.brand-modal-group-title {
    font-size: 0.78rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(117, 22, 61, 0.72);
    font-weight: 700;
}

.brand-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.brand-modal-field-full {
    grid-column: 1 / -1;
}

.brand-logo-preview {
    min-height: 150px;
    border-radius: 24px;
    border: 1px dashed rgba(117, 22, 61, 0.18);
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.brand-logo-preview img {
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
}

.brand-logo-preview-empty {
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.brand-preview-copy {
    display: grid;
    gap: 6px;
}

.brand-preview-kicker {
    font-size: 0.74rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(117, 22, 61, 0.68);
    font-weight: 700;
}

.brand-preview-copy strong {
    font-size: 1.14rem;
    color: var(--primary-dark);
}

.brand-preview-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.brand-remove-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.92rem;
}

.brand-remove-button {
    justify-self: start;
}

.owner-task-modal {
    width: min(720px, calc(100vw - 32px));
}

.owner-task-modal-card {
    display: grid;
    gap: 18px;
}

.owner-task-modal-body {
    display: grid;
    gap: 18px;
}

.owner-task-preview-card {
    min-height: 260px;
}

.owner-task-preview-image {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.photo-card-task-manage {
    max-width: 560px;
}

.task-manage-image {
    max-height: 360px;
    object-fit: contain;
}

.brand-modal-message {
    margin-bottom: 16px;
}

.brand-modal-actions {
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .brand-modal-layout,
    .brand-modal-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-backup-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-backup-card {
    display: flex;
    flex-direction: column;
    min-height: 240px;
}

.dashboard-backup-card .report-meta {
    margin: 10px 0 18px;
}

.dashboard-backup-card .field {
    margin-top: 10px;
}

.dashboard-backup-card .actions {
    margin-top: auto;
}

@media (max-width: 900px) {
    .dashboard-backup-meta {
        grid-template-columns: 1fr;
    }
}

.print-empty-state {
    margin-top: 120px;
}

.print-page-only {
    min-height: 100vh;
    padding: 24px 20px 40px;
}

@media print {
    .print-screen-sidebar,
    .print-screen-topbar {
        display: none !important;
    }

    .print-screen-shell {
        display: block !important;
        min-height: auto !important;
    }

    .print-screen-shell .app-main {
        padding: 0 !important;
    }
}

@media (max-width: 1180px) {
    .app-shell {
        display: block !important;
    }

    .app-sidebar {
        display: block !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        margin: 0 18px 18px !important;
        padding: 18px !important;
        border-right: 0 !important;
        border-radius: 28px !important;
        background: rgba(255, 255, 255, 0.72) !important;
        backdrop-filter: blur(22px) !important;
        box-shadow: 0 16px 36px rgba(83, 25, 41, 0.1) !important;
    }

    .app-main {
        padding-left: 18px !important;
        padding-right: 18px !important;
        padding-top: 0 !important;
    }

    .sidebar-brand,
    .sidebar-company {
        margin-bottom: 14px;
    }

    .sidebar-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .app-sidebar .sidebar-section:has(a.sidebar-link) > .sidebar-label,
    .app-sidebar .sidebar-section:has(a.sidebar-link) a.sidebar-link .sidebar-pill {
        display: none !important;
    }

    .app-sidebar .sidebar-section:has(> .sidebar-nav > .sidebar-link:not(a)) {
        display: none !important;
    }

    .sidebar-link {
        width: auto !important;
        min-width: 150px;
        flex: 1 1 180px;
    }

    .sidebar-user-card {
        margin-top: 14px !important;
    }
}

@media (max-width: 780px) {
    .app-sidebar {
        margin: 0 14px 16px !important;
        padding: 16px !important;
    }

    .sidebar-link {
        flex: 1 1 100%;
        min-width: 0;
    }

    .card-inner {
        padding: 18px !important;
    }

    .module-panel .card-inner,
    .provisioning-panel .card-inner {
        padding-top: 28px !important;
    }

    .panel-head {
        gap: 12px !important;
    }

    .panel-head .status-badge {
        align-self: flex-start;
    }

    .detail-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .detail-actions form,
    .detail-actions a,
    .detail-actions button {
        width: 100%;
    }

    .detail-actions .button {
        justify-content: center;
    }

    .provisioning-grid {
        grid-template-columns: 1fr !important;
    }

    .provisioning-panel .permissions-grid-open {
        grid-template-columns: 1fr !important;
    }

    .users-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .admin-user-card {
        padding: 12px !important;
        gap: 10px !important;
    }

    .admin-user-head {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .users-grid {
        grid-auto-columns: calc((100% - 14px) / 2) !important;
    }

    .history-item {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 12px !important;
    }

    .history-item .button {
        width: 100%;
        justify-content: center;
    }

    .history-list {
        gap: 10px !important;
    }

    .photo-grid,
    .photo-grid-single {
        grid-template-columns: 1fr !important;
    }

    .table-head,
    .table-row {
        gap: 8px !important;
    }
}

.permissions-menu {
    border: 1px solid rgba(117, 22, 61, 0.12) !important;
    border-radius: 22px !important;
    background: linear-gradient(180deg, rgba(255, 251, 248, 0.94), rgba(255, 255, 255, 0.9)) !important;
    padding: 14px 16px !important;
    box-shadow: 0 14px 32px rgba(83, 25, 41, 0.08) !important;
}

.permissions-menu summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

.permissions-menu summary::after {
    margin-left: auto !important;
}

.permissions-summary-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.permissions-summary-count {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(117, 22, 61, 0.08);
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.permissions-headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.permissions-inline-title {
    color: #b05d79;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.permissions-grid {
    gap: 12px !important;
    margin-top: 14px !important;
}

.permissions-grid-open {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px !important;
}

.permission-option {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 12px !important;
    padding: 12px 14px !important;
    border: 1px solid rgba(117, 22, 61, 0.1) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.84) !important;
    font-weight: 500 !important;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease !important;
}

.permission-option:hover {
    transform: translateY(-1px);
    border-color: rgba(117, 22, 61, 0.18) !important;
    box-shadow: 0 14px 28px rgba(83, 25, 41, 0.08) !important;
}

.permission-option-copy {
    display: grid;
    gap: 4px;
}

.permission-option-copy strong {
    color: var(--primary-dark);
    font-size: 0.95rem;
    line-height: 1.25;
}

.permission-option-copy small {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.permission-option:has(input:checked) {
    border-color: rgba(117, 22, 61, 0.24) !important;
    background: linear-gradient(180deg, rgba(117, 22, 61, 0.08), rgba(255, 255, 255, 0.92)) !important;
    box-shadow: 0 16px 32px rgba(83, 25, 41, 0.1) !important;
}

@media (max-width: 980px) {
    .permissions-grid-open {
        grid-template-columns: 1fr;
    }

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

    .provisioning-grid .field-password {
        grid-column: 1 / -1;
    }

    .provisioning-panel .permissions-grid-open {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .provisioning-grid {
        grid-template-columns: 1fr;
    }

    .provisioning-panel .permissions-grid-open {
        grid-template-columns: 1fr;
    }
}
