@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
    --page-bg: #f4f7f8;
    --page-bg-soft: #eef4f2;
    --panel-bg: rgba(255, 255, 255, 0.92);
    --panel-solid: #ffffff;
    --panel-alt: #eff7f6;
    --line: rgba(27, 49, 57, 0.12);
    --line-strong: rgba(15, 143, 131, 0.28);
    --text: #17242b;
    --muted: #667784;
    --primary: #0f8f83;
    --primary-dark: #0b6f68;
    --primary-soft: rgba(15, 143, 131, 0.12);
    --gold: #b7791f;
    --gold-soft: rgba(183, 121, 31, 0.14);
    --blue: #246f9f;
    --blue-soft: rgba(36, 111, 159, 0.14);
    --danger: #c2413a;
    --danger-soft: rgba(194, 65, 58, 0.12);
    --success: #23845f;
    --success-soft: rgba(35, 132, 95, 0.13);
    --shadow-sm: 0 8px 18px rgba(23, 36, 43, 0.06);
    --shadow: 0 18px 45px rgba(23, 36, 43, 0.11);
    --shadow-active: 0 22px 52px rgba(15, 143, 131, 0.18);
    --radius: 8px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.theme-dark {
    --page-bg: #0d151b;
    --page-bg-soft: #121f27;
    --panel-bg: rgba(18, 31, 39, 0.9);
    --panel-solid: #15242d;
    --panel-alt: #10202a;
    --line: rgba(225, 238, 242, 0.11);
    --line-strong: rgba(45, 212, 191, 0.34);
    --text: #edf7f7;
    --muted: #a7b8bf;
    --primary: #2dd4bf;
    --primary-dark: #14b8a6;
    --primary-soft: rgba(45, 212, 191, 0.16);
    --gold: #f0b85a;
    --blue: #67b8e8;
    --danger: #f87171;
    --success: #34d399;
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.24);
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
    --shadow-active: 0 24px 56px rgba(45, 212, 191, 0.16);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    direction: rtl;
    text-align: right;
    background:
        linear-gradient(135deg, rgba(15, 143, 131, 0.08), transparent 38%),
        linear-gradient(315deg, rgba(183, 121, 31, 0.08), transparent 34%),
        var(--page-bg);
    color: var(--text);
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 15px;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(23, 36, 43, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 36, 43, 0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 80%);
}

a {
    color: inherit;
}

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

::selection {
    background: rgba(15, 143, 131, 0.22);
}

.landing-page {
    position: relative;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    background:
        linear-gradient(100deg, rgba(7, 17, 25, 0.98), rgba(7, 17, 25, 0.72) 45%, rgba(15, 143, 131, 0.14)),
        url('../img/images/accounting-hero-rtl.png') center/cover no-repeat fixed;
}

.landing-page::before {
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 88%);
    animation: financeGridDrift 18s linear infinite;
}

.landing-page::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(7, 17, 25, 0.52) 0%, rgba(7, 17, 25, 0.16) 48%, rgba(7, 17, 25, 0.45) 100%),
        repeating-linear-gradient(118deg, transparent 0 84px, rgba(45, 212, 191, 0.035) 85px 86px, transparent 87px 150px);
    animation: financeScan 12s ease-in-out infinite alternate;
}

.landing-page form {
    position: relative;
    z-index: 2;
    min-height: 100vh;
}

.finance-floaters {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.finance-floater {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(226, 244, 243, 0.26);
    border-radius: 8px;
    background: rgba(7, 26, 34, 0.24);
    color: rgba(236, 251, 249, 0.58);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(10px);
    font-weight: 800;
    transform: translate3d(0, 0, 0);
    animation: financeFloat 11s ease-in-out infinite;
}

.finance-floater::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-inline-end: 8px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 18px rgba(240, 184, 90, 0.48);
}

.finance-floater-1 {
    top: 18%;
    left: 12%;
}

.finance-floater-2 {
    top: 64%;
    left: 8%;
    animation-delay: -4s;
}

.finance-floater-3 {
    top: 26%;
    left: 42%;
    animation-delay: -7s;
}

.finance-floater-4 {
    top: 76%;
    right: 7%;
    animation-delay: -2s;
}

.finance-floater-5 {
    top: 48%;
    left: 47%;
    animation-delay: -8s;
}

.finance-floater-6 {
    top: 10%;
    right: 48%;
    animation-delay: -5s;
}

.landing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 20px;
    animation: slideDown 0.7s var(--ease) both;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 22px;
}

.brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.56);
    border-radius: var(--radius);
    padding: 6px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.landing-main {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) 430px;
    gap: 44px;
    align-items: center;
    max-width: 1180px;
    min-height: calc(100vh - 104px);
    margin: 0 auto;
    padding: 18px 20px 64px;
}

.auth-center {
    min-height: calc(100vh - 104px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 56px;
}

.auth-panel {
    width: 480px;
    max-width: 100%;
}

.hero-copy {
    animation: fadeUp 0.8s 0.1s var(--ease) both;
}

.hero-copy h1 {
    margin: 0 0 18px;
    max-width: 780px;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 0;
    text-wrap: balance;
}

.hero-copy p {
    max-width: 640px;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 18px;
    line-height: 1.9;
    font-weight: 600;
}

.hero-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 670px;
    margin-top: 34px;
}

.hero-chip {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.11);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 800;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
    animation: fadeUp 0.75s var(--ease) both;
}

.hero-chip:nth-child(2) {
    animation-delay: 0.12s;
}

.hero-chip:nth-child(3) {
    animation-delay: 0.2s;
}

.hero-chip::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: translateX(110%);
    transition: transform 0.7s var(--ease);
}

.hero-chip:hover::before {
    transform: translateX(-110%);
}

.login-panel,
.plain-panel,
.form-panel,
.table-panel {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-panel {
    position: relative;
    overflow: hidden;
    color: var(--text);
    padding: 30px;
    animation: cardIn 0.82s 0.18s var(--ease) both;
}

.login-panel::before,
.form-panel::before,
.plain-panel::before,
.table-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--blue), var(--gold));
}

.panel-title {
    margin: 0 0 8px;
    font-size: 23px;
    font-weight: 800;
    color: var(--text);
}

.panel-subtitle {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.75;
    font-weight: 600;
}

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

.field {
    margin-bottom: 16px;
}

.field label,
.check-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-weight: 800;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 16px;
    color: var(--muted);
    font-weight: 800;
}

.login-options a {
    color: var(--primary-dark);
    text-decoration: none;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.input,
.select,
textarea.input {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(27, 49, 57, 0.16);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    padding: 9px 12px;
    font-family: inherit;
    font-size: 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

textarea.input {
    min-height: 92px;
    resize: vertical;
}

.input:focus,
.select:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 143, 131, 0.13);
    transform: translateY(-1px);
}

body.theme-dark .input,
body.theme-dark .select,
body.theme-dark textarea.input {
    background: rgba(11, 23, 32, 0.82);
    color: var(--text);
    border-color: rgba(225, 238, 242, 0.14);
}

body.theme-dark .input:focus,
body.theme-dark .select:focus {
    background: rgba(15, 29, 38, 0.96);
}

.custom-select-field {
    position: relative;
}

.custom-native-select.is-native-hidden {
    display: none;
}

.custom-select-ui {
    position: relative;
    width: 100%;
}

.custom-select-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(27, 49, 57, 0.16);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-align: right;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.custom-select-button:hover,
.custom-select-ui.is-open .custom-select-button {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15, 143, 131, 0.13);
}

.custom-select-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-arrow {
    color: var(--primary-dark);
    font-size: 18px;
    line-height: 1;
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 1300;
    display: none;
    max-height: 230px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 18px 40px rgba(5, 19, 27, 0.18);
}

.custom-select-ui.is-open .custom-select-menu {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.custom-select-option {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-align: right;
}

.custom-select-option:hover,
.custom-select-option.is-selected {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

body.theme-dark .custom-select-button {
    border-color: rgba(225, 238, 242, 0.14);
    background: rgba(11, 23, 32, 0.82);
    color: var(--text);
}

body.theme-dark .custom-select-button:hover,
body.theme-dark .custom-select-ui.is-open .custom-select-button {
    background: rgba(15, 29, 38, 0.96);
}

body.theme-dark .custom-select-menu {
    border-color: rgba(225, 238, 242, 0.14);
    background: #10212b;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
}

.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 8px 18px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
    transform: translateX(105%);
    transition: transform 0.45s var(--ease);
}

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

.btn:hover::after {
    transform: translateX(-105%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 12px 24px rgba(15, 143, 131, 0.22);
}

.btn-primary:hover {
    box-shadow: var(--shadow-active);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.86);
    border-color: var(--line);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--line-strong);
    color: var(--primary-dark);
}

