:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-hover: #f1f5f9;
    --text: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;
    --border: #e2e8f0;

    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: #ccfbf1;

    --success: #047857;
    --success-soft: #d1fae5;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --warning: #b45309;
    --warning-soft: #fef3c7;

    --sidebar: #0b1324;
    --sidebar-soft: #172033;
    --sidebar-text: #cbd5e1;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 20px;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, .05);
    --shadow: 0 10px 35px rgba(15, 23, 42, .08);

    --transition: 160ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    transition:
        background-color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition),
        color var(--transition),
        transform var(--transition);
}

/* ---------- AUTH ---------- */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, .12), transparent 34%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.auth-card {
    width: min(430px, 100%);
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: var(--radius-lg);
    padding: 34px;
    box-shadow: var(--shadow);
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #14b8a6);
    color: white;
    font-size: 20px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(15, 118, 110, .22);
    margin-bottom: 22px;
}

.auth-card h1 {
    margin: 0;
    font-size: 29px;
    line-height: 1.15;
}

.auth-card .subtitle {
    color: var(--muted);
    margin: 8px 0 28px;
}

/* ---------- FORMS ---------- */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    padding: 10px 13px;
    background: white;
    color: var(--text);
    outline: none;
}

.form-control:hover {
    border-color: #94a3b8;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .10);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.field-help {
    color: var(--muted);
    font-size: 12px;
    margin-top: 6px;
}

/* ---------- BUTTONS ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0d9488);
    color: white;
    box-shadow: 0 5px 15px rgba(15, 118, 110, .18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-secondary {
    background: white;
    color: var(--text-soft);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

.btn-small {
    min-height: 34px;
    padding: 6px 11px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* ---------- ALERTS ---------- */

.alert {
    padding: 13px 15px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-danger {
    background: #fff1f2;
    color: #991b1b;
    border: 1px solid #fecdd3;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ---------- APP SHELL ---------- */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 246px minmax(0, 1fr);
}

.sidebar {
    min-height: 100vh;
    height: 100vh;
    position: sticky;
    top: 0;
    background:
        linear-gradient(180deg, var(--sidebar) 0%, #111c31 100%);
    color: var(--sidebar-text);
    padding: 20px 14px;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 6px 10px 22px;
    color: white;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.sidebar-brand small {
    display: block;
    margin-top: 4px;
    color: #7f8ea3;
    font-size: 11px;
    font-weight: 600;
}

.nav-section {
    margin-top: 14px;
}

.nav-title {
    color: #637189;
    font-size: 10px;
    letter-spacing: .10em;
    text-transform: uppercase;
    padding: 8px 10px;
    font-weight: 800;
}

.nav-link {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 11px;
    margin: 4px 0;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
}

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

.nav-link.active {
    background: rgba(255, 255, 255, .11);
    color: white;
    box-shadow: inset 3px 0 0 #2dd4bf;
}

.main-area {
    min-width: 0;
}

.topbar {
    min-height: 68px;
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 26px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 17px;
    font-weight: 800;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-meta {
    text-align: right;
}

.user-meta strong {
    display: block;
    font-size: 13px;
}

.user-meta span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.logout-button {
    min-height: 38px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-soft);
    font-weight: 700;
}

.logout-button:hover {
    background: var(--surface-hover);
}

/* ---------- CONTENT ---------- */

.content {
    padding: 26px;
}

.page-heading {
    margin-bottom: 22px;
}

.page-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.page-heading h1 {
    margin: 0 0 5px;
    font-size: 27px;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

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

.stat-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-card {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -18px;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(15, 118, 110, .055);
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.02em;
}

.panel {
    margin-top: 18px;
    padding: 20px;
}

.panel h2 {
    margin: 0 0 16px;
    font-size: 17px;
}

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

.info-item {
    background: var(--surface-soft);
    border: 1px solid #edf2f7;
    padding: 15px;
    border-radius: 12px;
}

.info-label {
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 5px;
}

.info-value {
    font-size: 14px;
    font-weight: 750;
}

/* ---------- TABLES ---------- */

.search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.search-row .form-control {
    max-width: 460px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

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

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

.data-table th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
    font-weight: 800;
}

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

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

.table-subtext {
    color: var(--muted);
    margin-top: 4px;
    font-size: 11px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 800;
}

.status-active {
    color: #065f46;
    background: var(--success-soft);
}

.status-disabled {
    color: #991b1b;
    background: var(--danger-soft);
}

.empty-state {
    text-align: center !important;
    padding: 34px !important;
    color: var(--muted);
}

/* ---------- USER FORMS ---------- */

.form-panel {
    max-width: 1000px;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.user-checkbox {
    margin-top: 6px;
    margin-bottom: 0;
}

.error-list {
    margin: 8px 0 0;
    padding-left: 19px;
}

.pagination-wrap {
    margin-top: 18px;
}

/* ---------- MOBILE NAV ---------- */

.mobile-nav {
    display: none;
}

/* ---------- RESPONSIVE ---------- */

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

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .content {
        padding: 20px;
    }

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

@media (max-width: 760px) {
    body {
        padding-bottom: 68px;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .topbar {
        min-height: 60px;
        padding: 10px 14px;
    }

    .page-title {
        font-size: 15px;
    }

    .user-meta {
        display: none;
    }

    .logout-button {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .content {
        padding: 16px 12px 22px;
    }

    .page-heading {
        margin-bottom: 16px;
    }

    .page-heading-row {
        flex-direction: column;
        align-items: stretch;
    }

    .page-heading h1 {
        font-size: 23px;
    }

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

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 23px;
    }

    .panel {
        margin-top: 14px;
        padding: 15px;
        border-radius: 14px;
    }

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

    .search-row .form-control {
        max-width: none;
    }

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

    .form-actions {
        flex-direction: column;
    }

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

    .auth-page {
        padding: 14px;
    }

    .auth-card {
        padding: 24px 19px;
        border-radius: 17px;
    }

    .mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        height: 64px;
        background: rgba(255, 255, 255, .97);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
        box-shadow: 0 -6px 20px rgba(15, 23, 42, .05);
    }

    .mobile-nav a {
        display: grid;
        place-items: center;
        color: var(--muted);
        font-size: 11px;
        font-weight: 650;
    }

    .mobile-nav a.active {
        color: var(--primary);
        font-weight: 800;
    }
}

@media (max-width: 420px) {
    .topbar {
        padding-left: 11px;
        padding-right: 11px;
    }

    .content {
        padding-left: 10px;
        padding-right: 10px;
    }

    .auth-card h1 {
        font-size: 25px;
    }

    .btn {
        min-height: 44px;
    }

    .form-control {
        min-height: 48px;
    }
}

/* =========================================================
   SPEEDACURE DCF — PRODUCTION DASHBOARD
   ========================================================= */

.hero-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
    margin-bottom: 20px;
    padding: 28px 30px;
    background:
        radial-gradient(circle at 90% 20%, rgba(20,184,166,.15), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
    border: 1px solid #d9eeea;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(15,23,42,.055);
}

.hero-panel.compact {
    padding: 22px 26px;
}

.hero-kicker {
    margin-bottom: 8px;
    color: #0f766e;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero-panel h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(25px, 2.2vw, 34px);
    line-height: 1.15;
    letter-spacing: -.035em;
}

.hero-panel p {
    margin: 9px 0 0;
    color: #64748b;
    font-size: 14px;
}

.hero-action {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 11px 19px;
    white-space: nowrap;
}

/* KPI CARDS */

.modern-stats {
    margin-bottom: 16px;
}

.modern-stats .stat-card {
    min-height: 118px;
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15,23,42,.04);
}

.modern-stats .stat-label {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.modern-stats .stat-value {
    color: #0f172a;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.025em;
}

.stat-foot {
    margin-top: 8px;
    color: #8290a3;
    font-size: 12px;
    line-height: 1.4;
}


/* ===== DASHBOARD OPERATIONS V1 START ===== */

.dashboard-operations {
    align-items: stretch;
    margin-top: 2px;
}

.dashboard-operational-panel {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}

.dashboard-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
}

.dashboard-panel-kicker {
    margin-bottom: 4px;
    color: #0c8d81;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
}

.dashboard-panel-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
}

.dashboard-panel-context {
    color: #8290a3;
    font-size: 12px;
    white-space: nowrap;
}

.dashboard-workflow-list {
    display: grid;
    gap: 9px;
}

.dashboard-workflow-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 13px;
    border: 1px solid #e7edf1;
    border-radius: 11px;
    background: #fafcfc;
}

.dashboard-workflow-row strong,
.dashboard-workflow-row span {
    display: block;
}

.dashboard-workflow-row strong {
    color: #16202c;
    font-size: 14px;
}

.dashboard-workflow-row > div > span {
    margin-top: 2px;
    color: #778590;
    font-size: 12px;
}

.dashboard-workflow-status {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef2f4;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.dashboard-workflow-status.is-active {
    background: #eef8f6;
    color: #08766d;
}

.dashboard-workflow-status.is-complete {
    background: #eaf8f0;
    color: #23724a;
}

.dashboard-next-action {
    margin-top: 12px;
    padding: 12px 13px;
    border-left: 3px solid #0c8d81;
    border-radius: 8px;
    background: #f5fbfa;
}

.dashboard-next-action span,
.dashboard-next-action strong {
    display: block;
}

.dashboard-next-action span {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.dashboard-next-action strong {
    margin-top: 3px;
    color: #0f172a;
    font-size: 14px;
}

.dashboard-snapshot-meta {
    margin: -5px 0 13px;
    color: #778590;
    font-size: 12px;
}

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

.dashboard-snapshot-metric {
    padding: 11px 12px;
    border: 1px solid #e7edf1;
    border-radius: 10px;
    background: #fafcfc;
}

.dashboard-snapshot-metric span,
.dashboard-snapshot-metric strong {
    display: block;
}

.dashboard-snapshot-metric span {
    color: #778590;
    font-size: 11px;
    font-weight: 700;
}

.dashboard-snapshot-metric strong {
    margin-top: 4px;
    color: #0f172a;
    font-size: 14px;
}

.dashboard-empty-state {
    padding: 24px 15px;
    border: 1px dashed #d8e1e7;
    border-radius: 11px;
    color: #778590;
    text-align: center;
}

@media (max-width: 640px) {

    .dashboard-operational-panel {
        padding: 16px;
    }

    .dashboard-panel-header {
        margin-bottom: 12px;
    }

    .dashboard-workflow-row {
        align-items: flex-start;
    }

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

/* ===== DASHBOARD OPERATIONS V1 END ===== */

/* DASHBOARD COLUMNS */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr);
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-grid > .panel {
    height: 100%;
    margin-top: 0;
}

/* PANEL HEADERS */

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

.panel-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
}

.panel-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
}

/* STATUS */

.status-open {
    color: #0369a1;
    background: #e0f2fe;
}

/* CLOSING PROGRESS */

.closing-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 10px;
}

.progress-step {
    min-width: 0;
    padding: 15px 13px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
}

.progress-step > span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.progress-step.active {
    background: #f0fdfa;
    border-color: #99f6e4;
}

.progress-step.active > span {
    color: #fff;
    background: #0f766e;
}

.progress-step strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
}

.progress-step small {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* PENDING ACTIONS */

.action-list {
    display: grid;
}

.action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 13px 2px;
    border-bottom: 1px solid #edf2f7;
}

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

.action-item strong {
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 750;
}

.action-item small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
}

.action-status {
    flex: 0 0 auto;
    padding: 5px 9px;
    color: #b45309;
    background: #fef3c7;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.action-status.muted {
    color: #64748b;
    background: #f1f5f9;
}

/* ACCOUNT / SECURITY */

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

.dashboard-grid .info-item {
    min-height: 72px;
}

/* TABLE / USER MANAGEMENT */

.table-wrap {
    background: #fff;
}

.data-table td {
    color: #334155;
}

.data-table td strong {
    color: #0f172a;
}

.form-panel {
    max-width: 1050px;
}

/* TABLET */

@media (max-width: 1150px) {

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

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

/* MOBILE */

@media (max-width: 760px) {

    .hero-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        margin-bottom: 14px;
        padding: 20px 17px;
        border-radius: 16px;
    }

    .hero-panel h1 {
        font-size: 25px;
    }

    .hero-panel p {
        font-size: 13px;
    }

    .hero-action {
        width: 100%;
        min-height: 48px;
    }

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

    .modern-stats .stat-card {
        min-height: 108px;
        padding: 15px;
    }

    .modern-stats .stat-value {
        font-size: 20px;
    }

    .dashboard-grid {
        display: block;
        margin-bottom: 0;
    }

    .dashboard-grid > .panel {
        margin-bottom: 14px;
    }

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

    .progress-step {
        padding: 13px 11px;
    }

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

    .action-item {
        align-items: flex-start;
    }
}

/* SMALL PHONE */

@media (max-width: 390px) {

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

    .closing-progress {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   DAILY CLOSING WORKSPACE
   ========================================================= */

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

.closing-head h1 {
    margin: 5px 0;
    color: #0f172a;
    font-size: 27px;
    letter-spacing: -.025em;
}

.closing-head p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.back-link {
    display: inline-block;
    margin-bottom: 12px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    color: #0f766e;
}

.closing-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.closing-summary-grid .stat-card {
    min-height: 105px;
}

.closing-workspace {
    display: grid;
    grid-template-columns: 270px minmax(0,1fr);
    gap: 18px;
    align-items: start;
}

.closing-sections {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(15,23,42,.04);
}

.closing-section {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 15px;
    border-bottom: 1px solid #edf2f7;
}

.closing-section:last-child {
    border-bottom: 0;
}

.closing-section > span {
    width: 30px;
    height: 30px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 800;
}

.closing-section strong,
.closing-section small {
    display: block;
}

.closing-section strong {
    color: #0f172a;
    font-size: 12px;
}

.closing-section small {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 10px;
}

.closing-section.active {
    background: #f0fdfa;
}

.closing-section.active > span {
    color: #fff;
    background: #0f766e;
}

.closing-editor {
    margin-top: 0;
    min-height: 470px;
}

.workspace-placeholder {
    display: grid;
    min-height: 340px;
    place-items: center;
    align-content: center;
    padding: 30px;
    text-align: center;
}

.placeholder-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 15px;
    color: #fff;
    background: #0f766e;
    border-radius: 16px;
    font-weight: 800;
}

.workspace-placeholder h3 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
}

.workspace-placeholder p {
    max-width: 560px;
    margin: 8px auto;
    color: #64748b;
}

.workspace-note {
    max-width: 620px;
    margin-top: 15px;
    padding: 13px 16px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    font-size: 12px;
}

@media (max-width: 1000px) {
    .closing-workspace {
        grid-template-columns: 1fr;
    }

    .closing-sections {
        display: grid;
        grid-template-columns: repeat(4,1fr);
    }

    .closing-section {
        border-right: 1px solid #edf2f7;
    }
}

@media (max-width: 760px) {
    .closing-head {
        flex-direction: column;
    }

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

    .closing-sections {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .closing-sections::-webkit-scrollbar {
        display: none;
    }

    .closing-section {
        min-width: 155px;
        border-bottom: 0;
    }

    .closing-editor {
        min-height: 380px;
    }

    .workspace-placeholder {
        min-height: 280px;
        padding: 20px 10px;
    }
}

/* ==========================================================
   Daily Closing - Sales Entry
   ========================================================== */

.sales-entry-form {
    margin-top: 24px;
}

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

.sales-channel-card {
    display: block;
    padding: 18px;
    background: #fff;
    border: 1px solid #dfe7ee;
    border-radius: 14px;
    cursor: text;
    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.sales-channel-card:focus-within {
    border-color: #0f8a7d;
    box-shadow: 0 0 0 3px rgba(15, 138, 125, .09);
    transform: translateY(-1px);
}

.sales-channel-head {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 14px;
}

.sales-channel-head strong {
    display: block;
    color: #10233f;
    font-size: 14px;
}

.sales-channel-head small {
    display: block;
    margin-top: 2px;
    color: #718096;
    font-size: 11px;
}

.sales-channel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: #e8f8f5;
    color: #087c70;
    font-size: 11px;
    font-weight: 800;
}

.money-input-wrap {
    display: flex;
    align-items: center;
    min-height: 46px;
    overflow: hidden;
    border: 1px solid #d8e2ea;
    border-radius: 10px;
    background: #f9fbfc;
}

.money-input-wrap:focus-within {
    border-color: #0f8a7d;
    background: #fff;
}

.money-prefix {
    padding-left: 14px;
    color: #52677e;
    font-size: 13px;
    font-weight: 700;
}

.money-input {
    width: 100%;
    min-width: 0;
    padding: 12px 14px 12px 8px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #10233f;
    font: inherit;
    font-size: 17px;
    font-weight: 750;
    text-align: right;
}

.money-input::placeholder {
    color: #a8b5c1;
}

.money-input:disabled {
    cursor: not-allowed;
    opacity: .7;
}

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

.sales-totals > div {
    padding: 15px 17px;
    border: 1px solid #dfe7ee;
    border-radius: 12px;
    background: #f8fafc;
}

.sales-totals span {
    display: block;
    margin-bottom: 4px;
    color: #718096;
    font-size: 11px;
}

.sales-totals strong {
    display: block;
    color: #10233f;
    font-size: 17px;
}

.sales-totals .sales-total-primary {
    border-color: #b9e7de;
    background: #edf9f6;
}

.sales-totals .sales-total-primary strong {
    color: #087c70;
}

.workspace-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e7edf2;
}

.save-hint {
    color: #718096;
    font-size: 12px;
}

.form-alert {
    margin: 0 0 18px;
    padding: 13px 15px;
    border: 1px solid #dce5ec;
    border-radius: 10px;
    background: #f8fafc;
    color: #52677e;
    font-size: 13px;
}

.form-alert-error {
    border-color: #f2c7c7;
    background: #fff5f5;
    color: #9b2c2c;
}

.form-alert-error ul {
    margin: 7px 0 0 18px;
    padding: 0;
}

@media (max-width: 900px) {
    .sales-channel-grid {
        grid-template-columns: 1fr;
    }

    .sales-totals {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sales-channel-card {
        padding: 14px;
    }

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

    .workspace-actions .btn {
        width: 100%;
    }
}



/* ==========================================================
   DCF Mobile Navigation & Accessibility Refinement
   Progressive enhancement — September 2026
   ========================================================== */

.nav-link-disabled {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: not-allowed;
    opacity: .58;
    user-select: none;
}

.nav-coming-soon {
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .8;
}

.topbar-leading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mobile-menu-button,
.mobile-drawer-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-drawer,
.mobile-drawer-backdrop {
    display: none;
}

.mobile-nav-more {
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav svg {
    display: block;
    width: 21px;
    height: 21px;
    margin: 0 auto 3px;
}

.mobile-nav a,
.mobile-nav-more {
    color: #475569;
}

.mobile-nav a.active,
.mobile-nav a[aria-current="page"] {
    color: var(--primary);
}

.mobile-nav span {
    display: block;
    line-height: 1.1;
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: rgba(15, 118, 110, .12);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(15, 118, 110, .32);
    outline-offset: 2px;
}

body.drawer-open {
    overflow: hidden;
}


@media (max-width: 760px) {

    .mobile-menu-button,
    .mobile-drawer-close {
        display: inline-flex;
    }

    .topbar-leading {
        flex: 1 1 auto;
        min-width: 0;
    }

    .page-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /*
     * Minimum comfortable touch targets throughout the
     * complete mobile breakpoint, not only <=420px.
     */
    .btn,
    .form-control,
    .nav-link,
    .logout-button,
    .mobile-nav a,
    .mobile-nav-more {
        min-height: 44px;
    }

    .btn,
    .logout-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    input,
    select,
    textarea,
    .form-control,
    .money-input {
        font-size: 16px;
    }

    .logout-button {
        min-height: 44px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    /*
     * Full mobile drawer.
     */
    .mobile-drawer {
        display: block;
        position: fixed;
        z-index: 1201;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(86vw, 320px);
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--sidebar);
        color: #fff;
        box-shadow: 18px 0 45px rgba(2, 6, 23, .24);
        transform: translateX(-102%);
        visibility: hidden;
        transition:
            transform .18s ease,
            visibility .18s ease;
    }

    .mobile-drawer.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .mobile-drawer-backdrop {
        display: block;
        position: fixed;
        z-index: 1200;
        inset: 0;
        background: rgba(2, 6, 23, .56);
        opacity: 0;
        transition: opacity .18s ease;
    }

    .mobile-drawer-backdrop.is-open {
        opacity: 1;
    }

    .mobile-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 18px 16px 12px;
    }

    .mobile-drawer-head .sidebar-brand {
        padding: 0;
        min-width: 0;
    }

    .mobile-drawer-close {
        flex: 0 0 44px;
        border-color: rgba(255, 255, 255, .16);
        background: rgba(255, 255, 255, .08);
        color: #fff;
    }

    .mobile-drawer-nav {
        padding: 4px 12px 28px;
    }

    .mobile-drawer .nav-link {
        display: flex;
        align-items: center;
    }

    /*
     * Mobile bottom navigation remains the existing fixed
     * application navigation pattern.
     */
    .mobile-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mobile-nav a,
    .mobile-nav-more {
        min-width: 0;
        padding: 7px 3px 6px;
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
        text-align: center;
    }

    /*
     * Avoid accidental horizontal viewport expansion.
     */
    .main-area,
    .content,
    .panel,
    .closing-workspace,
    .closing-editor,
    .topbar,
    .user-area {
        min-width: 0;
    }

    table {
        max-width: 100%;
    }

    .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}


@media (prefers-reduced-motion: reduce) {

    .mobile-drawer,
    .mobile-drawer-backdrop {
        transition: none;
    }
}

/* =========================================================
   Daily Closing reconciliation summary
   ========================================================= */

.stat-card-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.stat-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(15, 118, 110, .08);
    color: var(--primary);
}

.stat-card-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-card-priority {
    border-color: rgba(15, 118, 110, .18);
}

.stat-card-priority .stat-value {
    font-weight: 800;
}

.stat-value-pending {
    font-size: .82em;
}

.stat-card-variance.is-danger {
    border-color: rgba(185, 28, 28, .25);
}

.stat-card-variance.is-danger .stat-card-icon,
.stat-card-variance.is-danger .stat-variance-label {
    color: #b91c1c;
}

.stat-card-variance.is-success .stat-card-icon,
.stat-card-variance.is-success .stat-variance-label {
    color: var(--primary);
}

.stat-card-variance.is-neutral .stat-variance-label {
    color: var(--primary);
}

.stat-variance-label {
    font-weight: 700;
}

/* Honest upcoming workflow state */

.closing-section.is-upcoming {
    cursor: default;
    opacity: .62;
}

.closing-step-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.closing-step-lock svg {
    display: block;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   Daily Closing reconciliation summary
   ========================================================= */

.stat-card-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.stat-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(15, 118, 110, .08);
    color: var(--primary);
}

.stat-card-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-card-priority {
    border-color: rgba(15, 118, 110, .18);
}

.stat-card-priority .stat-value {
    font-weight: 800;
}

.stat-value-pending {
    font-size: .82em;
}

.stat-card-variance.is-danger {
    border-color: rgba(185, 28, 28, .25);
}

.stat-card-variance.is-danger .stat-card-icon,
.stat-card-variance.is-danger .stat-variance-label {
    color: #b91c1c;
}

.stat-card-variance.is-success .stat-card-icon,
.stat-card-variance.is-success .stat-variance-label {
    color: var(--primary);
}

.stat-card-variance.is-neutral .stat-variance-label {
    color: var(--primary);
}

.stat-variance-label {
    font-weight: 700;
}

/* Honest upcoming workflow state */

.closing-section.is-upcoming {
    cursor: default;
    opacity: .62;
}

.closing-step-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.closing-step-lock svg {
    display: block;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   Daily Closing reconciliation summary
   ========================================================= */

.stat-card-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.stat-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(15, 118, 110, .08);
    color: var(--primary);
}

.stat-card-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.stat-card-priority {
    border-color: rgba(15, 118, 110, .18);
}

.stat-card-priority .stat-value {
    font-weight: 800;
}

.stat-value-pending {
    font-size: .82em;
}

.stat-card-variance.is-danger {
    border-color: rgba(185, 28, 28, .25);
}

.stat-card-variance.is-danger .stat-card-icon,
.stat-card-variance.is-danger .stat-variance-label {
    color: #b91c1c;
}

.stat-card-variance.is-success .stat-card-icon,
.stat-card-variance.is-success .stat-variance-label {
    color: var(--primary);
}

.stat-card-variance.is-neutral .stat-variance-label {
    color: var(--primary);
}

.stat-variance-label {
    font-weight: 700;
}

/* Honest upcoming workflow state */

.closing-section.is-upcoming {
    cursor: default;
    opacity: .62;
}

.closing-step-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.closing-step-lock svg {
    display: block;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}



/* =========================================================
   Daily Closing - responsive viewport-fit workspace
   Scoped to closings/show only through .closing-screen
   ========================================================= */

.closing-screen {
    width: 100%;
    min-width: 0;
}

.closing-screen .closing-head {
    margin-bottom: 12px;
}

.closing-screen .closing-summary-grid {
    gap: 10px;
    margin-bottom: 12px;
}

.closing-screen .stat-card {
    min-width: 0;
    padding: 14px 16px;
}

.closing-screen .stat-card::after {
    width: 42px;
    height: 42px;
}

.closing-screen .stat-card-head {
    margin-bottom: 6px;
}

.closing-screen .stat-value {
    font-size: clamp(1.2rem, 1.55vw, 1.65rem);
    line-height: 1.15;
}

.closing-screen .stat-foot {
    margin-top: 5px;
    font-size: .72rem;
}

.closing-screen .closing-workspace {
    min-width: 0;
}

.closing-screen .closing-editor {
    min-width: 0;
}

.closing-screen .panel-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.closing-screen .panel-header h2 {
    margin-bottom: 2px;
}


/* ---------------------------------------------------------
   Large desktop / laptop:
   fit the complete Sales workspace inside the browser window
   --------------------------------------------------------- */

