@import "bootstrap/dist/css/bootstrap.min.css";
@import "select2/dist/css/select2.css";
@import "datatables.net-dt/css/dataTables.dataTables.css";
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800;900&family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap");

:root {
    --primary: #124c88;
    --primary-strong: #0b3564;
    --primary-soft: #edf5fc;
    --accent: #124c88;
    --accent-soft: #f1f6fb;
    --ink: #111827;
    --muted: #6b7280;
    --line: rgba(139, 158, 181, 0.34);
    --line-soft: rgba(216, 226, 238, 0.86);
    --surface: #ffffff;
    --surface-soft: #eef4fb;
    --danger: #b42318;
    --success: #14724d;
    --shadow: 0 18px 50px rgba(31, 48, 68, 0.12);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: linear-gradient(135deg, #c6cdd7 0%, #e1e6ee 50%, #b9c2cf 100%);
    color: var(--ink);
    font-family: "Geist", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
    font-size: 14px;
    letter-spacing: 0;
    font-variant-numeric: lining-nums;
    font-feature-settings: "lnum" 1, "tnum" 1, "locl" 0;
    transition: background 0.24s ease, color 0.24s ease;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

html[dir="rtl"] body {
    font-family: "Noto Naskh Arabic", "Geist", Tahoma, Arial, sans-serif;
    font-size: 15px;
}

html[dir="ltr"] body {
    font-family: "Geist", Arial, sans-serif;
    font-size: 14px;
}

button,
input,
select,
textarea,
.select2-container,
.dt-container {
    font: inherit;
}

html[data-theme="dark"] {
    --primary: #6aa7e8;
    --primary-strong: #9cc9f6;
    --primary-soft: rgba(96, 165, 250, 0.12);
    --accent: #5fbdb4;
    --accent-soft: rgba(45, 212, 191, 0.11);
    --ink: #e7edf6;
    --muted: #9ca8ba;
    --line: rgba(148, 163, 184, 0.28);
    --line-soft: rgba(71, 85, 105, 0.52);
    --surface: #111827;
    --surface-soft: #0f172a;
    --danger: #f87171;
    --success: #5ee0b5;
    --shadow: 0 22px 60px rgba(2, 6, 23, 0.42);
}

html[data-theme="dark"] body {
    background: linear-gradient(135deg, #101827 0%, #151f30 52%, #19343a 100%);
}

html[data-theme="dark"] .app-shell {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.92)),
        #0f172a;
    border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .brand-zone,
html[data-theme="dark"] .system-strip,
html[data-theme="dark"] .tab-rail,
html[data-theme="dark"] .welcome-panel,
html[data-theme="dark"] .hero-metrics article,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .balance-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .activity-panel,
html[data-theme="dark"] .backup-panel,
html[data-theme="dark"] .panel-loader,
html[data-theme="dark"] .empty-state {
    background: rgba(17, 24, 39, 0.82);
    border-color: rgba(148, 163, 184, 0.24);
    color: #e7edf6;
}

button,
input,
select,
textarea {
    font: inherit;
    font-variant-numeric: inherit;
    font-feature-settings: inherit;
}

svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.9;
}

.mis-body {
    direction: rtl;
}

.app-shell {
    width: min(1840px, calc(100% - 48px));
    margin: 24px auto;
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(248, 251, 254, 0.98), rgba(244, 249, 253, 0.94)),
        #f8fbfe;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 26px;
    box-shadow: var(--shadow);
    animation: shellIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    backdrop-filter: blur(16px);
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
    min-height: 54px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: fadeSlideUp 0.45s 0.06s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.brand-zone,
.system-strip,
.user-chip,
.status-chip,
.date-stack,
.action-cluster,
.table-tools,
.form-actions,
.backup-actions {
    display: flex;
    align-items: center;
}

.brand-zone {
    order: 1;
    gap: 8px;
    min-width: 0;
    align-items: center;
}

.top-logo,
.brand-logo {
    width: 78px;
    height: 56px;
    object-fit: contain;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    flex-shrink: 0;
    display: block;
}

.brand-logo {
    width: 92px;
    height: 64px;
}

.brand-zone > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-zone span,
.brand-lockup h1 {
    display: block;
    color: var(--primary);
    font-family: "Geist", Arial, sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;
}

.brand-zone strong {
    display: block;
    margin-top: 4px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.tab-rail {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 5px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 999px;
    scrollbar-width: thin;
}

.module-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 34px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 800;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.module-tab:hover,
.module-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(13, 74, 147, 0.18);
}

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

.module-tab svg {
    width: 14px;
    height: 14px;
}

.system-strip {
    order: 2;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    margin-inline-start: auto;
}

.date-stack,
.user-chip,
.status-chip,
.language-select {
    min-height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 999px;
    background: #fff;
    padding: 6px 10px;
    box-shadow: 0 8px 22px rgba(30, 54, 88, 0.06);
}

.date-stack {
    display: grid;
    align-content: center;
    min-width: 126px;
}

.date-stack span {
    color: var(--primary);
    font-family: "Geist", Arial, sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;
}

.date-stack small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.user-chip,
.status-chip {
    gap: 7px;
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap;
}

.status-chip {
    color: var(--success);
}

.status-chip.offline {
    color: var(--danger);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(20, 114, 77, 0.1);
    animation: statusPulse 1.8s ease-in-out infinite;
}

.language-select {
    width: 88px;
    color: var(--ink);
    outline: none;
    appearance: none;
    text-align: center;
}

.hero-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 500px);
    gap: 14px;
    align-items: stretch;
    padding: 18px 0 8px;
    animation: fadeSlideUp 0.5s 0.12s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.welcome-panel {
    min-height: 170px;
    padding: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(236, 247, 255, 0.34));
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 24px;
}

.welcome-panel p,
.welcome-panel h1,
.welcome-panel span {
    margin: 0;
}