.btn-danger {
    background: var(--danger-soft);
    border-color: rgba(194, 65, 58, 0.25);
    color: var(--danger);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0;
    min-height: auto;
    box-shadow: none;
}

.btn-link:hover {
    transform: translateX(-3px);
}

.message {
    display: block;
    margin-top: 14px;
    color: var(--danger);
    font-weight: 800;
    animation: fadeIn 0.28s ease both;
}

.message.ok {
    color: var(--success);
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgba(16, 36, 45, 0.98), rgba(10, 29, 38, 0.98)),
        linear-gradient(135deg, rgba(15, 143, 131, 0.18), transparent);
    color: #fff;
    padding: 22px 16px;
    box-shadow: -16px 0 48px rgba(10, 29, 38, 0.18);
    animation: slideFromRight 0.55s var(--ease) both;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

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

.sidebar-head,
.sidebar-menu-panel {
    display: block;
}

.mobile-menu-toggle {
    display: none;
}

.sidebar-context {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 18px;
}

.sidebar-context::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--gold);
}

.sidebar-context strong {
    display: block;
    margin-bottom: 4px;
}

.sidebar-context span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.nav a,
.nav-group-title {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: rgba(255, 255, 255, 0.84);
    text-decoration: none;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0;
    text-align: right;
    cursor: pointer;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    transition: transform 0.22s var(--ease), background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.nav a span,
.nav-group-title span {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.nav a small,
.nav-group-title small {
    color: rgba(255, 255, 255, 0.46);
    font-size: 11px;
    font-weight: 800;
}

.nav a::before,
.nav-group-title::before {
    content: "";
    position: absolute;
    right: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: var(--primary);
    opacity: 0;
    transform: scaleY(0.4);
    transition: opacity 0.22s ease, transform 0.22s var(--ease);
}

.nav a:hover,
.nav a.active,
.nav-group-title:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateX(-4px);
}

.nav-group.open > .nav-group-title {
    background: rgba(15, 143, 131, 0.18);
    border-color: rgba(45, 212, 191, 0.22);
    color: #fff;
}

.nav a:hover::before,
.nav a.active::before,
.nav-group-title:hover::before {
    opacity: 1;
    transform: scaleY(1);
}

.nav-group {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.045);
    padding: 7px;
}

.nav-group-title {
    min-height: 40px;
    padding-inline: 10px;
}

.nav-group-title::after {
    content: "▾";
    color: rgba(255, 255, 255, 0.62);
    margin-right: 8px;
    font-size: 12px;
    transition: transform 0.2s var(--ease);
}

.nav-group-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 6px;
}

.nav-group:not(.open) .nav-group-links {
    display: none;
}

.nav-group.open .nav-group-title::after {
    transform: rotate(180deg);
}

.nav-child {
    min-height: 38px !important;
    padding: 8px 14px !important;
    padding-right: 24px !important;
    font-size: 13px !important;
    background: rgba(0, 0, 0, 0.08);
}

.content-area {
    min-width: 0;
    animation: fadeIn 0.45s ease both;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 76px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
}

body.theme-dark .topbar {
    background: rgba(18, 31, 39, 0.82);
}

.topbar-title h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.topbar-title p {
    margin: 3px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu {
    position: relative;
}

.user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.76);
    color: var(--text);
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.2s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body.theme-dark .user-trigger {
    background: rgba(21, 36, 45, 0.86);
}

.user-trigger:hover,
.user-menu:focus-within .user-trigger {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    background: #fff;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 210px;
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s var(--ease);
}

.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown,
.user-menu.is-open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 11px 12px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.user-dropdown a:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.user-dropdown .danger-link:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.notification-menu {
    position: relative;
}

.notification-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.76);
    color: var(--primary-dark);
    cursor: pointer;
    transition: transform 0.2s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .notification-trigger {
    background: rgba(21, 36, 45, 0.86);
    color: var(--primary);
}

.notification-trigger:hover,
.notification-menu:focus-within .notification-trigger {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 900;
}

.notification-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    border: 2px solid var(--panel-solid);
    font-size: 11px;
    line-height: 17px;
    text-align: center;
    font-weight: 900;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s var(--ease);
}

.notification-menu:hover .notification-dropdown,
.notification-menu:focus-within .notification-dropdown,
.notification-menu.is-open .notification-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 4px 10px;
    border-bottom: 1px solid var(--line);
}

.notification-head strong {
    font-weight: 900;
}

.notification-head a {
    color: var(--primary-dark);
    font-size: 13px;
    text-decoration: none;
    font-weight: 900;
}

.notification-item {
    display: block;
    padding: 11px 9px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--primary-soft);
}

.notification-item strong,
.notification-item span {
    display: block;
}

.notification-item strong {
    font-size: 14px;
    font-weight: 900;
}

.notification-item span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.notification-item:not(.read) strong::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 7px;
    border-radius: 50%;
    background: var(--primary);
}

.notification-item.warning {
    border-right: 3px solid var(--gold);
}

.notification-item.danger {
    border-right: 3px solid var(--danger);
}

.notification-empty {
    padding: 16px 10px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.main {
    padding: 28px;
}

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

.stat {
    position: relative;
    overflow: hidden;
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    animation: fadeUp 0.55s var(--ease) both;
    transition: transform 0.22s var(--ease), box-shadow 0.22s ease, border-color 0.22s ease;
}

.stat:nth-child(2) {
    animation-delay: 0.07s;
}

.stat:nth-child(3) {
    animation-delay: 0.14s;
}

.stat:nth-child(4) {
    animation-delay: 0.21s;
}

.stat::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--blue), var(--gold));
}

.stat:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-active);
}

.stat span {
    color: var(--muted);
    font-weight: 800;
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 32px;
    color: var(--primary-dark);
    line-height: 1;
}

.screen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.screen-card {
    position: relative;
    overflow: hidden;
    display: block;
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    animation: fadeUp 0.5s var(--ease) both;
    transition: transform 0.22s var(--ease), border-color 0.22s ease, box-shadow 0.22s ease;
}

.screen-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s var(--ease);
}

.screen-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-active);
}

.screen-card:hover::after {
    transform: scaleX(1);
}

.screen-card strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text);
}

.screen-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.dashboard-screen-panel {
    overflow: visible;
}

.dashboard-screen-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.dashboard-screen-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.dashboard-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.dashboard-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-solid);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s var(--ease), border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.dashboard-tab:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-active);
}

.dashboard-tab.is-active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-color: transparent;
    color: #fff;
}

.dashboard-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(0, 141, 130, 0.12);
    color: var(--primary-dark);
    font-size: 12px;
    line-height: 1;
}

.dashboard-tab.is-active .dashboard-tab-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.dashboard-tab-panel {
    display: none;
}

.dashboard-tab-panel.is-active {
    display: block;
}

.dashboard-screen-grid {
    align-items: stretch;
}

.dashboard-screen-card {
    min-height: 96px;
}

.dashboard-empty {
    padding: 22px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: rgba(0, 141, 130, 0.06);
    color: var(--muted);
    text-align: center;
    font-weight: 900;
}

.form-panel,
.table-panel,
.plain-panel {
    position: relative;
    overflow: hidden;
    padding: 22px;
    margin-bottom: 22px;
    animation: fadeUp 0.55s var(--ease) both;
}

.narrow-panel {
    max-width: 760px;
}

body.theme-dark .data-table th {
    background: #10202a;
}