@media (min-width: 1024px) and (min-height: 650px) {

    .closing-screen {
        height: calc(100dvh - 92px);
        max-height: calc(100dvh - 92px);

        display: grid;
        grid-template-rows:
            auto
            auto
            minmax(0, 1fr);

        gap: 0;

        overflow: hidden;
    }

    .closing-screen .closing-head {
        flex-shrink: 0;
    }

    .closing-screen .closing-head h1 {
        margin-top: 5px;
        margin-bottom: 4px;
        font-size: clamp(1.35rem, 1.8vw, 1.8rem);
    }

    .closing-screen .closing-head p {
        margin: 0;
    }

    .closing-screen .closing-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        flex-shrink: 0;
    }

    .closing-screen .stat-card {
        min-height: 108px;
        padding: 12px 14px;
    }

    .closing-screen .stat-card-icon {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .closing-screen .stat-card-icon svg {
        width: 16px;
        height: 16px;
    }

    .closing-screen .closing-workspace {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr);

        gap: 12px;

        min-height: 0;
        height: 100%;

        overflow: hidden;
    }

    .closing-screen .closing-sections {
        min-height: 0;
        height: 100%;

        overflow: hidden;

        border-radius: var(--radius);
    }

    .closing-screen .closing-section {
        min-height: 0;
        padding: 8px 10px;
    }

    .closing-screen .closing-section strong {
        font-size: .77rem;
    }

    .closing-screen .closing-section small {
        font-size: .65rem;
        line-height: 1.2;
    }

    .closing-screen .closing-step-number,
    .closing-screen .closing-step-lock {
        width: 27px;
        height: 27px;
        flex-basis: 27px;
    }

    .closing-screen .closing-editor {
        height: 100%;
        min-height: 0;

        display: flex;
        flex-direction: column;

        overflow: hidden;

        padding: 14px 16px;
    }

    .closing-screen .sales-entry-form {
        flex: 1 1 auto;
        min-height: 0;

        display: flex;
        flex-direction: column;

        overflow: hidden;
    }


    /* 4 × 2 grid:
       all eight payment methods fit in two compact rows */

    .closing-screen .sales-channel-grid {
        display: grid;

        grid-template-columns:
            repeat(4, minmax(0, 1fr));

        gap: 8px;

        flex: 1 1 auto;
        min-height: 0;

        align-content: start;
    }

    .closing-screen .sales-channel-card {
        min-width: 0;

        display: flex;
        flex-direction: column;

        gap: 6px;

        padding: 9px 10px;
    }

    .closing-screen .sales-channel-head {
        min-width: 0;
        min-height: 30px;
    }

    .closing-screen .sales-channel-head strong {
        display: block;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        font-size: .77rem;
    }

    .closing-screen .sales-channel-head small {
        display: block;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        margin-top: 1px;

        font-size: .64rem;
    }

    .closing-screen .money-input-wrap {
        width: 100%;
        min-width: 0;
        min-height: 44px;
    }

    .closing-screen .money-input {
        width: 100%;
        min-width: 0;
        min-height: 44px;

        font-size: .95rem;
    }


    /* Running totals stay visible beneath the two input rows */

    .closing-screen .sales-totals {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));

        gap: 8px;

        flex: 0 0 auto;

        margin-top: 9px;
    }

    .closing-screen .sales-totals > div {
        padding: 8px 11px;
    }

    .closing-screen .sales-totals span {
        font-size: .68rem;
    }

    .closing-screen .sales-totals strong {
        font-size: 1rem;
    }


    /* Action bar always visible.
       No need to hunt for Save at bottom of page. */

    .closing-screen .workspace-actions {
        position: relative;
        bottom: auto;

        flex: 0 0 auto;

        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 12px;

        margin-top: 9px;
        padding: 8px 0 0;

        background: var(--surface);
    }

    .closing-screen .save-hint {
        font-size: .7rem;
    }

    .closing-screen .sales-save-button {
        min-width: 145px;
        min-height: 44px;
    }
}


/* ---------------------------------------------------------
   Medium laptop:
   2 columns instead of 4 where horizontal room is tighter
   --------------------------------------------------------- */

@media (min-width: 1024px) and (max-width: 1280px) {

    .closing-screen .closing-workspace {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .closing-screen .sales-channel-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .closing-screen .sales-channel-card {
        display: grid;

        grid-template-columns:
            minmax(0, 1fr) minmax(145px, 180px);

        align-items: center;
    }
}


/* ---------------------------------------------------------
   Short laptop screens
   --------------------------------------------------------- */

@media (min-width: 1024px) and (max-height: 760px) {

    .closing-screen {
        height: calc(100dvh - 82px);
        max-height: calc(100dvh - 82px);
    }

    .closing-screen .closing-head {
        margin-bottom: 7px;
    }

    .closing-screen .hero-kicker {
        margin-top: 2px;
    }

    .closing-screen .closing-summary-grid {
        margin-bottom: 8px;
    }

    .closing-screen .stat-card {
        min-height: 90px;
        padding: 9px 12px;
    }

    .closing-screen .stat-card-head {
        margin-bottom: 3px;
    }

    .closing-screen .stat-card-icon {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }

    .closing-screen .stat-card-icon svg {
        width: 14px;
        height: 14px;
    }

    .closing-screen .stat-value {
        font-size: 1.18rem;
    }

    .closing-screen .stat-foot {
        margin-top: 2px;
        font-size: .62rem;
    }

    .closing-screen .closing-editor {
        padding: 10px 12px;
    }

    .closing-screen .panel-header {
        margin-bottom: 6px;
        padding-bottom: 5px;
    }

    .closing-screen .sales-channel-card {
        padding: 6px 8px;
    }

    .closing-screen .money-input,
    .closing-screen .money-input-wrap {
        min-height: 42px;
    }

    .closing-screen .sales-totals {
        margin-top: 6px;
    }

    .closing-screen .workspace-actions {
        margin-top: 6px;
    }
}


/* ---------------------------------------------------------
   Tablet and mobile:
   do NOT force viewport height. Natural scrolling is safer.
   --------------------------------------------------------- */

@media (max-width: 1023px) {

    .closing-screen {
        height: auto;
        max-height: none;
        overflow: visible;
    }

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

    .closing-screen .closing-workspace {
        min-width: 0;
    }
}


@media (max-width: 760px) {

    .closing-screen .closing-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;
    }

    .closing-screen .stat-card {
        padding: 11px;
        min-width: 0;
    }

    .closing-screen .stat-card-icon {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .closing-screen .stat-card-icon svg {
        width: 15px;
        height: 15px;
    }

    .closing-screen .stat-value {
        font-size: clamp(1rem, 5vw, 1.25rem);
        overflow-wrap: anywhere;
    }

    .closing-screen .stat-foot {
        font-size: .65rem;
    }

    .closing-screen .closing-sections {
        display: flex;

        max-width: 100%;

        overflow-x: auto;
        overflow-y: hidden;

        gap: 7px;
        padding-bottom: 5px;

        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .closing-screen .closing-sections::-webkit-scrollbar {
        display: none;
    }

    .closing-screen .closing-section {
        flex: 0 0 118px;
        min-width: 118px;
        min-height: 48px;

        padding: 8px;
    }

    .closing-screen .closing-section.is-upcoming {
        flex-basis: 112px;
        min-width: 112px;
    }

    .closing-screen .sales-channel-grid {
        grid-template-columns: minmax(0, 1fr);

        width: 100%;
        max-width: 100%;
    }

    .closing-screen .sales-channel-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .closing-screen .money-input-wrap,
    .closing-screen .money-input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .closing-screen .money-input {
        min-height: 48px;

        /* prevents iOS input zoom */
        font-size: 16px;
    }

    .closing-screen .sales-totals {
        grid-template-columns: minmax(0, 1fr);
    }

    .closing-screen .workspace-actions {
        position: sticky;
        z-index: 25;

        bottom: 68px;

        margin-left: -2px;
        margin-right: -2px;

        padding: 9px 2px;

        background: var(--surface);
    }

    .closing-screen .sales-save-button {
        width: 100%;
        min-height: 48px;
    }
}


@media (max-width: 390px) {

    .closing-screen .closing-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .closing-screen .closing-section {
        min-width: 105px;
        flex-basis: 105px;
    }
}


/* Daily Closing - larger payment method labels */

.closing-screen .sales-channel-head strong {
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 700;
}

@media (min-width: 1024px) {
    .closing-screen .sales-channel-head strong {
        font-size: 1.05rem;
    }
}

@media (max-width: 760px) {
    .closing-screen .sales-channel-head strong {
        font-size: 1.05rem;
    }
}


/* Daily Closing - emphasize running sales totals */

.closing-screen .sales-totals span {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
}

.closing-screen .sales-totals strong {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.closing-screen .sales-totals .sales-total-primary span {
    font-size: 1rem;
}

.closing-screen .sales-totals .sales-total-primary strong {
    font-size: 1.5rem;
}

@media (max-width: 760px) {
    .closing-screen .sales-totals span {
        font-size: 1rem;
    }

    .closing-screen .sales-totals strong {
        font-size: 1.4rem;
    }

    .closing-screen .sales-totals .sales-total-primary strong {
        font-size: 1.55rem;
    }
}



/* =========================================================
   FIX: mobile drawer must never block the page while closed
   ========================================================= */

@media (max-width: 760px) {

    /*
     * The backdrop covers the entire viewport.
     * While closed it must NOT receive any taps.
     */
    .mobile-drawer-backdrop {
        pointer-events: none;
        visibility: hidden;
    }

    .mobile-drawer-backdrop.is-open {
        pointer-events: auto;
        visibility: visible;
    }

    /*
     * Respect the HTML hidden attribute regardless of
     * any earlier display:block drawer rules.
     */
    .mobile-drawer-backdrop[hidden] {
        display: none !important;
        pointer-events: none !important;
        visibility: hidden !important;
    }

    /*
     * Closed drawer itself must also be non-interactive.
     */
    .mobile-drawer {
        pointer-events: none;
    }

    .mobile-drawer.is-open {
        pointer-events: auto;
    }

    /*
     * Ensure real mobile controls stay tappable.
     */
    .mobile-menu-button,
    .logout-button,
    .mobile-nav,
    .mobile-nav a,
    .mobile-nav button,
    .mobile-nav-more {
        pointer-events: auto;
    }
}



/* =========================================================
   DCF functional workflow sections 02-05
   ========================================================= */

.closing-step-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.closing-step-link:hover,
.closing-step-link:focus-visible {
    border-color: rgba(15, 118, 110, .35);
    background: rgba(15, 118, 110, .05);
}

.closing-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(15, 118, 110, .08);
    color: var(--primary);
    font-size: .78rem;
    font-weight: 800;
}

.closing-step-copy {
    min-width: 0;
}

.closing-step-copy strong,
.closing-step-copy small {
    display: block;
}

.closing-step-copy small {
    margin-top: 2px;
    color: var(--text-muted, #64748b);
    font-size: .72rem;
}

.closing-work-section {
    scroll-margin-top: 90px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.closing-work-section + .closing-work-section {
    margin-top: 16px;
}

.closing-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.closing-section-heading h2 {
    margin: 2px 0 3px;
    font-size: 1.1rem;
}

.closing-section-heading p {
    margin: 0;
    color: var(--text-muted, #64748b);
    font-size: .86rem;
}

.closing-section-heading > strong {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 1rem;
}

.section-kicker {
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.closing-entry-form {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background: var(--surface-soft, #f8fafc);
}

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

.closing-entry-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.closing-entry-grid label > span {
    font-size: .8rem;
    font-weight: 700;
}

.closing-entry-grid input,
.closing-entry-grid select {
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: inherit;
    font: inherit;
}

.closing-field-wide {
    grid-column: span 2;
}

.closing-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.button-primary {
    min-height: 44px;
    padding: 9px 16px;
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}

.closing-entry-list {
    display: grid;
    gap: 8px;
}

.closing-entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
}

.closing-entry-row small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted, #64748b);
}

.closing-entry-amount {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    text-align: right;
}

.closing-remove-button {
    min-height: 36px;
    padding: 6px 9px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    color: #b91c1c;
    font-weight: 700;
    cursor: pointer;
}

.closing-empty-state {
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: 9px;
    color: var(--text-muted, #64748b);
    text-align: center;
    font-size: .85rem;
}

@media (max-width: 900px) {
    .closing-entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {

    .closing-work-section {
        padding: 14px;
    }

    .closing-section-heading {
        display: block;
    }

    .closing-section-heading > strong {
        display: block;
        margin-top: 8px;
    }

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

    .closing-field-wide {
        grid-column: auto;
    }

    .closing-entry-grid input,
    .closing-entry-grid select {
        min-height: 48px;
        font-size: 16px;
    }

    .closing-form-actions .button-primary {
        width: 100%;
        min-height: 48px;
    }

    .closing-entry-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .closing-entry-amount {
        width: 100%;
        justify-content: space-between;
        text-align: left;
    }
}



/* DCF workflow clickable steps */
.closing-section.closing-step-link {
    pointer-events: auto !important;
    cursor: pointer !important;
    text-decoration: none;
    color: inherit;
}

.closing-section.closing-step-link:hover,
.closing-section.closing-step-link:focus-visible {
    background: rgba(15, 118, 110, .07);
    border-color: var(--primary);
    outline: none;
}

.closing-section.closing-step-link .closing-step-number {
    background: var(--primary);
    color: #fff;
}


/* =========================================================
   DCF Step 06 - Cash Count
   ========================================================= */

.closing-screen #cash-count {
    scroll-margin-top: 90px;
}

.closing-screen .cash-count-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 10px;
}

.closing-screen .cash-denomination {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius);
    background: #fff;
}

.closing-screen .cash-denomination-label {
    font-weight: 800;
    font-size: .95rem;
}

.closing-screen .cash-denomination input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

.closing-screen .cash-denomination small {
    color: var(--text-muted, #64748b);
    font-weight: 700;
}

.closing-screen .cash-count-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(15, 118, 110, .22);
    border-radius: var(--radius);
    background: rgba(15, 118, 110, .055);
}

.closing-screen .cash-count-total span {
    font-size: 1rem;
    font-weight: 700;
}

.closing-screen .cash-count-total strong {
    color: var(--primary);
    font-size: 1.35rem;
    font-weight: 800;
}

.closing-screen .cash-count-notes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
}

.closing-screen .cash-count-notes > span {
    font-weight: 700;
}

.closing-screen .cash-count-notes textarea {
    width: 100%;
    min-height: 64px;
    resize: vertical;
}

.closing-screen .cash-count-last {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: #f8fafc;
}

.closing-screen .cash-count-last > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.closing-screen .cash-count-last span,
.closing-screen .cash-count-last small {
    color: var(--text-muted, #64748b);
}

.closing-screen .cash-count-last strong {
    color: var(--primary);
}

@media (max-width: 900px) {
    .closing-screen .cash-count-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 390px) {
    .closing-screen .cash-count-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .closing-screen .cash-count-total {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Functional sections need internal scrolling on desktop */
@media (min-width: 1024px) {
    .closing-screen .closing-editor {
        overflow-y: auto !important;
        overscroll-behavior: contain;
        scroll-behavior: smooth;
    }
}

/* =========================================================
   DCF Step 07 - Reconciliation
   ========================================================= */

.closing-screen #reconciliation {
    scroll-margin-top: 90px;
}

.closing-screen .reconciliation-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.closing-screen .reconciliation-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius);
    background: #fff;
}

.closing-screen .reconciliation-card span,
.closing-screen .reconciliation-result span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted, #64748b);
    font-size: .8rem;
    font-weight: 700;
}

.closing-screen .reconciliation-card strong {
    font-size: 1rem;
    font-weight: 800;
}

.closing-screen .reconciliation-card small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted, #64748b);
    font-size: .7rem;
    line-height: 1.35;
}

.closing-screen .reconciliation-result {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.closing-screen .reconciliation-result > div {
    min-width: 0;
    padding: 14px;
    border-radius: var(--radius);
    background: #f8fafc;
}

.closing-screen .reconciliation-result strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
}

.closing-screen .reconciliation-difference.is-balanced {
    background: rgba(15, 118, 110, .08);
}

.closing-screen .reconciliation-difference.is-short {
    background: rgba(185, 28, 28, .08);
}

.closing-screen .reconciliation-difference.is-over {
    background: rgba(180, 83, 9, .08);
}

.closing-screen .reconciliation-removal {
    border: 1px solid rgba(15, 118, 110, .2);
}

.closing-screen .reconciliation-removal strong {
    color: var(--primary);
}

.closing-screen .recon-positive {
    color: #047857;
}

.closing-screen .recon-negative {
    color: #b91c1c;
}

@media (max-width: 900px) {
    .closing-screen .reconciliation-grid,
    .closing-screen .reconciliation-result {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .closing-screen .reconciliation-grid,
    .closing-screen .reconciliation-result {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =========================================================
   DCF Step 08 - Review & Submit
   ========================================================= */

.closing-screen #review-submit {
    scroll-margin-top: 90px;
}

.closing-screen .review-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.closing-screen .review-status.is-draft,
.closing-screen .review-status.is-reopened {
    background: #fef3c7;
    color: #92400e;
}

.closing-screen .review-status.is-submitted {
    background: #dbeafe;
    color: #1d4ed8;
}

.closing-screen .review-status.is-approved {
    background: #dcfce7;
    color: #166534;
}

.closing-screen .review-status.is-locked {
    background: #ccfbf1;
    color: #0f766e;
}

.closing-screen .review-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.closing-screen .review-summary-card {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius);
    background: #fff;
}

.closing-screen .review-summary-card span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted, #64748b);
    font-size: .78rem;
    font-weight: 700;
}

.closing-screen .review-summary-card strong {
    font-size: 1.1rem;
    font-weight: 800;
}

.closing-screen .review-summary-card.is-balanced {
    border-color: rgba(15, 118, 110, .25);
}

.closing-screen .review-summary-card.has-variance {
    border-color: rgba(185, 28, 28, .28);
}

.closing-screen .review-checklist {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.closing-screen .review-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius);
    background: #f8fafc;
}

.closing-screen .review-check-icon {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 900;
}

.closing-screen .review-check.is-complete
.review-check-icon {
    background: #ccfbf1;
    color: #0f766e;
}

.closing-screen .review-check.is-pending
.review-check-icon,
.closing-screen .review-check.is-warning
.review-check-icon {
    background: #fef3c7;
    color: #92400e;
}

.closing-screen .review-check strong,
.closing-screen .review-check small {
    display: block;
}

.closing-screen .review-check small {
    margin-top: 3px;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
}

.closing-screen .review-action-form {
    margin-top: 14px;
}

.closing-screen .review-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.closing-screen .review-field > span {
    font-weight: 700;
}

.closing-screen .review-field textarea {
    width: 100%;
    resize: vertical;
}

.closing-screen .review-workflow-note {
    margin-top: 14px;
    padding: 11px 13px;
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    background: rgba(15, 118, 110, .055);
    font-size: .85rem;
}

.closing-screen .review-locked {
    margin-top: 14px;
    padding: 18px;
    border: 1px solid rgba(15, 118, 110, .22);
    border-radius: var(--radius);
    background: rgba(15, 118, 110, .06);
}

.closing-screen .review-locked strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.closing-screen button[disabled] {
    cursor: not-allowed;
    opacity: .5;
}

@media (max-width: 900px) {
    .closing-screen .review-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .closing-screen .review-checklist {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .closing-screen .review-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =========================================================
   DCF Step 08 - Review & Submit
   ========================================================= */

.closing-screen #review-submit {
    scroll-margin-top: 90px;
}

.closing-screen .review-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.closing-screen .review-status.is-draft,
.closing-screen .review-status.is-reopened {
    background: #fef3c7;
    color: #92400e;
}

.closing-screen .review-status.is-submitted {
    background: #dbeafe;
    color: #1d4ed8;
}

.closing-screen .review-status.is-approved {
    background: #dcfce7;
    color: #166534;
}

.closing-screen .review-status.is-locked {
    background: #ccfbf1;
    color: #0f766e;
}

.closing-screen .review-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.closing-screen .review-summary-card {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius);
    background: #fff;
}

.closing-screen .review-summary-card span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted, #64748b);
    font-size: .78rem;
    font-weight: 700;
}

.closing-screen .review-summary-card strong {
    font-size: 1.1rem;
    font-weight: 800;
}

.closing-screen .review-summary-card.is-balanced {
    border-color: rgba(15, 118, 110, .25);
}

.closing-screen .review-summary-card.has-variance {
    border-color: rgba(185, 28, 28, .28);
}

.closing-screen .review-checklist {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.closing-screen .review-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius);
    background: #f8fafc;
}

.closing-screen .review-check-icon {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 900;
}

.closing-screen .review-check.is-complete
.review-check-icon {
    background: #ccfbf1;
    color: #0f766e;
}

.closing-screen .review-check.is-pending
.review-check-icon,
.closing-screen .review-check.is-warning
.review-check-icon {
    background: #fef3c7;
    color: #92400e;
}

.closing-screen .review-check strong,
.closing-screen .review-check small {
    display: block;
}

.closing-screen .review-check small {
    margin-top: 3px;
    color: var(--text-muted, #64748b);
    line-height: 1.35;
}

.closing-screen .review-action-form {
    margin-top: 14px;
}

.closing-screen .review-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.closing-screen .review-field > span {
    font-weight: 700;
}

.closing-screen .review-field textarea {
    width: 100%;
    resize: vertical;
}

.closing-screen .review-workflow-note {
    margin-top: 14px;
    padding: 11px 13px;
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    background: rgba(15, 118, 110, .055);
    font-size: .85rem;
}

.closing-screen .review-locked {
    margin-top: 14px;
    padding: 18px;
    border: 1px solid rgba(15, 118, 110, .22);
    border-radius: var(--radius);
    background: rgba(15, 118, 110, .06);
}

.closing-screen .review-locked strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.closing-screen button[disabled] {
    cursor: not-allowed;
    opacity: .5;
}

@media (max-width: 900px) {
    .closing-screen .review-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .closing-screen .review-checklist {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .closing-screen .review-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Sales rail/anchor navigation */
.closing-screen #sales-breakdown {
    scroll-margin-top: 12px;
}

.closing-screen .closing-section-anchor {
    display: block;
    height: 0;
    scroll-margin-top: 0;
}

/* =========================================================
   DCF desktop functional workspace correction
   Sales and subsequent steps belong to one scrollable editor.
   Do not force the Sales form to consume/collapse available
   viewport height.
   ========================================================= */

@media (min-width: 1024px) {

    .closing-screen .closing-editor {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .closing-screen .sales-entry-form {
        flex: none !important;
        display: block !important;
        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .closing-screen .sales-channel-grid {
        flex: none !important;
        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .closing-screen #sales-breakdown {
        display: block;
        height: 0;
    }
}

/* Transaction block totals and actions */

.section-total-box {
    min-width: 150px;
    text-align: right;
}

.section-total-box span {
    display: block;
    margin-bottom: 3px;
    color: var(--text-muted, #64748b);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.section-total-box strong {
    color: var(--primary);
    font-size: 1.08rem;
}

.entry-action-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

.closing-edit-button,
.closing-remove-button {
    border: 0;
    background: transparent;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.closing-edit-button {
    color: var(--primary);
}

.closing-remove-button {
    color: #b91c1c;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

@media (max-width: 760px) {
    .section-total-box {
        margin-top: 8px;
        text-align: left;
    }

    .entry-action-group {
        justify-content: flex-start;
    }
}

/* ==========================================================
   Administrative Danger Zone
   ========================================================== */

.closing-danger-zone {
    border-top: 1px solid #fecaca;
}

.danger-access-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fef2f2;
    color: #991b1b;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.danger-card {
    overflow: hidden;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    background: #fff;
}

.danger-card-heading {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    background: #fff7f7;
    border-bottom: 1px solid #fee2e2;
}

.danger-card-heading h3 {
    margin: 0 0 5px;
    color: #991b1b;
    font-size: 1rem;
}

.danger-card-heading p {
    margin: 0;
    color: #7f1d1d;
    line-height: 1.55;
    font-size: .84rem;
}

.danger-icon {
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #b91c1c;
    color: #fff;
    font-weight: 900;
}

.danger-closing-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.danger-closing-summary > div {
    padding: 12px 14px;
    background: #fff;
}

.danger-closing-summary span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: .69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.danger-closing-summary strong {
    display: block;
    color: #0f172a;
    font-size: .84rem;
    overflow-wrap: anywhere;
}

.danger-warning {
    margin: 16px;
    padding: 14px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-size: .82rem;
    line-height: 1.55;
}

.danger-warning strong {
    display: block;
    margin-bottom: 5px;
}

.danger-warning p {
    margin: 5px 0 0;
}

.danger-delete-form {
    padding: 0 16px 16px;
}

.danger-field {
    display: block;
    margin-top: 14px;
}

.danger-field > span {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: .78rem;
    font-weight: 750;
}

.danger-field input,
.danger-field textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.danger-field textarea {
    resize: vertical;
    min-height: 88px;
}

.danger-field small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    line-height: 1.4;
}

.field-error {
    margin-top: 6px;
    color: #b91c1c;
    font-size: .77rem;
    font-weight: 700;
}

.danger-delete-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #fee2e2;
}

.danger-delete-note {
    max-width: 520px;
    color: #64748b;
    font-size: .75rem;
    line-height: 1.45;
}

.btn-danger-delete {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid #991b1b;
    border-radius: 9px;
    background: #b91c1c;
    color: #fff;
    font: inherit;
    font-size: .8rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger-delete:hover {
    background: #991b1b;
}

.btn-danger-delete:focus-visible {
    outline: 3px solid rgba(185, 28, 28, .22);
    outline-offset: 2px;
}

@media (max-width: 760px) {

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

    .danger-delete-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .btn-danger-delete {
        width: 100%;
    }
}

/* =========================================================
   MASTER DATA INTERACTIVE WORKSPACE
   ========================================================= */

.master-workspace {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 18px;
    min-height: calc(100vh - 150px);
}

.master-workspace-rail,
.master-workspace-editor {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.master-workspace-rail {
    padding: 14px;
    align-self: start;
    position: sticky;
    top: 16px;
}

.master-workspace-heading {
    padding: 4px 6px 14px;
    border-bottom: 1px solid #edf0f2;
    margin-bottom: 10px;
}

.master-workspace-heading small {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
}

.master-tab-list {
    display: grid;
    gap: 5px;
}

.master-tab-button {
    appearance: none;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #334155;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.master-tab-button:hover {
    background: #f1f5f4;
    color: var(--primary);
}

.master-tab-button.active {
    background: #ecfdf5;
    color: var(--primary);
}

.master-tab-count {
    min-width: 28px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    text-align: center;
}

.master-tab-button.active .master-tab-count {
    background: #ccfbf1;
    color: #0f766e;
}

.master-workspace-editor {
    min-width: 0;
    overflow: hidden;
}

.master-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.master-editor-toolbar h1 {
    margin: 0;
    font-size: 20px;
}

.master-editor-toolbar p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 13px;
}

.master-search {
    width: min(320px, 100%);
}

.master-search label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 5px;
}

.master-search input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 9px 12px;
    font: inherit;
}

.master-search input:focus {
    outline: 2px solid rgba(15, 118, 110, .18);
    border-color: var(--primary);
}

.master-panel {
    padding: 18px;
}

.master-panel[hidden] {
    display: none !important;
}

.master-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.master-panel-header h2 {
    margin: 0 0 3px;
    font-size: 18px;
}

.master-panel-header p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.master-summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.master-summary-badge {
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
}

.master-summary-badge.is-active {
    background: #ecfdf5;
    color: #047857;
}

.master-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
}

.master-status.is-active {
    background: #dcfce7;
    color: #166534;
}

.master-status.is-inactive {
    background: #f1f5f9;
    color: #64748b;
}

.master-table-wrap {
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.master-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.master-table th,
.master-table td {
    padding: 11px 13px;
    border-bottom: 1px solid #edf0f2;
    text-align: left;
    vertical-align: middle;
}

.master-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.master-table tbody tr:hover {
    background: #f8fafc;
}

.master-search-empty {
    margin: 16px 0 0;
    padding: 18px;
    text-align: center;
    background: #f8fafc;
    border-radius: 10px;
    color: #64748b;
}

@media (max-width: 900px) {
    .master-workspace {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .master-workspace-rail {
        position: static;
        overflow-x: auto;
    }

    .master-tab-list {
        display: flex;
        min-width: max-content;
    }

    .master-tab-button {
        width: auto;
        white-space: nowrap;
    }

    .master-editor-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .master-search {
        width: 100%;
    }
}

/* Master Data management screens */

.master-manage-page {
    display: grid;
    gap: 16px;
}

.master-manage-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.master-manage-header h1 {
    margin: 4px 0;
}

.master-manage-header p {
    margin: 0;
    color: #64748b;
}

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

.master-manage-stats > div {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 13px 15px;
}

.master-manage-stats span {
    display: block;
    color: #64748b;
    font-size: 12px;
}

.master-manage-stats strong {
    display: block;
    margin-top: 3px;
    font-size: 20px;
}

.master-manage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, .75fr);
    gap: 16px;
    align-items: start;
}

.master-list-panel,
.master-form-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    min-width: 0;
}

.master-form-panel {
    position: sticky;
    top: 16px;
}

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

.master-panel-title h2 {
    margin: 0;
    font-size: 17px;
}

.master-panel-title p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 12px;
}

.master-panel-title input[type="search"] {
    width: 220px;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font: inherit;
}