.welcome-panel p {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.welcome-panel h1 {
    margin-top: 4px;
    color: var(--ink);
    font-size: 36px;
    font-weight: 700;
    line-height: 1.12;
}

.welcome-panel > span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

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

.progress-meters article {
    display: grid;
    gap: 7px;
    animation: fadeSlideUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.progress-meters article:nth-child(1) { animation-delay: 0.18s; }
.progress-meters article:nth-child(2) { animation-delay: 0.23s; }
.progress-meters article:nth-child(3) { animation-delay: 0.28s; }
.progress-meters article:nth-child(4) { animation-delay: 0.33s; }

.progress-meters article:hover .meter {
    box-shadow: inset 0 0 0 1px rgba(13, 74, 147, 0.08), 0 8px 18px rgba(13, 74, 147, 0.08);
}

.progress-meters small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.progress-meters strong {
    color: var(--primary);
    font-family: "Geist", Arial, sans-serif;
    font-size: 13px;
    font-weight: 800;
}

.meter {
    height: 20px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(13, 74, 147, 0.12);
}

.meter span {
    display: block;
    width: 44%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0d4a93, #1d8cff);
    transform-origin: right center;
    animation: meterSweep 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: width 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.meter.muted span {
    width: 64%;
    background: linear-gradient(90deg, rgba(13, 74, 147, 0.18), rgba(13, 74, 147, 0.08));
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-content: center;
}

.hero-metrics article {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 132px;
    padding: 14px 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(30, 54, 88, 0.08);
    animation: softScale 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.hero-metrics article:nth-child(1) { animation-delay: 0.18s; }
.hero-metrics article:nth-child(2) { animation-delay: 0.24s; }
.hero-metrics article:nth-child(3) { animation-delay: 0.3s; }

.hero-metrics article:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 22px 48px rgba(30, 54, 88, 0.12);
}

.hero-metrics i,
.hero-metrics svg {
    color: rgba(13, 74, 147, 0.42);
}

.hero-metrics strong {
    margin-top: 8px;
    display: block;
    width: 100%;
    min-width: 0;
    color: var(--ink);
    font-family: "Geist", Arial, sans-serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.06;
    direction: ltr;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.hero-metrics strong span,
.hero-metrics strong small {
    display: block;
}

.hero-metrics strong span {
    color: var(--ink);
    font-size: inherit;
    font-weight: inherit;
}

.hero-metrics strong small {
    margin-top: 4px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.hero-metrics span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(132px, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
}

.stat-card {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    column-gap: 9px;
    min-width: 0;
    min-height: 66px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    box-shadow: none;
    animation: fadeSlideUp 0.44s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 34px rgba(30, 54, 88, 0.1);
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.11s; }
.stat-card:nth-child(4) { animation-delay: 0.14s; }
.stat-card:nth-child(5) { animation-delay: 0.17s; }
.stat-card:nth-child(6) { animation-delay: 0.2s; }
.stat-card:nth-child(7) { animation-delay: 0.23s; }
.stat-card:nth-child(8) { animation-delay: 0.26s; }

.stat-icon {
    grid-row: span 2;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--primary);
    background: rgba(13, 74, 147, 0.09);
    border-radius: 50%;
}

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

.stat-card .stat-label {
    display: block;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.stat-card strong {
    display: block;
    margin-top: 5px;
    min-width: 0;
    color: var(--primary);
    font-family: "Geist", Arial, sans-serif;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
    direction: ltr;
    overflow-wrap: anywhere;
}

.skeleton-card span,
.skeleton-card strong,
.panel-loader span {
    display: block;
    border-radius: 8px;
    background: linear-gradient(90deg, #edf3fa 0%, #ffffff 50%, #edf3fa 100%);
    background-size: 220% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-card {
    display: block;
}

.skeleton-card span {
    width: 80%;
    height: 13px;
}

.skeleton-card strong {
    width: 62%;
    height: 20px;
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.workspace-grid {
    display: block;
}

.workspace-main {
    min-height: 560px;
}

.exchange-entry-shell .topbar {
    margin-bottom: 14px;
}

.exchange-entry-shell .workspace-main {
    min-height: auto;
}

.exchange-entry-workspace {
    display: grid;
    gap: 14px;
}

.exchange-entry-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 2px 0;
}

.exchange-entry-head p {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 850;
}

.exchange-entry-head h1 {
    margin: 2px 0 0;
    color: var(--ink);
    font-size: 24px;
    font-weight: 880;
}

.exchange-entry-head span {
    max-width: 520px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-align: end;
}

.forms-only-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    grid-auto-rows: 520px;
    gap: 14px;
    align-items: start;
}

.panel-loader,
.empty-state {
    display: grid;
    place-items: center;
    min-height: 420px;
    gap: 12px;
    color: var(--muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 22px;
    animation: fadeSlideUp 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.panel-loader span {
    width: min(420px, 90%);
    height: 14px;
}

.module-workspace,
.utility-workspace {
    display: grid;
    grid-template-columns: minmax(340px, 4fr) minmax(0, 8fr);
    gap: 14px;
    align-items: start;
}

.forms-only-module {
    display: block;
    height: 100%;
    min-height: 0;
}

.form-panel,
.data-panel {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(30, 54, 88, 0.09);
    animation: fadeSlideUp 0.44s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.data-panel {
    animation-delay: 0.04s;
}

.form-panel:hover,
.data-panel:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 48px rgba(30, 54, 88, 0.11);
}

.form-panel {
    position: sticky;
    top: 12px;
    display: grid;
    gap: 12px;
    max-height: calc(100dvh - 40px);
    padding: 16px;
    overflow: auto;
}

.forms-only-module .form-panel {
    grid-template-rows: auto minmax(0, 1fr) auto;
    position: static;
    height: 100%;
    max-height: none;
    min-height: 100%;
    overflow: hidden;
}

.forms-only-module .record-form {
    min-height: 0;
    overflow-y: auto;
    padding-inline-end: 4px;
    scrollbar-color: rgba(18, 76, 136, 0.42) rgba(214, 225, 236, 0.46);
    scrollbar-width: thin;
}

.forms-only-module .record-form::-webkit-scrollbar {
    width: 7px;
}

.forms-only-module .record-form::-webkit-scrollbar-track {
    background: rgba(214, 225, 236, 0.46);
    border-radius: 999px;
}

.forms-only-module .record-form::-webkit-scrollbar-thumb {
    background: rgba(18, 76, 136, 0.42);
    border-radius: 999px;
}

.forms-only-module .form-actions {
    margin-top: 0;
}

.data-panel {
    min-width: 0;
    padding: 16px;
    overflow: hidden;
}

.data-panel.records-modal-workspace {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.data-panel.records-modal-workspace:hover {
    background: transparent;
    box-shadow: none;
}

.section-head,
.listing-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.section-head {
    margin-bottom: 2px;
}

.listing-head {
    margin-bottom: 10px;
}

.section-head p,
.listing-head p,
.backup-panel p,
.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
}

.section-head h2,
.listing-head h3,
.backup-panel h3,
.brand-lockup h1 {
    margin: 2px 0 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
}

.compact-action {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.listing-head h3 {
    font-size: 17px;
}

.record-form,
.filter-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 20px;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.record-form:focus-within,
.filter-panel:focus-within {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(13, 74, 147, 0.18);
    box-shadow: 0 12px 28px rgba(30, 54, 88, 0.06);
}

.form-field {
    display: grid;
    gap: 4px;
}

.form-field.wide {
    grid-column: span 1;
}

.form-field label {
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.form-field input,
.form-field select,
.form-field textarea,
.date-filters input,
.backup-actions input,
.select2-container--default .select2-selection--single {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(194, 211, 230, 0.74);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    padding: 7px 9px;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.form-field textarea {
    min-height: 82px;
    resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.date-filters input:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 59, 122, 0.1);
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover,
.date-filters input:hover,
.backup-actions input:hover,
.select2-container--default .select2-selection--single:hover {
    border-color: rgba(13, 74, 147, 0.34);
}

.read-only-form {
    opacity: 0.78;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--ink);
    line-height: 26px;
    padding: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    inset-inline-end: 7px;
    inset-inline-start: auto;
    top: 8px;
}

.select2-dropdown {
    border-color: var(--line);
    border-radius: 8px;
    z-index: 2080;
}

.select2-container--open,
.app-modal .select2-container--open,
.modal .select2-container--open {
    z-index: 2080;
}

.app-modal .select2-dropdown,
.modal .select2-dropdown {
    z-index: 2090;
}

.field-error {
    min-height: 0;
    color: var(--danger);
    font-size: 11px;
}

.field-error:empty {
    display: none;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.summary-strip article,
.balance-card,
.ledger-item,
.chart-panel {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 18px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.summary-strip article:hover,
.balance-card:hover,
.ledger-item:hover,
.chart-panel:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 28px rgba(30, 54, 88, 0.08);
}

.summary-strip article {
    padding: 9px;
}

.summary-strip span,
.balance-card small,
.ledger-item small,
.slip-grid span,
.slip-lines span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.summary-strip strong,
.balance-card strong,
.ledger-item strong {
    display: block;
    margin-top: 5px;
    color: var(--primary);
    font-family: "Geist", Arial, sans-serif;
    font-weight: 800;
}

.summary-strip strong {
    font-size: 16px;
}

.form-actions {
    gap: 8px;
    padding-top: 2px;
}

.form-actions .primary-action,
.form-actions .secondary-action {
    flex: 1 1 0;
}

.primary-action,
.secondary-action,
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(30, 54, 88, 0.06);
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.primary-action {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    color: #fff;
}

.primary-action:hover {
    background: var(--primary-strong);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(13, 74, 147, 0.18);
}

.secondary-action,
.icon-btn {
    background: rgba(255, 255, 255, 0.76);
    color: var(--primary);
    border-color: var(--line);
}

.secondary-action:hover,
.icon-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(30, 54, 88, 0.1);
}

.module-tab:active,
.primary-action:active,
.secondary-action:active,
.icon-btn:active {
    transform: translateY(1px);
}

.icon-btn {
    width: 38px;
    padding: 0;
}

.icon-btn.danger,
.icon-btn.danger:hover,
.logout-btn {
    color: var(--danger);
}

.table-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.table-tools select {
    width: 150px;
}

.table-tools .select2-container {
    flex: 0 0 150px;
    width: 150px !important;
}

.table-filter-bar {
    display: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: -2px 0 10px;
    padding: 10px;
    border: 1px solid rgba(226, 235, 245, 0.92);
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.74);
}

.table-filter-bar.is-open {
    display: grid;
    animation: filterPanelIn 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.js-toggle-table-filters.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.table-filter-bar .form-field {
    gap: 3px;
}

.table-filter-bar .form-field label {
    color: #667085;
    font-size: 10px;
}

.table-filter-bar .select2-container {
    width: 100% !important;
}

.table-filter-bar .select2-container--default .select2-selection--single,
.table-filter-bar input {
    min-height: 38px;
    border-radius: 12px;
}

.date-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.table-panel {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 22px;
    overflow-x: auto;
    transition: box-shadow 0.18s ease, background 0.18s ease;
}

.table-panel:hover {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 0 0 1px rgba(13, 74, 147, 0.04);
}

.records-table {
    width: 100% !important;
    min-width: 850px;
    border-collapse: separate;
    border-spacing: 0;
}

table.dataTable > thead > tr > th,
.records-table th {
    background: #eef7ff;
    color: var(--primary);
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

table.dataTable tbody td {
    color: var(--ink);
    vertical-align: middle;
    transition: background 0.16s ease;
}

table.dataTable > thead > tr > th,
table.dataTable tbody td {
    padding: 11px 12px;
}

table.dataTable tbody tr:hover td {
    background: rgba(234, 246, 255, 0.74);
}

.dt-container .dt-layout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.dt-container .dt-layout-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dt-container .dt-search,
.dt-container .dt-length,
.dt-container .dt-info,
.dt-container .dt-paging {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
    appearance: none;
    min-height: 38px;
    border: 1px solid rgba(194, 211, 230, 0.74) !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: var(--ink) !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.dt-container .dt-search input:focus,
.dt-container .dt-length select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(18, 59, 122, 0.1) !important;
}

.dt-container .dt-search input {
    width: min(280px, 46vw);
}

.dt-container .dt-length select {
    width: 74px;
    text-align: center;
}

.dt-container .dt-paging button {
    min-width: 34px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    font-weight: 800;
}

.dt-container .dt-paging button.current,
.dt-container .dt-paging button:hover {
    background: var(--primary);
    color: #fff;
}

.table-actions {
    display: inline-flex;
    gap: 4px;
    white-space: nowrap;
    position: relative;
}

.table-actions .icon-btn {
    width: 30px;
    min-height: 30px;
    box-shadow: none;
}

.action-menu-panel {
    display: none;
    position: absolute;
    inset-block-start: calc(100% + 6px);
    inset-inline-end: 0;
    min-width: 170px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 6;
    transform-origin: top right;
}

.action-menu.open .action-menu-panel {
    display: grid;
    gap: 4px;
    animation: menuIn 0.16s ease both;
}

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    text-align: start;
}

.action-menu-item svg {
    width: 16px;
    height: 16px;
}

.action-menu-item:hover {
    background: var(--accent-soft);
    color: var(--primary);
}

.action-menu-item.danger,
.action-menu-item.danger:hover {
    color: var(--danger);
}

.status-pill {
    display: inline-flex;
    min-width: 66px;
    justify-content: center;
    border: 1px solid #cfe7da;
    border-radius: 999px;
    background: #effaf4;
    color: var(--success);
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
}

.column-menu {
    position: relative;
}

.column-menu-panel {
    display: none;
    position: absolute;
    inset-block-start: calc(100% + 6px);
    inset-inline-end: 0;
    width: 190px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 5;
    transform-origin: top right;
}

.column-menu.open .column-menu-panel {
    display: grid;
    gap: 6px;
    animation: menuIn 0.16s ease both;
}

.column-menu-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.balance-board,
.ledger-grid,
.chart-grid {
    display: grid;
    gap: 10px;
}

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

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

.balance-card,
.ledger-item {
    padding: 12px;
}

.balance-card strong,
.ledger-item strong {
    font-size: 19px;
}

.mini-ledger {
    display: grid;
    gap: 8px;
}

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

.chart-panel {
    min-height: 290px;
    padding: 12px;
}

.chart-panel.wide {
    grid-column: span 2;
}

.chart-panel h3 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
}

.chart-panel canvas {
    width: 100% !important;
    max-height: 238px;
}

.backup-panel {
    display: grid;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
}

.backup-panel span {
    color: var(--muted);
    font-size: 12px;
}

.backup-panel form {
    display: grid;
    gap: 8px;
}

.modal-backdrop {
    background: rgba(15, 23, 42, 0.34);
    opacity: 1 !important;
    backdrop-filter: blur(12px) saturate(1.05);
    -webkit-backdrop-filter: blur(12px) saturate(1.05);
}

body.modal-open {
    padding-right: 0 !important;
    overflow: hidden;
}

body.modal-open .app-shell {
    filter: blur(2px);
    transition: filter 0.18s ease;
}

body.modal-open .premium-shell {
    filter: blur(2px);
    transition: filter 0.18s ease;
}

.app-modal {
    pointer-events: auto;
    direction: rtl;
    text-align: right;
}

html[dir="ltr"] .app-modal {
    direction: ltr;
    text-align: left;
}

.app-modal .modal-dialog {
    pointer-events: auto;
    width: min(1180px, calc(100vw - 32px));
    margin-inline: auto;
    transform: translateY(12px) scale(0.985);
    transition: transform 0.24s ease, opacity 0.24s ease;
}

.app-modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.modal-content {
    max-height: min(84dvh, 820px);
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(30, 54, 88, 0.22);
    overflow: hidden;
    direction: inherit;
    text-align: inherit;
}

#recordsTableModal .modal-dialog {
    max-width: 1180px;
}

#recordsTableModal .modal-body {
    overflow: auto;
}

.modal-header,
.modal-footer {
    border-color: var(--line);
}

.modal-header {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
}

.modal-title {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 850;
    text-align: start;
}

.modal-body {
    direction: inherit;
    text-align: inherit;
}

.modal-footer {
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 18px;
}

html[dir="ltr"] .modal-footer {
    justify-content: flex-end;
}

.print-slip {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: #fff;
    direction: rtl;
    text-align: right;
}

.slip-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 72px;
    gap: 12px;
    align-items: center;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 12px;
    margin-bottom: 14px;
    direction: rtl;
    text-align: right;
}

.slip-head img {
    grid-column: 3;
    grid-row: 1;
    width: 72px;
    height: 64px;
    object-fit: contain;
}

.slip-head > div {
    grid-column: 2;
    min-width: 0;
}

.slip-head h2 {
    margin: 0;
    color: var(--primary);
    font-family: "Geist", Arial, sans-serif;
}

.slip-head p {
    margin: 0;
    color: var(--muted);
}

.slip-head strong {
    grid-column: 1;
    color: var(--accent);
    font-family: "Geist", Arial, sans-serif;
    text-align: left;
    direction: ltr;
}

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

.slip-grid div,
.slip-lines div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    text-align: right;
}

.slip-grid .wide {
    grid-column: span 3;
}

.slip-grid strong,
.slip-lines strong {
    display: block;
    margin-top: 5px;
    color: var(--ink);
    direction: inherit;
    unicode-bidi: plaintext;
    word-break: break-word;
}

.slip-lines {
    margin-top: 10px;
}

.signature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 36px;
}

.signature-grid div {
    min-height: 70px;
    border-top: 1px solid var(--ink);
    color: var(--muted);
    padding-top: 8px;
    text-align: center;
}

/* Minimal daily-use refinement */
.topbar,
.hero-dashboard,
.progress-meters article,
.hero-metrics article,
.stat-card,
.form-panel,
.data-panel {
    animation: none;
}

.tab-rail,
.date-stack,
.user-chip,
.status-chip,
.language-select,
.welcome-panel,
.hero-metrics article,
.stat-card,
.form-panel,
.data-panel,
.summary-strip article,
.balance-card,
.ledger-item,
.chart-panel,
.table-panel {
    box-shadow: none;
}

.tab-rail {
    background: #fff;
    border-color: var(--line-soft);
}

.module-tab {
    min-height: 32px;
    padding: 6px 11px;
    font-size: 11px;
}

.module-tab:hover,
.module-tab.active {
    box-shadow: none;
}

.date-stack,
.user-chip,
.status-chip,
.language-select {
    min-height: 34px;
    border-color: var(--line-soft);
    background: #fff;
}

.hero-dashboard {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
    gap: 12px;
    padding: 12px 0;
}

.welcome-panel {
    min-height: 138px;
    padding: 16px;
    background: #fff;
    border-color: var(--line-soft);
    border-radius: 18px;
}

.welcome-panel h1 {
    font-size: 30px;
    font-weight: 700;
}

.welcome-panel p,
.welcome-panel > span,
.progress-meters small,
.hero-metrics span,
.stat-card .stat-label {
    color: var(--muted);
}

.progress-meters {
    gap: 8px;
    margin-top: 18px;
}

.meter {
    height: 12px;
    background: #e8eef5;
}

.meter span {
    background: var(--primary);
}

.meter.muted span {
    background: #cbd6e3;
}

.hero-metrics {
    gap: 8px;
}

.hero-metrics article {
    min-height: 104px;
    padding: 12px 8px;
    background: #fff;
    border-color: var(--line-soft);
    border-radius: 16px;
}

.hero-metrics article:hover,
.stat-card:hover,
.summary-strip article:hover,
.balance-card:hover,
.ledger-item:hover,
.chart-panel:hover,
.form-panel:hover,
.data-panel:hover {
    transform: none;
    box-shadow: none;
    background: #fff;
}

.hero-metrics strong {
    font-size: 22px;
}

.hero-metrics strong small {
    font-size: 12px;
}

.stats-grid {
    gap: 8px;
    margin: 8px 0 14px;
}

.stat-card {
    min-height: 58px;
    padding: 8px 10px;
    background: #fff;
    border-color: var(--line-soft);
    border-radius: 14px;
}

.stat-icon {
    width: 30px;
    height: 30px;
    background: var(--accent-soft);
    border-radius: 10px;
}

.module-workspace,
.utility-workspace {
    gap: 12px;
}

.form-panel,
.data-panel {
    background: #fff;
    border-color: var(--line-soft);
    border-radius: 18px;
}

.form-panel,
.data-panel {
    padding: 14px;
}

.section-head,
.listing-head {
    padding: 10px 12px;
    border: 1px solid rgba(18, 76, 136, 0.18);
    border-radius: 14px;
    background:
        radial-gradient(circle at 12% 20%, rgba(245, 166, 35, 0.22), transparent 34%),
        radial-gradient(circle at 88% 18%, rgba(15, 118, 110, 0.17), transparent 32%),
        linear-gradient(135deg, rgba(18, 76, 136, 0.14), rgba(226, 242, 255, 0.72)),
        #f7fbff;
}

.section-head p,
.listing-head p {
    color: #0f766e;
}

.record-form,
.filter-panel {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.record-form:focus-within,
.filter-panel:focus-within {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.form-field input,
.form-field select,
.form-field textarea,
.date-filters input,
.backup-actions input,
.select2-container--default .select2-selection--single {
    min-height: 40px;
    border-color: #d6e1ec;
    border-radius: 12px;
}

.summary-strip article,
.balance-card,
.ledger-item,
.chart-panel {
    background: #f8fbfe;
    border-color: var(--line-soft);
    border-radius: 12px;
}

.primary-action {
    background: var(--primary);
}

.primary-action:hover {
    background: var(--primary-strong);
    box-shadow: none;
}

.primary-action,
.secondary-action,
.icon-btn {
    box-shadow: none;
}

.secondary-action,
.icon-btn {
    border-color: var(--line-soft);
    background: #fff;
}

.secondary-action:hover,
.icon-btn:hover {
    box-shadow: none;
}

.table-panel {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.table-panel:hover {
    background: transparent;
    box-shadow: none;
}

table.dataTable > thead > tr > th,
.records-table th {
    background: #f1f6fb;
}

.modal-content,
.login-panel {
    box-shadow: 0 16px 42px rgba(31, 48, 68, 0.12);
}

@keyframes shellIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes softScale {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes meterSweep {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes menuIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes filterPanelIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fourthSurfaceIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes statusPulse {
    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(20, 114, 77, 0.1);
    }
    50% {
        box-shadow: 0 0 0 7px rgba(20, 114, 77, 0.04);
    }
}

.auth-screen {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    background: var(--surface-soft);
}

.login-shell {
    width: min(520px, calc(100% - 28px));
}

.login-panel {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-lockup span,
.demo-users,
.check-row {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-users {
    display: grid;
    gap: 4px;
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.demo-users strong {
    color: var(--primary);
}

html[dir="ltr"] .mis-body {
    direction: ltr;
}

/* Premium second view */
.premium-view-body {
    min-height: 100dvh;
    overflow: hidden;
    background:
        linear-gradient(145deg, #cfd8e4 0%, #edf2f7 48%, #87d8d5 100%);
}

.premium-shell {
    display: flex;
    flex-direction: column;
    width: min(1420px, calc(100% - 52px));
    height: calc(100dvh - 28px);
    margin: 28px auto 0;
    padding: 18px 18px 12px;
    overflow: hidden;
    background: #f8fafc;
    border: 0;
    border-radius: 32px;
    box-shadow: 0 34px 90px rgba(15, 23, 42, 0.24);
    animation: premiumIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.premium-topbar,
.premium-brand,
.premium-nav,
.premium-top-actions,
.premium-card-head,
.premium-card-actions,
.premium-module-top,
.premium-module-actions,
.premium-module-meta {
    display: flex;
    align-items: center;
}

.premium-topbar {
    flex: 0 0 auto;
    direction: inherit;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.premium-brand {
    gap: 9px;
    min-width: 172px;
    color: #101828;
    text-decoration: none;
}

.premium-brand span {
    display: grid;
    gap: 2px;
    text-align: start;
}

.premium-brand strong {
    color: #124c88;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.05;
}

.premium-brand small {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.premium-home-dot,
.premium-icon-btn,
.premium-card-icon,
.premium-module-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.premium-home-dot {
    width: 34px;
    height: 34px;
    border: 1px solid #d7e2ee;
    border-radius: 50%;
    background: #e9fbf8;
    color: #0f766e;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.premium-home-dot:hover,
.premium-icon-btn:hover,
.premium-nav a:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.premium-nav {
    flex: 0 0 auto;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    max-width: 440px;
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
}

.premium-nav a,
.premium-nav span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 7px 13px;
    border-radius: 999px;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.18s ease, color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.premium-nav .active {
    background: #101828;
    color: #fff;
}

.premium-top-actions {
    flex: 0 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.premium-status-chip,
.premium-language,
.premium-action-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #0f766e;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
}

.premium-action-pill {
    color: #fff;
    background: #101828;
    border-color: #101828;
    padding-inline: 12px;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, background 0.22s ease;
}

.premium-action-pill.ghost {
    background: #fff;
    color: #124c88;
    border-color: #d7e2ee;
}

.premium-action-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.premium-action-pill:active,
.premium-icon-btn:active,
.premium-home-dot:active {
    transform: translateY(1px) scale(0.98);
}

.premium-status-chip {
    gap: 7px;
}

.premium-status-chip.offline {
    color: var(--danger);
}

.premium-language {
    width: 86px;
    color: #111827;
}

.premium-logo {
    width: 94px;
    height: 46px;
    object-fit: contain;
    border-radius: 0;
}

.premium-dashboard {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(330px, 0.98fr) minmax(420px, 1.28fr) minmax(270px, 0.78fr);
    grid-template-rows: minmax(0, 0.82fr) minmax(0, 1fr);
    grid-template-areas:
        "exchange rates date"
        "modules modules modules";
    gap: 14px;
}

.premium-hero-card,
.premium-date-card,
.premium-stat-strip,
.premium-rates-card,
.premium-module-card,
.premium-payroll-card,
.premium-dark-card {
    min-width: 0;
    border: 1px solid #e5edf5;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.premium-hero-card:hover,
.premium-date-card:hover,
.premium-rates-card:hover,
.premium-module-card:hover,
.premium-payroll-card:hover,
.premium-dark-card:hover {
    transform: translateY(-3px);
    border-color: #d5e3f0;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.12);
}

.premium-hero-card,
.premium-date-card,
.premium-stat-strip,
.premium-exchange-card,
.premium-rates-card,
.premium-module-card,
.premium-payroll-card {
    animation: premiumPanelIn 0.58s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.premium-date-card { animation-delay: 0.04s; }
.premium-stat-strip { animation-delay: 0.08s; }
.premium-exchange-card { animation-delay: 0.12s; }
.premium-rates-card { animation-delay: 0.16s; }
.premium-module-card { animation-delay: calc(0.16s + (var(--i, 0) * 0.035s)); }
.premium-payroll-card { animation-delay: 0.22s; }

.premium-hero-card {
    grid-area: hero;
    display: grid;
    grid-template-columns: minmax(300px, 0.82fr) minmax(360px, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "flow copy"
        "kpis copy";
    gap: 20px;
    align-items: stretch;
    min-height: 168px;
    padding: 20px 22px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 247, 255, 0.86)),
        #fff;
}

html[dir="ltr"] .premium-hero-card {
    grid-template-columns: minmax(360px, 1fr) minmax(300px, 0.82fr);
    grid-template-areas:
        "copy flow"
        "copy kpis";
}

.premium-hero-copy {
    grid-area: copy;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
}

.premium-hero-copy p,
.premium-card-head p,
.premium-module-top p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.premium-hero-copy h1 {
    margin: 8px 0 4px;
    color: #101828;
    font-size: 32px;
    font-weight: 760;
    line-height: 1.08;
}

.premium-hero-copy > span {
    display: block;
    color: #667085;
    font-size: 13px;
    font-weight: 750;
}

.premium-hero-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.premium-hero-badges span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid #dce8f3;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #0f766e;
    font-size: 11px;
    font-weight: 820;
}

.premium-hero-badges svg {
    width: 15px;
    height: 15px;
}

.premium-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.premium-hero-actions .primary-action,
.premium-hero-actions .secondary-action {
    min-height: 36px;
    border-radius: 999px;
    padding-inline: 13px;
}

.premium-hero-flow {
    grid-area: flow;
    display: grid;
    gap: 9px;
    align-self: start;
    padding: 11px 12px;
    border: 1px solid #e2eaf3;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(237, 248, 246, 0.72)),
        #fff;
}

.premium-flow-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.premium-flow-head span {
    color: #667085;
    font-size: 11px;
    font-weight: 850;
}

.premium-flow-head strong {
    color: #101828;
    font-family: "Geist", Arial, sans-serif;
    font-size: 15px;
    font-weight: 850;
    direction: ltr;
}

.premium-flow-bars {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    align-items: end;
    gap: 6px;
    height: 44px;
}

.premium-flow-bars span {
    min-height: 10px;
    border-radius: 999px 999px 5px 5px;
    background: linear-gradient(180deg, #8ee5df, #155ea8);
    transform-origin: bottom;
    animation: barRise 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.premium-hero-kpis {
    grid-area: kpis;
    display: grid;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 10px;
    align-self: end;
}

.premium-hero-kpis article {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e5edf5;
    border-radius: 18px;
    background: #fff;
}

.premium-hero-kpis article > span,
.premium-date-list article > span,
.premium-dark-metrics article > span,
.premium-rate-list article > span,
.premium-mini-ledger article > span,
.premium-module-meta > span {
    display: block;
    color: #667085;
    font-size: 11px;
    font-weight: 800;
}

.premium-hero-kpis strong,
.premium-date-list strong,
.premium-dark-metrics strong,
.premium-rate-list strong,
.premium-mini-ledger strong,
.premium-module-meta strong {
    display: block;
    margin-top: 5px;
    color: #101828;
    font-family: "Geist", Arial, sans-serif;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.12;
    direction: ltr;
    overflow-wrap: anywhere;
}

.premium-date-card {
    grid-area: date;
    display: grid;
    align-content: start;
    gap: 9px;
    padding: 12px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 255, 0.86)),
        #fff;
}

.premium-card-head {
    justify-content: space-between;
    gap: 12px;
}

.premium-card-head > div {
    min-width: 0;
    flex: 1 1 auto;
}

.premium-card-head h2 {
    margin: 4px 0 0;
    color: #101828;
    font-size: 20px;
    font-weight: 850;
    line-height: 1.15;
}

.premium-card-icon,
.premium-module-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: #edf8f6;
    color: #0f766e;
}

.premium-card-icon.light {
    background: rgba(255, 255, 255, 0.14);
    color: #d7fffb;
}

.premium-date-list,
.premium-rate-list,
.premium-mini-ledger {
    display: grid;
    gap: 9px;
}

.premium-date-card .premium-card-head {
    padding: 11px 12px;
    border: 1px solid #e1ebf5;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(18, 76, 136, 0.08), rgba(245, 166, 35, 0.08)),
        #fff;
}

.premium-date-card .premium-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 17px;
    background: #e9f5fb;
    color: #124c88;
}

.premium-date-list article,
.premium-rate-list article,
.premium-mini-ledger article {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    background: #fbfdff;
}

.premium-date-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-color: #dfeaf4;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 254, 0.74)),
        #fff;
}

.premium-date-list strong {
    margin: 0;
    font-size: 16px;
    text-align: end;
}

.premium-stat-strip {
    grid-area: stats;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.premium-stat-strip article {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    background: #fbfdff;
    animation: premiumPanelIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(0.12s + (var(--i, 0) * 0.045s));
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.premium-stat-strip article:hover {
    transform: translateY(-2px);
    background: #fff;
    border-color: #d7e2ee;
}

.premium-stat-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 14px;
    background: #edf8f6;
    color: #0f766e;
}

.premium-stat-strip div {
    min-width: 0;
}

.premium-stat-strip small {
    display: block;
    color: #667085;
    font-size: 10px;
    font-weight: 820;
}

.premium-stat-strip strong {
    display: block;
    margin-top: 4px;
    color: #101828;
    font-family: "Geist", Arial, sans-serif;
    font-size: 14px;
    font-weight: 850;
    direction: ltr;
    overflow-wrap: anywhere;
}

.premium-exchange-card {
    grid-area: exchange;
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 0;
    padding: 16px;
}

.premium-dark-card {
    background:
        radial-gradient(circle at 16% 18%, rgba(245, 166, 35, 0.22), transparent 30%),
        linear-gradient(135deg, #0b3564 0%, #124c88 64%, #f5a623 190%);
    border-color: rgba(245, 166, 35, 0.36);
    color: #fff;
}

.premium-dark-card .premium-card-head h2,
.premium-dark-card .premium-dark-metrics strong {
    color: #fff;
}

.premium-dark-card .premium-card-head p,
.premium-dark-card .premium-dark-metrics span {
    color: rgba(255, 255, 255, 0.72);
}

.premium-card-actions {
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.premium-icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #dfe8f1;
    border-radius: 50%;
    background: #fff;
    color: #124c88;
    padding: 0;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.premium-icon-btn.light {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.premium-icon-btn.danger {
    color: var(--danger);
}

.premium-sparkline {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    align-items: end;
    gap: 7px;
    height: 74px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(5, 34, 72, 0.56);
    overflow: hidden;
}

.premium-sparkline span {
    display: block;
    min-height: 14px;
    border-radius: 999px 999px 4px 4px;
    background: linear-gradient(180deg, #f7c75e 0%, #f59e0b 24%, #55d6e7 100%);
    transform-origin: bottom;
    animation: barRise 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both, premiumBarBreathe 3.6s ease-in-out 0.8s infinite;
}

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

.premium-dark-metrics article {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
}

.premium-rates-card {
    grid-area: rates;
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 16px;
}

.premium-rate-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.premium-rate-list small {
    display: block;
    margin-top: 3px;
    color: #8a97a8;
    font-size: 10px;
    font-weight: 750;
}

.premium-rate-card {
    cursor: text;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.premium-rate-card:hover,
.premium-rate-card.is-editing {
    transform: translateY(-2px);
    border-color: #cfe0ef;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 12px 26px rgba(15, 23, 42, 0.08);
}

.premium-rate-input {
    display: none;
    width: 100%;
    margin-top: 5px;
    border: 0;
    border-bottom: 1px solid #cfe0ef;
    border-radius: 0;
    background: transparent;
    color: #101828;
    font-family: "Geist", Arial, sans-serif;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.12;
    direction: ltr;
    outline: none;
    padding: 0 0 4px;
}

.premium-rate-card:hover .js-rate-value,
.premium-rate-card.is-editing .js-rate-value {
    display: none;
}

.premium-rate-card:hover .premium-rate-input,
.premium-rate-card.is-editing .premium-rate-input {
    display: block;
}

.premium-module-board {
    grid-area: modules;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(132px, 1fr);
    gap: 12px;
    width: 100%;
    min-height: 0;
    overflow: auto;
    padding-inline-end: 2px;
    align-items: stretch;
    scrollbar-width: thin;
}

.premium-module-card {
    position: relative;
    display: grid;
    gap: 14px;
    min-height: 132px;
    height: 100%;
    padding: 16px;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 254, 0.86)),
        #fff;
}

.premium-module-card::before,
.premium-module-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.premium-module-card::before {
    background:
        radial-gradient(circle at 18px 18px, hsla(var(--module-hue), 72%, 45%, 0.12) 0 2px, transparent 2.5px),
        linear-gradient(135deg, hsla(var(--module-hue), 72%, 48%, 0.11), transparent 42%);
    background-size: 34px 34px, 100% 100%;
    opacity: 0.72;
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-module-card::after {
    inset: -35% auto auto -24%;
    width: 52%;
    height: 170%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
    opacity: 0;
    transform: translateX(-42%) rotate(18deg);
    transition: opacity 0.2s ease, transform 0.52s cubic-bezier(0.16, 1, 0.3, 1);
}

html[dir="rtl"] .premium-module-card::after {
    right: -24%;
    left: auto;
    transform: translateX(42%) rotate(-18deg);
}

.premium-module-card > * {
    position: relative;
    z-index: 1;
}

.premium-module-card:hover,
.premium-module-card:focus-within {
    transform: translateY(-5px);
}

.premium-module-card:hover::before,
.premium-module-card:focus-within::before {
    opacity: 1;
    transform: scale(1.06);
}

.premium-module-card:hover::after,
.premium-module-card:focus-within::after {
    opacity: 1;
    transform: translateX(164%) rotate(18deg);
}

html[dir="rtl"] .premium-module-card:hover::after,
html[dir="rtl"] .premium-module-card:focus-within::after {
    transform: translateX(-164%) rotate(-18deg);
}

.premium-module-card:hover .premium-module-icon,
.premium-module-card:focus-within .premium-module-icon {
    transform: none;
}

.premium-module-card.featured {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(232, 247, 245, 0.9)),
        #fff;
}

.premium-module-top {
    gap: 10px;
    min-width: 0;
}

.premium-module-icon {
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease, color 0.18s ease;
}

.premium-module-top h3 {
    margin: 0 0 2px;
    color: #101828;
    font-size: 17px;
    font-weight: 850;
}

.premium-module-top p {
    line-height: 1.35;
}

.premium-module-meta {
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding-top: 4px;
}

.premium-module-actions {
    justify-content: space-between;
    gap: 8px;
    align-self: end;
}

.premium-module-actions .secondary-action {
    min-height: 38px;
    border-radius: 999px;
}

.premium-payroll-card {
    grid-area: payroll;
    display: grid;
    gap: 15px;
    align-content: start;
    padding: 18px;
}

.create-form-modal-body .forms-only-module {
    height: auto;
}

.create-form-modal-body .create-modal-module .section-head.compact {
    display: none;
}

.create-form-modal-body .forms-only-module .form-panel {
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.create-form-modal-body .forms-only-module .record-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
    max-height: min(58dvh, 560px);
    padding-inline-end: 6px;
}

.create-form-modal-body .forms-only-module .form-field.wide {
    grid-column: 1 / -1;
}

.create-form-modal-body .forms-only-module .form-field textarea {
    min-height: 96px;
}

.treasury-secret-value {
    position: relative;
}

.treasury-secret-value .treasury-real {
    display: none;
}

.treasury-sensitive-card:hover .treasury-mask,
.treasury-sensitive-card:focus .treasury-mask,
.treasury-sensitive-card:focus-within .treasury-mask,
.treasury-sensitive-card.is-revealed .treasury-mask {
    display: none;
}

.treasury-sensitive-card:hover .treasury-real,
.treasury-sensitive-card:focus .treasury-real,
.treasury-sensitive-card:focus-within .treasury-real,
.treasury-sensitive-card.is-revealed .treasury-real {
    display: block;
    animation: premiumReveal 0.2s ease both;
}

.treasury-sensitive-card:focus {
    outline: 2px solid rgba(96, 165, 250, 0.44);
    outline-offset: 3px;
}

/* Third view */
.third-view-body {
    height: 100dvh;
    overflow: hidden;
    background:
        radial-gradient(circle at 7% 32%, rgba(18, 76, 136, 0.14), transparent 22%),
        radial-gradient(circle at 92% 8%, rgba(245, 166, 35, 0.18), transparent 26%),
        radial-gradient(circle at 82% 90%, rgba(15, 118, 110, 0.16), transparent 28%),
        linear-gradient(145deg, #e9edf9 0%, #f7fbff 46%, #dcefed 100%);
}

.third-shell {
    position: relative;
    display: block;
    width: min(1500px, calc(100% - 46px));
    height: calc(100dvh - 34px);
    margin: 17px auto 0;
    overflow: visible;
}

.third-topbar,
.third-brand,
.third-view-switch,
.third-actions,
.third-form-menu {
    display: flex;
    align-items: center;
}

.third-main-surface {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(240, 247, 255, 0.7)),
        rgba(244, 248, 255, 0.78);
    box-shadow: 0 28px 80px rgba(39, 62, 102, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
}

.third-topbar {
    flex: 0 0 auto;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.third-brand {
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
}

.third-brand img {
    width: 98px;
    height: 48px;
    object-fit: contain;
}

.third-brand span {
    display: grid;
    gap: 2px;
}

.third-brand strong {
    color: #124c88;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.08;
}

.third-brand small,
.third-clock small {
    color: #667085;
    font-size: 11px;
    font-weight: 800;
}

.third-view-switch {
    justify-content: center;
    gap: 6px;
    padding: 5px;
    border: 1px solid rgba(219, 231, 243, 0.72);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.third-view-switch a,
.third-view-switch span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 13px;
    border-radius: 999px;
    color: #667085;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.third-view-switch span {
    background: #124c88;
    color: #fff;
    box-shadow: 0 12px 26px rgba(18, 76, 136, 0.18);
}

.third-actions {
    justify-content: flex-end;
    gap: 8px;
}

.third-clock {
    display: grid;
    min-width: 112px;
    padding: 6px 12px;
    border: 1px solid rgba(219, 231, 243, 0.76);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.third-clock span {
    color: #101828;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
}

.third-form-menu {
    flex: 0 0 auto;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    overflow-x: auto;
    border: 1px solid rgba(219, 231, 243, 0.72);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
    scrollbar-width: thin;
}

.third-form-tab {
    flex: 0 0 auto;
    min-height: 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(214, 225, 236, 0.86);
}

.third-form-tab.active {
    background: linear-gradient(135deg, #124c88, #0f766e);
    color: #fff;
    border-color: transparent;
}

.third-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.third-content .module-workspace {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(290px, 4fr) minmax(0, 8fr);
    align-items: stretch;
}

.third-content .form-panel,
.third-content .data-panel {
    min-height: 0;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 18px 46px rgba(39, 62, 102, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.third-content .form-panel {
    position: static;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    max-height: none;
    overflow: hidden;
}

.third-content .record-form {
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.third-content .data-panel {
    display: flex;
    flex-direction: column;
}

.third-content .table-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.third-content .dt-container {
    min-height: 100%;
}

.third-content .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fourth-view-body {
    background:
        radial-gradient(circle at 12% 16%, rgba(18, 76, 136, 0.1), transparent 24%),
        radial-gradient(circle at 86% 14%, rgba(245, 166, 35, 0.14), transparent 24%),
        linear-gradient(145deg, #eef4fb 0%, #fbfdff 48%, #e5f4f2 100%);
}

.fourth-shell {
    width: min(1540px, calc(100% - 64px));
    height: calc(100dvh - 48px);
    margin-top: 24px;
}

.fourth-main-surface {
    padding: 24px;
    border-radius: 34px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 249, 255, 0.74)),
        rgba(255, 255, 255, 0.82);
    box-shadow: 0 32px 90px rgba(39, 62, 102, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.94);
    animation: fourthSurfaceIn 0.46s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.fourth-topbar {
    gap: 16px;
    margin-bottom: 20px;
}

.fourth-module-picker {
    display: grid;
    gap: 5px;
    min-width: min(320px, 30vw);
    padding: 9px 14px;
    border: 1px solid rgba(219, 231, 243, 0.8);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.fourth-module-picker label {
    color: #667085;
    font-size: 11px;
    font-weight: 850;
}

.fourth-module-select {
    width: 100%;
    min-height: 36px;
    border: 0;
    background: transparent;
    color: #101828;
    font-weight: 900;
    outline: none;
}

.fourth-view-switch {
    flex: 0 1 auto;
}

.fourth-content {
    padding-top: 2px;
}

.fourth-content .module-workspace {
    gap: 18px;
    grid-template-columns: minmax(320px, 3.8fr) minmax(0, 8.2fr);
}

.fourth-content .form-panel,
.fourth-content .data-panel {
    border: 1px solid rgba(181, 202, 225, 0.72);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(247, 251, 255, 0.76)),
        rgba(255, 255, 255, 0.82);
    box-shadow:
        0 22px 58px rgba(39, 62, 102, 0.14),
        0 1px 0 rgba(255, 255, 255, 0.96) inset,
        0 0 0 1px rgba(255, 255, 255, 0.48) inset;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.fourth-content .form-panel:hover,
.fourth-content .data-panel:hover {
    transform: translateY(-2px);
    border-color: rgba(18, 76, 136, 0.24);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(249, 252, 255, 0.84)),
        rgba(255, 255, 255, 0.88);
    box-shadow:
        0 28px 70px rgba(39, 62, 102, 0.17),
        0 1px 0 rgba(255, 255, 255, 0.98) inset,
        0 0 0 1px rgba(255, 255, 255, 0.58) inset;
}

html[data-theme="dark"] .fourth-view-body {
    background:
        radial-gradient(circle at 12% 16%, rgba(96, 165, 250, 0.12), transparent 24%),
        radial-gradient(circle at 86% 14%, rgba(245, 166, 35, 0.11), transparent 24%),
        linear-gradient(145deg, #101827 0%, #111827 48%, #123338 100%);
}

html[data-theme="dark"] .fourth-main-surface,
html[data-theme="dark"] .fourth-module-picker {
    background: rgba(17, 24, 39, 0.82);
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .fourth-module-select {
    color: #e7edf6;
}

html[data-theme="dark"] .fourth-content .form-panel,
html[data-theme="dark"] .fourth-content .data-panel {
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(17, 24, 39, 0.78)),
        rgba(15, 23, 42, 0.82);
    border-color: rgba(148, 163, 184, 0.34);
    box-shadow:
        0 24px 64px rgba(2, 6, 23, 0.36),
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

html[data-theme="dark"] .third-view-body {
    background:
        radial-gradient(circle at 7% 32%, rgba(96, 165, 250, 0.12), transparent 22%),
        radial-gradient(circle at 92% 8%, rgba(245, 166, 35, 0.13), transparent 26%),
        radial-gradient(circle at 82% 90%, rgba(45, 212, 191, 0.12), transparent 28%),
        linear-gradient(145deg, #101827 0%, #111827 50%, #123338 100%);
}

html[data-theme="dark"] .third-main-surface,
html[data-theme="dark"] .third-shell,
html[data-theme="dark"] .third-form-menu,
html[data-theme="dark"] .third-view-switch,
html[data-theme="dark"] .third-clock {
    background: rgba(17, 24, 39, 0.84);
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .third-clock span,
html[data-theme="dark"] .third-brand strong {
    color: #e7edf6;
}

html[data-theme="dark"] .third-view-switch span {
    background: linear-gradient(135deg, #dcecff, #8fe7dc);
    color: #101827;
}

html[data-theme="dark"] .third-form-tab {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.24);
    color: #a8b3c4;
}

html[data-theme="dark"] .third-form-tab.active {
    background: linear-gradient(135deg, #dcecff, #8fe7dc);
    color: #101827;
}

html[data-theme="dark"] .premium-view-body {
    background:
        radial-gradient(circle at 12% 12%, rgba(45, 212, 191, 0.12), transparent 28%),
        radial-gradient(circle at 86% 8%, rgba(96, 165, 250, 0.13), transparent 26%),
        linear-gradient(145deg, #0d1523 0%, #111827 52%, #123338 100%);
}

html[data-theme="dark"] .premium-shell {
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 34px 92px rgba(2, 6, 23, 0.48);
}

html[data-theme="dark"] .premium-brand,
html[data-theme="dark"] .premium-card-head h2,
html[data-theme="dark"] .premium-module-top h3,
html[data-theme="dark"] .premium-hero-copy h1,
html[data-theme="dark"] .premium-hero-kpis strong,
html[data-theme="dark"] .premium-date-list strong,
html[data-theme="dark"] .premium-rate-list strong,
html[data-theme="dark"] .premium-mini-ledger strong,
html[data-theme="dark"] .premium-module-meta strong,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .listing-head h3,
html[data-theme="dark"] .form-field label,
html[data-theme="dark"] .modal-title {
    color: #e7edf6;
}

html[data-theme="dark"] .premium-brand strong {
    color: #a7d0fb;
}

html[data-theme="dark"] .premium-brand small,
html[data-theme="dark"] .premium-hero-copy p,
html[data-theme="dark"] .premium-card-head p,
html[data-theme="dark"] .premium-module-top p,
html[data-theme="dark"] .premium-hero-copy > span,
html[data-theme="dark"] .premium-hero-kpis article > span,
html[data-theme="dark"] .premium-date-list article > span,
html[data-theme="dark"] .premium-rate-list article > span,
html[data-theme="dark"] .premium-mini-ledger article > span,
html[data-theme="dark"] .premium-module-meta > span,
html[data-theme="dark"] .premium-rate-list small {
    color: #9ca8ba;
}

html[data-theme="dark"] .premium-nav,
html[data-theme="dark"] .premium-status-chip,
html[data-theme="dark"] .premium-language,
html[data-theme="dark"] .premium-home-dot,
html[data-theme="dark"] .premium-action-pill.ghost,
html[data-theme="dark"] .premium-icon-btn,
html[data-theme="dark"] .premium-date-card,
html[data-theme="dark"] .premium-rates-card,
html[data-theme="dark"] .premium-module-card,
html[data-theme="dark"] .premium-payroll-card,
html[data-theme="dark"] .premium-date-list article,
html[data-theme="dark"] .premium-rate-list article,
html[data-theme="dark"] .premium-mini-ledger article,
html[data-theme="dark"] .premium-hero-flow,
html[data-theme="dark"] .premium-hero-kpis article {
    background: rgba(17, 24, 39, 0.82);
    border-color: rgba(148, 163, 184, 0.24);
    color: #e7edf6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 48px rgba(2, 6, 23, 0.24);
}

html[data-theme="dark"] .premium-nav .active,
html[data-theme="dark"] .premium-action-pill {
    background: #e7edf6;
    border-color: #e7edf6;
    color: #101827;
}

html[data-theme="dark"] .premium-date-card .premium-card-head,
html[data-theme="dark"] .premium-date-list article {
    background:
        linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(245, 166, 35, 0.08)),
        rgba(15, 23, 42, 0.74);
    border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .premium-date-card .premium-card-icon {
    background: rgba(96, 165, 250, 0.14);
    color: #9cc9f6;
}

html[data-theme="dark"] .premium-card-icon,
html[data-theme="dark"] .premium-module-icon,
html[data-theme="dark"] .premium-stat-icon {
    background: rgba(45, 212, 191, 0.12);
    color: #5ee0d7;
}

html[data-theme="dark"] .premium-dark-card {
    background:
        radial-gradient(circle at 16% 18%, rgba(245, 166, 35, 0.2), transparent 32%),
        linear-gradient(135deg, #082b57 0%, #0f4f92 66%, #d98a10 190%);
    border-color: rgba(245, 166, 35, 0.34);
}

html[data-theme="dark"] .premium-sparkline {
    background: rgba(2, 23, 52, 0.48);
}

html[data-theme="dark"] .premium-dark-metrics article {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .premium-module-card.featured {
    background:
        linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(19, 57, 62, 0.72)),
        #111827;
}

html[data-theme="dark"] .premium-rate-card:hover,
html[data-theme="dark"] .premium-rate-card.is-editing,
html[data-theme="dark"] .premium-module-card:hover,
html[data-theme="dark"] .premium-rates-card:hover,
html[data-theme="dark"] .premium-date-card:hover,
html[data-theme="dark"] .premium-payroll-card:hover {
    background: rgba(22, 31, 48, 0.96);
    border-color: rgba(125, 211, 252, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 24px 60px rgba(2, 6, 23, 0.38);
}

html[data-theme="dark"] .premium-rate-input {
    color: #e7edf6;
    border-bottom-color: rgba(125, 211, 252, 0.36);
}

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .form-panel,
html[data-theme="dark"] .data-panel,
html[data-theme="dark"] .record-form,
html[data-theme="dark"] .filter-panel,
html[data-theme="dark"] .table-filter-bar,
html[data-theme="dark"] .table-panel {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(148, 163, 184, 0.24);
    color: #e7edf6;
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.42);
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .section-head,
html[data-theme="dark"] .listing-head {
    background:
        radial-gradient(circle at 12% 20%, rgba(245, 166, 35, 0.18), transparent 34%),
        radial-gradient(circle at 88% 18%, rgba(45, 212, 191, 0.13), transparent 32%),
        linear-gradient(135deg, rgba(96, 165, 250, 0.16), rgba(17, 24, 39, 0.78)),
        rgba(15, 23, 42, 0.72);
    border-color: rgba(125, 211, 252, 0.22);
}

html[data-theme="dark"] .section-head p,
html[data-theme="dark"] .listing-head p {
    color: #5ee0d7;
}

html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field select,
html[data-theme="dark"] .form-field textarea,
html[data-theme="dark"] .date-filters input,
html[data-theme="dark"] .backup-actions input,
html[data-theme="dark"] .select2-container--default .select2-selection--single {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.32);
    color: #e7edf6;
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e7edf6;
}

html[data-theme="dark"] .select2-dropdown {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.32);
    color: #e7edf6;
}

html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #2563eb;
}

html[data-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
    background: rgba(96, 165, 250, 0.18);
}

html[data-theme="dark"] table.dataTable,
html[data-theme="dark"] .dt-container,
html[data-theme="dark"] .dt-search input,
html[data-theme="dark"] .dt-length select {
    color: #e7edf6;
}

html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .secondary-action {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.28);
    color: #9cc9f6;
}

html[data-theme="dark"] .js-toggle-table-filters.active {
    background: #dcecff;
    border-color: #dcecff;
    color: #0f172a;
}

html[data-theme="dark"] .primary-action {
    background: #dcecff;
    color: #0f172a;
    border-color: #dcecff;
}

@keyframes premiumIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.986);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes premiumPanelIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes premiumReveal {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes barRise {
    from {
        transform: scaleY(0.25);
        opacity: 0.45;
    }
    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

@keyframes premiumBarBreathe {
    0%,
    100% {
        transform: scaleY(0.92);
        opacity: 0.82;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

@media (max-width: 1180px) {
    .premium-dashboard {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "date rates"
            "exchange exchange"
            "modules modules";
    }

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

    .premium-nav {
        max-width: none;
    }
}

@media (max-width: 760px) {
    .premium-shell {
        width: min(100% - 18px, 1420px);
        height: calc(100dvh - 10px);
        margin: 10px auto 0;
        padding: 12px 12px 8px;
        border-radius: 24px;
    }

    .premium-topbar,
    .premium-top-actions {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .premium-dashboard,
    .premium-hero-card,
    .premium-hero-kpis,
    .premium-rate-list,
    .premium-module-board,
    .premium-dark-metrics {
        grid-template-columns: 1fr;
    }

    .premium-dashboard {
        grid-template-areas:
            "date"
            "rates"
            "exchange"
            "modules";
        overflow: auto;
    }

    .premium-hero-card,
    html[dir="ltr"] .premium-hero-card {
        grid-template-areas:
            "copy"
            "flow"
            "kpis";
    }

    .premium-hero-copy h1 {
        font-size: 28px;
    }

    .premium-nav {
        order: 3;
        flex: 1 0 100%;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .premium-stat-strip {
        grid-template-columns: 1fr;
    }

    .create-form-modal-body .forms-only-module .record-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .third-view-body {
        overflow: auto;
    }

    .third-shell {
        height: auto;
        min-height: calc(100dvh - 20px);
        width: min(100% - 20px, 1500px);
        margin-top: 10px;
    }

    .third-topbar,
    .third-actions {
        flex-wrap: wrap;
    }

    .third-view-switch {
        order: 3;
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .third-content {
        overflow: visible;
    }

    .third-content .module-workspace {
        grid-template-columns: 1fr;
        height: auto;
    }

    .fourth-shell {
        width: min(100% - 20px, 1540px);
        height: auto;
        min-height: calc(100dvh - 20px);
        margin-top: 10px;
    }

    .fourth-main-surface {
        padding: 14px;
    }

    .fourth-module-picker {
        flex: 1 1 100%;
        min-width: 0;
    }

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

    .brand-zone {
        margin-inline-start: 0;
    }

    .system-strip {
        margin-inline-start: 0;
    }

    .system-strip {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

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

    .module-workspace,
    .utility-workspace {
        grid-template-columns: 1fr;
    }

    .form-panel {
        position: static;
        max-height: none;
    }
}

@media (max-width: 760px) {
    .app-shell {
        width: min(100% - 16px, 1640px);
        margin: 8px auto;
        border-radius: 22px;
        padding: 12px;
    }

    .welcome-panel h1 {
        font-size: 30px;
    }

    .hero-metrics strong {
        font-size: 22px;
    }

    .stats-grid,
    .balance-board,
    .chart-grid,
    .progress-meters,
    .hero-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .forms-only-grid {
        grid-template-columns: 1fr;
    }

    .exchange-entry-head {
        align-items: start;
        flex-direction: column;
    }

    .exchange-entry-head span {
        text-align: start;
    }

    .chart-panel.wide,
    .slip-grid .wide {
        grid-column: span 1;
    }

    .slip-grid,
    .slip-lines,
    .signature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .welcome-panel h1 {
        font-size: 27px;
    }

    .hero-metrics strong {
        font-size: 20px;
    }

    .stats-grid,
    .balance-board,
    .chart-grid,
    .table-filter-bar,
    .date-filters,
    .progress-meters,
    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .section-head,
    .listing-head {
        align-items: stretch;
        flex-direction: column;
    }

    .table-tools,
    .form-actions {
        align-items: stretch;
    }

    .table-tools .select2-container {
        flex: 1 1 100%;
        width: 100% !important;
    }

    .dt-container .dt-layout-row,
    .dt-container .dt-layout-cell,
    .dt-container .dt-search,
    .dt-container .dt-length {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .dt-container .dt-search input,
    .dt-container .dt-length select {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    body * {
        visibility: hidden;
    }

    .print-slip,
    .print-slip * {
        visibility: visible;
    }

    .print-slip {
        position: absolute;
        inset: 0;
        border: 0;
        box-shadow: none;
    }
}