.table-panel {
    overflow-x: auto;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.data-table th,
.data-table td {
    border-bottom: none;
    padding: 13px 12px;
    vertical-align: middle;
    transition: background 0.18s ease;
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(135deg, rgba(15, 143, 131, 0.12), rgba(36, 111, 159, 0.08));
    color: var(--muted);
    font-weight: 800;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.data-table th:first-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.data-table th:last-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.data-table td {
    background: rgba(255, 255, 255, 0.72);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

body.theme-dark .data-table td {
    background: rgba(21, 36, 45, 0.72);
}

.data-table td:first-child {
    border-right: 1px solid var(--line);
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.data-table td:last-child {
    border-left: 1px solid var(--line);
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.data-table tr:hover td {
    background: rgba(15, 143, 131, 0.075);
    box-shadow: inset 0 0 0 999px rgba(15, 143, 131, 0.01);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.badge.ok {
    background: var(--success-soft);
    color: var(--success);
}

.badge.off {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge.info {
    background: var(--blue-soft);
    color: var(--blue);
}

.danger-text {
    color: var(--danger) !important;
}

.success-text {
    color: var(--success) !important;
}

.ltr-input {
    direction: ltr;
    text-align: left;
    font-family: Consolas, 'Courier New', monospace;
    font-weight: 800;
}

.switch-field {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    margin: 2px 0 14px;
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
}

.switch-field input[type="checkbox"] {
    width: 40px;
    height: 22px;
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(102, 119, 132, 0.24);
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.switch-field input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s var(--ease);
}

.switch-field input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.switch-field input[type="checkbox"]:checked::before {
    transform: translateX(-18px);
}

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

.lookup-panel {
    min-height: 390px;
}

.lookup-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 18px;
}

.lookup-head .panel-subtitle {
    margin-bottom: 0;
}

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

.lookup-table-panel .data-table {
    min-width: 820px;
}

.companies-form-panel {
    overflow: visible;
    border-top: 3px solid var(--primary);
}

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

.companies-form-grid .field {
    min-width: 0;
}

.companies-form-grid label {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.companies-form-grid .input,
.companies-form-grid .select {
    min-height: 46px;
    border-color: rgba(27, 49, 57, 0.14);
    background: rgba(255, 255, 255, 0.92);
}

body.theme-dark .companies-form-grid .input,
body.theme-dark .companies-form-grid .select {
    border-color: rgba(225, 238, 242, 0.14);
    background: rgba(11, 23, 32, 0.86);
}

.companies-active-switch {
    width: fit-content;
    margin: 16px 0 0;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-alt);
}

.companies-form-actions {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.companies-table-panel {
    overflow: hidden;
}

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

.table-section-head .panel-title {
    margin-bottom: 0;
    font-size: 21px;
}

.company-grid-shell {
    overflow-x: auto;
    padding: 2px 2px 6px;
}

.company-data-table {
    min-width: 1180px;
    border-spacing: 0 10px;
}

.company-data-table th {
    font-size: 12px;
    letter-spacing: 0;
    white-space: nowrap;
}

.company-data-table td {
    white-space: nowrap;
}

.company-data-table td:nth-child(2) {
    color: var(--text);
    font-weight: 900;
}

.company-data-table td:nth-child(9) {
    color: var(--primary-dark);
    direction: ltr;
    font-weight: 900;
    text-align: left;
}

.company-actions-cell {
    width: 132px;
}

.grid-action-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

.grid-icon-action {
    --grid-action-color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-solid);
    color: var(--grid-action-color);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.grid-icon-action::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--grid-icon) center / contain no-repeat;
    mask: var(--grid-icon) center / contain no-repeat;
}

.grid-icon-action:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: var(--primary-soft);
    color: var(--primary-dark);
    box-shadow: var(--shadow-active);
}

.grid-icon-action.edit {
    --grid-action-color: var(--blue);
    --grid-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
}

.grid-icon-action.details {
    --grid-action-color: var(--primary-dark);
    --grid-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

.grid-icon-action.disable {
    --grid-action-color: var(--danger);
    --grid-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18.36 6.64a9 9 0 1 1-12.73 0'/%3E%3Cpath d='M12 2v10'/%3E%3C/svg%3E");
}

.grid-icon-action.print {
    --grid-action-color: var(--primary-dark);
    --grid-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V2h12v7'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Cpath d='M6 14h12v8H6z'/%3E%3C/svg%3E");
}

.grid-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.company-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.choice-card {
    position: relative;
    overflow: hidden;
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.55s var(--ease) both;
    transition: transform 0.22s var(--ease), box-shadow 0.22s ease, border-color 0.22s ease;
}

.choice-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--blue), var(--gold));
}

.choice-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-active);
}

.choice-card h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 800;
}

.choice-card p {
    margin: 0 0 16px;
    color: var(--muted);
    font-weight: 700;
}

.check-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 43px;
    font-weight: 800;
}

.check-inline input[type="checkbox"],
.data-table input[type="checkbox"],
.remember-option input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(23, 36, 43, 0.12));
}

.check-inline label,
.remember-option span {
    cursor: pointer;
}

.check-inline,
.remember-option {
    user-select: none;
}

.theme-choice input[type="radio"] {
    transform: scale(1.08);
}

.reset-link-box {
    margin-top: 18px;
    padding: 14px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--primary-soft);
    overflow-wrap: anywhere;
}

.reset-link-box strong {
    display: block;
    margin-bottom: 8px;
}

.reset-link-box a {
    color: var(--primary-dark);
    font-weight: 800;
}

.profile-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    width: fit-content;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px;
    box-shadow: var(--shadow-sm);
}

body.theme-dark .profile-tabs {
    background: rgba(18, 31, 39, 0.76);
}

.tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: var(--radius);
    padding: 8px 16px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 800;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}

.tab-link:hover,
.tab-link.active {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

button.tab-link {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.company-overview-panel {
    display: grid;
    gap: 14px;
}

.company-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.company-detail-head h2 {
    margin: 8px 0 4px;
    font-size: 24px;
}

.company-detail-head p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.company-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.company-overview-panel .company-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 0;
}

.company-summary-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-bg);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
}

.company-overview-panel .company-summary-card {
    background: var(--panel-alt);
    box-shadow: none;
    padding: 10px 13px;
}

.company-summary-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--blue), var(--gold));
}

.company-summary-card span,
.company-summary-card strong {
    display: block;
}

.company-summary-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 6px;
}

.company-summary-card strong {
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
}

.company-overview-panel .company-summary-card strong {
    font-size: 18px;
}

.company-tabs {
    margin-bottom: 4px;
}

.company-tab-panel {
    display: none;
}

.company-tab-panel.is-active {
    display: block;
}

.company-payment-grid {
    margin-top: 18px;
    overflow-x: auto;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.zatca-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel-alt);
    padding: 13px 15px;
    margin-bottom: 16px;
}

.zatca-note strong,
.zatca-note span {
    display: block;
}

.zatca-note strong {
    color: var(--text);
    font-weight: 900;
}

.zatca-note span {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.8;
}

.zatca-code-input {
    min-height: 132px !important;
    white-space: pre;
    overflow: auto;
    font-size: 13px;
    line-height: 1.7;
}

.zatca-active-check {
    align-self: end;
    min-height: 44px;
}

.profile-panel {
    max-width: 1040px;
}

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

.avatar-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.profile-avatar-large {
    width: 152px;
    height: 152px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    background: #fff;
}

.file-input {
    min-height: auto;
}