.master-row-subtitle {
    display: block;
    margin-top: 3px;
    color: #64748b;
}

.master-row-actions,
.master-form-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.master-row-actions form {
    margin: 0;
}

.btn-sm {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
}

.btn-danger-soft {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c;
}

.master-entry-form {
    display: grid;
    gap: 12px;
}

.master-form-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.master-field {
    display: grid;
    gap: 5px;
}

.master-field > span {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.master-field input,
.master-field textarea,
.master-field select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    padding: 9px 10px;
    font: inherit;
    background: #fff;
}

.master-field input:focus,
.master-field textarea:focus,
.master-field select:focus {
    outline: 2px solid rgba(15, 118, 110, .16);
    border-color: var(--primary);
}

.master-form-actions {
    justify-content: flex-end;
    padding-top: 5px;
}

.master-form-errors {
    padding: 10px 12px;
    border-radius: 9px;
    background: #fff1f2;
    color: #9f1239;
    font-size: 12px;
}

.master-form-errors ul {
    margin: 5px 0 0;
    padding-left: 18px;
}

@media (max-width: 1050px) {
    .master-manage-grid {
        grid-template-columns: 1fr;
    }

    .master-form-panel {
        position: static;
    }
}

@media (max-width: 650px) {
    .master-manage-header,
    .master-panel-title {
        flex-direction: column;
        align-items: stretch;
    }

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

    .master-form-two {
        grid-template-columns: 1fr;
    }

    .master-panel-title input[type="search"] {
        width: 100%;
        font-size: 16px;
    }

    .master-field input,
    .master-field textarea,
    .master-field select {
        font-size: 16px;
    }
}

/* =========================================================
   MASTER DATA LEFT NAVIGATION
   ========================================================= */

.master-data-page {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    column-gap: 18px;
    align-items: start;
}

.master-data-header {
    grid-column: 1 / -1;
    margin-bottom: 16px;
}

.master-data-left-nav {
    grid-column: 1;
    grid-row: 2 / span 20;

    position: sticky;
    top: 16px;

    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);

    padding: 10px;
}

.master-data-left-title {
    padding: 8px 9px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.master-data-left-title strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.master-data-left-title small {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
}

.master-data-left-nav nav {
    display: grid;
    gap: 4px;
}

.master-data-left-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    min-height: 42px;
    padding: 9px 10px;

    border-radius: 9px;

    color: #334155;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;

    transition: var(--transition);
}

.master-data-left-link:hover {
    background: #f0fdfa;
    color: var(--primary);
}

.master-data-left-link.active {
    background: #ccfbf1;
    color: #0f766e;
}

.master-data-left-link strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 27px;
    height: 23px;
    padding: 0 7px;

    border-radius: 999px;

    background: #f1f5f9;
    color: #64748b;

    font-size: 11px;
}

.master-data-left-link.active strong {
    background: #ffffff;
    color: #0f766e;
}

.master-data-section {
    grid-column: 2;
    min-width: 0;
}

@media (max-width: 900px) {

    .master-data-page {
        display: block;
    }

    .master-data-left-nav {
        position: static;
        margin-bottom: 14px;
        overflow-x: auto;
    }

    .master-data-left-title {
        display: none;
    }

    .master-data-left-nav nav {
        display: flex;
        width: max-content;
        min-width: 100%;
    }

    .master-data-left-link {
        white-space: nowrap;
    }
}

.master-check-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    cursor: pointer;
}

.master-check-field input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--primary);
}

.master-check-field span {
    display: grid;
    gap: 2px;
}

.master-check-field strong {
    font-size: 13px;
    color: #334155;
}

.master-check-field small {
    color: #64748b;
    font-size: 11px;
}

/* =========================================================
   MASTER DATA — MOBILE RESPONSIVE
   Applies to:
   Vendors
   Expense Categories
   Payment Methods
   Staff & Owners
   Branches & Settings
   ========================================================= */

.master-manage-page {
    min-width: 0;
}

.master-manage-header,
.master-panel-title,
.master-form-actions,
.master-row-actions {
    min-width: 0;
}

.master-list-panel,
.master-form-panel {
    min-width: 0;
}

/* Prevent tables from breaking the page width */
.master-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.master-table {
    width: 100%;
}

/* Search inputs should never overflow */
.master-panel-title input[type="search"] {
    max-width: 100%;
}

/* Form controls */
.master-entry-form input,
.master-entry-form select,
.master-entry-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Long text / email / addresses */
.master-table td,
.master-table th {
    overflow-wrap: anywhere;
}

/* =========================================================
   TABLET / SMALL LAPTOP
   ========================================================= */

@media (max-width: 1100px) {

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

    .master-form-panel {
        position: static;
    }

    .master-manage-header {
        align-items: flex-start;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .master-manage-page {
        width: 100%;
        max-width: 100%;
        padding: 0;
        overflow-x: hidden;
    }

    .master-manage-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .master-manage-header h1 {
        font-size: 1.35rem;
        line-height: 1.25;
        margin-bottom: 4px;
    }

    .master-manage-header p {
        font-size: 0.88rem;
        line-height: 1.45;
    }

    .master-manage-header > .btn,
    .master-manage-header > a.btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        text-align: center;
    }

    /* KPI counters */
    .master-manage-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .master-manage-stats > div {
        min-width: 0;
        padding: 10px;
    }

    .master-manage-stats span {
        font-size: 0.72rem;
        line-height: 1.25;
    }

    .master-manage-stats strong {
        font-size: 1.15rem;
    }

    /* List and form become stacked */
    .master-manage-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .master-list-panel,
    .master-form-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    /* Search moves below heading */
    .master-panel-title {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .master-panel-title input[type="search"] {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
    }

    /* Keep table readable through horizontal scroll */
    .master-table-wrap {
        margin-left: 0;
        margin-right: 0;
        border-radius: 8px;
    }

    .master-table {
        min-width: 680px;
    }

    .master-table th,
    .master-table td {
        padding: 9px 8px;
        font-size: 0.78rem;
        white-space: normal;
        vertical-align: top;
    }

    .master-table th {
        white-space: nowrap;
    }

    .master-row-subtitle {
        display: block;
        margin-top: 3px;
        line-height: 1.3;
    }

    /* Row action buttons */
    .master-row-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        min-width: 100px;
    }

    .master-row-actions form {
        width: 100%;
        margin: 0;
    }

    .master-row-actions .btn,
    .master-row-actions button {
        width: 100%;
        min-height: 38px;
        justify-content: center;
        white-space: nowrap;
    }

    /* Forms */
    .master-entry-form {
        width: 100%;
    }

    .master-form-two {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

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

    .master-field input,
    .master-field select,
    .master-field textarea {
        min-height: 44px;
        font-size: 16px;
    }

    .master-field textarea {
        min-height: 84px;
    }

    .master-check-field {
        width: 100%;
        box-sizing: border-box;
    }

    /* Form buttons */
    .master-form-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .master-form-actions .btn,
    .master-form-actions button,
    .master-form-actions a {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        text-align: center;
    }
}

/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 480px) {

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

    .master-manage-stats > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .master-manage-stats strong {
        font-size: 1.1rem;
    }

    .master-list-panel,
    .master-form-panel {
        border-radius: 10px;
    }

    .master-table {
        min-width: 620px;
    }

    .master-table th,
    .master-table td {
        padding: 8px 7px;
    }

    .master-manage-header h1 {
        font-size: 1.22rem;
    }
}

/* =========================================================
   MASTER DATA LEFT NAVIGATION — RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    .master-data-page {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .master-data-left-nav {
        position: static;
        display: flex;
        width: 100%;
        max-width: 100%;
        gap: 7px;
        padding: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .master-data-left-link {
        flex: 0 0 auto;
        min-height: 42px;
        white-space: nowrap;
    }
}

/* Avoid oversized tap animation and accidental overflow */
@media (hover: none) and (pointer: coarse) {

    .master-row-actions .btn,
    .master-form-actions .btn,
    .master-manage-header .btn,
    .master-data-left-link {
        min-height: 44px;
    }
}


/* =========================================================
   MASTER DATA MOBILE OVERLAP FIX
   ========================================================= */

@media (max-width: 900px) {

    /* Master Data landing page must become one clean column */
    .master-data-page {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .master-data-page > * {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Navigation becomes a compact horizontal strip */
    .master-data-left-nav {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 14px 0 !important;
        padding: 8px !important;

        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    .master-data-left-link {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: max-content !important;
    }

    /* Dedicated management pages */
    .master-manage-page {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    .master-manage-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        margin-bottom: 14px !important;
    }

    .master-manage-header > div {
        width: 100% !important;
        min-width: 0 !important;
    }

    .master-manage-header h1 {
        margin: 2px 0 4px !important;
        font-size: 28px !important;
        line-height: 1.15 !important;
    }

    .master-manage-header p {
        margin: 0 !important;
        font-size: 14px !important;
        line-height: 1.45 !important;
    }

    /* Remove any accidental multi-column desktop layout */
    .master-manage-grid {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .master-list-panel,
    .master-form-panel {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 0 14px 0 !important;
        position: static !important;
    }

    /* Tables stay inside their own scroll container */
    .master-table-wrap {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
    }

    .master-table {
        width: max-content !important;
        min-width: 640px !important;
        max-width: none !important;
    }

    /* Do not let text behind the table */
    .master-list-panel {
        overflow: hidden !important;
    }

    /* Forms follow after list, never overlap */
    .master-form-panel {
        clear: both !important;
    }

    /* Mobile page spacing */
    .app-main,
    .main-content,
    .page-content {
        min-width: 0 !important;
    }
}

@media (max-width: 600px) {

    .master-manage-header h1 {
        font-size: 26px !important;
    }

    .master-manage-stats {
        margin-bottom: 12px !important;
    }

    .master-list-panel,
    .master-form-panel {
        border-radius: 10px !important;
    }

}

/* =========================================================
   MASTER DATA CONFIGURATION HUB
   ========================================================= */

.master-hub {
    width: 100%;
    max-width: 1220px;
}

.master-hub-header {
    margin-bottom: 24px;
}

.master-hub-header h1 {
    margin: 5px 0 8px;
    font-size: 30px;
    line-height: 1.15;
}

.master-hub-header p {
    margin: 0;
    max-width: 720px;
    color: var(--text-muted, #64748b);
    line-height: 1.55;
}

.master-hub-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.master-hub-summary > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.master-hub-summary strong {
    color: #0f172a;
    font-size: 21px;
    line-height: 1.1;
}

.master-hub-summary span {
    color: #64748b;
    font-size: 12px;
}

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

.master-hub-card {
    display: flex;
    gap: 16px;
    min-width: 0;
    padding: 20px;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .03);
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.master-hub-card:hover {
    border-color: #99d5cf;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
    transform: translateY(-1px);
}

.master-hub-icon {
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    color: var(--primary, #0f766e);
    background: #ecfdf9;
}

.master-hub-icon svg {
    width: 23px;
    height: 23px;
    fill: currentColor;
}

.master-hub-card-body {
    flex: 1;
    min-width: 0;
}

.master-hub-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.master-hub-card-title h2 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    line-height: 1.25;
}

.master-hub-count {
    flex: 0 0 auto;
    min-width: 30px;
    padding: 4px 8px;
    text-align: center;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    background: #f1f5f9;
    border-radius: 999px;
}

.master-hub-card p {
    margin: 0 0 14px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.master-hub-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary, #0f766e);
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 1000px) {

    .master-hub-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {

    .master-hub {
        max-width: 100%;
    }

    .master-hub-header {
        margin-bottom: 16px;
    }

    .master-hub-header h1 {
        font-size: 26px;
    }

    .master-hub-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .master-hub-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .master-hub-card {
        padding: 15px;
        gap: 12px;
    }

    .master-hub-icon {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }

    .master-hub-card-title h2 {
        font-size: 16px;
    }
}

@media (max-width: 420px) {

    .master-hub-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .master-hub-summary > div {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}


/* =========================================================
   MASTER DATA — MOBILE CARD TABLES
   No horizontal scrolling on phones
   ========================================================= */

@media (max-width: 768px) {

    .master-table-wrap {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
    }

    .master-table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border: 0 !important;
        background: transparent !important;
    }

    .master-table thead {
        display: none !important;
    }

    .master-table tbody {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .master-table tbody tr {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        padding: 8px 12px !important;

        background: #fff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;

        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .master-table tbody td {
        display: grid !important;
        grid-template-columns: 112px minmax(0, 1fr) !important;
        align-items: start !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        padding: 8px 0 !important;

        border: 0 !important;
        border-bottom: 1px solid #edf2f7 !important;

        font-size: 13px !important;
        line-height: 1.4 !important;

        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;

        box-sizing: border-box !important;
    }

    .master-table tbody td:last-child {
        border-bottom: 0 !important;
    }

    .master-table tbody td[data-label]::before {
        content: attr(data-label);

        color: #64748b;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.35;

        text-transform: uppercase;
        letter-spacing: .03em;
    }

    .master-table tbody td strong {
        font-size: 14px !important;
        line-height: 1.35 !important;
    }

    .master-row-subtitle {
        display: block !important;
        margin-top: 3px !important;
        font-size: 12px !important;
        color: #64748b !important;
    }

    .master-status {
        width: fit-content !important;
        max-width: 100% !important;
    }

    /* Edit / Activate / Deactivate area */
    .master-row-actions {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;

        align-items: center !important;
        gap: 7px !important;

        width: 100% !important;
        min-width: 0 !important;
    }

    .master-row-actions form {
        display: inline-flex !important;
        width: auto !important;
        margin: 0 !important;
    }

    .master-row-actions .btn,
    .master-row-actions button,
    .master-row-actions a {
        width: auto !important;
        min-width: 74px !important;
        min-height: 38px !important;

        padding: 7px 11px !important;

        font-size: 12px !important;
        white-space: nowrap !important;
    }

    /* Empty state */
    .master-table tbody td.master-empty {
        display: block !important;
        padding: 22px 12px !important;
        text-align: center !important;
        border: 0 !important;
    }

    .master-table tbody td.master-empty::before {
        display: none !important;
    }

}


/* Very small phones */
@media (max-width: 420px) {

    .master-table tbody td {
        grid-template-columns: 92px minmax(0, 1fr) !important;
        gap: 8px !important;
    }

    .master-table tbody tr {
        padding: 7px 10px !important;
    }

    .master-row-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .master-row-actions form {
        width: 100% !important;
    }

    .master-row-actions .btn,
    .master-row-actions button,
    .master-row-actions a {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

}


/* =========================================================
   MASTER DATA — MOBILE FINAL POLISH
   Compact forms + KPI cards + bottom safe area
   ========================================================= */

@media (max-width: 768px) {

    /* -----------------------------------------------------
       PAGE SPACING
       ----------------------------------------------------- */

    .master-manage-page {
        padding-bottom: 18px !important;
    }

    .master-manage-header {
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .master-manage-header h1 {
        margin: 0 0 3px !important;
        font-size: 27px !important;
    }

    .master-manage-header p {
        margin: 0 !important;
        line-height: 1.4 !important;
    }

    /* -----------------------------------------------------
       COMPACT KPI CARDS
       ----------------------------------------------------- */

    .master-manage-stats {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin: 0 0 14px !important;
    }

    .master-manage-stats > div {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;

        min-height: 72px !important;
        padding: 10px 12px !important;

        border-radius: 12px !important;
    }

    .master-manage-stats span {
        font-size: 11px !important;
        line-height: 1.25 !important;
    }

    .master-manage-stats strong {
        margin-top: 3px !important;
        font-size: 21px !important;
        line-height: 1 !important;
    }

    /* -----------------------------------------------------
       PANELS
       ----------------------------------------------------- */

    .master-list-panel,
    .master-form-panel {
        padding: 14px !important;
        margin-bottom: 12px !important;
    }

    .master-panel-title {
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .master-panel-title h2 {
        margin: 0 0 2px !important;
        font-size: 20px !important;
        line-height: 1.2 !important;
    }

    .master-panel-title p {
        margin: 0 !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
    }

    /* -----------------------------------------------------
       COMPACT MASTER DATA FORMS
       ----------------------------------------------------- */

    .master-entry-form {
        display: grid !important;
        gap: 11px !important;
    }

    .master-field {
        gap: 5px !important;
        margin: 0 !important;
    }

    .master-field > span {
        font-size: 13px !important;
        line-height: 1.25 !important;
        font-weight: 700 !important;
    }

    .master-field input,
    .master-field select {
        min-height: 46px !important;
        height: 46px !important;

        padding: 9px 12px !important;

        font-size: 16px !important;
        line-height: 1.25 !important;

        border-radius: 10px !important;
    }

    .master-field textarea {
        min-height: 76px !important;
        height: auto !important;

        padding: 10px 12px !important;

        font-size: 16px !important;
        line-height: 1.4 !important;

        border-radius: 10px !important;
    }

    /* Address/notes do not need huge boxes on mobile */
    .master-field textarea[rows="3"] {
        min-height: 76px !important;
    }

    .master-form-two {
        gap: 11px !important;
    }

    .master-check-field {
        min-height: 44px !important;
        padding: 9px 10px !important;
    }

    /* -----------------------------------------------------
       FORM ACTIONS
       ----------------------------------------------------- */

    .master-form-actions {
        gap: 8px !important;
        margin-top: 3px !important;
    }

    .master-form-actions .btn,
    .master-form-actions button,
    .master-form-actions a {
        min-height: 48px !important;
        padding: 10px 14px !important;

        border-radius: 10px !important;

        font-size: 14px !important;
        font-weight: 700 !important;
    }

    /* -----------------------------------------------------
       ADD BUTTON
       ----------------------------------------------------- */

    .master-manage-header > .btn,
    .master-manage-header > a.btn {
        min-height: 48px !important;
        margin-top: 4px !important;
        border-radius: 10px !important;
    }

    /* -----------------------------------------------------
       SEARCH
       ----------------------------------------------------- */

    .master-panel-title input[type="search"] {
        min-height: 46px !important;
        height: 46px !important;
        padding: 9px 12px !important;
        border-radius: 10px !important;
    }

    /* -----------------------------------------------------
       MOBILE RECORD CARDS
       Keep existing no-horizontal-scroll behaviour
       ----------------------------------------------------- */

    .master-table tbody {
        gap: 9px !important;
    }

    .master-table tbody tr {
        padding: 6px 11px !important;
        border-radius: 11px !important;
    }

    .master-table tbody td {
        padding: 7px 0 !important;
    }

    .master-row-actions .btn,
    .master-row-actions button,
    .master-row-actions a {
        min-height: 40px !important;
    }
}


/* =========================================================
   SMALL PHONE KPI LAYOUT
   ========================================================= */

@media (max-width: 520px) {

    .master-manage-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .master-manage-stats > div {
        min-height: 68px !important;
        padding: 9px 8px !important;
        text-align: center !important;
        align-items: center !important;
    }

    .master-manage-stats span {
        font-size: 10px !important;
    }

    .master-manage-stats strong {
        font-size: 20px !important;
    }
}


/* =========================================================
   BOTTOM MOBILE NAV — SAFE AREA
   Prevent Android/iPhone gesture area collision
   ========================================================= */

@media (max-width: 768px) {

    .mobile-bottom-nav {
        padding-bottom:
            max(8px, env(safe-area-inset-bottom)) !important;
    }

    body {
        padding-bottom:
            calc(76px + env(safe-area-inset-bottom)) !important;
    }

}


/* Very narrow devices */
@media (max-width: 360px) {

    .master-manage-stats {
        gap: 6px !important;
    }

    .master-manage-stats > div {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .master-manage-stats span {
        font-size: 9px !important;
    }

}


/* =========================================================
   DAILY CLOSING — BANK / SAFE CASH TRANSFER
   ========================================================= */

.cash-transfer-panel {
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface, #fff);
}

.cash-transfer-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 15px;
}

.cash-transfer-heading > div {
    min-width: 0;
}

.cash-transfer-heading h3 {
    margin: 3px 0 4px;
    font-size: 18px;
    line-height: 1.25;
}

.cash-transfer-heading p {
    margin: 0;
    max-width: 680px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.cash-transfer-total {
    flex: 0 0 auto;
    text-align: right;
}

.cash-transfer-total span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.cash-transfer-total strong {
    display: block;
    margin-top: 3px;
    font-size: 19px;
}

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

.cash-transfer-notes,
.cash-transfer-submit {
    grid-column: 1 / -1;
}

.cash-transfer-submit {
    display: flex;
    justify-content: flex-end;
}

.cash-transfer-history {
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.cash-transfer-history h4 {
    margin: 0 0 10px;
    font-size: 14px;
}

.cash-transfer-row {
    position: relative;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.cash-transfer-row:first-of-type {
    border-top: 0;
}

.cash-transfer-row-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.cash-transfer-row-main span {
    font-weight: 800;
}

.cash-transfer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.cash-transfer-row-notes {
    margin: 6px 0 0;
    font-size: 13px;
}

.cash-transfer-delete {
    margin-top: 8px;
}

@media (max-width: 768px) {

    .cash-transfer-panel {
        padding: 14px;
    }

    .cash-transfer-heading {
        flex-direction: column;
        gap: 9px;
    }

    .cash-transfer-total {
        width: 100%;
        text-align: left;
    }

    .cash-transfer-form {
        grid-template-columns:
            minmax(0, 1fr);
        gap: 10px;
    }

    .cash-transfer-notes,
    .cash-transfer-submit {
        grid-column: auto;
    }

    .cash-transfer-submit .btn {
        width: 100%;
        min-height: 46px;
    }

    .cash-transfer-row-main {
        align-items: flex-start;
    }
}


/* Cash transfer edit/delete controls */

.cash-transfer-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.cash-transfer-actions form {
    margin: 0;
}

.cash-transfer-submit {
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .cash-transfer-actions {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

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

    .cash-transfer-submit {
        display: grid;
        grid-template-columns:
            minmax(0, 1fr);
    }

    .cash-transfer-submit .btn {
        width: 100%;
    }
}

/* =========================================================
   DAILY CLOSING — COMPACT SAVED RECORD LISTS
   ========================================================= */

.record-list-toggle-wrap {
    margin: 12px 0 4px;
}

.record-list-toggle {
    width: 100%;
    min-height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 9px 14px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: rgba(15, 118, 110, 0.05);
    color: var(--primary);

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background var(--transition),
        border-color var(--transition),
        transform var(--transition);
}

.record-list-toggle:hover {
    background: rgba(15, 118, 110, 0.10);
    border-color: var(--primary);
}

.record-list-toggle:active {
    transform: translateY(1px);
}

.record-list-toggle:focus-visible {
    outline: 3px solid
        rgba(15, 118, 110, 0.18);
    outline-offset: 2px;
}

.record-toggle-symbol {
    width: 24px;
    height: 24px;

    flex: 0 0 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--primary);
    color: #fff;

    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.record-list-toggle[
    aria-expanded="true"
] {
    margin-bottom: 8px;
}

.closing-entry-list[hidden],
.cash-transfer-history[hidden] {
    display: none !important;
}

@media (max-width: 768px) {

    .record-list-toggle-wrap {
        margin-top: 10px;
    }

    .record-list-toggle {
        min-height: 44px;
        padding: 9px 12px;
        font-size: 13px;
    }
}


/* =========================================================
   DAILY CLOSING — STICKY LEFT WORKFLOW NAV
   ========================================================= */

@media (min-width: 769px) {

    .closing-workspace {
        align-items: flex-start;
    }

    .closing-sections {
        position: sticky;
        top: 18px;

        align-self: flex-start;

        max-height: calc(100vh - 36px);
        overflow-y: auto;

        scrollbar-width: thin;
        z-index: 5;
    }

    .closing-sections::-webkit-scrollbar {
        width: 6px;
    }

    .closing-sections::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(100, 116, 139, 0.35);
    }
}


/* =========================================================
   APP SHELL — STICKY MAIN SIDEBAR
   ========================================================= */

@media (min-width: 769px) {

    .app-sidebar,
    .sidebar,
    .main-sidebar {
        position: sticky;
        top: 0;

        align-self: flex-start;

        height: 100vh;
        max-height: 100vh;

        overflow-y: auto;
        overflow-x: hidden;

        z-index: 20;
    }

    .app-sidebar::-webkit-scrollbar,
    .sidebar::-webkit-scrollbar,
    .main-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .app-sidebar::-webkit-scrollbar-thumb,
    .sidebar::-webkit-scrollbar-thumb,
    .main-sidebar::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.20);
    }
}


/* =========================================================
   APP SHELL — FIXED DESKTOP MAIN SIDEBAR
   Dashboard / Daily Closing / Users / Master Data
   ========================================================= */

@media (min-width: 761px) {

    .app-shell {
        grid-template-columns: 246px minmax(0, 1fr);
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;

        width: 246px;
        height: 100vh;
        min-height: 100vh;

        overflow-y: auto;
        overflow-x: hidden;

        z-index: 40;
    }

    .main-area {
        grid-column: 2;
        min-width: 0;
        width: 100%;
    }
}


/* Existing intermediate desktop width */
@media (min-width: 761px) and (max-width: 860px) {

    .app-shell {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .sidebar {
        width: 210px;
    }
}


/* Mobile remains unchanged */
@media (max-width: 760px) {

    .sidebar {
        position: static !important;
        width: auto;
        height: auto;
        min-height: 0;
    }

    .main-area {
        width: 100%;
    }
}


/* =========================================================
   DAILY CLOSING — NORMAL PAGE / TOUCHPAD SCROLL
   Keep workflow rail sticky without nested vertical scrolling
   ========================================================= */

@media (min-width: 769px) {

    .closing-sections {
        position: sticky !important;
        top: 18px !important;

        height: auto !important;
        max-height: none !important;

        overflow-y: visible !important;
        overflow-x: visible !important;

        overscroll-behavior: auto !important;
    }

    .closing-editor {
        height: auto !important;
        max-height: none !important;

        overflow-y: visible !important;
        overflow-x: visible !important;

        overscroll-behavior: auto !important;
    }

    .closing-workspace,
    .closing-screen {
        height: auto !important;
        max-height: none !important;

        overflow-y: visible !important;

        overscroll-behavior-y: auto !important;
    }
}


/* ==========================================================
   Credit Sales
   ========================================================== */

#credit-sales .closing-entry-form {
    margin-top: 16px;
}

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

#credit-sales .form-grid > label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

#credit-sales .form-grid > label > span:first-child {
    font-size: 0.82rem;
    font-weight: 700;
}

#credit-sales input,
#credit-sales select,
#credit-sales textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border-color, #d8e0ea);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    box-sizing: border-box;
}

#credit-sales textarea {
    min-height: 74px;
    resize: vertical;
}

#credit-sales .money-input-wrap {
    width: 100%;
}

#credit-sales .money-input-wrap input {
    border: 0;
    min-height: 40px;
}

#credit-sales .form-span-2 {
    grid-column: 1 / -1;
}

#credit-sales .workspace-actions {
    margin-top: 14px;
}

#credit-sales .record-list {
    margin-top: 18px;
}

#credit-sales .record-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 14px;
}

#credit-sales .record-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#credit-sales .record-amount {
    font-weight: 800;
}

#credit-sales .record-status {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

@media (max-width: 760px) {
    #credit-sales .form-grid {
        grid-template-columns: 1fr;
    }

    #credit-sales .form-span-2 {
        grid-column: auto;
    }

    #credit-sales .record-card {
        grid-template-columns: 1fr;
    }
}

/* Credit Sales conditional fields */
#credit-sales [hidden] {
    display: none !important;
}

/* Credit Sales expandable transaction history */
#credit-sales .credit-history-toggle {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

#credit-sales .credit-history-toggle button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 8px 14px;
}

#credit-sales .credit-history-toggle button:hover {
    text-decoration: underline;
}

/* ==========================================================
   Credit Sales - consistent saved-entry rows
   ========================================================== */

#credit-sales .record-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