.avatar-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.theme-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.theme-choice {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 118px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    background: var(--panel-solid);
    transition: transform 0.2s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-choice:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.theme-choice input {
    accent-color: var(--primary);
}

.theme-choice strong {
    grid-column: 2;
}

.theme-preview {
    grid-column: 2;
    display: block;
    height: 58px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.hr-two-column {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

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

.org-tree {
    display: block;
    margin-top: 14px;
}

.org-tree a {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    margin: 3px 0;
    padding: 6px 10px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.org-tree a:hover,
.org-tree a:focus {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.archive-tree-panel .panel-subtitle {
    margin-bottom: 12px;
}

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

.archive-folder-table .data-table,
.archive-client-table .data-table {
    min-width: 960px;
}

.archive-client-panel {
    margin-top: 18px;
}

.account-chart-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(15, 143, 131, 0.12), rgba(36, 111, 159, 0.08)),
        var(--panel-bg);
    box-shadow: var(--shadow-soft);
}

.account-chart-hero p {
    margin: 7px 0 0;
    color: var(--muted);
    font-weight: 700;
}

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

.stat.compact {
    min-height: 86px;
    margin: 0;
}

.account-chart-layout {
    grid-template-columns: 390px minmax(0, 1fr);
}

.account-tree-panel {
    min-height: 520px;
}

.account-tree a {
    direction: rtl;
}

.account-form-panel {
    overflow: visible;
}

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

.account-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 4px;
}

.account-table-panel .table-head-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.account-data-table {
    min-width: 1060px;
}

.account-data-table td:first-child,
.account-data-table th:first-child {
    direction: ltr;
    text-align: left;
    font-weight: 900;
}

.cashbox-form-panel {
    overflow: visible;
}

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

.cashbox-notes-field {
    grid-column: span 3;
}

.cashbox-table-panel .table-head-line {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.table-search-field {
    min-width: 280px;
    margin: 0;
}

.cashbox-data-table {
    min-width: 1040px;
}

.cashbox-data-table td:first-child,
.cashbox-data-table th:first-child {
    direction: ltr;
    text-align: left;
    font-weight: 900;
}

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

.bank-notes-field {
    grid-column: span 2;
}

.bank-data-table {
    min-width: 1280px;
}

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

.customer-address-field,
.customer-notes-field {
    grid-column: span 2;
}

.customer-data-table {
    min-width: 1480px;
}

.customer-data-table td:first-child,
.customer-data-table th:first-child {
    direction: ltr;
    text-align: left;
    font-weight: 900;
}

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

.supplier-address-field,
.supplier-notes-field {
    grid-column: span 2;
}

.supplier-data-table {
    min-width: 1520px;
}

.supplier-data-table td:first-child,
.supplier-data-table th:first-child {
    direction: ltr;
    text-align: left;
    font-weight: 900;
}

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

.branch-address-field,
.branch-notes-field {
    grid-column: span 2;
}

.branch-data-table {
    min-width: 1180px;
}

.branch-data-table td:first-child,
.branch-data-table th:first-child {
    direction: ltr;
    text-align: left;
    font-weight: 900;
}

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

.costcenter-notes-field {
    grid-column: span 2;
}

.costcenter-data-table {
    min-width: 1180px;
}

.costcenter-data-table td:first-child,
.costcenter-data-table th:first-child {
    direction: ltr;
    text-align: left;
    font-weight: 900;
}

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

.period-notes-field {
    grid-column: span 2;
}

.period-data-table {
    min-width: 1180px;
}

.period-data-table td:first-child,
.period-data-table th:first-child {
    direction: ltr;
    text-align: left;
    font-weight: 900;
}

.journal-hero .btn {
    white-space: nowrap;
}

.journal-filter-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
}

.journal-search-field {
    grid-column: span 2;
}

.journal-filter-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    grid-column: span 4;
}

.journal-filter-actions .message {
    margin: 0;
}

.journal-table-panel .table-head-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.table-caption {
    color: var(--muted);
    font-weight: 800;
    font-size: 13px;
}

.journal-data-table {
    min-width: 1500px;
}

.journal-data-table td:first-child,
.journal-data-table th:first-child {
    direction: ltr;
    text-align: left;
    font-weight: 900;
}

.journal-detail-hero {
    align-items: flex-start;
}

.journal-detail-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.journal-detail-header-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.journal-detail-description {
    grid-column: span 4;
}

.journal-lines-panel {
    overflow: auto;
}

.journal-lines-panel .table-head-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.journal-add-line-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.8fr) minmax(170px, 0.85fr) minmax(260px, 1.3fr) minmax(110px, 0.55fr) minmax(110px, 0.55fr) auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 86%, var(--primary-soft));
}

.journal-add-line-grid .field {
    margin: 0;
}

.journal-add-action {
    display: flex;
    align-items: end;
}

.journal-excel-table {
    min-width: 1560px;
    border-collapse: separate;
    border-spacing: 0;
}

.journal-excel-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: color-mix(in srgb, var(--panel-bg) 88%, var(--primary-soft));
}

.journal-excel-table td,
.journal-excel-table th {
    padding: 6px;
}

.journal-excel-table tfoot td {
    background: color-mix(in srgb, var(--primary-soft) 42%, var(--panel-bg));
}

.journal-excel-table .excel-select,
.journal-excel-table .excel-input,
.journal-excel-table .excel-number {
    min-height: 36px;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
}

.journal-excel-table .excel-number {
    direction: ltr;
    text-align: right;
    font-weight: 900;
}

.journal-excel-table td:nth-child(1),
.journal-excel-table th:nth-child(1) {
    width: 42px;
    text-align: center;
}

.journal-excel-table td:nth-child(2),
.journal-excel-table th:nth-child(2) {
    min-width: 280px;
}

.journal-excel-table td:nth-child(3),
.journal-excel-table th:nth-child(3),
.journal-excel-table td:nth-child(4),
.journal-excel-table th:nth-child(4) {
    min-width: 210px;
}

.journal-excel-table td:nth-child(5),
.journal-excel-table th:nth-child(5) {
    min-width: 320px;
}

.journal-excel-table td:nth-child(6),
.journal-excel-table th:nth-child(6),
.journal-excel-table td:nth-child(7),
.journal-excel-table th:nth-child(7) {
    min-width: 130px;
}

.excel-delete-field {
    width: max-content;
    margin: 0 auto;
}

.journal-line-actions {
    margin-top: 14px;
}

.archive-transactions-panel {
    min-width: 0;
}

.archive-head {
    align-items: center;
}

.archive-transaction-table {
    min-width: 1180px;
}

.archive-modal-shell {
    position: fixed;
    inset: 0;
    z-index: 1250;
    visibility: hidden;
    pointer-events: none;
}

.archive-modal-shell.is-open {
    visibility: visible;
    pointer-events: auto;
}

.archive-modal-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(4, 18, 25, 0.48);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}

.archive-modal-shell.is-open .archive-modal-backdrop {
    opacity: 1;
}

.archive-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(1120px, calc(100vw - 34px));
    max-height: calc(100vh - 34px);
    margin: 0;
    overflow-y: auto;
    transform: translate(-50%, -48%) scale(0.98);
    opacity: 0;
    transition: transform 0.25s var(--ease), opacity 0.25s ease;
}

.archive-modal-shell.is-open .archive-modal {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.archive-selected-folder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-alt);
    font-weight: 900;
}

.archive-selected-folder span {
    color: var(--primary-dark);
}

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

.archive-subject-field,
.archive-wide-field {
    grid-column: span 2;
}

.archive-modal .attachment-current {
    min-height: 72px;
}

.grid-input {
    min-width: 86px;
}

.legal-input {
    min-width: 320px;
    min-height: 68px;
}

.muted-line {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.result-panel .mini-stats {
    margin-top: 16px;
}

.mini-stats .stat strong {
    font-size: 24px;
}

.mail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.mail-compose-panel .field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mail-recipient-field {
    grid-column: span 2;
}

.mail-recipient-list {
    min-height: 148px;
    padding: 8px;
}

.mail-body-input {
    min-height: 190px;
}

.mail-subject-link {
    color: var(--primary-dark);
    font-weight: 800;
    text-decoration: none;
}

.mail-subject-link:hover {
    color: var(--primary);
}

.mail-view {
    animation: fadeUp 0.42s var(--ease) both;
}

.mail-view-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.mail-view-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.4;
}

.mail-view-head p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.mail-body-view {
    min-height: 120px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-alt);
    padding: 16px;
    line-height: 1.9;
    font-weight: 700;
}

.mail-recipient-summary {
    margin-top: 16px;
}

.mail-recipient-summary strong {
    display: block;
    margin-bottom: 10px;
}

.mail-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mail-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    background: var(--gold-soft);
    color: var(--gold);
    padding: 5px 11px;
    font-size: 13px;
    font-weight: 800;
}

.mail-pill.read {
    background: var(--success-soft);
    color: var(--success);
}

.mail-table .badge.off {
    background: var(--blue-soft);
    color: var(--blue);
}

.messenger-shell,
.messenger-compose {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    min-height: calc(100vh - 132px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel-solid);
    box-shadow: var(--shadow);
    animation: fadeUp 0.48s var(--ease) both;
}

.messenger-list,
.compose-side {
    border-left: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(15, 143, 131, 0.06), transparent 42%),
        var(--panel-alt);
    min-width: 0;
    overflow-y: auto;
}

.messenger-list-head {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

body.theme-dark .messenger-list-head {
    background: rgba(18, 31, 39, 0.9);
}

.messenger-list-head.stacked {
    display: block;
}

.messenger-list-head strong {
    display: block;
    font-size: 18px;
    font-weight: 900;
}

.messenger-list-head span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.compact-field {
    margin: 12px 0 0;
}

.conversation-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    width: calc(100% - 18px);
    margin: 9px;
    padding: 11px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text);
    text-align: right;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.theme-dark .conversation-card {
    background: rgba(21, 36, 45, 0.76);
}

.conversation-card:hover,
.conversation-card.active {
    transform: translateX(-3px);
    border-color: var(--line-strong);
    background: var(--panel-solid);
    box-shadow: var(--shadow-active);
}

.conversation-card.unread {
    border-color: rgba(15, 143, 131, 0.22);
    background: linear-gradient(135deg, var(--primary-soft), rgba(255, 255, 255, 0.78));
}

body.theme-dark .conversation-card.unread {
    background: linear-gradient(135deg, var(--primary-soft), rgba(21, 36, 45, 0.82));
}

.conversation-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--blue));
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 10px 18px rgba(15, 143, 131, 0.18);
}

.conversation-avatar.large {
    width: 54px;
    height: 54px;
    font-size: 16px;
}

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

.conversation-main strong,
.conversation-main em,
.conversation-main small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-main strong {
    font-weight: 900;
}

.conversation-main em {
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
    font-weight: 800;
}

.conversation-main small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.conversation-meta b {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 11px;
}

.messenger-chat,
.compose-chat {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        linear-gradient(135deg, rgba(15, 143, 131, 0.055), transparent 44%),
        linear-gradient(315deg, rgba(183, 121, 31, 0.06), transparent 38%),
        var(--panel-solid);
}

.messenger-chat-head {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 80px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
}

body.theme-dark .messenger-chat-head {
    background: rgba(18, 31, 39, 0.86);
}

.messenger-chat-head h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 900;
    line-height: 1.35;
}

.messenger-chat-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.messenger-chat-actions {
    display: flex;
    gap: 9px;
    margin-right: auto;
    align-items: center;
}

.messenger-thread {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    position: relative;
    width: fit-content;
    max-width: min(660px, 76%);
    border-radius: 18px;
    padding: 11px 14px 8px;
    box-shadow: var(--shadow-sm);
    animation: fadeUp 0.28s var(--ease) both;
}

.chat-bubble strong {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--muted);
}

.chat-bubble div {
    line-height: 1.8;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.chat-bubble time {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: left;
}

.chat-bubble.mine {
    align-self: flex-start;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-bottom-left-radius: 6px;
}

.chat-bubble.mine strong,
.chat-bubble.mine time {
    color: rgba(255, 255, 255, 0.78);
}

.chat-bubble.other {
    align-self: flex-end;
    color: var(--text);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-bottom-right-radius: 6px;
}

body.theme-dark .chat-bubble.other {
    background: rgba(21, 36, 45, 0.94);
}

.messenger-placeholder {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}

.messenger-placeholder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    margin-bottom: 16px;
    border-radius: 50%;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-weight: 900;
}

.messenger-placeholder h2 {
    margin: 0 0 8px;
}

.messenger-placeholder p,
.messenger-empty-list {
    color: var(--muted);
    font-weight: 800;
}

.messenger-empty-list {
    padding: 24px 16px;
    text-align: center;
}

.messenger-compose {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.compose-side {
    padding: 18px;
}

.compose-profile {
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.compose-profile strong,
.compose-profile small {
    display: block;
}

.compose-profile strong {
    margin-top: 10px;
    font-size: 19px;
    font-weight: 900;
}

.compose-profile small {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 800;
    line-height: 1.7;
}

.compose-bubble {
    flex: 1;
    padding: 22px;
}

.compose-bubble .field {
    max-width: 850px;
}

.compose-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.74);
}

body.theme-dark .compose-actions {
    background: rgba(18, 31, 39, 0.78);
}

.notification-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.notification-page-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.notification-page-head p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.notification-page-list {
    display: grid;
    gap: 12px;
}

.notification-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-right: 4px solid var(--primary);
    border-radius: var(--radius);
    background: var(--panel-solid);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    animation: fadeUp 0.36s var(--ease) both;
}

.notification-row.warning {
    border-right-color: var(--gold);
}

.notification-row.danger {
    border-right-color: var(--danger);
}

.notification-row.read {
    opacity: 0.72;
}

.notification-row strong {
    display: block;
    font-weight: 900;
}

.notification-row p {
    margin: 5px 0;
    color: var(--muted);
    font-weight: 800;
}

.notification-row small {
    color: var(--muted);
    font-weight: 700;
}

.notification-row-actions {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
}

.leave-request-panel .employee-context strong {
    display: flex;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-alt);
    padding: 9px 12px;
}

.leave-form-head,
.tracking-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 18px;
}

.leave-form-head .panel-subtitle,
.tracking-head p {
    margin-bottom: 0;
}

.tracking-head h3 {
    margin: 0 0 5px;
    font-size: 19px;
    font-weight: 900;
}

.tracking-head p {
    color: var(--muted);
    font-weight: 800;
}

.leave-main-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
}

.leave-date-row,
.leave-balance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.metric-input {
    color: var(--primary-dark);
    font-weight: 900;
    text-align: center;
}

.leave-balance-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 72px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(15, 143, 131, 0.09), transparent 60%),
        var(--panel-alt);
    padding: 12px 14px;
}

.leave-balance-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.leave-balance-card strong {
    display: block;
    margin-top: 4px;
    color: var(--primary-dark);
    font-size: 21px;
    font-weight: 900;
    line-height: 1.2;
}

.leave-balance-card.mode-card strong {
    color: var(--gold);
    font-size: 16px;
}

.leave-attachment-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
    gap: 14px;
    align-items: stretch;
}

.leave-file-input {
    padding-top: 10px;
}

.attachment-current {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 72px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel-alt);
    padding: 12px 14px;
    margin-bottom: 16px;
}

.attachment-current > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.attachment-current strong {
    display: block;
    margin-top: 5px;
    font-size: 14px;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    padding: 4px 10px;
    font-weight: 900;
    text-decoration: none;
}

.attachment-link:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

body.theme-dark .leave-balance-card {
    background:
        linear-gradient(135deg, rgba(45, 212, 191, 0.11), transparent 60%),
        var(--panel-alt);
}

.leave-flow {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.leave-flow span {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 900;
    text-align: center;
    transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.leave-flow span::after {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    width: 8px;
    height: 2px;
    background: var(--line-strong);
}

.leave-flow span:last-child::after {
    display: none;
}

.leave-flow span.done {
    background: var(--success-soft);
    border-color: rgba(35, 132, 95, 0.28);
    color: var(--success);
}

.leave-flow span.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-active);
    transform: translateY(-2px);
}

.leave-flow span.returned {
    background: var(--gold-soft);
    border-color: rgba(183, 121, 31, 0.32);
    color: var(--gold);
    box-shadow: none;
}

.leave-flow span.cancelled {
    background: var(--danger-soft);
    border-color: rgba(194, 65, 58, 0.28);
    color: var(--danger);
    box-shadow: none;
}

.leave-tracking-panel {
    max-width: 1180px;
}

.tracking-flow {
    margin-top: 0;
}

.leave-requests-table {
    min-width: 1080px;
}

.approval-layout {
    display: grid;
    gap: 18px;
}

.approval-card {
    max-width: 1120px;
}

.approval-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.approval-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.approval-head p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.approval-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.approval-summary div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-alt);
    padding: 12px;
}

.approval-summary strong,
.approval-summary span {
    display: block;
}

.approval-summary strong {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.approval-reason {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.58);
    padding: 14px;
    margin-bottom: 16px;
    line-height: 1.9;
}

body.theme-dark .approval-reason {
    background: rgba(21, 36, 45, 0.7);
}

.approval-reason strong {
    display: block;
    margin-bottom: 7px;
}

.request-entry-panel .request-type-panel {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin-top: 4px;
}

.request-manager-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel-alt);
    padding: 13px 15px;
    margin: 4px 0 16px;
}

.request-manager-box span {
    color: var(--muted);
    font-weight: 900;
}

.request-manager-box strong {
    color: var(--primary-dark);
    font-size: 17px;
}

.employee-account-panel {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel-alt);
    padding: 14px;
    margin: 2px 0 16px;
}

.employee-account-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.employee-account-title strong {
    color: var(--text);
    font-weight: 900;
}

.panel-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 900;
}

.btn-sm {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 13px;
}

.badge.warn {
    background: var(--gold-soft);
    color: var(--gold);
}

.employee-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-top: 3px solid var(--primary);
}

.employee-page-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.employee-head-actions {
    display: flex;
    align-items: end;
    gap: 12px;
    min-width: min(520px, 100%);
}

.employee-company-field {
    flex: 1 1 260px;
    margin: 0;
}

.employee-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.employee-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 14px;
    min-height: 300px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-solid);
    box-shadow: var(--shadow-sm);
    animation: fadeUp 0.45s var(--ease) both;
    transition: transform 0.22s var(--ease), border-color 0.22s ease, box-shadow 0.22s ease;
}

.employee-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--blue), var(--gold));
}

.employee-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-active);
}

.employee-card-top,
.employee-card-actions,
.employee-tab-toolbar,
.employee-editor-head,
.employee-editor-person {
    display: flex;
    align-items: center;
    gap: 12px;
}

.employee-card-top {
    justify-content: space-between;
}

.employee-card-avatar,
.employee-editor-avatar,
.employee-photo-preview {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-soft), var(--blue-soft));
    color: var(--primary-dark);
    font-weight: 900;
}

.employee-card-avatar {
    width: 62px;
    height: 62px;
}