#credit-sales .record-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid var(--border-color, #d8e0ea);
    border-radius: 9px;
    background: #fff;
}

#credit-sales .record-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#credit-sales .record-main strong {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    text-transform: none;
}

#credit-sales .record-main small {
    font-size: 0.75rem;
    line-height: 1.3;
    color: #64748b;
}

#credit-sales .record-amount {
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 800;
}

#credit-sales .record-status {
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 800;
}

#credit-sales .record-card form {
    margin: 0;
}

#credit-sales .record-card .btn {
    min-height: 34px;
    padding: 6px 10px;
}

@media (max-width: 760px) {
    #credit-sales .record-card {
        grid-template-columns: 1fr auto;
    }

    #credit-sales .record-amount {
        grid-column: 2;
        grid-row: 1;
    }

    #credit-sales .record-status {
        grid-column: 1;
    }
}

/* Credit Sales saved-entry toggle — match saved payments style */
#credit-sales .credit-history-toggle {
    margin-top: 12px;
    width: 100%;
}

#credit-sales .credit-history-toggle button {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 8px 14px;

    border: 1px solid #d7e2e8;
    border-radius: 14px;

    background: #f4f8f8;
    color: #006d64;

    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;

    cursor: pointer;
    text-decoration: none;
}

#credit-sales .credit-history-toggle button::before {
    content: '+';

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;
    flex: 0 0 22px;

    border-radius: 50%;
    background: #0b8377;
    color: #fff;

    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

#credit-sales .credit-history-toggle button[data-expanded="1"]::before {
    content: '−';
}

#credit-sales .credit-history-toggle button:hover {
    background: #edf6f5;
    text-decoration: none;
}

/* ==========================================================
   Daily Closing persistent section navigator
   ========================================================== */

.closing-screen .closing-sections {
    position: sticky !important;
    top: 82px !important;

    align-self: flex-start !important;

    max-height: calc(100vh - 100px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;

    z-index: 20;
}

/* Keep the navigation scrollbar unobtrusive */
.closing-screen .closing-sections {
    scrollbar-width: thin;
}

.closing-screen .closing-sections::-webkit-scrollbar {
    width: 5px;
}

.closing-screen .closing-sections::-webkit-scrollbar-thumb {
    border-radius: 8px;
}

/* Desktop: navigator remains fixed while closing content scrolls */
@media (min-width: 901px) {
    .closing-screen .closing-workspace {
        align-items: flex-start !important;
    }

    .closing-screen .closing-sections {
        position: sticky !important;
        top: 82px !important;
    }
}

/* Mobile/tablet: normal horizontal/flow behaviour */
@media (max-width: 900px) {
    .closing-screen .closing-sections {
        position: relative !important;
        top: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
}

/* =========================================================
   DAILY CLOSING — NORMAL PAGE / TOUCHPAD SCROLL
   Keep workflow rail sticky without nested vertical scrolling
   ========================================================= */

@media (min-width: 769px) {

    .closing-sections {
        position: sticky !important;
        top: 18px !important;

        height: auto !important;
        max-height: none !important;

        overflow-y: visible !important;
        overflow-x: visible !important;

        overscroll-behavior: auto !important;
    }

    .closing-editor {
        height: auto !important;
        max-height: none !important;

        overflow-y: visible !important;
        overflow-x: visible !important;

        overscroll-behavior: auto !important;
    }

    .closing-workspace,
    .closing-screen {
        height: auto !important;
        max-height: none !important;

        overflow-y: visible !important;

        overscroll-behavior-y: auto !important;
    }
}


/* ==========================================================
   FINAL FIX — Daily Closing step navigator stays visible
   while the browser page scrolls
   ========================================================== */

@media (min-width: 901px) {

    /*
     * Sticky elements stop working when an ancestor uses
     * overflow:hidden/auto. The Daily Closing page itself is
     * scrolling in the browser, so these wrappers must allow
     * normal document scrolling.
     */
    .closing-screen {
        overflow: visible !important;
    }

    .closing-screen .closing-workspace {
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        align-items: start !important;
    }

    .closing-screen .closing-editor {
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }

    /*
     * Keep 01–08 navigator visible beneath the application
     * header while the right-hand closing form scrolls.
     */
    .closing-screen .closing-sections {
        position: sticky !important;
        position: -webkit-sticky !important;

        top: 82px !important;

        align-self: start !important;
        height: fit-content !important;
        max-height: calc(100vh - 100px) !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        z-index: 50 !important;
    }
}

/* Mobile/tablet remains in normal document flow */
@media (max-width: 900px) {
    .closing-screen .closing-sections {
        position: relative !important;
        top: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* ==========================================================
   DAILY CLOSING — BALANCED RESPONSIVE VIEW
   Consistent proportions across desktop / laptop / tablet
   ========================================================== */

/* Overall workspace */
.closing-screen .closing-workspace {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    gap: 14px !important;
}

/* Left 01–08 navigator */
@media (min-width: 901px) {
    .closing-screen .closing-sections {
        flex: 0 0 190px !important;
        width: 190px !important;
        min-width: 190px !important;
        max-width: 190px !important;
    }

    .closing-screen .closing-editor {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
    }
}

/* Main content cards */
.closing-screen .closing-work-section,
.closing-screen .panel {
    border-radius: 12px !important;
}

.closing-screen .closing-work-section {
    padding: 16px !important;
    margin-bottom: 14px !important;
}

/* Headings */
.closing-screen .closing-section-heading {
    gap: 12px !important;
    margin-bottom: 12px !important;
}

.closing-screen .closing-section-heading h2 {
    margin-top: 2px !important;
    margin-bottom: 3px !important;
}

.closing-screen .closing-section-heading p {
    margin: 0 !important;
    line-height: 1.4 !important;
}

/* Standardize form containers */
.closing-screen .form-grid,
.closing-screen .vendor-payment-grid,
.closing-screen .expense-grid {
    gap: 12px !important;
}

/* Consistent controls */
.closing-screen input,
.closing-screen select,
.closing-screen textarea {
    box-sizing: border-box;
}

.closing-screen input:not([type="checkbox"]):not([type="radio"]),
.closing-screen select {
    min-height: 40px;
}

.closing-screen textarea {
    min-height: 62px;
}

/* Reduce oversized textarea blocks */
.closing-screen textarea[rows="3"] {
    min-height: 68px !important;
}

.closing-screen textarea[rows="4"],
.closing-screen textarea[rows="5"] {
    min-height: 82px !important;
}

/* Buttons stay compact and consistent */
.closing-screen .btn {
    min-height: 38px;
}

/* ==========================================================
   CASH COUNT
   ========================================================== */

.closing-screen .cash-count-grid {
    gap: 10px !important;
}

.closing-screen .cash-count-card {
    padding: 12px !important;
}

.closing-screen .cash-count-card input {
    min-height: 38px !important;
}

.closing-screen .cash-count-total {
    margin-top: 12px !important;
}

/* ==========================================================
   RECONCILIATION
   ========================================================== */

.closing-screen .reconciliation-grid {
    gap: 10px !important;
}

.closing-screen .reconciliation-card {
    padding: 12px !important;
    min-height: 0 !important;
}

.closing-screen .reconciliation-result {
    gap: 10px !important;
    margin-top: 12px !important;
}

.closing-screen .reconciliation-result > div {
    padding: 12px !important;
}

/* ==========================================================
   REVIEW & SUBMIT
   ========================================================== */

#review-submit + *,
.closing-screen .review-submit-panel,
.closing-screen .review-submit-section {
    scroll-margin-top: 90px;
}

/* Summary cards */
.closing-screen .review-summary-grid {
    gap: 10px !important;
}

.closing-screen .review-summary-grid > * {
    min-width: 0 !important;
}

/* Avoid huge vertical gaps */
.closing-screen .workspace-actions {
    margin-top: 12px !important;
    gap: 10px !important;
}

/* ==========================================================
   ADMINISTRATIVE / DELETE ENTIRE DAY
   ========================================================== */

/*
 * This action should remain prominent, but not dominate
 * the page visually.
 */
.closing-screen .delete-day-panel,
.closing-screen [data-delete-day],
.closing-screen .administrative-actions {
    margin-bottom: 14px !important;
}

.closing-screen .delete-day-panel textarea,
.closing-screen [data-delete-day] textarea {
    min-height: 72px !important;
}

/* ==========================================================
   LAPTOP: 1024–1366
   ========================================================== */

@media (min-width: 901px) and (max-width: 1366px) {
    .closing-screen .closing-workspace {
        gap: 10px !important;
    }

    .closing-screen .closing-sections {
        flex-basis: 176px !important;
        width: 176px !important;
        min-width: 176px !important;
        max-width: 176px !important;
    }

    .closing-screen .closing-work-section {
        padding: 14px !important;
    }

    .closing-screen .closing-section-heading {
        margin-bottom: 10px !important;
    }

    .closing-screen .reconciliation-card,
    .closing-screen .cash-count-card {
        padding: 10px !important;
    }
}

/* ==========================================================
   TABLET
   ========================================================== */

@media (min-width: 641px) and (max-width: 900px) {
    .closing-screen .closing-workspace {
        display: block !important;
    }

    .closing-screen .closing-sections {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px !important;

        width: 100% !important;
        max-width: none !important;

        margin-bottom: 10px !important;

        position: sticky !important;
        top: 64px !important;

        z-index: 30 !important;

        background: #fff;
        padding: 8px !important;
        border-radius: 10px;
    }

    .closing-screen .closing-section {
        min-width: 0 !important;
    }

    .closing-screen .closing-section small {
        display: none !important;
    }

    .closing-screen .closing-editor {
        width: 100% !important;
    }

    .closing-screen .closing-work-section {
        padding: 13px !important;
    }

    .closing-screen .cash-count-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 640px) {
    .closing-screen {
        padding: 0 !important;
    }

    .closing-screen .closing-workspace {
        display: block !important;
        width: 100% !important;
    }

    .closing-screen .closing-sections {
        display: flex !important;
        gap: 6px !important;

        position: sticky !important;
        top: 58px !important;

        width: 100% !important;
        max-width: none !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding: 7px !important;
        margin: 0 0 8px 0 !important;

        z-index: 30 !important;
        background: #fff;
    }

    .closing-screen .closing-section {
        flex: 0 0 auto !important;
        min-width: 52px !important;
        padding: 7px !important;
    }

    .closing-screen .closing-section > div {
        display: none !important;
    }

    .closing-screen .closing-step-number {
        margin: 0 auto !important;
    }

    .closing-screen .closing-editor {
        width: 100% !important;
        padding: 0 8px 12px !important;
    }

    .closing-screen .closing-work-section,
    .closing-screen .panel {
        padding: 12px !important;
        border-radius: 10px !important;
    }

    .closing-screen .closing-section-heading {
        display: flex !important;
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .closing-screen .section-total-box {
        width: 100% !important;
        text-align: left !important;
    }

    .closing-screen .form-grid {
        grid-template-columns: 1fr !important;
    }

    .closing-screen .form-span-2 {
        grid-column: auto !important;
    }

    .closing-screen .cash-count-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .closing-screen .reconciliation-grid,
    .closing-screen .reconciliation-result {
        grid-template-columns: 1fr !important;
    }

    .closing-screen .workspace-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .closing-screen .workspace-actions .btn {
        width: 100% !important;
    }
}

/* ==========================================================
   DAILY CLOSING — BALANCED RESPONSIVE VIEW
   Consistent proportions across desktop / laptop / tablet
   ========================================================== */

/* Overall workspace */
.closing-screen .closing-workspace {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    gap: 14px !important;
}

/* Left 01–08 navigator */
@media (min-width: 901px) {
    .closing-screen .closing-sections {
        flex: 0 0 190px !important;
        width: 190px !important;
        min-width: 190px !important;
        max-width: 190px !important;
    }

    .closing-screen .closing-editor {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
    }
}

/* Main content cards */
.closing-screen .closing-work-section,
.closing-screen .panel {
    border-radius: 12px !important;
}

.closing-screen .closing-work-section {
    padding: 16px !important;
    margin-bottom: 14px !important;
}

/* Headings */
.closing-screen .closing-section-heading {
    gap: 12px !important;
    margin-bottom: 12px !important;
}

.closing-screen .closing-section-heading h2 {
    margin-top: 2px !important;
    margin-bottom: 3px !important;
}

.closing-screen .closing-section-heading p {
    margin: 0 !important;
    line-height: 1.4 !important;
}

/* Standardize form containers */
.closing-screen .form-grid,
.closing-screen .vendor-payment-grid,
.closing-screen .expense-grid {
    gap: 12px !important;
}

/* Consistent controls */
.closing-screen input,
.closing-screen select,
.closing-screen textarea {
    box-sizing: border-box;
}

.closing-screen input:not([type="checkbox"]):not([type="radio"]),
.closing-screen select {
    min-height: 40px;
}

.closing-screen textarea {
    min-height: 62px;
}

/* Reduce oversized textarea blocks */
.closing-screen textarea[rows="3"] {
    min-height: 68px !important;
}

.closing-screen textarea[rows="4"],
.closing-screen textarea[rows="5"] {
    min-height: 82px !important;
}

/* Buttons stay compact and consistent */
.closing-screen .btn {
    min-height: 38px;
}

/* ==========================================================
   CASH COUNT
   ========================================================== */

.closing-screen .cash-count-grid {
    gap: 10px !important;
}

.closing-screen .cash-count-card {
    padding: 12px !important;
}

.closing-screen .cash-count-card input {
    min-height: 38px !important;
}

.closing-screen .cash-count-total {
    margin-top: 12px !important;
}

/* ==========================================================
   RECONCILIATION
   ========================================================== */

.closing-screen .reconciliation-grid {
    gap: 10px !important;
}

.closing-screen .reconciliation-card {
    padding: 12px !important;
    min-height: 0 !important;
}

.closing-screen .reconciliation-result {
    gap: 10px !important;
    margin-top: 12px !important;
}

.closing-screen .reconciliation-result > div {
    padding: 12px !important;
}

/* ==========================================================
   REVIEW & SUBMIT
   ========================================================== */

#review-submit + *,
.closing-screen .review-submit-panel,
.closing-screen .review-submit-section {
    scroll-margin-top: 90px;
}

/* Summary cards */
.closing-screen .review-summary-grid {
    gap: 10px !important;
}

.closing-screen .review-summary-grid > * {
    min-width: 0 !important;
}

/* Avoid huge vertical gaps */
.closing-screen .workspace-actions {
    margin-top: 12px !important;
    gap: 10px !important;
}

/* ==========================================================
   ADMINISTRATIVE / DELETE ENTIRE DAY
   ========================================================== */

/*
 * This action should remain prominent, but not dominate
 * the page visually.
 */
.closing-screen .delete-day-panel,
.closing-screen [data-delete-day],
.closing-screen .administrative-actions {
    margin-bottom: 14px !important;
}

.closing-screen .delete-day-panel textarea,
.closing-screen [data-delete-day] textarea {
    min-height: 72px !important;
}

/* ==========================================================
   LAPTOP: 1024–1366
   ========================================================== */

@media (min-width: 901px) and (max-width: 1366px) {
    .closing-screen .closing-workspace {
        gap: 10px !important;
    }

    .closing-screen .closing-sections {
        flex-basis: 176px !important;
        width: 176px !important;
        min-width: 176px !important;
        max-width: 176px !important;
    }

    .closing-screen .closing-work-section {
        padding: 14px !important;
    }

    .closing-screen .closing-section-heading {
        margin-bottom: 10px !important;
    }

    .closing-screen .reconciliation-card,
    .closing-screen .cash-count-card {
        padding: 10px !important;
    }
}

/* ==========================================================
   TABLET
   ========================================================== */

@media (min-width: 641px) and (max-width: 900px) {
    .closing-screen .closing-workspace {
        display: block !important;
    }

    .closing-screen .closing-sections {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px !important;

        width: 100% !important;
        max-width: none !important;

        margin-bottom: 10px !important;

        position: sticky !important;
        top: 64px !important;

        z-index: 30 !important;

        background: #fff;
        padding: 8px !important;
        border-radius: 10px;
    }

    .closing-screen .closing-section {
        min-width: 0 !important;
    }

    .closing-screen .closing-section small {
        display: none !important;
    }

    .closing-screen .closing-editor {
        width: 100% !important;
    }

    .closing-screen .closing-work-section {
        padding: 13px !important;
    }

    .closing-screen .cash-count-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 640px) {
    .closing-screen {
        padding: 0 !important;
    }

    .closing-screen .closing-workspace {
        display: block !important;
        width: 100% !important;
    }

    .closing-screen .closing-sections {
        display: flex !important;
        gap: 6px !important;

        position: sticky !important;
        top: 58px !important;

        width: 100% !important;
        max-width: none !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding: 7px !important;
        margin: 0 0 8px 0 !important;

        z-index: 30 !important;
        background: #fff;
    }

    .closing-screen .closing-section {
        flex: 0 0 auto !important;
        min-width: 52px !important;
        padding: 7px !important;
    }

    .closing-screen .closing-section > div {
        display: none !important;
    }

    .closing-screen .closing-step-number {
        margin: 0 auto !important;
    }

    .closing-screen .closing-editor {
        width: 100% !important;
        padding: 0 8px 12px !important;
    }

    .closing-screen .closing-work-section,
    .closing-screen .panel {
        padding: 12px !important;
        border-radius: 10px !important;
    }

    .closing-screen .closing-section-heading {
        display: flex !important;
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .closing-screen .section-total-box {
        width: 100% !important;
        text-align: left !important;
    }

    .closing-screen .form-grid {
        grid-template-columns: 1fr !important;
    }

    .closing-screen .form-span-2 {
        grid-column: auto !important;
    }

    .closing-screen .cash-count-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .closing-screen .reconciliation-grid,
    .closing-screen .reconciliation-result {
        grid-template-columns: 1fr !important;
    }

    .closing-screen .workspace-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .closing-screen .workspace-actions .btn {
        width: 100% !important;
    }
}

/* ==========================================================
   REPORTS CENTER
   ========================================================== */

.report-page {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}

.report-page-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.report-page-header h1 {
    margin: 3px 0 4px;
}

.report-page-header p {
    margin: 0;
}

.report-kicker {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.report-panel {
    background: #fff;
    border: 1px solid #dde5ea;
    border-radius: 13px;
    padding: 16px;
    margin-bottom: 14px;
}

.report-panel h2 {
    margin: 0 0 12px;
}

.report-card-grid,
.report-selector-grid {
    display: grid;
    gap: 9px;
}

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

.report-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #e0e7eb;
    background: #fbfcfd;
    padding: 11px 12px;
    border-radius: 9px;
}

.report-card > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.report-card small {
    color: #647380;
}

.report-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.summary-metric-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.summary-metric {
    padding: 11px;
    border: 1px solid #e0e7eb;
    border-radius: 9px;
    background: #fbfcfd;
}

.summary-metric span {
    display: block;
    font-size: .72rem;
    color: #687783;
    margin-bottom: 3px;
}

.summary-metric strong {
    font-size: 1rem;
}

.report-table-wrap {
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th,
.report-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e3e9ed;
    text-align: left;
}

.report-table th {
    font-size: .74rem;
    text-transform: uppercase;
}

.report-table .amount {
    text-align: right;
    white-space: nowrap;
}

.report-filter {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.report-filter label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

@media (max-width: 900px) {
    .summary-metric-grid,
    .report-selector-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .report-page-header,
    .report-card {
        flex-direction: column;
        align-items: stretch;
    }

    .summary-metric-grid,
    .report-selector-grid {
        grid-template-columns: 1fr;
    }

    .report-actions .btn {
        flex: 1;
    }
}

@media print {
    .sidebar,
    .mobile-topbar,
    .report-actions,
    .report-filter {
        display: none !important;
    }

    .report-panel {
        break-inside: avoid;
        border-color: #bbb;
    }
}


/* ==========================================================
   REPORTS CENTER — MODERN NAVIGATION
   ========================================================== */

.report-center-modern {
    padding-bottom: 28px;
}

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

.reports-hero h1 {
    margin: 4px 0 5px;
    font-size: clamp(1.7rem, 2.5vw, 2.25rem);
}

.reports-hero p {
    margin: 0;
    max-width: 700px;
    color: #667684;
}

.reports-hero-stats {
    display: flex;
    gap: 10px;
}

.reports-hero-stats > div {
    min-width: 96px;
    padding: 10px 13px;
    background: #fff;
    border: 1px solid #dde5ea;
    border-radius: 11px;
    text-align: center;
}

.reports-hero-stats strong {
    display: block;
    font-size: 1.12rem;
}

.reports-hero-stats span {
    display: block;
    margin-top: 2px;
    font-size: .68rem;
    color: #6c7984;
}


/* CATEGORY NAV */

.reports-tabbar {
    position: sticky;
    top: 0;
    z-index: 15;

    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 8px;

    margin-bottom: 15px;
    padding: 6px;

    background: rgba(255, 255, 255, .96);
    border: 1px solid #dfe7eb;
    border-radius: 14px;

    box-shadow:
        0 4px 18px rgba(15, 31, 46, .05);
}

.reports-tab {
    border: 0;
    background: transparent;

    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    min-height: 54px;

    padding: 8px 11px;

    border-radius: 10px;
    cursor: pointer;

    text-align: left;
    color: #34424d;
}

.reports-tab:hover {
    background: #f2f6f7;
}

.reports-tab.active {
    background: #eef8f6;
    color: #08766d;
    box-shadow:
        inset 0 0 0 1px #bcded9;
}

.reports-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    border-radius: 9px;

    background: #edf1f4;

    font-size: .72rem;
    font-weight: 800;
}

.reports-tab.active .reports-tab-icon {
    background: #0c8d81;
    color: #fff;
}

.reports-tab strong,
.reports-tab small {
    display: block;
}

.reports-tab strong {
    font-size: .84rem;
}

.reports-tab small {
    margin-top: 2px;
    color: #788590;
    font-size: .66rem;
}


/* WORKSPACES */

.reports-workspace {
    display: none;
}

.reports-workspace.active {
    display: block;
}

.reports-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    background: #fff;
    border: 1px solid #dde5ea;
    border-bottom: 0;

    border-radius: 13px 13px 0 0;

    padding: 15px 18px 10px;
}

.reports-section-heading h2 {
    margin: 3px 0 3px;
}

.reports-section-heading p {
    margin: 0;
    color: #687781;
}


/* QUICK REPORT PANEL */

.report-quick-panel {
    display: grid;

    grid-template-columns:
        minmax(280px, 1.7fr)
        minmax(220px, .9fr)
        auto;

    gap: 12px;

    align-items: end;

    padding: 14px 16px 16px;

    background: #fff;

    border-left: 1px solid #dde5ea;
    border-right: 1px solid #dde5ea;
    border-bottom: 1px solid #dde5ea;

    border-radius: 0 0 13px 13px;

    margin-bottom: 16px;
}

.report-quick-panel > .report-field-wide:first-child:last-of-type {
    grid-column: span 2;
}

.report-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-field label {
    font-size: .72rem;
    font-weight: 700;
    color: #53616d;
}

.report-modern-select,
.report-modern-input {
    width: 100%;
    min-height: 42px;

    padding: 8px 11px;

    border: 1px solid #cfd9df;
    border-radius: 9px;

    background: #fff;
    color: #182631;

    font: inherit;
}

.report-modern-select:focus,
.report-modern-input:focus {
    outline: none;
    border-color: #15998e;
    box-shadow:
        0 0 0 3px rgba(21, 153, 142, .11);
}

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

.report-modern-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

.disabled-report-action {
    pointer-events: none;
    cursor: not-allowed;
    opacity: .55;
    filter: grayscale(.35);
}


/* RECENT TABLE */

.reports-subheading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin: 0 2px 8px;
}

.reports-subheading h3 {
    margin: 0;
}

.reports-subheading span {
    font-size: .7rem;
    color: #778590;
}

.modern-report-table-wrap {
    overflow: hidden;
    background: #fff;
    border: 1px solid #dde5ea;
    border-radius: 14px;
}

.modern-report-table th {
    background: #f6f9fa;
}

.modern-report-table tbody tr:hover {
    background: #fafcfc;
}

.report-reference {
    font-size: .76rem;
    color: #53636f;
}

.report-status {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 60px;

    padding: 4px 7px;

    border-radius: 999px;

    background: #eef2f4;

    font-size: .65rem;
    font-weight: 800;
}

.report-status-draft {
    background: #fff5dc;
    color: #815d0c;
}

.report-status-submitted {
    background: #edf4ff;
    color: #245a9b;
}

.report-status-approved {
    background: #eaf8f0;
    color: #23724a;
}

.report-status-locked {
    background: #e9f7f5;
    color: #08766d;
}

.table-report-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.table-report-actions .btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
}

.report-action-column {
    text-align: right !important;
}

.report-empty-row {
    text-align: center !important;
    padding: 30px !important;
    color: #74818b;
}


/* INFORMATION CARD */

.reports-info-card {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 14px 16px;

    background: #f8fbfb;
    border: 1px solid #dce8e7;
    border-radius: 12px;
}

.reports-info-card p {
    margin: 3px 0 0;
    color: #667681;
}

.reports-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 52px;
    height: 42px;

    padding: 0 8px;

    border-radius: 10px;

    background: #e6f5f2;
    color: #08766d;

    font-size: .72rem;
    font-weight: 800;
}


/* RESPONSIVE */

@media (max-width: 1050px) {

    .reports-hero {
        align-items: flex-start;
    }

    .report-quick-panel {
        grid-template-columns:
            1fr 1fr;
    }

    .report-modern-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

}

@media (max-width: 760px) {

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

    .reports-hero-stats {
        width: 100%;
    }

    .reports-hero-stats > div {
        min-width: 0;
        flex: 1;
    }

    .reports-tabbar {
        display: flex;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .reports-tab {
        flex: 0 0 190px;
    }

    .report-quick-panel {
        grid-template-columns: 1fr;
    }

    .report-date-fields {
        grid-template-columns: 1fr 1fr;
    }

    .report-modern-actions {
        grid-column: auto;
        justify-content: stretch;
    }

    .report-modern-actions .btn {
        flex: 1 1 130px;
    }

    .table-report-actions {
        justify-content: flex-start;
    }

}

@media (max-width: 520px) {

    .reports-hero-stats {
        display: grid;
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .reports-hero-stats > div {
        padding: 8px 5px;
    }

    .report-date-fields {
        grid-template-columns: 1fr;
    }

    .reports-section-heading,
    .report-quick-panel {
        padding-left: 12px;
        padding-right: 12px;
    }

}


/* ==========================================================
   STAFF MASTER + ATTENDANCE
   ========================================================== */

.staff-master-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.staff-master-grid label,
.attendance-filter label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.staff-master-grid label > span,
.attendance-filter label > span {
    font-size: .7rem;
    font-weight: 700;
    color: #596874;
}

.staff-master-grid input,
.staff-master-grid select,
.staff-master-grid textarea,
.attendance-filter input,
.attendance-filter select,
.attendance-table input,
.attendance-table select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cfd9df;
    border-radius: 8px;
    padding: 7px 9px;
    background: #fff;
    font: inherit;
}

.staff-master-grid input:focus,
.staff-master-grid select:focus,
.staff-master-grid textarea:focus,
.attendance-table input:focus,
.attendance-table select:focus {
    outline: none;
    border-color: #15998e;
    box-shadow:
        0 0 0 3px rgba(21, 153, 142, .10);
}

.staff-field-wide {
    grid-column: span 2;
}

.attendance-filter {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.attendance-filter label {
    min-width: 190px;
}

.attendance-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.attendance-toolbar h2 {
    margin: 0;
}

.attendance-toolbar span {
    color: #74818b;
    font-size: .72rem;
}

.attendance-designation {
    display: block;
    margin-top: 2px;
    color: #75838d;
}

.attendance-table input[type="time"] {
    min-width: 105px;
}

.attendance-table select {
    min-width: 125px;
}


@media (max-width: 1050px) {
    .staff-master-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 620px) {
    .staff-master-grid {
        grid-template-columns: 1fr;
    }

    .staff-field-wide {
        grid-column: auto;
    }

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

    .attendance-filter label {
        min-width: 0;
    }
}

/* =========================================================
   CREDIT RECOVERY
   ========================================================= */

.credit-recovery-grid {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.credit-recovery-card {
    border: 1px solid var(--border, #dfe5ec);
    border-radius: 14px;
    padding: 18px;
    background: #fff;
}

.credit-recovery-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.credit-recovery-card-head strong {
    display: block;
    font-size: 16px;
}

.credit-recovery-card-head small {
    display: block;
    margin-top: 4px;
    opacity: .7;
}

.credit-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef3f8;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.credit-recovery-amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.credit-recovery-amounts > div {
    padding: 12px 14px;
    border-radius: 10px;
    background: #f7f9fb;
}

.credit-recovery-amounts span {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    opacity: .7;
}

.credit-recovery-amounts strong {
    display: block;
}

.credit-recovery-amounts .credit-outstanding {
    background: #fff7e8;
}

.credit-recovery-form {
    border-top: 1px solid var(--border, #e1e6eb);
    padding-top: 16px;
}

.credit-recovery-form-grid {
    display: grid;
    grid-template-columns:
        minmax(140px, .8fr)
        minmax(180px, 1fr)
        minmax(160px, 1fr)
        minmax(220px, 1.4fr);
    gap: 12px;
}

.credit-recovery-form-grid label > span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
}

.credit-recovery-form-grid input,
.credit-recovery-form-grid select {
    width: 100%;
}

.credit-recovery-history {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border, #e1e6eb);
}

.credit-recovery-history-title {
    margin-bottom: 12px;
}

.credit-recovery-history-title h3 {
    margin: 0;
    font-size: 15px;
}

@media (max-width: 900px) {
    .credit-recovery-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .credit-recovery-card-head {
        display: block;
    }

    .credit-status-badge {
        margin-top: 10px;
    }

    .credit-recovery-amounts,
    .credit-recovery-form-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   MODERN DCF RECORD CARDS
   ========================================================= */

.closing-entry-list {
    display: grid;
    gap: 12px;
}

/* Individual transaction/record card */
.closing-entry-item,
.closing-record,
.entry-record {
    position: relative;
    background: #ffffff;
    border: 1px solid #e7ebf2;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.03),
        0 5px 18px rgba(15, 23, 42, 0.035);
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.closing-entry-item:hover,
.closing-record:hover,
.entry-record:hover {
    border-color: #d5dce8;
    box-shadow:
        0 2px 5px rgba(15, 23, 42, 0.04),
        0 10px 25px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
}

/* Amount */
.closing-entry-amount {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.closing-entry-amount > strong {
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    white-space: nowrap;
}

/* Action area */
.entry-action-group {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: 4px;
}

.entry-action-group form {
    margin: 0;
}

/* Edit button */
.closing-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 9px;
    border: 1px solid #dbe5f0;
    background: #f7fafc;
    color: #2563eb !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}

.closing-edit-button:hover {
    background: #eef5ff;
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

/* Delete / Remove button */
.closing-remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 9px;
    border: 1px solid #fee2e2;
    background: #fff7f7;
    color: #dc2626;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}

.closing-remove-button:hover {
    background: #fef2f2;
    border-color: #fecaca;
    transform: translateY(-1px);
}

/* Record title */
.closing-entry-item h3,
.closing-entry-item h4,
.closing-record h3,
.closing-record h4,
.entry-record h3,
.entry-record h4 {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 750;
    color: #0f172a;
    letter-spacing: -0.015em;
}

/* Secondary text e.g. Cash / Bank */
.closing-entry-item p,
.closing-record p,
.entry-record p {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 13px;
}

/* Mobile */
@media (max-width: 700px) {
    .closing-entry-item,
    .closing-record,
    .entry-record {
        padding: 14px;
        border-radius: 14px;
    }

    .closing-entry-amount {
        width: 100%;
        justify-content: space-between;
        margin-top: 12px;
    }

    .closing-entry-amount > strong {
        font-size: 17px;
    }

    .entry-action-group {
        margin-left: auto;
    }

    .closing-edit-button,
    .closing-remove-button {
        min-height: 32px;
        padding: 6px 10px;
        font-size: 12px;
    }
}


/* =========================================================
   DCF UNIFIED FINANCIAL BLOCKS
   ========================================================= */

/* ----- Section totals ----- */

.closing-section-heading {
    align-items: flex-start;
    gap: 24px;
}

.section-total-box,
.cash-transfer-total {
    min-width: 190px;
    padding: 11px 15px;
    border: 1px solid #e4eaf2;
    border-radius: 13px;
    background: #f8fafc;
    text-align: right;
    flex-shrink: 0;
}

.section-total-box > span,
.cash-transfer-total > span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.section-total-box > strong,
.cash-transfer-total > strong {
    display: block;
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.section-total-split {
    min-width: 245px;
}

.section-total-split strong small {
    margin: 0 5px;
    color: #94a3b8;
    font-size: 12px;
}


/* ----- Standard record card ----- */

.closing-entry-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.closing-entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 14px 16px;

    border: 1px solid #e5eaf1;
    border-radius: 14px;

    background: #fff;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, .025),
        0 4px 12px rgba(15, 23, 42, .025);

    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        transform .16s ease;
}

.closing-entry-row:hover {
    border-color: #d7dee9;

    box-shadow:
        0 2px 4px rgba(15, 23, 42, .035),
        0 8px 20px rgba(15, 23, 42, .055);

    transform: translateY(-1px);
}

.closing-entry-row > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.closing-entry-row > div:first-child > strong {
    display: block;

    color: #0f172a;

    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;

    letter-spacing: -.01em;
}


/* ----- Method/type badge line ----- */

.closing-entry-row > div:first-child > small {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    width: fit-content;

    margin-top: 6px;
    padding: 4px 8px;

    border: 1px solid #e2e8f0;
    border-radius: 999px;

    background: #f8fafc;

    color: #64748b;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
}


/* ----- Amount + actions ----- */

.closing-entry-amount {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 8px;

    flex: 0 0 auto;
}

.closing-entry-amount > strong {
    min-width: 135px;

    color: #0f172a;

    font-size: 16px;
    font-weight: 850;
    line-height: 1.2;

    text-align: right;
    white-space: nowrap;
}

.entry-action-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-left: 4px;
}

.entry-action-group form {
    margin: 0;
}


/* ----- Credit-sale cards: match standard rows ----- */

.record-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.record-card {
    display: grid;
    grid-template-columns:
        minmax(180px, 1fr)
        auto
        auto
        auto;

    align-items: center;
    gap: 12px;

    padding: 14px 16px;

    border: 1px solid #e5eaf1;
    border-radius: 14px;

    background: #fff;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, .025),
        0 4px 12px rgba(15, 23, 42, .025);
}

.record-main > strong {
    display: block;

    color: #0f172a;

    font-size: 15px;
    font-weight: 800;
}

.record-main > small {
    display: block;

    width: fit-content;

    margin-top: 6px;
    padding: 4px 8px;

    border: 1px solid #e2e8f0;
    border-radius: 999px;

    background: #f8fafc;

    color: #64748b;

    font-size: 11px;
    font-weight: 700;
}

.record-amount {
    color: #0f172a;

    font-size: 16px;
    font-weight: 850;

    white-space: nowrap;
}

.record-status {
    padding: 4px 8px;

    border: 1px solid #dbe3ec;
    border-radius: 999px;

    background: #f8fafc;

    color: #475569;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
}


/* ----- Cash Transfer cards: same visual language ----- */

.cash-transfer-history {
    margin-top: 16px;
}

.cash-transfer-history > h4 {
    margin: 0 0 10px;

    color: #64748b;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.cash-transfer-row {
    padding: 14px 16px;
    margin-bottom: 10px;

    border: 1px solid #e5eaf1;
    border-radius: 14px;

    background: #fff;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, .025),
        0 4px 12px rgba(15, 23, 42, .025);
}

.cash-transfer-row-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cash-transfer-row-main strong {
    color: #0f172a;

    font-size: 15px;
    font-weight: 800;
}

.cash-transfer-row-main > span {
    color: #0f172a;

    font-size: 16px;
    font-weight: 850;

    white-space: nowrap;
}

.cash-transfer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin-top: 7px;
}

.cash-transfer-meta > span {
    padding: 4px 8px;

    border: 1px solid #e2e8f0;
    border-radius: 999px;

    background: #f8fafc;

    color: #64748b;

    font-size: 11px;
    font-weight: 650;
}


/* ----- Responsive ----- */

@media (max-width: 760px) {

    .closing-section-heading {
        flex-direction: column;
    }

    .section-total-box,
    .cash-transfer-total,
    .section-total-split {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .closing-entry-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .closing-entry-amount {
        width: 100%;
        justify-content: space-between;
    }

    .closing-entry-amount > strong {
        min-width: 0;
        text-align: left;
    }

    .record-card {
        grid-template-columns: 1fr;
    }

    .cash-transfer-row-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}


/* =========================================================
   CREDIT RECOVERY V2
   ========================================================= */

.recovery-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.recovery-summary-card {
    padding: 15px 16px;
    border: 1px solid #e4eaf2;
    border-radius: 14px;
    background: #f8fafc;
}

.recovery-summary-card.is-primary {
    background: #f0fdfa;
    border-color: #ccfbf1;
}

.recovery-summary-card > span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.recovery-summary-card > strong {
    display: block;
    margin-top: 7px;
    color: #0f172a;
    font-size: 20px;
    font-weight: 850;
    letter-spacing: -.02em;
}

.recovery-summary-card > small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
}

.recovery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0;
}

.recovery-search-wrap {
    flex: 1 1 280px;
}

.recovery-search-wrap input {
    width: 100%;
}

.recovery-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.recovery-filter {
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid #dce4ed;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.recovery-filter.is-active {
    background: #0f8f83;
    border-color: #0f8f83;
    color: #fff;
}

.recovery-account-list {
    display: grid;
    gap: 14px;
}

.recovery-account-card {
    padding: 18px;
    border: 1px solid #e3e9f1;
    border-radius: 16px;
    background: #fff;
    box-shadow:
        0 2px 5px rgba(15, 23, 42, .025),
        0 8px 24px rgba(15, 23, 42, .035);
}

.recovery-account-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.recovery-account-head strong {
    color: #0f172a;
    font-size: 17px;
    font-weight: 850;
}

.recovery-account-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
    color: #64748b;
    font-size: 12px;
}

.recovery-pill,
.recovery-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.recovery-pill {
    border: 1px solid #dbe5ec;
    background: #f8fafc;
    color: #475569;
}

.recovery-status-badge.is-open {
    background: #f1f5f9;
    color: #334155;
}

.recovery-status-badge.is-partial {
    background: #fff7ed;
    color: #c2410c;
}

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

.recovery-money-grid > div {
    padding: 13px 14px;
    border-radius: 12px;
    background: #f8fafc;
}

.recovery-money-grid > div.is-outstanding {
    background: #fff8e8;
}

.recovery-money-grid span {
    display: block;
    color: #64748b;
    font-size: 11px;
}

.recovery-money-grid strong {
    display: block;
    margin-top: 6px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 850;
}

.recovery-payment-form {
    margin-top: 17px;
    padding-top: 16px;
    border-top: 1px solid #edf1f5;
}

.recovery-payment-grid {
    display: grid;
    grid-template-columns:
        minmax(130px, .8fr)
        minmax(170px, 1fr)
        minmax(150px, 1fr)
        minmax(180px, 1.25fr);
    gap: 12px;
}

.recovery-payment-grid label > span {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-size: 11px;
    font-weight: 750;
}

.recovery-payment-grid input,
.recovery-payment-grid select {
    width: 100%;
}

.recovery-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.recovery-history {
    margin-top: 15px;
    border-top: 1px solid #edf1f5;
    padding-top: 12px;
}

.recovery-history summary {
    cursor: pointer;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.recovery-history summary span {
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #edf2f7;
}

.recovery-history-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.recovery-history-row,
.recovery-today-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #edf1f5;
    border-radius: 10px;
    background: #fbfcfe;
}

.recovery-history-row small,
.recovery-today-row small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
}

.recovery-today-panel {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e8edf3;
}

.recovery-today-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.recovery-today-title h3 {
    margin: 3px 0 0;
    color: #0f172a;
    font-size: 15px;
}

.recovery-today-title > strong {
    color: #0f172a;
    font-size: 18px;
    font-weight: 850;
}

.recovery-today-list {
    display: grid;
    gap: 8px;
}

.recovery-today-amount {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recovery-today-amount > strong {
    white-space: nowrap;
}

@media (max-width: 900px) {

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

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

}

@media (max-width: 650px) {

    .recovery-summary-grid,
    .recovery-money-grid,
    .recovery-payment-grid {
        grid-template-columns: 1fr;
    }

    .recovery-toolbar,
    .recovery-account-head,
    .recovery-today-title,
    .recovery-history-row,
    .recovery-today-row {
        align-items: stretch;
        flex-direction: column;
    }

    .recovery-actions {
        flex-direction: column;
    }

    .recovery-actions .btn {
        width: 100%;
    }

}

/* =========================================================
   CREDIT RECOVERY SELECTOR
   ========================================================= */

.recovery-selector-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    margin: 18px 0;
    padding: 15px 16px;

    border: 1px solid #dfe7ee;
    border-radius: 14px;

    background: #f8fafc;
}

.recovery-selector-bar > div {
    min-width: 0;
}

.recovery-selector-bar strong {
    display: block;

    color: #0f172a;

    font-size: 14px;
    font-weight: 800;
}

.recovery-selector-bar small {
    display: block;

    margin-top: 4px;

    color: #64748b;

    font-size: 12px;
}

.recovery-selector-panel {
    margin-top: 12px;
    padding: 16px;

    border: 1px solid #e3e9f1;
    border-radius: 16px;

    background: #fbfcfd;
}

.recovery-selector-panel[hidden] {
    display: none !important;
}

@media (max-width: 650px) {

    .recovery-selector-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .recovery-selector-bar .btn {
        width: 100%;
    }

}

/* =========================================================
   SAFE CREDIT ACCOUNT SELECTOR
   ========================================================= */

.recovery-selector-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin: 16px 0;
    padding: 15px 16px;

    border: 1px solid #e1e8ef;
    border-radius: 14px;

    background: #f8fafc;
}

.recovery-selector-bar strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.recovery-selector-bar small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

#credit-recovery-toolbar[hidden],
#recovery-account-list[hidden] {
    display: none !important;
}

@media (max-width: 650px) {
    .recovery-selector-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .recovery-selector-bar .btn {
        width: 100%;
    }
}


/* Credit Recovery: debtor records remain hidden
   until Select / Search Credit is opened. */

.recovery-account-list.recovery-selector-collapsed {
    display: none !important;
}


/* =========================================================
   CREDIT SEARCH - EXPLICIT SEARCH BUTTON
   ========================================================= */

.recovery-search-with-button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recovery-search-with-button input {
    flex: 1 1 auto;
    min-width: 0;
}

.recovery-search-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.credit-search-result-message {
    margin: 10px 0 14px;
    padding: 12px 14px;

    border: 1px solid #e3e9f1;
    border-radius: 11px;

    background: #f8fafc;

    color: #64748b;

    font-size: 13px;
    font-weight: 650;
}

@media (max-width: 650px) {

    .recovery-search-with-button {
        flex-direction: column;
        align-items: stretch;
    }

    .recovery-search-button {
        width: 100%;
    }
}


/* =========================================================
   CREDIT PICKER LIST
   ========================================================= */

.credit-picker-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.credit-picker-row {
    width: 100%;

    display: grid;
    grid-template-columns:
        minmax(220px, 1fr)
        auto
        auto
        22px;

    align-items: center;
    gap: 14px;

    padding: 13px 15px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #ffffff;

    text-align: left;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background .15s ease,
        box-shadow .15s ease;
}

.credit-picker-row:hover {
    border-color: #99d8cf;
    background: #f8fffd;

    box-shadow:
        0 4px 14px rgba(15, 143, 131, .08);
}

.credit-picker-main strong {
    display: block;

    color: #0f172a;

    font-size: 14px;
    font-weight: 800;
}

.credit-picker-main small {
    display: block;

    margin-top: 4px;

    color: #64748b;

    font-size: 11px;
}

.credit-picker-balance {
    min-width: 120px;

    text-align: right;
}

.credit-picker-balance span {
    display: block;

    color: #64748b;

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
}

.credit-picker-balance strong {
    display: block;

    margin-top: 3px;

    color: #0f172a;

    font-size: 14px;
    font-weight: 850;

    white-space: nowrap;
}

.credit-picker-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 54px;

    padding: 5px 8px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 800;
}

.credit-picker-status.is-open {
    background: #f1f5f9;
    color: #334155;
}

.credit-picker-status.is-partial {
    background: #fff7ed;
    color: #c2410c;
}

.credit-picker-arrow {
    color: #0f8f83;

    font-size: 24px;
    font-weight: 700;

    text-align: right;
}

@media (max-width: 700px) {

    .credit-picker-row {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .credit-picker-balance {
        text-align: right;
    }

    .credit-picker-status {
        justify-self: start;
    }

    .credit-picker-arrow {
        justify-self: end;
    }
}


/* =========================================================
   CREDIT RECOVERY MODAL
   ========================================================= */

.credit-recovery-modal {
    position: fixed;
    inset: 0;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
}

.credit-recovery-modal[hidden] {
    display: none !important;
}

.credit-recovery-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(15, 23, 42, .48);

    backdrop-filter: blur(2px);
}

.credit-recovery-modal-dialog {
    position: relative;

    width: min(860px, 100%);
    max-height: calc(100vh - 48px);

    display: flex;
    flex-direction: column;

    border: 1px solid #dfe6ed;
    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 24px 70px rgba(15, 23, 42, .25);

    overflow: hidden;
}

.credit-recovery-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 20px 22px;

    border-bottom: 1px solid #e8edf2;
}

.credit-recovery-modal-head h3 {
    margin: 3px 0 0;

    color: #0f172a;

    font-size: 20px;
    font-weight: 850;
}

.credit-recovery-modal-head p {
    margin: 6px 0 0;

    color: #64748b;

    font-size: 13px;
}

.credit-recovery-modal-close {
    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    border: 1px solid #dfe6ed;
    border-radius: 10px;

    background: #fff;

    color: #475569;

    font-size: 24px;
    line-height: 1;

    cursor: pointer;
}

.credit-recovery-modal-close:hover {
    background: #f8fafc;
}

.credit-recovery-modal-body {
    overflow-y: auto;

    padding: 18px 22px 22px;
}

.credit-modal-search-row {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 10px;
}

.credit-modal-search-row input {
    width: 100%;
}

#credit-modal-filters {
    margin-top: 12px;
}

#credit-modal-results {
    margin-top: 16px;
}

body.credit-modal-open {
    overflow: hidden;
}

@media (max-width: 650px) {

    .credit-recovery-modal {
        padding: 10px;
    }

    .credit-recovery-modal-dialog {
        max-height: calc(100vh - 20px);

        border-radius: 14px;
    }

    .credit-modal-search-row {
        grid-template-columns: 1fr;
    }

    .credit-recovery-modal-head {
        padding: 16px;
    }

    .credit-recovery-modal-body {
        padding: 14px 16px 18px;
    }

}

/* Main DCF must not show inline credit picker.
   Credit selection is handled only inside modal. */

#credit-picker-list {
    display: none !important;
}


/* =========================================================
   ADVANCED PERMISSION MANAGER
   ========================================================= */

.permission-manager {
    max-width: 1180px;
}

.permission-user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;

    margin-bottom: 16px;
    padding: 18px 20px;

    border: 1px solid #e2e8f0;
    border-radius: 15px;

    background: #fff;
}

.permission-user-card strong {
    display: block;
    font-size: 17px;
    color: #0f172a;
}

.permission-user-card span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.permission-role-badges {
    display: flex;
    gap: 6px;
}

.permission-role-badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: #e9f8f5;
    color: #087f73 !important;
    font-weight: 800;
}

.permission-help {
    margin-bottom: 18px;
    padding: 14px 16px;

    border: 1px solid #dce9e7;
    border-radius: 13px;

    background: #f5fbfa;
}

.permission-help p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 12px;
}

.permission-groups {
    display: grid;
    gap: 16px;
}

.permission-group {
    overflow: hidden;

    border: 1px solid #e2e8f0;
    border-radius: 16px;

    background: #fff;
}

.permission-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 15px 18px;

    border-bottom: 1px solid #edf1f5;
    background: #f8fafc;
}

.permission-group-head h2 {
    margin: 0;
    font-size: 15px;
    color: #0f172a;
}

.permission-group-head span {
    font-size: 11px;
    color: #64748b;
}

.permission-select-group {
    border: 0;
    background: transparent;
    color: #0f8f83;
    font-weight: 800;
    cursor: pointer;
}

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

    gap: 1px;

    background: #edf1f5;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;

    padding: 14px 16px;

    background: #fff;
    cursor: pointer;
}

.permission-item:hover {
    background: #fbfefd;
}

.permission-item input {
    margin-top: 3px;
}

.permission-item-content strong {
    display: block;
    color: #172033;
    font-size: 13px;
}

.permission-item-content small {
    display: block;
    margin-top: 2px;
    color: #8793a5;
    font-size: 10px;
}

.permission-inherited {
    display: inline-flex !important;

    margin-top: 6px !important;
    padding: 3px 7px;

    border-radius: 999px;

    background: #eef3f8;
    color: #64748b !important;

    font-size: 9px !important;
    font-weight: 800;
}

.permission-save-bar {
    position: sticky;
    bottom: 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-top: 18px;
    padding: 14px 16px;

    border: 1px solid #dfe7ee;
    border-radius: 14px;

    background: rgba(255,255,255,.96);

    box-shadow:
        0 10px 35px rgba(15,23,42,.10);

    backdrop-filter: blur(8px);
}

.permission-save-bar strong,
.permission-save-bar span {
    display: block;
}

.permission-save-bar span {
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
}

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

    .permission-user-card,
    .permission-save-bar {
        align-items: stretch;
        flex-direction: column;
    }
}

/* =========================================================
   EMAIL ALERT ADMINISTRATION
   ========================================================= */

.email-alert-admin {
    max-width: 1180px;
}

.email-status-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

    margin-bottom: 18px;
}

.email-status-card {
    padding: 16px;

    border: 1px solid #e2e8f0;
    border-radius: 14px;

    background: #fff;
}

.email-status-card > span {
    display: block;

    color: #64748b;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .06em;
    text-transform: uppercase;
}

.email-status-card > strong {
    display: block;

    margin-top: 7px;

    color: #0f172a;

    font-size: 18px;
    font-weight: 850;
}

.email-status-card > strong.email-status-small {
    font-size: 13px;

    overflow-wrap: anywhere;
}

.email-status-card > small {
    display: block;

    margin-top: 4px;

    color: #64748b;

    font-size: 11px;
}

.email-warning {
    margin-bottom: 18px;
    padding: 14px 16px;

    border: 1px solid #f5d99c;
    border-radius: 13px;

    background: #fff9e8;
}

.email-warning strong {
    color: #8a5a00;
}

.email-warning p {
    margin: 5px 0 0;

    color: #745d2c;

    font-size: 12px;
}

.email-admin-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(300px, .8fr);

    gap: 16px;
}

.email-admin-card {
    padding: 18px;

    border: 1px solid #e2e8f0;
    border-radius: 16px;

    background: #fff;
}

.email-admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 14px;
}

.email-admin-head h2 {
    margin: 3px 0 0;

    color: #0f172a;

    font-size: 17px;
}

.email-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 34px;
    height: 34px;

    border-radius: 999px;

    background: #eaf8f6;

    color: #087f73;

    font-weight: 850;
}

.email-recipient-list {
    display: grid;
    gap: 8px;
}

.email-recipient-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    padding: 11px 12px;

    border: 1px solid #edf1f5;
    border-radius: 11px;

    background: #fafcfd;
}

.email-recipient-row strong {
    display: block;

    color: #0f172a;

    font-size: 13px;
}

.email-recipient-row small {
    display: block;

    margin-top: 3px;

    color: #64748b;

    font-size: 11px;
}

.email-role-badge {
    display: inline-flex;

    padding: 4px 7px;

    border-radius: 999px;

    background: #eef4f8;

    color: #475569;

    font-size: 9px;
    font-weight: 800;
}

.email-admin-note {
    margin-top: 15px;
    padding-top: 12px;

    border-top: 1px solid #edf1f5;

    color: #64748b;

    font-size: 11px;
}

.email-test-field > span {
    display: block;

    margin-bottom: 6px;

    color: #334155;

    font-size: 12px;
    font-weight: 750;
}

.email-test-field input {
    width: 100%;
}

.email-test-actions {
    display: flex;
    justify-content: flex-end;

    margin-top: 12px;
}