.employee-editor-avatar,
.employee-photo-preview {
    width: 88px;
    height: 88px;
}

.employee-card-avatar img,
.employee-editor-avatar img,
.employee-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.employee-avatar-initial {
    font-size: 22px;
    line-height: 1;
}

.employee-avatar-initial.hidden {
    display: none;
}

.employee-card-body strong,
.employee-card-body span,
.employee-card-body p {
    display: block;
}

.employee-card-body strong {
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.35;
}

.employee-card-body span {
    margin-top: 4px;
    color: var(--primary-dark);
    font-weight: 900;
}

.employee-card-body p {
    margin: 7px 0 0;
    color: var(--muted);
    font-weight: 800;
}

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

.employee-card-meta span,
.employee-card-meta strong {
    display: block;
    min-width: 0;
}

.employee-card-meta span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.employee-card-meta strong {
    margin-top: 3px;
    color: var(--text);
    font-weight: 900;
}

.employee-card-contact {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.employee-card-contact span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: right;
}

.employee-card-actions {
    flex-wrap: wrap;
    margin-top: auto;
}

.employee-empty-state {
    padding: 26px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: var(--panel-alt);
    color: var(--muted);
    text-align: center;
    font-weight: 900;
}

.employee-editor-panel {
    overflow: visible;
    border-top: 3px solid var(--primary);
}

.employee-editor-head {
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.employee-editor-person {
    align-items: center;
}

.employee-editor-person h2 {
    margin: 6px 0 4px;
    font-size: 25px;
}

.employee-editor-person p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.employee-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 18px;
}

.employee-tab-link {
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-solid);
    color: var(--text);
    font-family: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.employee-tab-link:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
}

.employee-tab-link.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
}

.employee-tab-panel {
    display: none;
}

.employee-tab-panel.is-active {
    display: block;
}

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

.employee-photo-panel {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-alt);
}

.employee-photo-preview {
    width: 150px;
    height: 150px;
    margin-inline: auto;
}

.employee-photo-preview .employee-avatar-initial {
    font-size: 38px;
}

.employee-profile-grid {
    grid-template-columns: repeat(7, minmax(104px, 1fr));
    gap: 10px;
}

.employee-profile-section-title {
    grid-column: 1 / -1;
    margin-top: 6px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 900;
}

.employee-profile-wide {
    grid-column: span 2;
}

.employee-profile-grid .field label {
    min-height: 34px;
    margin-bottom: 5px;
    font-size: 12px;
    line-height: 1.35;
}

.employee-profile-grid .input,
.employee-profile-grid .select {
    min-height: 42px;
    padding-inline: 10px;
}

.employee-account-grid {
    grid-template-columns: minmax(190px, 0.85fr) repeat(3, minmax(0, 1fr));
}

.employee-tab-toolbar {
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.employee-tab-toolbar h3 {
    margin: 0;
    font-size: 20px;
}

.employee-related-table {
    min-width: 100%;
}

.employee-related-table th,
.employee-related-table td {
    padding: 10px 9px;
    font-size: 13px;
}

.employee-tab-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.employee-detail-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(104px, 1fr));
    gap: 10px;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-alt);
}

.salary-master-form {
    grid-template-columns: repeat(7, minmax(96px, 1fr));
}

.medical-master-form,
.employee-attachment-form,
.certificate-master-form {
    grid-template-columns: repeat(7, minmax(96px, 1fr));
}

.employee-detail-form .field label,
.employee-attachment-form .field label {
    min-height: 32px;
    margin-bottom: 5px;
    font-size: 12px;
    line-height: 1.35;
}

.employee-detail-form .input,
.employee-detail-form .select,
.employee-attachment-form .input,
.employee-attachment-form .select {
    min-height: 42px;
    padding-inline: 10px;
}

.employee-detail-form textarea.input,
.employee-attachment-form textarea.input {
    min-height: 42px;
    resize: vertical;
}

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

.employee-detail-action {
    display: flex;
    align-items: end;
}

.employee-detail-action .btn {
    width: 100%;
}

.employee-attachment-form {
    display: grid;
    gap: 10px;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-alt);
}

.employee-attachment-file,
.employee-attachment-notes {
    grid-column: span 2;
}

.employee-attachment-action {
    display: flex;
    align-items: end;
}

.employee-attachment-action .btn {
    width: 100%;
}

.employee-editor-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 18px -22px -22px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
}

body.theme-dark .employee-editor-actions {
    background: rgba(18, 31, 39, 0.9);
}

.request-selected-panel {
    max-width: 1120px;
}

.request-detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.request-detail-list div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-alt);
    padding: 12px;
}

.request-detail-list strong,
.request-detail-list span {
    display: block;
}

.request-detail-list strong {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.request-detail-list span {
    line-height: 1.8;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.custody-stats {
    margin-top: 16px;
}

.section-subtitle {
    margin: 22px 0 10px;
    font-size: 17px;
}

.compact-table {
    min-width: 620px;
}

.appointment-panel,
.appointment-editor-panel,
.appointment-calendar-panel {
    margin-bottom: 18px;
}

.appointment-calendar-panel {
    overflow-x: auto;
}

.appointment-head {
    align-items: center;
}

.appointment-toolbar {
    align-items: end;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.appointment-title-field {
    display: flex;
    flex-direction: column;
}

.calendar-range-label {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-alt);
    color: var(--primary-dark);
    font-weight: 900;
}

.appointment-form-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
}

.appointment-options-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.6fr) repeat(2, minmax(220px, 1fr));
    gap: 14px;
    align-items: end;
}

.appointment-check {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.72);
}

body.theme-dark .appointment-check {
    background: rgba(21, 36, 45, 0.72);
}

.appointment-drawer-shell {
    position: fixed;
    inset: 0;
    z-index: 1200;
    visibility: hidden;
    pointer-events: none;
}

.appointment-drawer-shell.is-open {
    visibility: visible;
    pointer-events: auto;
}

.appointment-drawer-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(4, 18, 25, 0.46);
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.26s var(--ease);
}

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

.appointment-drawer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(620px, 92vw);
    padding: 16px;
    overflow-y: auto;
    background: var(--panel-solid);
    box-shadow: 18px 0 46px rgba(5, 19, 27, 0.24);
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease);
}

.appointment-drawer-shell.is-open .appointment-drawer {
    transform: translateX(0);
}

.appointment-drawer .appointment-editor-panel {
    min-height: calc(100vh - 32px);
    margin-bottom: 0;
}

.appointment-drawer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.appointment-drawer-top h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
}

.appointment-drawer-top p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 13px;
    font-weight: 800;
}

.appointment-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-alt);
    color: var(--primary-dark);
    cursor: pointer;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease;
}

.appointment-drawer-close:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: var(--primary-soft);
}

.appointment-calendar {
    display: grid;
    gap: 10px;
}

.month-view {
    grid-template-columns: repeat(7, minmax(120px, 1fr));
}

.week-view {
    grid-template-columns: repeat(7, minmax(150px, 1fr));
}

.calendar-weekday {
    min-height: 38px;
    padding: 9px 10px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-soft), rgba(36, 111, 159, 0.1));
    color: var(--primary-dark);
    font-weight: 900;
    text-align: center;
}

.calendar-day {
    min-height: 154px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

body.theme-dark .calendar-day {
    background: rgba(21, 36, 45, 0.76);
}

.week-view .calendar-day {
    min-height: 440px;
}

.calendar-day.outside {
    opacity: 0.58;
}

.calendar-day.today {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(190, 137, 36, 0.14), rgba(255, 255, 255, 0.82));
    box-shadow: inset 0 0 0 2px rgba(190, 137, 36, 0.3), var(--shadow-active);
}

body.theme-dark .calendar-day.today {
    background: linear-gradient(180deg, rgba(190, 137, 36, 0.18), rgba(21, 36, 45, 0.82));
}

.calendar-day.past {
    border-style: dashed;
    background: rgba(238, 243, 245, 0.78);
}

body.theme-dark .calendar-day.past {
    background: rgba(15, 29, 38, 0.72);
}

.calendar-day.past .calendar-date-head {
    opacity: 0.54;
    cursor: not-allowed;
}

.calendar-day.past .calendar-date-head strong,
.calendar-day.past .calendar-date-head span,
.calendar-day.past .calendar-date-head small {
    color: var(--muted);
}

.calendar-day.today .calendar-date-head strong {
    color: var(--gold);
}

.calendar-day.past .calendar-events {
    opacity: 0.96;
}

.calendar-date-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding-bottom: 9px;
    margin-bottom: 8px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
    appearance: none;
}

.calendar-day-trigger {
    transition: color 0.2s ease, border-color 0.2s ease;
}

.calendar-day-trigger:hover,
.calendar-day-trigger:focus-visible {
    border-bottom-color: var(--line-strong);
    outline: none;
}

.calendar-day-trigger:hover strong,
.calendar-day-trigger:focus-visible strong {
    color: var(--primary-dark);
}

.calendar-day-trigger:disabled {
    cursor: not-allowed;
}

.calendar-day.past .calendar-day-trigger:hover,
.calendar-day.past .calendar-day-trigger:focus-visible {
    border-bottom-color: var(--line);
}

.calendar-day.past .calendar-day-trigger:hover strong,
.calendar-day.past .calendar-day-trigger:focus-visible strong {
    color: var(--muted);
}

.calendar-date-head strong {
    display: block;
    font-size: 22px;
    line-height: 1;
    color: var(--text);
}

.calendar-date-head span,
.calendar-date-head small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-event {
    display: block;
    padding: 7px 8px;
    border: 1px solid rgba(15, 143, 131, 0.16);
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary-dark);
    text-decoration: none;
    transition: transform 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease;
}

.calendar-event:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: rgba(15, 143, 131, 0.18);
}

.calendar-event.multi-day {
    border-color: rgba(36, 111, 159, 0.22);
    background: var(--blue-soft);
    color: var(--blue);
}

.calendar-event strong,
.calendar-event span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event strong {
    font-size: 13px;
    font-weight: 900;
}

.calendar-event span {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
}

.calendar-more {
    display: inline-flex;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--gold-soft);
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
}

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

.year-month {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.76);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

body.theme-dark .year-month {
    background: rgba(21, 36, 45, 0.76);
}

.year-month h3 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 900;
    color: var(--text);
}

.year-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.year-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-alt);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    font-weight: 900;
    appearance: none;
}

.year-day small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1;
}

.year-day b {
    position: absolute;
    top: -6px;
    left: -4px;
    min-width: 19px;
    height: 19px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    line-height: 19px;
    text-align: center;
}

.year-day.has-events {
    border-color: var(--line-strong);
    background: var(--primary-soft);
}

.year-day.today {
    border-color: var(--gold);
    background: var(--gold-soft);
    color: var(--gold);
    box-shadow: inset 0 0 0 2px var(--gold);
}

.year-day.past {
    border-style: dashed;
    background: rgba(238, 243, 245, 0.82);
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.68;
}

.year-day.past.has-events {
    opacity: 0.86;
}

body.theme-dark .year-day.past {
    background: rgba(15, 29, 38, 0.72);
}

.appointment-table {
    min-width: 940px;
}

.cheque-panel,
.cheque-entry-panel,
.cheque-table-panel,
.cheque-template-form,
.cheque-preview-panel {
    margin-bottom: 16px;
}

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

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

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

.cheque-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(145px, 0.7fr)) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.cheque-filter-bar .form-actions {
    margin: 0;
}

.cheque-template-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
    gap: 16px;
    align-items: start;
}

.cheque-template-head-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.cheque-coordinate-grid {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(96px, 0.55fr) minmax(96px, 0.55fr);
    gap: 9px;
    align-items: center;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(238, 246, 247, 0.74);
}

body.theme-dark .cheque-coordinate-grid {
    background: rgba(14, 31, 39, 0.7);
}

.cheque-coordinate-grid label,
.coord-head {
    font-weight: 900;
    color: var(--text);
}

.coord-head {
    padding: 9px 10px;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    text-align: center;
}

.cheque-preview-panel {
    position: sticky;
    top: 16px;
}

.cheque-preview-sheet {
    position: relative;
    max-width: 100%;
    margin-top: 14px;
    overflow: hidden;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(15, 143, 131, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(15, 143, 131, 0.08) 1px, transparent 1px),
        var(--panel-solid);
    background-size: 10mm 10mm;
    box-shadow: var(--shadow-sm);
}