@media (max-width: 900px) {

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

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

@media (max-width: 600px) {

    .email-status-grid {
        grid-template-columns: 1fr;
    }

    .email-recipient-row {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================================================
   EMAIL ALERT ADMINISTRATION — UI REFRESH V2
   ========================================================= */

.email-alert-admin {
    width: 100%;
    max-width: 1280px;
    min-width: 0;
}

.email-alert-admin * {
    box-sizing: border-box;
}

.email-alert-admin .page-heading {
    margin-bottom: 20px;
}

.email-alert-admin .page-heading h1 {
    margin-bottom: 5px;
}

.email-alert-admin .page-heading p {
    max-width: 680px;
    margin-top: 0;
}


/* ---------- System status ---------- */

.email-status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.email-status-card {
    position: relative;
    min-width: 0;
    min-height: 118px;
    padding: 17px 18px;

    overflow: hidden;

    border-radius: 16px;
    border: 1px solid #dfe7ee;

    background: #fff;
}

.email-status-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 3px;

    background: #0f8f83;
}

.email-status-card > span {
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
}

.email-status-card > strong {
    margin-top: 11px;

    font-size: 20px;
    line-height: 1.2;
}

.email-status-card > strong.email-status-small {
    font-size: 14px;
    line-height: 1.35;
}

.email-status-card > small {
    margin-top: 7px;

    font-size: 11px;
    line-height: 1.4;
}


/* ---------- Main two-column area ---------- */

.email-admin-grid {
    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(360px, .85fr);

    gap: 18px;

    align-items: start;
}

.email-admin-card {
    min-width: 0;

    padding: 20px;

    border-radius: 17px;
    border: 1px solid #dfe7ee;

    background: #fff;
}

.email-admin-head {
    margin-bottom: 17px;
}

.email-admin-head h2 {
    margin-top: 4px;

    font-size: 19px;
    line-height: 1.25;
}

.email-count {
    flex: 0 0 auto;

    min-width: 38px;
    height: 38px;

    font-size: 14px;
}


/* ---------- Recipient list ---------- */

.email-recipient-list {
    gap: 10px;
}

.email-recipient-row {
    min-width: 0;

    padding: 13px 14px;

    border-color: #e5ebf0;
    border-radius: 12px;

    background: #f9fbfc;
}

.email-recipient-row > div:first-child {
    min-width: 0;
}

.email-recipient-row strong {
    font-size: 14px;
}

.email-recipient-row small {
    overflow-wrap: anywhere;

    font-size: 12px;
}

.email-role-badge {
    padding: 5px 9px;

    font-size: 10px;
}

.email-admin-note {
    margin-top: 17px;
    padding: 13px 14px;

    border: 0;
    border-radius: 10px;

    background: #f6f9fb;

    font-size: 11px;
    line-height: 1.5;
}

.email-admin-note strong {
    color: #334155;
}


/* ---------- Test email ---------- */

.email-admin-card form {
    min-width: 0;
}

.email-test-field {
    display: block;

    min-width: 0;

    margin-bottom: 15px;
}

.email-test-field > span {
    margin-bottom: 7px;

    font-size: 12px;
    font-weight: 800;
}

.email-test-field input,
.email-test-field select {
    display: block;

    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 44px;

    padding: 0 12px;

    border: 1px solid #cbd5e1;
    border-radius: 10px;

    background: #fff;

    color: #0f172a;

    font: inherit;
    font-size: 13px;

    outline: none;
}

.email-test-field select {
    cursor: pointer;
}

.email-test-field input:focus,
.email-test-field select:focus {
    border-color: #0f8f83;

    box-shadow:
        0 0 0 3px rgba(15, 143, 131, .10);
}

.email-test-help {
    display: block;

    margin-top: -7px;
    margin-bottom: 15px;

    color: #64748b;

    font-size: 11px;
    line-height: 1.45;
}

.email-test-help strong {
    color: #334155;
}

.email-test-actions {
    margin-top: 18px;
}

.email-test-actions button,
.email-test-actions .btn {
    width: 100%;
    min-height: 44px;

    justify-content: center;

    border-radius: 10px;
}


/* ---------- Prevent page overflow ---------- */

.email-alert-admin,
.email-status-grid,
.email-admin-grid,
.email-admin-card,
.email-test-field {
    min-width: 0;
}

.email-alert-admin select,
.email-alert-admin input {
    max-width: 100%;
}


/* ---------- Tablet ---------- */

@media (max-width: 1050px) {

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

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


/* ---------- Mobile ---------- */

@media (max-width: 600px) {

    .email-alert-admin {
        width: 100%;
    }

    .email-status-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .email-status-card {
        min-height: 0;
    }

    .email-admin-card {
        padding: 16px;
    }

    .email-recipient-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .email-test-field input,
    .email-test-field select {
        font-size: 16px;
    }
}


/* =========================================================
   SMTP GUI SETTINGS V1
   ========================================================= */

.smtp-settings-card {
    margin-bottom: 18px;
}

.smtp-settings-subtitle {
    margin: 5px 0 0;

    color: #64748b;

    font-size: 12px;
}

.smtp-security-badge {
    display: inline-flex;
    align-items: center;

    padding: 6px 10px;

    border-radius: 999px;

    background: #eaf8f6;

    color: #087f73;

    font-size: 10px;
    font-weight: 850;
}

.smtp-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
    padding: 13px 15px;

    border: 1px solid #dfe7ee;
    border-radius: 12px;

    background: #f8fbfc;
}

.smtp-toggle-row span {
    min-width: 0;
}

.smtp-toggle-row strong {
    display: block;

    color: #0f172a;

    font-size: 13px;
}

.smtp-toggle-row small {
    display: block;

    margin-top: 3px;

    color: #64748b;

    font-size: 11px;
}

.smtp-toggle-row input[type="checkbox"] {
    width: 20px;
    height: 20px;

    flex: 0 0 auto;

    accent-color: #0f8f83;
}

.smtp-form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0 16px;
}

.smtp-field-help {
    display: block;

    margin-top: 5px;

    color: #64748b;

    font-size: 10px;
}

.smtp-settings-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    margin-top: 4px;
    padding-top: 16px;

    border-top: 1px solid #edf1f5;

    color: #64748b;

    font-size: 11px;
}

@media (max-width: 700px) {

    .smtp-form-grid {
        grid-template-columns: 1fr;
    }

    .smtp-settings-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .smtp-settings-footer .btn {
        width: 100%;
    }
}


/* =========================================================
   ADMINISTRATION CONTROL CENTER V1
   ========================================================= */

.administration-hub {
    max-width: 1320px;
}

.admin-hub-heading {
    margin-bottom: 20px;
}

.admin-hub-summary {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 28px;
}

.admin-summary-card {
    min-width: 0;

    padding: 17px 18px;

    border: 1px solid #e2e8f0;
    border-radius: 14px;

    background: #ffffff;
}

.admin-summary-card span {
    display: block;

    margin-bottom: 5px;

    color: #64748b;

    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.admin-summary-card strong {
    display: block;

    overflow: hidden;

    color: #0f172a;

    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;

    text-overflow: ellipsis;
}

.admin-summary-card small {
    display: block;

    margin-top: 4px;

    color: #94a3b8;

    font-size: 11px;
}


.admin-section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    margin: 24px 0 11px;
}

.admin-section-title h2 {
    margin: 2px 0 0;

    color: #0f172a;

    font-size: 16px;
}


.admin-module-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}


.admin-module-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 178px;

    padding: 18px;

    border: 1px solid #e2e8f0;
    border-radius: 14px;

    background: #ffffff;

    color: inherit;
    text-decoration: none;

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        border-color .15s ease;
}

.admin-module-card:hover {
    transform: translateY(-2px);

    border-color: #b9d9d5;

    box-shadow:
        0 8px 24px rgba(15, 23, 42, .07);
}


.admin-module-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    margin-bottom: 13px;

    border-radius: 10px;

    background: #eef8f7;

    font-size: 18px;
}


.admin-module-body {
    flex: 1;
}

.admin-module-body h3 {
    margin: 0 0 6px;

    color: #0f172a;

    font-size: 14px;
    font-weight: 800;
}

.admin-module-body p {
    margin: 0;

    color: #64748b;

    font-size: 11px;
    line-height: 1.55;
}


.admin-module-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-top: 16px;
    padding-top: 11px;

    border-top: 1px solid #f1f5f9;

    color: #64748b;

    font-size: 10px;
    font-weight: 700;
}

.admin-module-meta span {
    color: #0f8f83;

    font-size: 18px;
    line-height: 1;
}


@media (max-width: 1000px) {

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

}


@media (max-width: 700px) {

    .admin-hub-summary,
    .admin-module-grid {
        grid-template-columns: 1fr;
    }

    .admin-module-card {
        min-height: auto;
    }

}


/* =========================================================
   ADVANCED PERMISSION HUB V2
   ========================================================= */

.permission-hub-stats {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.permission-user-search {
    width: min(320px, 100%);
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid #dbe4ea;
    border-radius: 10px;
    background: #fff;
    font: inherit;
}

.permission-user-list {
    display: flex;
    flex-direction: column;
}

.permission-user-row {
    display: grid;
    grid-template-columns:
        44px
        minmax(180px, 1.5fr)
        minmax(160px, 1fr)
        100px
        24px;

    align-items: center;
    gap: 13px;

    padding: 13px 5px;

    border-bottom: 1px solid #edf2f7;

    color: inherit;
    text-decoration: none;
}

.permission-user-row:last-child {
    border-bottom: 0;
}

.permission-user-row:hover {
    background: #f8fbfc;
}

.permission-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: #e9f7f5;
    color: #087f73;

    font-weight: 850;
}

.permission-user-info {
    min-width: 0;
}

.permission-user-info strong,
.permission-user-info span {
    display: block;
}

.permission-user-info strong {
    color: #0f172a;
    font-size: 13px;
}

.permission-user-info span {
    margin-top: 2px;

    overflow: hidden;

    color: #64748b;

    font-size: 11px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.permission-user-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.permission-user-rights {
    text-align: right;
}

.permission-user-rights strong,
.permission-user-rights small {
    display: block;
}

.permission-user-rights strong {
    color: #0f172a;
    font-size: 15px;
}

.permission-user-rights small {
    color: #94a3b8;
    font-size: 9px;
}

.permission-user-arrow {
    color: #0f8f83;
    font-size: 20px;
}

@media (max-width: 800px) {

    .permission-user-row {
        grid-template-columns:
            40px minmax(0, 1fr) 22px;
    }

    .permission-user-roles,
    .permission-user-rights {
        display: none;
    }

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


/* =========================================================
   EMAIL RECIPIENT MANAGER V2
   ========================================================= */

.email-recipient-manager {
    margin-bottom: 18px;
}

.email-recipient-count {
    min-width: 82px;
    padding: 9px 13px;

    border: 1px solid #dce9e7;
    border-radius: 11px;

    background: #f4fbfa;

    text-align: center;
}

.email-recipient-count strong,
.email-recipient-count span {
    display: block;
}

.email-recipient-count strong {
    color: #087f73;
    font-size: 20px;
}

.email-recipient-count span {
    margin-top: 1px;
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}


.email-recipient-add-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;

    margin-top: 17px;
}


.email-recipient-add-card {
    min-width: 0;

    padding: 16px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #f8fafc;
}


.email-recipient-add-title {
    margin-bottom: 13px;
}

.email-recipient-add-title strong,
.email-recipient-add-title span {
    display: block;
}

.email-recipient-add-title strong {
    color: #0f172a;
    font-size: 13px;
}

.email-recipient-add-title span {
    margin-top: 3px;

    color: #64748b;

    font-size: 10px;
    line-height: 1.45;
}


.email-recipient-add-form {
    display: grid;
    gap: 7px;
}

.email-recipient-add-form label {
    margin-top: 3px;

    color: #475569;

    font-size: 10px;
    font-weight: 800;
}

.email-recipient-add-form input,
.email-recipient-add-form select {
    box-sizing: border-box;

    width: 100%;
    min-width: 0;
    min-height: 42px;

    padding: 0 11px;

    border: 1px solid #d7e0e7;
    border-radius: 9px;

    background: #fff;

    font: inherit;
}

.email-recipient-add-form button {
    margin-top: 5px;
}


.email-recipient-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-top: 20px;
    padding-bottom: 10px;

    border-bottom: 1px solid #e8edf2;
}

.email-recipient-list-head strong {
    color: #0f172a;
    font-size: 12px;
}

.email-recipient-list-head span {
    margin-left: 5px;
    color: #94a3b8;
    font-size: 10px;
}

.email-recipient-list-head input {
    box-sizing: border-box;

    width: min(270px, 100%);
    min-height: 38px;

    padding: 0 11px;

    border: 1px solid #d7e0e7;
    border-radius: 9px;

    font: inherit;
}


.email-recipient-row {
    display: grid;

    grid-template-columns:
        40px
        minmax(180px, 1.5fr)
        minmax(110px, .7fr)
        80px
        auto;

    align-items: center;

    gap: 12px;

    padding: 12px 3px;

    border-bottom: 1px solid #edf2f7;
}

.email-recipient-row.is-disabled {
    opacity: .62;
}

.email-recipient-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    border-radius: 50%;

    background: #e8f7f5;
    color: #087f73;

    font-size: 12px;
    font-weight: 850;
}


.email-recipient-identity {
    min-width: 0;
}

.email-recipient-identity strong,
.email-recipient-identity span {
    display: block;
}

.email-recipient-identity strong {
    color: #0f172a;
    font-size: 12px;
}

.email-recipient-identity span {
    overflow: hidden;

    margin-top: 2px;

    color: #64748b;

    font-size: 10px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.recipient-status-on,
.recipient-status-off {
    display: inline-flex;

    padding: 4px 7px;

    border-radius: 999px;

    font-size: 9px;
    font-weight: 850;
}

.recipient-status-on {
    background: #e9f8f2;
    color: #087f5b;
}

.recipient-status-off {
    background: #f1f5f9;
    color: #64748b;
}


.email-recipient-actions {
    display: flex;
    justify-content: flex-end;

    gap: 6px;
}

.email-recipient-actions form {
    margin: 0;
}


.email-recipient-empty {
    padding: 28px 15px;

    text-align: center;
}

.email-recipient-empty strong {
    color: #334155;
}

.email-recipient-empty p {
    margin: 4px 0 0;

    color: #94a3b8;

    font-size: 10px;
}


@media (max-width: 900px) {

    .email-recipient-add-grid {
        grid-template-columns: 1fr;
    }

    .email-recipient-row {
        grid-template-columns:
            38px minmax(0, 1fr) auto;
    }

    .email-recipient-type,
    .email-recipient-status {
        display: none;
    }

}


@media (max-width: 600px) {

    .email-recipient-list-head {
        align-items: stretch;
        flex-direction: column;
    }

    .email-recipient-list-head input {
        width: 100%;
    }

    .email-recipient-row {
        align-items: start;

        grid-template-columns:
            36px minmax(0, 1fr);
    }

    .email-recipient-actions {
        grid-column: 1 / -1;

        justify-content: flex-end;

        padding-left: 48px;
    }

}


/* =========================================================
   ADMINISTRATION UI V3
   Unified administration workspace
   ========================================================= */

.admin-ui-v3 {
    box-sizing: border-box;
    width: 100%;
    max-width: 1380px !important;
    margin-right: auto;
    margin-left: auto;
    padding-right: 26px;
    padding-left: 26px;
}


/* ---------------------------------------------------------
   PAGE HEADING
   --------------------------------------------------------- */

.admin-ui-v3 .page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 24px;
    padding-bottom: 18px;

    border-bottom: 1px solid #e8edf2;
}

.admin-ui-v3 .page-heading h1 {
    margin-top: 3px;
    margin-bottom: 5px;

    color: #0f172a;

    font-size: 25px;
    font-weight: 800;
    line-height: 1.2;
}

.admin-ui-v3 .page-heading p {
    max-width: 760px;
    margin: 0;

    color: #64748b;

    font-size: 12px;
    line-height: 1.55;
}


/* ---------------------------------------------------------
   SECTION KICKERS
   --------------------------------------------------------- */

.admin-ui-v3 .section-kicker {
    color: #0f8f83;

    font-size: 9px;
    font-weight: 850;

    letter-spacing: .11em;
    text-transform: uppercase;
}


/* ---------------------------------------------------------
   GENERAL ADMIN CARDS
   --------------------------------------------------------- */

.admin-ui-v3 .email-admin-card,
.admin-ui-v3 .admin-module-card,
.admin-ui-v3 .permission-user-card,
.admin-ui-v3 .permission-help {
    box-sizing: border-box;

    border: 1px solid #e1e8ee;
    border-radius: 14px;

    background: #ffffff;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, .025);
}


/* ---------------------------------------------------------
   EMAIL ALERT PAGE — MAIN WIDTH FIX
   --------------------------------------------------------- */

.admin-ui-v3.email-alert-admin {
    max-width: 1380px !important;
}

.admin-ui-v3 .email-admin-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;

    width: 100%;
}

.admin-ui-v3 .email-admin-card {
    min-width: 0;

    padding: 20px;
}

.admin-ui-v3 .email-admin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;

    margin-bottom: 16px;
}

.admin-ui-v3 .email-admin-head h2 {
    margin: 2px 0 3px;

    color: #0f172a;

    font-size: 16px;
    font-weight: 800;
}

.admin-ui-v3 .email-admin-head p {
    max-width: 620px;
    margin: 4px 0 0;

    color: #64748b;

    font-size: 11px;
    line-height: 1.5;
}


/* ---------------------------------------------------------
   EMAIL STATUS CARDS
   --------------------------------------------------------- */

.admin-ui-v3 .email-status-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

    margin-bottom: 18px;
}

.admin-ui-v3 .email-status-card {
    box-sizing: border-box;
    min-width: 0;

    padding: 15px 16px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #ffffff;
}

.admin-ui-v3 .email-status-card span {
    display: block;

    color: #64748b;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: .04em;
    text-transform: uppercase;
}

.admin-ui-v3 .email-status-card strong {
    display: block;

    overflow: hidden;

    margin-top: 5px;

    color: #0f172a;

    font-size: 14px;

    text-overflow: ellipsis;
}

.admin-ui-v3 .email-status-card small {
    display: block;

    margin-top: 3px;

    color: #94a3b8;

    font-size: 9px;
}


/* ---------------------------------------------------------
   SMTP FORM
   --------------------------------------------------------- */

.admin-ui-v3 .smtp-settings-card {
    width: 100%;
}

.admin-ui-v3 .smtp-form-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px 16px;
}

.admin-ui-v3 .email-test-field,
.admin-ui-v3 .smtp-form-grid label {
    min-width: 0;
}

.admin-ui-v3 input,
.admin-ui-v3 select,
.admin-ui-v3 textarea {
    box-sizing: border-box;

    max-width: 100%;
}

.admin-ui-v3 .smtp-form-grid input,
.admin-ui-v3 .smtp-form-grid select,
.admin-ui-v3 .email-test-field input,
.admin-ui-v3 .email-test-field select {
    width: 100%;
    min-width: 0;
    min-height: 43px;

    padding-right: 11px;
    padding-left: 11px;

    border: 1px solid #d8e1e8;
    border-radius: 9px;

    background: #ffffff;
}


/* ---------------------------------------------------------
   RECIPIENT MANAGER
   --------------------------------------------------------- */

.admin-ui-v3 .email-recipient-manager {
    grid-column: 1 / -1;

    width: 100%;
}

.admin-ui-v3 .email-recipient-add-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 16px;
}

.admin-ui-v3 .email-recipient-add-card {
    box-sizing: border-box;

    min-width: 0;

    padding: 17px;

    border: 1px solid #e3e9ef;
    border-radius: 12px;

    background: #f8fafc;
}

.admin-ui-v3 .email-recipient-add-form select,
.admin-ui-v3 .email-recipient-add-form input {
    width: 100%;
    min-height: 43px;
}

.admin-ui-v3 .email-recipient-add-form .btn {
    min-height: 42px;
}


/* ---------------------------------------------------------
   RECIPIENT TABLE / ROW
   Fix overflowing Disable / Remove buttons
   --------------------------------------------------------- */

.admin-ui-v3 .email-recipient-list-head {
    gap: 18px;

    margin-top: 21px;
    padding: 12px 0;
}

.admin-ui-v3 .email-recipient-list-head input {
    width: 300px;
    max-width: 100%;
}

.admin-ui-v3 .email-recipient-list {
    width: 100%;
}

.admin-ui-v3 .email-recipient-row {
    box-sizing: border-box;

    display: grid;

    grid-template-columns:
        42px
        minmax(220px, 1.6fr)
        minmax(125px, .65fr)
        90px
        minmax(175px, auto);

    align-items: center;

    gap: 12px;

    width: 100%;
    min-width: 0;

    padding: 12px 6px;

    border-bottom: 1px solid #edf1f5;
}

.admin-ui-v3 .email-recipient-identity {
    min-width: 0;
}

.admin-ui-v3 .email-recipient-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 6px;

    min-width: 0;
}

.admin-ui-v3 .email-recipient-actions .btn {
    min-width: 76px;
    min-height: 36px;

    padding: 7px 10px;

    white-space: nowrap;
}


/* ---------------------------------------------------------
   ADMINISTRATION HUB
   --------------------------------------------------------- */

.admin-ui-v3.administration-hub {
    max-width: 1380px !important;
}

.admin-ui-v3 .admin-hub-summary {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 15px;
}

.admin-ui-v3 .admin-module-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 15px;
}

.admin-ui-v3 .admin-module-card {
    min-height: 168px;

    padding: 19px;
}


/* ---------------------------------------------------------
   ADVANCED PERMISSIONS
   --------------------------------------------------------- */

.admin-ui-v3.advanced-permission-hub,
.admin-ui-v3.permission-manager {
    max-width: 1380px !important;
}

.admin-ui-v3 .permission-user-search {
    width: 340px;
    max-width: 100%;
}

.admin-ui-v3 .permission-user-row {
    grid-template-columns:
        46px
        minmax(200px, 1.5fr)
        minmax(170px, 1fr)
        120px
        25px;

    min-height: 58px;

    padding: 12px 8px;
}

.admin-ui-v3 .permission-groups {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 16px;
}

.admin-ui-v3 .permission-group {
    min-width: 0;

    padding: 16px;

    border: 1px solid #e3e9ef;
    border-radius: 12px;

    background: #ffffff;
}

.admin-ui-v3 .permission-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;
}


/* ---------------------------------------------------------
   USER MANAGEMENT / FORMS
   --------------------------------------------------------- */

.admin-ui-v3 table {
    width: 100%;

    border-collapse: separate;
    border-spacing: 0;
}

.admin-ui-v3 th {
    padding: 10px 12px;

    border-bottom: 1px solid #dfe7ed;

    color: #64748b;

    font-size: 9px;
    font-weight: 850;

    text-align: left;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.admin-ui-v3 td {
    padding: 11px 12px;

    border-bottom: 1px solid #edf2f6;

    color: #334155;

    font-size: 11px;
}

.admin-ui-v3 tbody tr:hover {
    background: #f8fbfc;
}


/* ---------------------------------------------------------
   BUTTON CONSISTENCY
   --------------------------------------------------------- */

.admin-ui-v3 .btn {
    box-sizing: border-box;

    border-radius: 9px;

    font-weight: 750;
}

.admin-ui-v3 .btn-primary {
    box-shadow:
        0 3px 8px rgba(15, 143, 131, .12);
}


/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 1150px) {

    .admin-ui-v3 .email-status-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .admin-ui-v3 .smtp-form-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .admin-ui-v3 .admin-module-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .admin-ui-v3 .email-recipient-row {
        grid-template-columns:
            42px
            minmax(180px, 1fr)
            120px
            minmax(165px, auto);
    }

    .admin-ui-v3 .email-recipient-status {
        display: none;
    }

}


@media (max-width: 820px) {

    .admin-ui-v3 {
        padding-right: 16px;
        padding-left: 16px;
    }

    .admin-ui-v3 .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-ui-v3 .email-admin-grid,
    .admin-ui-v3 .email-recipient-add-grid,
    .admin-ui-v3 .permission-groups {
        grid-template-columns: 1fr;
    }

    .admin-ui-v3 .email-status-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .admin-ui-v3 .smtp-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-ui-v3 .email-recipient-row {
        grid-template-columns:
            40px minmax(0, 1fr) auto;
    }

    .admin-ui-v3 .email-recipient-type,
    .admin-ui-v3 .email-recipient-status {
        display: none;
    }

    .admin-ui-v3 .permission-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 560px) {

    .admin-ui-v3 {
        padding-right: 11px;
        padding-left: 11px;
    }

    .admin-ui-v3 .email-status-grid,
    .admin-ui-v3 .admin-hub-summary,
    .admin-ui-v3 .admin-module-grid {
        grid-template-columns: 1fr;
    }

    .admin-ui-v3 .email-recipient-row {
        grid-template-columns:
            36px minmax(0, 1fr);

        gap: 9px;
    }

    .admin-ui-v3 .email-recipient-actions {
        grid-column: 1 / -1;

        justify-content: flex-start;

        padding-left: 45px;
    }

    .admin-ui-v3 .email-recipient-list-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-ui-v3 .email-recipient-list-head input {
        width: 100%;
    }

}


/* =========================================================
   ADMINISTRATION QUICK NAV + RESPONSIVE V4
   ========================================================= */


/* ---------------------------------------------------------
   GLOBAL ADMIN WORKSPACE WIDTH
   --------------------------------------------------------- */

.admin-ui-v3,
.admin-ui-v3.email-alert-admin,
.admin-ui-v3.administration-hub,
.admin-ui-v3.advanced-permission-hub,
.admin-ui-v3.permission-manager {
    box-sizing: border-box;

    width: 100% !important;
    max-width: 100% !important;

    margin: 0 !important;

    padding-right: 28px;
    padding-left: 28px;
}


/* ---------------------------------------------------------
   QUICK NAV
   --------------------------------------------------------- */

.admin-quick-nav {
    box-sizing: border-box;

    width: 100%;

    margin-bottom: 20px;

    border: 1px solid #e1e8ee;
    border-radius: 13px;

    background: #ffffff;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, .025);
}

.admin-quick-nav-scroll {
    display: flex;
    align-items: center;

    gap: 5px;

    width: 100%;

    padding: 7px;

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: thin;

    -webkit-overflow-scrolling: touch;
}

.admin-quick-nav-scroll::-webkit-scrollbar {
    height: 4px;
}

.admin-quick-link {
    display: inline-flex;
    align-items: center;

    flex: 0 0 auto;

    gap: 7px;

    min-height: 39px;

    padding: 0 12px;

    border: 1px solid transparent;
    border-radius: 9px;

    color: #475569;

    font-size: 11px;
    font-weight: 750;

    text-decoration: none;

    white-space: nowrap;

    transition:
        background .15s ease,
        color .15s ease,
        border-color .15s ease;
}

.admin-quick-link:hover {
    border-color: #d5e5e3;

    background: #f2faf9;

    color: #087f73;
}

.admin-quick-link.active {
    border-color: #c7e7e3;

    background: #eaf8f6;

    color: #087f73;
}

.admin-quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 17px;

    font-size: 13px;
}


/* ---------------------------------------------------------
   ADMIN PAGE HEADING
   --------------------------------------------------------- */

.admin-ui-v3 .page-heading {
    width: 100%;
}


/* ---------------------------------------------------------
   EMAIL ALERT LAYOUT — DESKTOP
   --------------------------------------------------------- */

.admin-ui-v3.email-alert-admin {
    width: 100% !important;
}

.admin-ui-v3 .email-status-grid {
    width: 100%;
}

.admin-ui-v3 .email-admin-grid {
    width: 100%;

    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(0, .85fr);
}

.admin-ui-v3 .smtp-settings-card,
.admin-ui-v3 .email-recipient-manager {
    width: 100%;
    min-width: 0;
}

.admin-ui-v3 .email-recipient-manager {
    grid-column: 1 / -1;
}


/* ---------------------------------------------------------
   RECIPIENT ROW — KEEP EVERYTHING INSIDE
   --------------------------------------------------------- */

.admin-ui-v3 .email-recipient-row {
    grid-template-columns:
        42px
        minmax(210px, 1fr)
        minmax(120px, auto)
        88px
        minmax(170px, auto);

    width: 100%;

    overflow: hidden;
}

.admin-ui-v3 .email-recipient-actions {
    justify-self: end;
}


/* ---------------------------------------------------------
   FORM RESPONSIVENESS
   --------------------------------------------------------- */

.admin-ui-v3 input,
.admin-ui-v3 select,
.admin-ui-v3 textarea,
.admin-ui-v3 button {
    max-width: 100%;
}

.admin-ui-v3 input,
.admin-ui-v3 select,
.admin-ui-v3 textarea {
    min-width: 0;
}

.admin-ui-v3 .email-recipient-add-form,
.admin-ui-v3 .smtp-settings-form {
    min-width: 0;
}


/* ---------------------------------------------------------
   TABLE RESPONSIVENESS
   --------------------------------------------------------- */

.admin-ui-v3 .table-responsive,
.admin-ui-v3 .responsive-table-wrap {
    width: 100%;

    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
}

.admin-ui-v3 table {
    min-width: 680px;
}


/* ---------------------------------------------------------
   TABLET
   --------------------------------------------------------- */

@media (max-width: 1024px) {

    .admin-ui-v3 {
        padding-right: 20px;
        padding-left: 20px;
    }

    .admin-ui-v3 .email-status-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .admin-ui-v3 .email-admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-ui-v3 .smtp-form-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .admin-ui-v3 .admin-module-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .admin-ui-v3 .email-recipient-row {
        grid-template-columns:
            40px
            minmax(180px, 1fr)
            105px
            minmax(160px, auto);
    }

    .admin-ui-v3 .email-recipient-status {
        display: none;
    }

}


/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */

@media (max-width: 768px) {

    .admin-ui-v3 {
        padding-right: 12px;
        padding-left: 12px;
    }

    .admin-quick-nav {
        margin-bottom: 14px;

        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .admin-quick-nav-scroll {
        padding: 6px 2px;
    }

    .admin-quick-link {
        min-height: 38px;

        padding-right: 10px;
        padding-left: 10px;

        font-size: 10px;
    }

    .admin-ui-v3 .page-heading {
        gap: 12px;

        margin-bottom: 17px;
        padding-bottom: 13px;
    }

    .admin-ui-v3 .page-heading h1 {
        font-size: 21px;
    }

    .admin-ui-v3 .email-status-grid,
    .admin-ui-v3 .admin-hub-summary,
    .admin-ui-v3 .admin-module-grid,
    .admin-ui-v3 .email-recipient-add-grid,
    .admin-ui-v3 .permission-groups,
    .admin-ui-v3 .smtp-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-ui-v3 .email-admin-card {
        padding: 15px;
    }

    .admin-ui-v3 .email-admin-head {
        gap: 10px;
    }

    .admin-ui-v3 .email-recipient-count {
        min-width: 68px;
    }

    .admin-ui-v3 .email-recipient-list-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-ui-v3 .email-recipient-list-head input {
        width: 100%;
    }

    .admin-ui-v3 .email-recipient-row {
        grid-template-columns:
            38px minmax(0, 1fr);

        gap: 9px;

        padding: 12px 4px;
    }

    .admin-ui-v3 .email-recipient-type,
    .admin-ui-v3 .email-recipient-status {
        display: none;
    }

    .admin-ui-v3 .email-recipient-actions {
        grid-column: 1 / -1;

        justify-self: stretch;
        justify-content: flex-start;

        padding-left: 47px;
    }

    .admin-ui-v3 .email-recipient-actions form {
        flex: 1;
    }

    .admin-ui-v3 .email-recipient-actions .btn {
        width: 100%;
    }

    .admin-ui-v3 .permission-user-row {
        grid-template-columns:
            38px minmax(0, 1fr) 20px;

        gap: 9px;
    }

    .admin-ui-v3 .permission-user-roles,
    .admin-ui-v3 .permission-user-rights {
        display: none;
    }

}


/* ---------------------------------------------------------
   SMALL MOBILE
   --------------------------------------------------------- */

@media (max-width: 480px) {

    .admin-ui-v3 {
        padding-right: 8px;
        padding-left: 8px;
    }

    .admin-ui-v3 .email-status-grid {
        gap: 8px;
    }

    .admin-ui-v3 .email-status-card {
        padding: 12px;
    }

    .admin-ui-v3 .admin-module-card {
        min-height: auto;

        padding: 15px;
    }

    .admin-ui-v3 .email-recipient-add-card {
        padding: 13px;
    }

    .admin-ui-v3 input,
    .admin-ui-v3 select,
    .admin-ui-v3 textarea {
        font-size: 16px;
    }

}


/* =========================================================
   GLOBAL ADMIN QUICK NAV V5
   ========================================================= */

.global-admin-quick-nav-wrap {
    box-sizing: border-box;

    width: 100%;

    margin-bottom: 18px;
}


/*
 * When quick navigation is supplied by the main layout,
 * it must use the full content workspace regardless of
 * the inner page width.
 */
.global-admin-quick-nav-wrap .admin-quick-nav {
    width: 100%;

    margin: 0;

    border: 1px solid #e1e8ee;
    border-radius: 13px;

    background: #ffffff;
}


/*
 * Desktop:
 * links remain on one line where space permits,
 * then horizontal scrolling is available.
 */
.global-admin-quick-nav-wrap
.admin-quick-nav-scroll {
    display: flex;
    align-items: center;

    gap: 5px;

    width: 100%;

    padding: 7px;

    overflow-x: auto;
    overflow-y: hidden;

    white-space: nowrap;

    scrollbar-width: thin;

    -webkit-overflow-scrolling: touch;
}


/* Tablet */
@media (max-width: 1024px) {

    .global-admin-quick-nav-wrap {
        margin-bottom: 15px;
    }

    .global-admin-quick-nav-wrap
    .admin-quick-link {
        min-height: 39px;

        padding-right: 11px;
        padding-left: 11px;

        font-size: 10px;
    }

}


/* Mobile */
@media (max-width: 768px) {

    .global-admin-quick-nav-wrap {
        width: calc(100% + 24px);

        margin-right: -12px;
        margin-bottom: 13px;
        margin-left: -12px;
    }

    .global-admin-quick-nav-wrap
    .admin-quick-nav {
        border-right: 0;
        border-left: 0;

        border-radius: 0;
    }

    .global-admin-quick-nav-wrap
    .admin-quick-nav-scroll {
        padding: 6px 10px;
    }

    .global-admin-quick-nav-wrap
    .admin-quick-link {
        min-height: 38px;

        padding: 0 10px;

        font-size: 10px;
    }

}


/* Small phones */
@media (max-width: 480px) {

    .global-admin-quick-nav-wrap
    .admin-quick-link {
        gap: 5px;

        padding: 0 9px;

        font-size: 10px;
    }

    .global-admin-quick-nav-wrap
    .admin-quick-icon {
        font-size: 12px;
    }

}


/* =========================================================
   MASTER DATA / VENDOR UI V4
   ========================================================= */

.master-manage-page {
    box-sizing: border-box;

    width: 100%;
    max-width: none;

    padding: 0 24px 24px;
}


/* ---------------------------------------------------------
   HEADER
   --------------------------------------------------------- */

.master-manage-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}

.master-manage-header h1 {
    margin: 3px 0 4px;

    color: #0f172a;

    font-size: 24px;
    font-weight: 800;
}

.master-manage-header p {
    margin: 0;

    color: #64748b;

    font-size: 12px;
}


/* ---------------------------------------------------------
   STATS
   --------------------------------------------------------- */

.master-manage-stats {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 18px;
}

.master-manage-stats > div {
    padding: 15px 17px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #fff;
}

.master-manage-stats span {
    display: block;

    color: #64748b;

    font-size: 10px;
    font-weight: 700;
}

.master-manage-stats strong {
    display: block;

    margin-top: 4px;

    color: #0f172a;

    font-size: 21px;
}


/* ---------------------------------------------------------
   MAIN GRID
   --------------------------------------------------------- */

.master-manage-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.8fr)
        minmax(320px, .82fr);

    align-items: start;

    gap: 18px;
}


/* ---------------------------------------------------------
   LIST PANEL
   --------------------------------------------------------- */

.master-list-panel {
    min-width: 0;

    padding: 18px;

    border: 1px solid #e2e8f0;
    border-radius: 14px;

    background: #fff;
}

.master-list-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    margin-bottom: 14px;
}

.master-list-panel-header h2 {
    margin: 0 0 3px;

    color: #0f172a;

    font-size: 16px;
    font-weight: 800;
}

.master-list-panel-header p {
    margin: 0;

    color: #64748b;

    font-size: 10px;
}

.master-list-panel-header input[type="search"] {
    box-sizing: border-box;

    width: 260px;
    max-width: 100%;
    min-height: 40px;

    padding: 0 12px;

    border: 1px solid #d8e1e8;
    border-radius: 9px;

    background: #fff;

    font: inherit;
}


/* ---------------------------------------------------------
   TABLE
   --------------------------------------------------------- */

.master-table-wrap {
    width: 100%;

    overflow-x: auto;

    border: 1px solid #e6ebf0;
    border-radius: 11px;

    -webkit-overflow-scrolling: touch;
}

.master-table {
    width: 100%;
    min-width: 760px;

    border-collapse: collapse;

    background: #fff;
}

.master-table th {
    padding: 11px 12px;

    border-bottom: 1px solid #e5eaf0;

    background: #f8fafc;

    color: #64748b;

    font-size: 9px;
    font-weight: 800;

    text-align: left;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.master-table td {
    padding: 13px 12px;

    border-bottom: 1px solid #edf1f5;

    color: #334155;

    font-size: 11px;
    vertical-align: middle;
}

.master-table tbody tr:last-child td {
    border-bottom: 0;
}

.master-table tbody tr:hover {
    background: #fbfdfd;
}


/* vendor/name column */
.master-table td:first-child {
    min-width: 230px;

    color: #0f172a;

    font-size: 12px;
    font-weight: 750;
}


/* code */
.master-table td:nth-child(2) {
    min-width: 75px;
    white-space: nowrap;
}


/* contact */
.master-table td:nth-child(3) {
    min-width: 105px;
}


/* status */
.master-table td:nth-child(4) {
    min-width: 85px;
}


/* actions */
.master-table td:nth-child(5) {
    min-width: 210px;
}


/* ---------------------------------------------------------
   STATUS BADGE
   --------------------------------------------------------- */

.master-status,
.status-badge,
.badge-active,
.badge-inactive {
    display: inline-flex;
    align-items: center;

    min-height: 27px;

    padding: 0 9px;

    border-radius: 999px;

    white-space: nowrap;

    font-size: 9px;
    font-weight: 800;
}

.badge-active,
.status-active {
    background: #dcfce7;
    color: #15803d;
}

.badge-inactive,
.status-inactive {
    background: #f1f5f9;
    color: #64748b;
}


/* ---------------------------------------------------------
   ACTION BUTTONS
   --------------------------------------------------------- */

.master-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 6px;
}

.master-row-actions form {
    margin: 0;
}

.master-row-actions .btn,
.master-table .btn {
    min-height: 34px;

    padding: 6px 10px;

    border-radius: 8px;

    font-size: 10px;
    font-weight: 750;

    white-space: nowrap;
}


/* ---------------------------------------------------------
   FORM PANEL
   --------------------------------------------------------- */

.master-form-panel {
    min-width: 0;

    padding: 18px;

    border: 1px solid #e2e8f0;
    border-radius: 14px;

    background: #fff;

    position: sticky;
    top: 92px;
}

.master-form-panel h2 {
    margin: 3px 0 4px;

    color: #0f172a;

    font-size: 17px;
    font-weight: 800;
}

.master-form-panel p {
    margin: 0 0 15px;

    color: #64748b;

    font-size: 10px;
    line-height: 1.5;
}

.master-form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}

.master-form-grid .form-group,
.master-form-grid label {
    min-width: 0;
}

.master-form-grid .full-width,
.master-form-grid .form-full {
    grid-column: 1 / -1;
}

.master-form-panel input,
.master-form-panel select,
.master-form-panel textarea {
    box-sizing: border-box;

    width: 100%;
    min-width: 0;

    border: 1px solid #d7e0e7;
    border-radius: 9px;

    background: #fff;

    font: inherit;
}

.master-form-panel input,
.master-form-panel select {
    min-height: 42px;

    padding: 0 11px;
}

.master-form-panel textarea {
    min-height: 84px;

    padding: 10px 11px;

    resize: vertical;
}

.master-form-panel label {
    display: block;

    margin-bottom: 5px;

    color: #475569;

    font-size: 9px;
    font-weight: 800;
}

.master-form-panel .btn-primary {
    width: 100%;
    min-height: 42px;

    margin-top: 8px;
}


/* ---------------------------------------------------------
   TABLET
   --------------------------------------------------------- */

@media (max-width: 1100px) {

    .master-manage-grid {
        grid-template-columns:
            minmax(0, 1.5fr)
            minmax(300px, .9fr);
    }

    .master-table {
        min-width: 720px;
    }

}


/* ---------------------------------------------------------
   MOBILE / SMALL TABLET
   --------------------------------------------------------- */

@media (max-width: 850px) {

    .master-manage-page {
        padding-right: 14px;
        padding-left: 14px;
    }

    .master-manage-grid {
        grid-template-columns: 1fr;
    }

    .master-form-panel {
        position: static;
    }

    .master-list-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .master-list-panel-header input[type="search"] {
        width: 100%;
    }

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

}


/* ---------------------------------------------------------
   PHONE
   --------------------------------------------------------- */

@media (max-width: 560px) {

    .master-manage-page {
        padding-right: 8px;
        padding-left: 8px;
    }

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

    .master-list-panel,
    .master-form-panel {
        padding: 13px;
    }

    .master-form-grid {
        grid-template-columns: 1fr;
    }

    .master-form-grid .full-width,
    .master-form-grid .form-full {
        grid-column: auto;
    }

    .master-form-panel input,
    .master-form-panel select,
    .master-form-panel textarea {
        font-size: 16px;
    }

}


/* =========================================================
   ADMINISTRATION HUB ORGANIZATION V2
   ========================================================= */

.administration-hub {
    width: 100%;
}

.admin-hub-group {
    margin-top: 28px;
}

.admin-hub-group:first-of-type {
    margin-top: 22px;
}

.admin-hub-group-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 18px;

    margin-bottom: 12px;
    padding-bottom: 9px;

    border-bottom: 1px solid #e7edf2;
}

.admin-hub-group-head h2 {
    margin: 2px 0 3px;

    color: #0f172a;

    font-size: 16px;
    font-weight: 800;
}

.admin-hub-group-head p {
    margin: 0;

    color: #64748b;

    font-size: 10px;
}


/* Cards */
.administration-hub .admin-module-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}

.administration-hub .admin-module-card {
    position: relative;

    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 172px;

    padding: 18px;

    border: 1px solid #e1e8ee;
    border-radius: 13px;

    background: #ffffff;

    text-decoration: none;

    transition:
        transform .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

.administration-hub .admin-module-card:hover {
    transform: translateY(-2px);

    border-color: #b9deda;

    box-shadow:
        0 8px 22px rgba(15, 23, 42, .06);
}

.administration-hub .admin-module-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    margin-bottom: 12px;

    border-radius: 10px;

    background: #eef8f7;

    font-size: 18px;
}

.administration-hub .admin-module-body {
    flex: 1;
}

.administration-hub .admin-module-body h3 {
    margin: 0 0 6px;

    color: #0f172a;

    font-size: 13px;
    font-weight: 800;
}

.administration-hub .admin-module-body p {
    margin: 0;

    color: #64748b;

    font-size: 10px;
    line-height: 1.55;
}

.administration-hub .admin-module-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-top: 15px;
    padding-top: 10px;

    border-top: 1px solid #edf2f6;

    color: #64748b;

    font-size: 9px;
    font-weight: 700;
}

.administration-hub .admin-module-meta b {
    color: #0f8f83;

    font-size: 18px;
    font-weight: 600;
}


/* Summary row */
.administration-hub .admin-hub-summary {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 4px;
}


/* Tablet */
@media (max-width: 1000px) {

    .administration-hub .admin-module-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* Mobile */
@media (max-width: 700px) {

    .administration-hub .admin-hub-summary,
    .administration-hub .admin-module-grid {
        grid-template-columns: 1fr;
    }

    .admin-hub-group {
        margin-top: 22px;
    }

    .administration-hub .admin-module-card {
        min-height: auto;
    }

    .admin-hub-group-head {
        align-items: flex-start;
    }

}

/* ===== ADMIN MOBILE RESPONSIVE V5 START ===== */

/*
|--------------------------------------------------------------------------
| Administration responsive shell
|--------------------------------------------------------------------------
*/

.admin-ui-v3,
.administration-hub,
.admin-ui-v3 *,
.administration-hub * {
    box-sizing: border-box;
}

.administration-hub,
.admin-ui-v3 {
    width: 100%;
    min-width: 0;
}

.administration-hub .page-heading,
.admin-ui-v3 .page-heading {
    min-width: 0;
}

.administration-hub .page-heading > div,
.admin-ui-v3 .page-heading > div {
    min-width: 0;
}

.administration-hub .page-heading h1,
.admin-ui-v3 .page-heading h1 {
    overflow-wrap: anywhere;
}


/*
|--------------------------------------------------------------------------
| Administration overview statistics
|--------------------------------------------------------------------------
*/

.administration-hub .admin-hub-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

.administration-hub .admin-summary-card {
    min-width: 0;
    padding: 20px;
    border-radius: 16px;
}

.administration-hub .admin-summary-card span,
.administration-hub .admin-summary-card small {
    display: block;
}

.administration-hub .admin-summary-card strong {
    display: block;
    max-width: 100%;
    margin: 7px 0;
    overflow-wrap: anywhere;
    line-height: 1.15;
}


/*
|--------------------------------------------------------------------------
| Administration groups
|--------------------------------------------------------------------------
*/

.administration-hub .admin-hub-group {
    width: 100%;
    min-width: 0;
}

.administration-hub .admin-hub-group-head {
    width: 100%;
    min-width: 0;
}

.administration-hub .admin-hub-group-head > div {
    min-width: 0;
}

.administration-hub .admin-hub-group-head h2,
.administration-hub .admin-hub-group-head p {
    max-width: 100%;
    overflow-wrap: anywhere;
}


/*
|--------------------------------------------------------------------------
| Administration module cards
|--------------------------------------------------------------------------
*/

.administration-hub .admin-module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    width: 100%;
}

.administration-hub .admin-module-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "icon body"
        "icon meta";
    align-items: start;
    gap: 4px 14px;

    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 18px;

    text-decoration: none;
}

.administration-hub .admin-module-icon {
    grid-area: icon;
    flex: 0 0 auto;
}

.administration-hub .admin-module-body {
    grid-area: body;
    min-width: 0;
}

.administration-hub .admin-module-body h3 {
    margin-top: 0;
    overflow-wrap: anywhere;
}

.administration-hub .admin-module-body p {
    overflow-wrap: anywhere;
}

.administration-hub .admin-module-meta {
    grid-area: meta;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    min-width: 0;
    width: 100%;
}

.administration-hub .admin-module-meta span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.administration-hub .admin-module-meta b {
    flex: 0 0 auto;
}


/*
|--------------------------------------------------------------------------
| Global Administration quick navigation
|--------------------------------------------------------------------------
*/

.global-admin-quick-nav-wrap,
.admin-quick-nav {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.admin-quick-nav {
    overflow: hidden;
}

.admin-quick-nav-scroll {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;

    width: 100%;
    max-width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;

    padding-bottom: 3px;
}

.admin-quick-nav-scroll::-webkit-scrollbar {
    display: none;
}

.admin-quick-link {
    flex: 0 0 auto;
    white-space: nowrap;
}


/*
|--------------------------------------------------------------------------
| Email Administration
|--------------------------------------------------------------------------
*/

.admin-ui-v3 .email-admin-grid,
.admin-ui-v3 .email-status-grid,
.admin-ui-v3 .email-recipient-add-grid {
    min-width: 0;
    width: 100%;
}

.admin-ui-v3 .email-admin-card,
.admin-ui-v3 .email-recipient-manager,
.admin-ui-v3 .email-recipient-add-card,
.admin-ui-v3 .email-status-card {
    min-width: 0;
    max-width: 100%;
}

.admin-ui-v3 .email-admin-head {
    min-width: 0;
}

.admin-ui-v3 .email-admin-head > div {
    min-width: 0;
}

.admin-ui-v3 .email-admin-head h2,
.admin-ui-v3 .email-admin-head p {
    overflow-wrap: anywhere;
}

.admin-ui-v3 .email-recipient-add-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-ui-v3 .email-recipient-add-form {
    min-width: 0;
}

.admin-ui-v3 input,
.admin-ui-v3 select,
.admin-ui-v3 textarea {
    max-width: 100%;
}

.admin-ui-v3 .email-recipient-list {
    min-width: 0;
    max-width: 100%;
}

.admin-ui-v3 .email-recipient-row {
    min-width: 0;
}

.admin-ui-v3 .email-recipient-identity {
    min-width: 0;
}

.admin-ui-v3 .email-recipient-identity strong,
.admin-ui-v3 .email-recipient-identity span {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-ui-v3 .email-recipient-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}


/*
|--------------------------------------------------------------------------
| Tablet
|--------------------------------------------------------------------------
*/

@media (max-width: 1024px) {

    .administration-hub .admin-module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-ui-v3 .email-admin-grid {
        grid-template-columns: 1fr;
    }

}


/*
|--------------------------------------------------------------------------
| Small tablet / large phone
|--------------------------------------------------------------------------
*/

@media (max-width: 768px) {

    .administration-hub .page-heading,
    .admin-ui-v3 .page-heading {
        margin-bottom: 18px;
    }

    .administration-hub .page-heading h1,
    .admin-ui-v3 .page-heading h1 {
        font-size: clamp(1.45rem, 6vw, 1.85rem);
        line-height: 1.15;
    }

    .administration-hub .admin-hub-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .administration-hub .admin-summary-card {
        padding: 15px 16px;
    }

    .administration-hub .admin-summary-card strong {
        font-size: 1.45rem;
    }

    .administration-hub .admin-hub-group {
        margin-top: 20px;
    }

    .administration-hub .admin-hub-group-head {
        margin-bottom: 11px;
    }

    .administration-hub .admin-hub-group-head h2 {
        font-size: 1.16rem;
        line-height: 1.25;
    }

    .administration-hub .admin-hub-group-head p {
        font-size: .9rem;
        line-height: 1.45;
    }

    .administration-hub .admin-module-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .administration-hub .admin-module-card {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        grid-template-areas:
            "icon body arrow"
            "icon meta arrow";

        gap: 3px 11px;
        align-items: center;

        padding: 14px;
        min-height: 88px;
        border-radius: 14px;
    }

    .administration-hub .admin-module-icon {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 42px;
        height: 42px;
    }

    .administration-hub .admin-module-body h3 {
        margin-bottom: 3px;
        font-size: .98rem;
    }

    .administration-hub .admin-module-body p {
        margin: 0;
        font-size: .82rem;
        line-height: 1.35;
    }

    .administration-hub .admin-module-meta {
        justify-content: flex-start;
        font-size: .76rem;
    }

    .administration-hub .admin-module-meta b {
        position: absolute;
        right: 16px;
        font-size: 1.4rem;
    }

    .administration-hub .admin-module-meta span {
        padding-right: 20px;
    }


    /*
     * Quick nav becomes horizontal touch-scrolling pills.
     */

    .global-admin-quick-nav-wrap {
        max-width: 100%;
        overflow: hidden;
    }

    .admin-quick-nav-scroll {
        gap: 7px;
        padding: 2px 2px 7px;
    }

    .admin-quick-link {
        min-height: 40px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: .84rem;
    }

    .admin-quick-icon {
        font-size: .95rem;
    }


    /*
     * Email page
     */

    .admin-ui-v3 .email-status-grid,
    .admin-ui-v3 .email-admin-grid,
    .admin-ui-v3 .email-recipient-add-grid,
    .admin-ui-v3 .smtp-form-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .admin-ui-v3 .email-admin-card,
    .admin-ui-v3 .email-recipient-manager,
    .admin-ui-v3 .email-recipient-add-card,
    .admin-ui-v3 .email-status-card {
        padding: 15px;
    }

    .admin-ui-v3 .email-admin-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .admin-ui-v3 .email-recipient-count {
        flex: 0 0 auto;
    }

    .admin-ui-v3 .email-recipient-list-head {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .admin-ui-v3 .email-recipient-list-head input {
        width: 100%;
    }

    .admin-ui-v3 .email-recipient-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;

        padding: 13px;
        border-radius: 12px;
    }

    .admin-ui-v3 .email-recipient-type,
    .admin-ui-v3 .email-recipient-status {
        justify-self: start;
    }

    .admin-ui-v3 .email-recipient-actions {
        width: 100%;
    }

    .admin-ui-v3 .email-recipient-actions form {
        flex: 1 1 auto;
    }

    .admin-ui-v3 .email-recipient-actions .btn {
        min-height: 42px;
    }

    .admin-ui-v3 input,
    .admin-ui-v3 select,
    .admin-ui-v3 textarea {
        width: 100%;
        min-height: 44px;

        /*
         * 16px prevents automatic input zoom on iPhone.
         */
        font-size: 16px;
    }

}


/*
|--------------------------------------------------------------------------
| Phone
|--------------------------------------------------------------------------
*/

@media (max-width: 480px) {

    .administration-hub,
    .admin-ui-v3 {
        padding-left: 0;
        padding-right: 0;
    }

    .administration-hub .section-kicker,
    .admin-ui-v3 .section-kicker {
        font-size: .69rem;
        letter-spacing: .08em;
    }

    .administration-hub .admin-summary-card {
        padding: 13px 14px;
    }

    .administration-hub .admin-module-card {
        min-height: 82px;
        padding: 12px;
    }

    .administration-hub .admin-module-icon {
        width: 38px;
        height: 38px;
    }

    .administration-hub .admin-module-body h3 {
        font-size: .94rem;
    }

    .administration-hub .admin-module-body p {
        font-size: .78rem;
    }

    .admin-ui-v3 .email-admin-card,
    .admin-ui-v3 .email-recipient-manager,
    .admin-ui-v3 .email-recipient-add-card,
    .admin-ui-v3 .email-status-card {
        padding: 13px;
        border-radius: 13px;
    }

    .admin-ui-v3 .email-recipient-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }

    .admin-ui-v3 .email-recipient-actions form,
    .admin-ui-v3 .email-recipient-actions .btn {
        width: 100%;
    }

    .admin-ui-v3 .email-recipient-add-form .btn,
    .admin-ui-v3 .email-test-actions .btn,
    .admin-ui-v3 .smtp-settings-form .btn {
        width: 100%;
        min-height: 44px;
    }

}

/* ===== ADMIN MOBILE RESPONSIVE V5 END ===== */