.cheque-preview-field {
    position: absolute;
    display: inline-flex;
    align-items: center;
    min-width: 26mm;
    min-height: 8mm;
    padding: 2px 5px;
    border: 1px solid rgba(15, 143, 131, 0.2);
    border-radius: 6px;
    background: rgba(15, 143, 131, 0.1);
    color: var(--primary-dark);
    font-weight: 900;
    white-space: nowrap;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.cheque-preview-field:hover,
.cheque-preview-field.is-dragging {
    border-color: var(--primary);
    background: rgba(15, 143, 131, 0.18);
    box-shadow: var(--shadow-sm);
}

.cheque-preview-field.is-dragging {
    z-index: 3;
    cursor: grabbing;
    transform: scale(1.02);
}

.cheque-table-panel .grid-icon-action {
    font-size: 0;
}

.cheque-table-panel .grid-icon-action::before {
    flex: 0 0 18px;
}

@media (max-width: 980px) {
    .hr-two-column {
        grid-template-columns: 1fr;
    }

    .account-chart-hero {
        align-items: stretch;
        flex-direction: column;
    }

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

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

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

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

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

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

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

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

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

    .journal-search-field,
    .journal-filter-actions {
        grid-column: auto;
    }

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

    .journal-detail-header-grid {
        grid-template-columns: 1fr;
    }

    .journal-detail-description {
        grid-column: auto;
    }

    .journal-detail-actions,
    .journal-lines-panel .table-head-line,
    .journal-add-line-grid {
        align-items: stretch;
        flex-direction: column;
    }

    .journal-add-line-grid {
        display: flex;
    }

    .cashbox-notes-field {
        grid-column: auto;
    }

    .bank-notes-field {
        grid-column: auto;
    }

    .customer-address-field,
    .customer-notes-field {
        grid-column: auto;
    }

    .supplier-address-field,
    .supplier-notes-field {
        grid-column: auto;
    }

    .branch-address-field,
    .branch-notes-field {
        grid-column: auto;
    }

    .costcenter-notes-field {
        grid-column: auto;
    }

    .period-notes-field {
        grid-column: auto;
    }

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

    .table-search-field {
        min-width: 0;
    }

    .messenger-shell,
    .messenger-compose {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .messenger-list,
    .compose-side {
        border-left: none;
        border-bottom: 1px solid var(--line);
        max-height: 420px;
    }

    .messenger-chat,
    .compose-chat {
        min-height: 520px;
    }

    .leave-flow {
        grid-template-columns: 1fr;
    }

    .leave-main-grid,
    .leave-date-row,
    .leave-balance-grid,
    .leave-attachment-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .leave-flow span::after {
        display: none;
    }

    .mail-compose-panel .field-row {
        grid-template-columns: 1fr;
    }

    .mail-recipient-field {
        grid-column: span 1;
    }

    .lookup-workspace {
        grid-template-columns: 1fr;
    }

    .appointment-form-grid,
    .appointment-options-row {
        grid-template-columns: 1fr;
    }

    .appointment-calendar-panel {
        overflow-x: auto;
    }

    .appointment-drawer {
        width: min(620px, 96vw);
        padding: 12px;
    }

    .appointment-drawer .appointment-editor-panel {
        min-height: calc(100vh - 24px);
    }

    .month-view,
    .week-view {
        min-width: 860px;
    }

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

.light-preview {
    background:
        linear-gradient(90deg, #10242d 0 24%, #f4f7f8 24%),
        linear-gradient(#fff, #fff);
}

.dark-preview {
    background:
        linear-gradient(90deg, #0b1720 0 24%, #12202a 24%),
        linear-gradient(#15242d, #15242d);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes slideFromRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes financeGridDrift {
    from {
        background-position: 0 0, 0 0;
    }
    to {
        background-position: 48px 48px, 48px 48px;
    }
}

@keyframes financeScan {
    from {
        background-position: 0 0, -80px 0;
    }
    to {
        background-position: 0 0, 120px 0;
    }
}

@keyframes financeFloat {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
        opacity: 0.38;
    }
    50% {
        transform: translate3d(0, -18px, 0);
        opacity: 0.64;
    }
}

@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 (max-width: 1220px) {
    .companies-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .employee-profile-grid,
    .employee-account-grid,
    .employee-detail-form,
    .employee-attachment-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .employee-profile-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

@media (max-width: 980px) {
    .landing-main,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .landing-page {
        background-attachment: scroll;
        background-position: center;
    }

    .landing-main {
        align-items: start;
        padding-top: 26px;
    }

    .sidebar {
        position: relative;
        height: auto;
        max-height: none;
        padding: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 14px 34px rgba(10, 29, 38, 0.18);
        animation: none;
        transform: none;
        z-index: 700;
    }

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

    .sidebar .brand {
        margin-bottom: 0;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.92);
        cursor: pointer;
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
        transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
    }

    .mobile-menu-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 999px;
        background: #0f8f83;
        transition: transform 0.2s var(--ease), opacity 0.2s ease;
    }

    .mobile-menu-toggle:hover {
        transform: translateY(-1px);
        border-color: rgba(45, 212, 191, 0.45);
    }

    .sidebar.menu-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 900;
        background: rgba(3, 12, 17, 0.48);
        backdrop-filter: blur(3px);
    }

    .sidebar.menu-open .mobile-menu-toggle {
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 960;
    }

    .sidebar.menu-open .mobile-menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .sidebar.menu-open .mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    .sidebar.menu-open .mobile-menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .sidebar-menu-panel {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 940;
        width: min(86vw, 340px);
        height: 100vh;
        max-height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        box-sizing: border-box;
        margin-top: 0;
        padding: 74px 14px 18px;
        overflow-y: auto;
        background:
            linear-gradient(180deg, rgba(16, 36, 45, 0.99), rgba(10, 29, 38, 0.99)),
            linear-gradient(135deg, rgba(15, 143, 131, 0.2), transparent);
        border-left: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow: -18px 0 44px rgba(0, 0, 0, 0.28);
        opacity: 0;
        visibility: hidden;
        transform: translateX(105%);
        transition: transform 0.24s var(--ease), opacity 0.2s ease, visibility 0.2s ease;
    }

    .sidebar.menu-open .sidebar-menu-panel {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

    .sidebar-context {
        margin-bottom: 12px;
        padding: 12px 14px;
    }

    .nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 8px;
    }

    .nav-group.open .nav-group-links {
        max-height: 360px;
        overflow-y: auto;
        padding-left: 2px;
    }

    .content-area {
        min-width: 0;
        position: relative;
        z-index: 1;
    }

    .main {
        padding: 20px;
    }

    .topbar {
        padding-inline: 20px;
        z-index: 500;
    }

    .topbar-actions {
        position: relative;
        z-index: 520;
    }

    .topbar-title h1 {
        font-size: 22px;
    }

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

    .employee-page-head,
    .employee-editor-head {
        flex-direction: column;
        align-items: stretch;
    }

    .employee-head-actions {
        width: 100%;
        min-width: 0;
    }

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

    .employee-photo-panel {
        grid-template-columns: 150px minmax(0, 1fr);
        align-items: center;
    }

    .employee-photo-preview {
        margin-inline: 0;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .finance-floater {
        min-width: 40px;
        height: 32px;
        padding-inline: 10px;
        font-size: 12px;
        opacity: 0.42;
    }

    .finance-floater-3,
    .finance-floater-4,
    .finance-floater-5,
    .finance-floater-6 {
        display: none;
    }

    .finance-floater-1 {
        top: 16%;
        left: 8%;
    }

    .finance-floater-2 {
        top: 50%;
        left: 7%;
    }

    .landing-header,
    .landing-main,
    .main,
    .topbar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .landing-main {
        gap: 26px;
        padding-bottom: 34px;
    }

    .hero-strip,
    .field-row,
    .leave-main-grid,
    .leave-date-row,
    .leave-balance-grid,
    .leave-attachment-row,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-panel,
    .form-panel,
    .table-panel,
    .plain-panel,
    .choice-card {
        padding: 14px;
        margin-bottom: 14px;
    }

    .dashboard-screen-head {
        display: block;
        margin-bottom: 12px;
    }

    .dashboard-tabs {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .dashboard-tab {
        width: 100%;
        justify-content: space-between;
        min-height: 42px;
        padding: 9px 12px;
    }

    .dashboard-screen-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-screen-card {
        min-height: 84px;
        padding: 15px;
    }

    .employee-head-actions,
    .employee-card-actions,
    .employee-tab-toolbar,
    .employee-editor-person {
        flex-direction: column;
        align-items: stretch;
    }

    .employee-card-grid,
    .employee-profile-grid,
    .employee-account-grid,
    .employee-detail-form,
    .employee-attachment-form {
        grid-template-columns: 1fr;
    }

    .employee-card {
        min-height: auto;
        padding: 15px;
    }

    .employee-tabs {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .employee-tab-link {
        width: 100%;
    }

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

    .employee-photo-preview {
        width: 132px;
        height: 132px;
        margin-inline: auto;
    }

    .employee-attachment-file,
    .employee-attachment-notes,
    .employee-profile-wide,
    .employee-wide-field {
        grid-column: auto;
    }

    .employee-editor-actions {
        display: grid;
        grid-template-columns: 1fr;
        margin: 16px -14px -14px;
        padding: 12px 14px;
    }

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

    .companies-active-switch {
        width: 100%;
        justify-content: space-between;
    }

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

    .companies-table-head {
        margin-bottom: 10px;
    }

    .sidebar {
        padding: 12px;
    }

    .sidebar .brand {
        min-height: 42px;
        margin-bottom: 0;
    }

    .sidebar .brand img {
        width: 38px;
        height: 38px;
    }

    .sidebar-context {
        padding: 10px 12px;
    }

    .sidebar-context span {
        font-size: 12px;
    }

    .nav {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .nav-group {
        padding: 5px;
        border-radius: 8px;
    }

    .nav a,
    .nav-group-title {
        min-height: 40px;
        padding: 9px 11px;
        border-radius: 8px;
        font-size: 14px;
    }

    .nav-child {
        min-height: 36px !important;
        padding: 8px 12px !important;
        padding-right: 20px !important;
        font-size: 13px !important;
    }

    .nav-group-links {
        gap: 3px;
        padding-top: 5px;
    }

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

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

    .company-overview-panel .company-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .company-overview-panel .company-summary-card {
        padding: 10px 11px;
    }

    .company-tabs {
        width: 100%;
    }

    .company-tabs .tab-link {
        flex: 1 1 100%;
    }

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

    .nav-group.open .nav-group-links {
        max-height: 46vh;
    }

    .topbar {
        align-items: center;
        flex-direction: row;
        gap: 10px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .topbar-title h1 {
        font-size: 19px;
        line-height: 1.35;
    }

    .topbar-title p {
        font-size: 13px;
    }

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

    .topbar-actions {
        width: auto;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .topbar-actions .btn,
    .notification-trigger,
    .user-trigger {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        flex: 0 0 40px;
        padding: 0;
        border-radius: 8px;
        justify-content: center;
    }

    .notification-menu,
    .user-menu {
        flex: 0 0 auto;
    }

    .company-switch-btn .action-text,
    .user-trigger span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .company-switch-btn::before {
        content: "⇄";
        font-size: 20px;
        line-height: 1;
        color: var(--primary-dark);
    }

    .notification-trigger,
    .user-trigger {
        gap: 0;
    }

    .notification-icon {
        width: 22px;
        height: 22px;
        font-size: 13px;
    }

    .header-avatar {
        width: 26px;
        height: 26px;
    }

    .notification-dropdown,
    .user-dropdown {
        position: fixed;
        top: 78px;
        left: 12px;
        right: 12px;
        min-width: 0;
        width: auto;
        max-width: none;
        max-height: min(70vh, 420px);
        overflow-y: auto;
        z-index: 850;
    }

    .user-dropdown a {
        white-space: nowrap;
    }

    .stat {
        padding: 14px;
    }

    .stat strong {
        font-size: 24px;
    }

    .data-table {
        min-width: 640px;
    }

    .appointment-head,
    .tracking-head {
        flex-direction: column;
        align-items: stretch;
    }

    .appointment-head .form-actions,
    .appointment-editor-panel .form-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .month-view,
    .week-view {
        min-width: 720px;
    }

    .calendar-day {
        min-height: 142px;
        padding: 8px;
    }

    .week-view .calendar-day {
        min-height: 340px;
    }

    .calendar-year-grid {
        grid-template-columns: 1fr;
    }

    .year-days {
        grid-template-columns: repeat(7, minmax(34px, 1fr));
    }

    .appointment-table {
        min-width: 820px;
    }

    .cheque-bank-grid,
    .cheque-entry-grid,
    .cheque-template-head-grid,
    .cheque-filter-bar,
    .cheque-template-layout {
        grid-template-columns: 1fr;
    }

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

    .cheque-preview-panel {
        position: relative;
        top: auto;
    }

    .cheque-coordinate-grid {
        grid-template-columns: minmax(112px, 1fr) repeat(2, minmax(78px, 0.72fr));
        overflow-x: auto;
    }

    .cheque-preview-sheet {
        transform-origin: top right;
    }
}