/* ===== CLOSING HISTORY MOBILE CARDS V1 START ===== */
@media (max-width: 767px) {

    .closing-history-wrap {
        overflow: visible;
        border: 0;
    }

    .closing-history-table {
        display: block;
        width: 100%;
        border: 0;
    }

    .closing-history-table thead {
        display: none;
    }

    .closing-history-table tbody {
        display: grid;
        gap: 14px;
        width: 100%;
    }

    .closing-history-table tbody tr {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        width: 100%;
        padding: 16px;
        background: #fff;
        border: 1px solid var(--border, #dbe3e8);
        border-radius: var(--radius, 16px);
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    }

    .closing-history-table tbody td {
        display: grid;
        grid-template-columns: minmax(105px, 0.8fr) minmax(0, 1.2fr);
        align-items: center;
        gap: 12px;
        width: 100%;
        min-width: 0;
        padding: 10px 0;
        border: 0;
        border-bottom: 1px solid #edf1f4;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .closing-history-table tbody td::before {
        font-size: 12px;
        line-height: 1.3;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: #718096;
    }

    .closing-history-table tbody td:nth-child(1)::before {
        content: "Date";
    }

    .closing-history-table tbody td:nth-child(2)::before {
        content: "Closing No.";
    }

    .closing-history-table tbody td:nth-child(3)::before {
        content: "Version";
    }

    .closing-history-table tbody td:nth-child(4)::before {
        content: "Status";
    }

    .closing-history-table tbody td:nth-child(5)::before {
        content: "Gross Sales";
    }

    .closing-history-table tbody td:nth-child(6)::before {
        content: "Difference";
    }

    .closing-history-table tbody td:nth-child(7) {
        display: block;
        padding: 14px 0 0;
        border-bottom: 0;
    }

    .closing-history-table tbody td:nth-child(7)::before {
        display: none;
    }

    .closing-history-table tbody td:first-child {
        padding-top: 0;
    }

    .closing-history-table tbody td:first-child strong {
        font-size: 16px;
        color: #162033;
    }

    .closing-history-table tbody td:nth-child(2) {
        font-weight: 600;
        color: #334155;
    }

    .closing-history-table tbody td:last-child .btn {
        width: 100%;
        min-height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
/* ===== CLOSING HISTORY MOBILE CARDS V1 END ===== */

/* ===== DAILY CLOSING INDEX MOBILE WIDTH V1 START ===== */

.closing-index-page {
    width: 100%;
    min-width: 0;
}

@media (max-width: 767px) {

    .closing-index-page {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .closing-index-page > .hero-panel,
    .closing-index-page > .panel,
    .closing-index-page .closing-history-wrap,
    .closing-index-page .closing-history-table,
    .closing-index-page .closing-history-table tbody,
    .closing-index-page .closing-history-table tbody tr {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    .closing-index-page > .hero-panel {
        margin-left: 0;
        margin-right: 0;
    }

    .closing-index-page > .panel {
        margin-left: 0;
        margin-right: 0;
    }

    .closing-index-page .closing-history-wrap {
        overflow: visible;
    }
}

/* ===== DAILY CLOSING INDEX MOBILE WIDTH V1 END ===== */


/* ===== REPORTS-MOBILE-CARDS-V1 START ===== */

@media (max-width: 768px) {

    /* Prevent the Reports page itself from producing horizontal overflow */
    .report-center-modern,
    .report-center-modern * {
        min-width: 0;
        box-sizing: border-box;
    }

    .report-center-modern {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Report category navigation: 2 x 2 instead of horizontal scrolling */
    .report-center-modern .reports-tabbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
        overflow: visible;
        padding: 8px;
    }

    .report-center-modern .reports-tab {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 10px;
    }

    .report-center-modern .reports-tab > span:last-child {
        min-width: 0;
    }

    .report-center-modern .reports-tab strong,
    .report-center-modern .reports-tab small {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* Recent Daily Closings: desktop table becomes cards */
    .report-center-modern .modern-report-table-wrap {
        width: 100%;
        max-width: 100%;
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .report-center-modern .modern-report-table {
        display: block;
        width: 100%;
        min-width: 0 !important;
        border: 0;
        background: transparent;
    }

    .report-center-modern .modern-report-table thead {
        display: none;
    }

    .report-center-modern .modern-report-table tbody {
        display: grid;
        width: 100%;
        gap: 10px;
    }

    .report-center-modern .modern-report-table tbody tr {
        display: block;
        width: 100%;
        padding: 8px 12px 12px;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    }

    .report-center-modern .modern-report-table tbody td {
        display: grid;
        grid-template-columns: minmax(92px, .75fr) minmax(0, 1.25fr);
        align-items: center;
        gap: 10px;
        width: 100%;
        min-width: 0;
        padding: 10px 2px;
        border: 0;
        border-bottom: 1px solid #edf1f5;
        text-align: left;
        white-space: normal;
    }

    .report-center-modern .modern-report-table tbody td::before {
        color: #64748b;
        font-size: 11px;
        font-weight: 800;
        line-height: 1.2;
        text-transform: uppercase;
        letter-spacing: .02em;
    }

    .report-center-modern .modern-report-table tbody td:nth-child(1)::before {
        content: "Date";
    }

    .report-center-modern .modern-report-table tbody td:nth-child(2)::before {
        content: "Branch";
    }

    .report-center-modern .modern-report-table tbody td:nth-child(3)::before {
        content: "Closing No.";
    }

    .report-center-modern .modern-report-table tbody td:nth-child(4)::before {
        content: "Status";
    }

    .report-center-modern .modern-report-table tbody td:nth-child(5) {
        display: block;
        padding-top: 12px;
        border-bottom: 0;
    }

    .report-center-modern .modern-report-table tbody td:nth-child(5)::before {
        display: none;
    }

    .report-center-modern .report-reference {
        display: block;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .report-center-modern .table-report-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
    }

    .report-center-modern .table-report-actions .btn {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        margin: 0;
        justify-content: center;
        white-space: normal;
    }

    .report-center-modern .table-report-actions .btn:last-child:nth-child(3) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 430px) {
    .report-center-modern .reports-tabbar {
        grid-template-columns: 1fr;
    }
}

/* ===== REPORTS-MOBILE-CARDS-V1 END ===== */

/* ===== REPORT-DELETE-DAY-V1 START ===== */

.report-delete-modal[hidden] {
    display: none;
}

.report-delete-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 18px;
}

.report-delete-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .62);
}

.report-delete-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 20px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
}

.report-delete-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.report-delete-heading h2 {
    margin: 3px 0 0;
}

.report-delete-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    font-size: 25px;
    cursor: pointer;
}

.report-delete-warning {
    padding: 13px;
    margin-bottom: 14px;
    border: 1px solid #fecaca;
    border-radius: 11px;
    background: #fef2f2;
    color: #991b1b;
}

.report-delete-warning p {
    margin: 5px 0 0;
    line-height: 1.5;
}

.report-delete-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}

.report-delete-summary > div {
    min-width: 0;
    padding: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.report-delete-summary span,
.report-delete-summary strong {
    display: block;
}

.report-delete-summary span {
    margin-bottom: 4px;
    color: #64748b;
    font-size: 11px;
}

.report-delete-summary strong {
    overflow-wrap: anywhere;
}

.report-delete-field {
    display: block;
    margin-top: 13px;
}

.report-delete-field > span {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.report-delete-field input,
.report-delete-field textarea {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    font: inherit;
}

.report-delete-field small {
    display: block;
    margin-top: 5px;
    color: #64748b;
}

.report-delete-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 18px;
}

.report-delete-actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
}

.report-delete-open {
    overflow: hidden;
}

@media (max-width: 560px) {
    .report-delete-modal {
        align-items: end;
        padding: 8px;
    }

    .report-delete-dialog {
        width: 100%;
        max-height: 92vh;
        padding: 16px;
        border-radius: 16px 16px 10px 10px;
    }

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

    .report-delete-actions {
        grid-template-columns: 1fr;
    }

    .report-delete-field input,
    .report-delete-field textarea {
        font-size: 16px;
    }

    .report-center-modern .table-report-actions .report-delete-day-button {
        grid-column: 1 / -1;
    }
}

/* ===== REPORT-DELETE-DAY-V1 END ===== */

/* Daily Closing - Shift/date start controls */
.closing-start-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.closing-start-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.closing-start-field label {
    font-size: 0.78rem;
    font-weight: 700;
}

.closing-start-field input,
.closing-start-field select {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--border, #d7dee5);
    border-radius: 8px;
    background: var(--surface, #fff);
    font: inherit;
}

@media (max-width: 720px) {
    .closing-start-form {
        width: 100%;
        align-items: stretch;
    }

    .closing-start-field {
        width: 100%;
    }

    .closing-start-form .hero-action {
        width: 100%;
    }
}

/* =========================================================
   CASH COUNT MODE
   ========================================================= */

.cash-count-mode-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.cash-count-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border, #dbe3e8);
    border-radius: var(--radius, 12px);
    cursor: pointer;
    background: #fff;
}

.cash-count-mode-option input {
    margin-top: 4px;
    flex: 0 0 auto;
}

.cash-count-mode-option span {
    display: grid;
    gap: 4px;
}

.cash-count-mode-option small {
    color: var(--muted, #64748b);
    line-height: 1.4;
}

.cash-count-mode-option:has(input:checked) {
    border-color: var(--primary, #0f766e);
    box-shadow: 0 0 0 1px var(--primary, #0f766e);
}

[data-cash-total-panel] {
    margin-bottom: 18px;
}

[data-cash-total-panel] input {
    width: 100%;
    margin-top: 7px;
}

[data-cash-denomination-panel] {
    margin-bottom: 18px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 700px) {
    .cash-count-mode-selector {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Application Branding Administration
   ========================================================= */

.sidebar-brand-logo {
    display: block;
    width: auto;
    max-width: 170px;
    max-height: 48px;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 5px;
}

.mobile-drawer .sidebar-brand-logo {
    max-width: 160px;
    max-height: 44px;
}

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

.branding-admin-card {
    padding: 24px;
    border: 1px solid #dfe7ee;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 32, 56, .05);
}

.branding-admin-card-head h2 {
    margin: 5px 0 4px;
}

.branding-admin-card-head p {
    margin: 0;
    color: #728095;
    font-size: 13px;
}

.branding-preview {
    display: grid;
    place-items: center;
    min-height: 170px;
    margin: 22px 0;
    padding: 25px;
    border: 1px dashed #ccd8e3;
    border-radius: 15px;
    background:
        linear-gradient(
            145deg,
            #f8fbfc,
            #f0f6f7
        );
}

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

.branding-favicon-preview img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.branding-default-preview {
    text-align: center;
}

.branding-default-preview strong,
.branding-default-preview small {
    display: block;
}

.branding-default-preview strong {
    color: #0c2039;
    font-size: 26px;
}

.branding-default-preview small {
    margin-top: 5px;
    color: #8a97a8;
}

.branding-default-favicon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    color: #fff;
    background: #119b8d;
    font-size: 19px;
    font-weight: 900;
}

.branding-upload-form {
    display: grid;
    gap: 11px;
    margin-bottom: 13px;
}

.branding-upload-form label {
    color: #34445a;
    font-size: 12px;
    font-weight: 750;
}

.branding-upload-form input[type="file"] {
    width: 100%;
    padding: 11px;
    border: 1px solid #dce4ec;
    border-radius: 10px;
    background: #f9fbfc;
}

@media (max-width: 800px) {
    .branding-admin-grid {
        grid-template-columns: 1fr;
    }

    .branding-admin-card {
        padding: 19px;
    }
}

/* =========================================================
   Uploaded logo presentation refinement
   ========================================================= */

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sidebar-brand-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 185px;
    max-height: 62px;
    object-fit: contain;
    object-position: left center;
    margin: 0 0 7px 0;
}

.sidebar-brand small {
    margin-top: 1px;
}

.mobile-drawer .sidebar-brand-logo {
    max-width: 175px;
    max-height: 58px;
}

@media (max-width: 768px) {
    .sidebar-brand-logo,
    .mobile-drawer .sidebar-brand-logo {
        max-width: 160px;
        max-height: 54px;
    }
}

/* =========================================================
   FINAL SIDEBAR BRAND ALIGNMENT
   Keep this block last so it overrides older logo rules.
   ========================================================= */

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 96px;
    padding: 18px 12px 12px;
    text-align: center;
}

.sidebar-brand-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 185px;
    max-height: 68px;
    margin: 0 auto 7px;
    padding: 0;
    object-fit: contain;
    object-position: center center;
}

.sidebar-brand small {
    display: block;
    width: 100%;
    margin: 0;
    text-align: center;
    line-height: 1.25;
}

.mobile-drawer .sidebar-brand {
    min-height: auto;
    padding: 10px 8px;
}

.mobile-drawer .sidebar-brand-logo {
    max-width: 165px;
    max-height: 58px;
}

@media (max-width: 768px) {
    .sidebar-brand-logo,
    .mobile-drawer .sidebar-brand-logo {
        max-width: 155px;
        max-height: 54px;
    }
}

/* =========================================================
   HOTFIX - sidebar uploaded logo
   ========================================================= */

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 105px;
    padding: 16px 14px 12px;
    text-align: left;
}

.sidebar-brand-logo {
    display: block;
    width: 135px;
    height: auto;
    max-width: none;
    max-height: 76px;
    margin: 0 0 6px 0;
    padding: 0;
    object-fit: contain;
    object-position: left center;
}

.sidebar-brand small {
    width: auto;
    margin: 0;
    text-align: left;
}

.mobile-drawer .sidebar-brand {
    align-items: flex-start;
    text-align: left;
}

.mobile-drawer .sidebar-brand-logo {
    width: 130px;
    max-width: none;
    max-height: 70px;
}

@media (max-width: 768px) {
    .sidebar-brand-logo,
    .mobile-drawer .sidebar-brand-logo {
        width: 125px;
        max-width: none;
        max-height: 66px;
    }
}

/* =========================================================
   GLOBAL SEARCH
   ========================================================= */

.global-search-topbar {
    flex: 1 1 360px;
    max-width: 460px;
    min-width: 220px;
    height: 42px;
    margin: 0 28px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #d9e3ea;
    border-radius: 12px;
    background: #f7fafc;
    color: #64748b;
}

.global-search-topbar:focus-within {
    background: #ffffff;
    border-color: #0f9b8e;
    box-shadow: 0 0 0 3px rgba(15, 155, 142, .10);
}

.global-search-topbar input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font: inherit;
}

.global-search-topbar input::placeholder {
    color: #94a3b8;
}

.global-search-mobile-link {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9e3ea;
    border-radius: 11px;
    background: #ffffff;
    color: #334155;
    text-decoration: none;
}

.global-search-page {
    max-width: 1180px;
}

.global-search-panel {
    margin-bottom: 22px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #dde6ed;
    border-radius: 16px;
}

.global-search-main-form {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 7px 8px 7px 18px;
    border: 1px solid #d7e1e8;
    border-radius: 13px;
    color: #64748b;
}

.global-search-main-form:focus-within {
    border-color: #0f9b8e;
    box-shadow: 0 0 0 3px rgba(15, 155, 142, .10);
}

.global-search-main-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font: inherit;
    font-size: 15px;
}

.global-search-summary {
    margin: 0 0 16px;
    color: #64748b;
    font-size: 13px;
}

.global-result-group {
    overflow: hidden;
    margin-bottom: 18px;
    background: #ffffff;
    border: 1px solid #dde6ed;
    border-radius: 16px;
}

.global-result-heading {
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e7edf2;
}

.global-result-heading h2 {
    margin: 3px 0 0;
    font-size: 17px;
}

.global-result-count {
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef5f7;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.global-result-list {
    display: block;
}

.global-result-item {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 13px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #edf1f4;
    transition: background .15s ease;
}

.global-result-item:last-child {
    border-bottom: 0;
}

.global-result-item:hover {
    background: #f8fbfc;
}

.global-result-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eaf8f5;
    color: #087c71;
    font-size: 13px;
    font-weight: 800;
}

.global-result-body {
    flex: 1;
    min-width: 0;
}

.global-result-body strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.global-result-body span {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.global-result-arrow {
    color: #94a3b8;
    font-size: 24px;
}

.global-search-empty {
    min-height: 210px;
    padding: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #ffffff;
    border: 1px solid #dde6ed;
    border-radius: 16px;
}

.global-search-empty strong {
    color: #0f172a;
    font-size: 18px;
}

.global-search-empty span {
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 900px) {

    .global-search-topbar {
        display: none;
    }

    .global-search-mobile-link {
        display: inline-flex;
        margin-left: auto;
        margin-right: 10px;
    }
}

@media (max-width: 600px) {

    .global-search-main-form {
        padding: 10px 12px;
        flex-wrap: wrap;
    }

    .global-search-main-form input {
        flex-basis: calc(100% - 40px);
    }

    .global-search-main-form .btn {
        width: 100%;
    }

    .global-result-item {
        padding: 13px 14px;
    }

    .global-result-heading {
        padding: 15px 14px;
    }
}

/* =========================================================
   POLISHED LIVE GLOBAL SEARCH
   ========================================================= */

.global-search-topbar,
.global-search-main-form {
    position: relative;
}

.global-search-topbar {
    overflow: visible;
    z-index: 50;
}

.global-search-suggestions {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    right: 0;
    z-index: 999;
    display: none;
    overflow: hidden;
    min-width: 420px;
    max-height: 520px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #dce5eb;
    border-radius: 14px;
    box-shadow:
        0 18px 45px rgba(15, 23, 42, .14),
        0 3px 10px rgba(15, 23, 42, .06);
}

.global-search-suggestions.is-open {
    display: block;
}

.global-search-suggestion-status {
    padding: 17px 18px;
    color: #64748b;
    font-size: 13px;
}

.global-search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #edf2f5;
    cursor: pointer;
}

.global-search-suggestion-item:hover,
.global-search-suggestion-item.is-active {
    background: #f1faf8;
}

.global-search-suggestion-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #e8f7f4;
    color: #087c71;
    font-size: 12px;
    font-weight: 800;
}

.global-search-suggestion-content {
    flex: 1;
    min-width: 0;
}

.global-search-suggestion-type {
    display: block;
    margin-bottom: 2px;
    color: #0f9b8e;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.global-search-suggestion-title {
    display: block;
    overflow: hidden;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-suggestion-subtitle {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-suggestion-arrow {
    color: #94a3b8;
    font-size: 20px;
}

.global-search-suggestion-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    text-decoration: none;
}

.global-search-suggestion-footer strong {
    color: #087c71;
}

.global-search-suggestion-footer:hover {
    background: #eef8f6;
}

.global-search-loading-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: #0f9b8e;
}

@media (max-width: 900px) {
    .global-search-suggestions {
        min-width: 100%;
    }
}


/* =========================================================
   ACCESS MANAGEMENT HUB
   ========================================================= */

.access-hub-heading {
    align-items: flex-start;
}

.access-hub-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.access-role-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.access-role-card {
    padding: 16px;
    border: 1px solid #e1e8ed;
    border-radius: 13px;
    background: #fbfdfe;
}

.access-role-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.access-role-card-head strong {
    color: #0f172a;
    font-size: 14px;
}

.access-role-card p {
    min-height: 38px;
    margin: 9px 0 12px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.access-role-meta,
.access-user-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.access-count-badge,
.access-shift-badge,
.access-muted-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.access-count-badge {
    background: #edf2f7;
    color: #475569;
}

.access-shift-badge {
    background: #e7f7f4;
    color: #087c71;
}

.access-muted-badge {
    background: #f1f5f9;
    color: #64748b;
}

.access-user-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.access-user-list {
    display: flex;
    flex-direction: column;
}

.access-user-row {
    display: grid;
    grid-template-columns:
        44px minmax(220px, 1fr) 180px auto;
    align-items: center;
    gap: 14px;
    padding: 14px 4px;
    border-bottom: 1px solid #e8eef2;
}

.access-user-row:last-child {
    border-bottom: 0;
}

.access-user-main {
    min-width: 0;
}

.access-user-main > strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.access-user-main > span {
    display: block;
    margin: 3px 0 7px;
    overflow: hidden;
    color: #64748b;
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.access-user-branch small {
    display: block;
    color: #94a3b8;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.access-user-branch strong {
    display: block;
    margin-top: 3px;
    color: #334155;
    font-size: 12px;
}

.access-user-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.access-advanced-card {
    margin-bottom: 30px;
}

@media (max-width: 900px) {

    .access-user-row {
        grid-template-columns: 42px 1fr;
    }

    .access-user-branch,
    .access-user-actions {
        grid-column: 2;
    }

    .access-user-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {

    .access-hub-actions {
        width: 100%;
    }

    .access-hub-actions .btn {
        flex: 1;
    }

    .access-user-search {
        width: 100%;
    }

    .access-user-search input {
        width: 100%;
    }
}

/* =========================================================
   GLOBAL MOBILE RESPONSIVE HARDENING
   ========================================================= */

@media (max-width: 768px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .main-area {
        width: 100%;
        min-width: 0;
    }

    .content {
        width: 100%;
        min-width: 0;
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 88px;
    }

    .page-shell {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
    }


    /* PAGE HEADERS */

    .page-heading,
    .hero-panel.compact,
    .email-admin-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-heading > *,
    .hero-panel.compact > *,
    .email-admin-head > * {
        min-width: 0;
    }

    .page-heading h1,
    .hero-panel h1 {
        word-break: break-word;
    }


    /* TOPBAR */

    .topbar {
        min-width: 0;
        padding-left: 12px;
        padding-right: 12px;
    }

    .topbar-leading {
        min-width: 0;
    }

    .page-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-area {
        flex-shrink: 0;
    }

    .user-meta {
        display: none;
    }

    .logout-button {
        white-space: nowrap;
    }


    /* FORMS */

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

    .form-group,
    .form-control,
    select.form-control,
    textarea.form-control {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .form-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .form-actions .btn {
        flex: 1 1 150px;
    }

    .search-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .search-row .form-control {
        flex: 1 1 100%;
    }


    /* CARDS */

    .panel,
    .email-admin-card,
    .global-result-group {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }


    /* TABLES */

    .table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        width: 100%;
        min-width: 680px;
    }


    /* ACCESS MANAGEMENT */

    .access-hub-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .access-hub-actions .btn {
        width: 100%;
        text-align: center;
    }

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

    .access-role-card p {
        min-height: 0;
    }

    .access-user-search {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }

    .access-user-search input {
        width: 100%;
        flex: 1 1 100%;
    }

    .access-user-row {
        grid-template-columns: 42px minmax(0, 1fr) !important;
        gap: 10px;
    }

    .access-user-main {
        min-width: 0;
    }

    .access-user-branch,
    .access-user-actions {
        grid-column: 2;
    }

    .access-user-actions {
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 7px;
    }

    .access-user-actions .btn {
        flex: 1 1 125px;
        text-align: center;
    }


    /* PERMISSIONS */

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

    .permission-save-bar {
        gap: 12px;
    }


    /* GLOBAL SEARCH */

    .global-search-main-form {
        width: 100%;
    }

    .global-search-suggestions {
        left: 0;
        right: 0;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .global-result-item {
        min-width: 0;
    }

    .global-result-body {
        min-width: 0;
    }
}


@media (max-width: 520px) {

    .content {
        padding-left: 10px;
        padding-right: 10px;
    }

    .page-heading h1,
    .hero-panel h1 {
        font-size: 26px;
        line-height: 1.12;
    }

    .page-heading p,
    .hero-panel p {
        line-height: 1.5;
    }

    .btn,
    .btn-primary,
    .btn-secondary {
        min-height: 42px;
    }

    .access-user-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .access-user-actions .btn {
        width: 100%;
    }

    .permission-save-bar {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .permission-save-bar .btn {
        width: 100%;
    }

    .global-search-main-form {
        padding: 10px;
    }
}

/* =========================================================
   CURRENCY INPUTS
   ========================================================= */

input[data-money-input] {
    text-align: right;
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

input[data-money-input]:focus {
    text-align: right;
}




/* DCF MASTER DATA V1 moved to css/dcf-master-data.css */



/* DCF MASTER DATA V2 moved to css/dcf-master-data.css */




/* DCF MASTER DATA V3 moved to css/dcf-master-data.css */



/*
 * DCF MASTER DATA V4
 * moved to css/dcf-master-data.css
 */



/* ===== BUSINESS CONTROL CENTER V1 START ===== */

.business-control-center {
    display: grid;
    gap: 16px;
    padding-bottom: 30px;
}

.control-center-hero {
    margin-bottom: 0;
}

.control-center-tabs {
    position: sticky;
    top: 0;
    z-index: 12;

    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;

    padding: 7px;
    border: 1px solid #dfe7eb;
    border-radius: 14px;

    background: rgba(255,255,255,.97);
    box-shadow: 0 4px 16px rgba(15,23,42,.05);
}

.control-center-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 8px 10px;

    border-radius: 9px;

    color: #53616d;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}

.control-center-tabs a:hover {
    background: #f2f6f7;
}

.control-center-tabs a.active {
    background: #eef8f6;
    color: #08766d;
    box-shadow: inset 0 0 0 1px #bcded9;
}

.control-center-panel {
    padding: 18px;
    border: 1px solid #dde5ea;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15,23,42,.035);
}

.control-center-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 15px;
}

.control-center-heading h2 {
    margin: 3px 0 4px;
    color: #0f172a;
    font-size: 20px;
}

.control-center-heading p {
    margin: 0;
    color: #687781;
    font-size: 13px;
}

.control-center-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.control-center-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.control-center-table th,
.control-center-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #edf1f5;
    vertical-align: middle;
    text-align: left;
}

.control-center-table th {
    background: #f6f9fa;
    color: #53616d;
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
}

.control-center-table tbody tr:hover {
    background: #fafcfc;
}

.control-center-table tbody tr:last-child td {
    border-bottom: 0;
}

.control-center-table strong,
.control-center-table small {
    display: block;
}

.control-center-table small {
    margin-top: 3px;
    color: #7b8792;
    font-size: 11.5px;
}

.control-center-table .amount {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.control-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.control-row-actions form {
    margin: 0;
}

.control-row-actions .btn {
    white-space: nowrap;
}

.control-center-note {
    margin-top: 13px;
    padding: 11px 13px;

    border-left: 3px solid #0c8d81;
    border-radius: 8px;

    background: #f5fbfa;
    color: #63727d;
    font-size: 12px;
    line-height: 1.45;
}

.inline-ledger {
    scroll-margin-top: 80px;
}

.control-sales-filter {
    display: grid;
    grid-template-columns:
        minmax(210px, 1.3fr)
        minmax(150px, .8fr)
        minmax(150px, .8fr)
        auto;

    align-items: end;
    gap: 10px;

    margin-bottom: 14px;
    padding: 13px;

    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #fafcfc;
}

.control-sales-filter label {
    display: grid;
    gap: 5px;
}

.control-sales-filter label > span {
    color: #53616d;
    font-size: 11.5px;
    font-weight: 750;
}

.control-sales-filter input,
.control-sales-filter select {
    min-height: 40px;
    padding: 7px 10px;

    border: 1px solid #cfd9df;
    border-radius: 8px;

    background: #fff;
    color: #182631;
    font: inherit;
}

.control-sales-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 14px;
}

.control-sales-summary > div {
    padding: 12px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #fafcfc;
}

.control-sales-summary span,
.control-sales-summary strong {
    display: block;
}

.control-sales-summary span {
    color: #6f7d89;
    font-size: 11px;
    font-weight: 700;
}

.control-sales-summary strong {
    margin-top: 4px;
    color: #0f172a;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.sales-channel-details {
    min-width: 130px;
}

.sales-channel-details summary {
    cursor: pointer;
    color: #08766d;
    font-size: 12px;
    font-weight: 750;
}

.sales-channel-grid {
    position: absolute;
    z-index: 20;

    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 6px;

    width: min(420px, 80vw);
    margin-top: 7px;
    padding: 10px;

    border: 1px solid #dce5e9;
    border-radius: 10px;

    background: #fff;
    box-shadow: 0 10px 30px rgba(15,23,42,.12);
}

.sales-channel-grid > div {
    padding: 7px 8px;
    border-radius: 7px;
    background: #f7fafb;
}

.sales-channel-grid span,
.sales-channel-grid strong {
    display: block;
}

.sales-channel-grid span {
    color: #71808c;
    font-size: 10.5px;
}

.sales-channel-grid strong {
    margin-top: 2px;
    color: #0f172a;
    font-size: 12px;
}

.control-closing-link {
    display: inline-block;
    margin-top: 6px;
    color: #08766d;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 900px) {

    .control-center-tabs {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

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

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

@media (max-width: 640px) {

    .control-center-tabs {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        position: static;
    }

    .control-center-panel {
        padding: 14px;
    }

    .control-center-heading {
        display: grid;
    }

    .control-center-table-wrap {
        border: 0;
        overflow: visible;
    }

    .control-center-table {
        min-width: 760px;
    }

    .control-sales-filter,
    .control-sales-summary {
        grid-template-columns: 1fr;
    }

    .sales-channel-grid {
        position: relative;
        width: 100%;
        grid-template-columns: 1fr;
    }
}

/* ===== BUSINESS CONTROL CENTER V1 END ===== */


/* ===== CONTROL CENTER ADMIN V2 START ===== */

.access-role-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(175px, 1fr));
    gap: 9px;
    margin-bottom: 15px;
}

.access-role-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 11px 12px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #fafcfc;
}

.access-role-card strong,
.access-role-card span {
    display: block;
}

.access-role-card strong {
    color: #0f172a;
    font-size: 13px;
}

.access-role-card > div:first-child span {
    margin-top: 2px;
    color: #7b8792;
    font-size: 11px;
}

.access-role-shifts span {
    padding: 5px 8px;

    border-radius: 999px;

    background: #eef8f6;
    color: #08766d;

    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
}

.control-admin-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(210px, 1fr));
    gap: 11px;
}

.control-admin-card {
    display: block;

    min-height: 130px;
    padding: 15px;

    border: 1px solid #dde5ea;
    border-radius: 12px;

    background: #fafcfc;

    color: inherit;
    text-decoration: none;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.control-admin-card:hover {
    border-color: #b8d8d3;
    box-shadow: 0 7px 18px rgba(15,23,42,.06);
    transform: translateY(-1px);
}

.control-admin-card span,
.control-admin-card strong,
.control-admin-card small {
    display: block;
}

.control-admin-card span {
    color: #64748b;
    font-size: 11.5px;
    font-weight: 750;
}

.control-admin-card strong {
    margin-top: 7px;
    color: #0f172a;
    font-size: 22px;
}

.control-admin-card small {
    margin-top: 7px;
    color: #7b8792;
    font-size: 11.5px;
    line-height: 1.45;
}

@media (max-width: 640px) {

    .access-role-grid,
    .control-admin-grid {
        grid-template-columns: 1fr;
    }

}

/* ===== CONTROL CENTER ADMIN V2 END ===== */
