/* ============ TOKENS ============ */
:root {
    --ink: #132A35;
    --ink2: #0F3A40;
    --paper: #EEF3F5;
    --card: #FFFFFF;
    --teal: #0E9384;
    --teal-d: #0B6E63;
    --amber: #F5A623;
    --coral: #F0564A;
    --blue: #2F80C3;
    --green: #2E9E5B;
    --slate: #5B7285;
    --mist: #8A9BAA;
    --line: #D8E1E6;
    --line-soft: #EAF0F2;
    --f-disp: 'Archivo', 'Cairo', sans-serif;
    --f-body: 'IBM Plex Sans', 'Tajawal', sans-serif;
    --sh: 0 1px 2px rgba(19, 42, 53, .05), 0 10px 26px -14px rgba(19, 42, 53, .22);
    --sh-lg: 0 4px 10px rgba(19, 42, 53, .06), 0 22px 44px -18px rgba(19, 42, 53, .30);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    font-family: var(--f-body);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        radial-gradient(circle, rgba(19, 42, 53, .05) 1px, transparent 1.4px),
        radial-gradient(900px 420px at 88% -8%, rgba(14, 147, 132, .12), transparent 60%),
        radial-gradient(760px 400px at -6% 24%, rgba(245, 166, 35, .10), transparent 60%),
        radial-gradient(700px 380px at 60% 110%, rgba(47, 128, 195, .08), transparent 55%);
    background-size: 22px 22px, auto, auto, auto;
    background-attachment: fixed;
}



::selection {
    background: var(--teal);
    color: #fff
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit
}

input,
select,
textarea {
    font-family: inherit;
    font-size: 12.5px;
    color: var(--ink)
}

.num {
    direction: ltr;
    unicode-bidi: isolate
}

h1,
h2,
h3,
.disp {
    font-family: var(--f-disp)
}

/* ============ TOPBAR ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    background: linear-gradient(90deg, #10333C 0%, #0E4A44 55%, #0C5A50 100%);
    color: #EAF6F3;
    box-shadow: 0 2px 14px rgba(12, 50, 48, .28);
    transition: box-shadow .3s;
}

.topbar.scrolled {
    box-shadow: 0 6px 26px rgba(12, 50, 48, .45)
}

.topbar::after {
    content: "";
    position: absolute;
    inset-inline-end: 0;
    top: 0;
    height: 100%;
    width: 220px;
    pointer-events: none;
    background: repeating-linear-gradient(-55deg, rgba(255, 255, 255, .045) 0 8px, transparent 8px 20px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1
}

.brand-mark {
    width: 32px;
    height: 32px;
    flex: none
}

.brand-txt b {
    display: block;
    font: 800 15px/1 var(--f-disp);
    letter-spacing: .06em
}

.brand-txt span {
    display: block;
    font-size: 9px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #9ED4C9;
    margin-top: 2px
}

[dir="rtl"] .brand-txt span {
    letter-spacing: .08em
}

.nav-links {
    display: flex;
    gap: 2px;
    margin-inline-start: 14px;
    position: relative;
    z-index: 1
}

.nav-links a {
    position: relative;
    padding: 8px 13px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 12px;
    color: rgba(234, 246, 243, .75);
    transition: .22s
}

.nav-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .09)
}

.nav-links a.active {
    color: #fff;
    background: rgba(255, 255, 255, .12)
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    inset-inline: 13px;
    bottom: 2px;
    height: 3px;
    border-radius: 3px;
    background: var(--amber)
}

.nav-links a.new-doc {
    background: var(--amber);
    color: #3D2A00;
    font-weight: 700;
    margin-inline-start: 6px
}

.nav-links a.new-doc:hover {
    background: #FFBE45;
    transform: translateY(-1px)
}

.nav-links a.new-doc::after {
    display: none
}

.top-actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2
}

.lang-btn {
    border: 1.5px solid rgba(255, 255, 255, .4);
    border-radius: 99px;
    padding: 5px 13px;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .04em;
    transition: .2s
}

.lang-btn:hover {
    background: rgba(255, 255, 255, .14);
    border-color: #fff
}

.icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .10);
    transition: .2s
}

.icon-btn:hover {
    background: rgba(255, 255, 255, .20);
    transform: translateY(-1px)
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    stroke: #EAF6F3
}

.badge {
    position: absolute;
    top: -4px;
    inset-inline-end: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 99px;
    background: var(--coral);
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    display: grid;
    place-items: center;
    border: 2px solid #0E4A44
}

.badge.pulse {
    animation: pulse 1.8s infinite
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.18)
    }
}

.avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .10);
    transition: .2s
}

[dir="rtl"] .avatar-btn {
    padding: 4px 4px 4px 8px
}

.avatar-btn:hover {
    background: rgba(255, 255, 255, .2)
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font: 800 11px var(--f-disp);
    color: #fff;
    background: linear-gradient(135deg, var(--amber), var(--coral))
}

.avatar-btn small {
    font-size: 11px;
    font-weight: 700
}

.burger {
    display: none
}

/* dropdowns */
.dd {
    position: relative
}

.dd-panel {
    position: absolute;
    top: calc(100% + 12px);
    inset-inline-end: 0;
    min-width: 300px;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--sh-lg);
    padding: 8px;
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    transform-origin: top;
    pointer-events: none;
    transition: .22s cubic-bezier(.2, .9, .3, 1.2)
}

.dd.open .dd-panel {
    opacity: 1;
    transform: none;
    pointer-events: auto
}

.dd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 6px
}

.dd-head b {
    font-size: 12.5px
}

.link-btn {
    font-size: 11px;
    font-weight: 700;
    color: var(--teal);
    padding: 4px 8px;
    border-radius: 7px
}

.link-btn:hover {
    background: rgba(14, 147, 132, .1)
}

.notif-item {
    display: flex;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    transition: .18s;
    position: relative;
    cursor: pointer
}

.notif-item:hover {
    background: #F2F8F7
}

.notif-item.unread {
    background: color-mix(in srgb, var(--teal) 7%, white)
}

.notif-ic {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 13px;
    color: #fff
}

.notif-item p {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.4
}

.notif-item small {
    font-size: 10px;
    color: var(--mist);
    font-weight: 600
}

.notif-item .dot {
    position: absolute;
    top: 12px;
    inset-inline-end: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--coral)
}

.dd-foot {
    display: block;
    text-align: center;
    margin-top: 6px;
    padding: 9px;
    border-radius: 10px;
    background: #F4F8F9;
    font-size: 11px;
    font-weight: 700;
    color: var(--slate)
}

.dd-foot:hover {
    background: #E8F0F2;
    color: var(--teal)
}

.user-panel {
    min-width: 220px
}

.user-top {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 6px
}

.user-top .avatar {
    width: 38px;
    height: 38px;
    font-size: 13px
}

.user-top b {
    display: block;
    font-size: 12.5px
}

.user-top span {
    font-size: 10.5px;
    color: var(--mist);
    font-weight: 600
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    transition: .15s
}

.menu-item:hover {
    background: #F2F8F7;
    color: var(--teal-d)
}

.menu-item.danger:hover {
    background: #FDF1F0;
    color: var(--coral)
}

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

/* ============ LAYOUT ============ */
main {
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px 18px 70px;
    position: relative;
    z-index: 1
}

.view {
    display: none
}

.view.active {
    display: block;
    animation: viewIn .4s cubic-bezier(.2, .8, .3, 1)
}

@keyframes viewIn {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px
}

.page-head h1 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: 10px
}

.page-head h1::before {
    content: "";
    width: 6px;
    height: 22px;
    border-radius: 4px;
    background: linear-gradient(var(--amber), var(--coral))
}

.page-head .sub {
    font-size: 11.5px;
    color: var(--slate);
    font-weight: 500;
    width: 100%;
    margin-top: -6px;
    padding-inline-start: 16px
}

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .55s ease, transform .55s cubic-bezier(.2, .8, .3, 1)
}

.reveal.in {
    opacity: 1;
    transform: none
}

/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 9px;
    font-weight: 700;
    font-size: 12px;
    transition: .2s;
    border: 1.5px solid transparent
}

.btn:active {
    transform: scale(.97)
}

.btn.sm {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 8px
}

.b-teal {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 4px 12px -4px rgba(14, 147, 132, .55)
}

.b-teal:hover {
    background: var(--teal-d);
    transform: translateY(-1px)
}

.b-amber {
    background: var(--amber);
    color: #3D2A00;
    box-shadow: 0 4px 12px -4px rgba(245, 166, 35, .6)
}

.b-amber:hover {
    background: #FFBE45;
    transform: translateY(-1px)
}

.b-ink {
    background: var(--ink);
    color: #fff
}

.b-ink:hover {
    background: #1E4557;
    transform: translateY(-1px)
}

.b-line {
    border-color: var(--line);
    background: #fff;
    color: var(--slate)
}

.b-line:hover {
    border-color: var(--teal);
    color: var(--teal-d);
    transform: translateY(-1px)
}

.ibtn {
    width: 29px;
    height: 29px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--slate);
    transition: .18s
}

.ibtn:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh)
}

.ibtn.teal:hover {
    color: #fff;
    background: var(--teal);
    border-color: var(--teal)
}

.ibtn.amber:hover {
    color: #fff;
    background: var(--amber);
    border-color: var(--amber)
}

.ibtn.coral:hover {
    color: #fff;
    background: var(--coral);
    border-color: var(--coral)
}

.ibtn svg {
    width: 14px;
    height: 14px
}

/* chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap
}

.chip .cd {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor
}

/* ============ LEDGER STRIP ============ */
.ledger {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    color: #EAF6F3;
    padding: 20px 24px;
    margin-bottom: 16px;
    background: linear-gradient(115deg, #0F3A40, #0C5A50 70%, #0E6E5A);
    box-shadow: var(--sh-lg)
}

.ledger::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-55deg, rgba(255, 255, 255, .04) 0 10px, transparent 10px 26px)
}

.ledger-in {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0
}

.ledger-cell {
    padding: 0 26px;
    border-inline-start: 1px dashed rgba(255, 255, 255, .28)
}

.ledger-cell:first-child {
    padding-inline-start: 0;
    border: none
}

.ledger-cell small {
    display: block;
    font-size: 9.5px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #9ED4C9;
    font-weight: 700;
    margin-bottom: 5px
}

[dir="rtl"] .ledger-cell small {
    letter-spacing: .05em
}

.ledger-cell .big {
    font: 800 30px/1 var(--f-disp)
}

.ledger-cell .mid {
    font: 700 15px/1.3 var(--f-body)
}

.ledger-date .big {
    color: #FFD98A
}

.ledger-actions {
    margin-inline-start: auto;
    display: flex;
    gap: 9px;
    padding-inline-end: 0
}

.stamp {
    position: absolute;
    top: -24px;
    inset-inline-end: 190px;
    width: 86px;
    height: 86px;
    border: 2.5px dashed rgba(255, 217, 138, .5);
    border-radius: 50%;
    display: grid;
    place-items: center;
    transform: rotate(-14deg);
    font: 800 10px/1.5 var(--f-disp);
    letter-spacing: .14em;
    color: rgba(255, 217, 138, .75);
    text-align: center;
    pointer-events: none
}

/* ============ KPIs ============ */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 13px;
    margin-bottom: 16px
}

.kpi {
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 3px solid var(--kc);
    border-radius: 13px;
    padding: 14px 16px;
    box-shadow: var(--sh);
    display: flex;
    gap: 12px;
    transition: .25s
}

.kpi:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-lg)
}

.kpi-ic {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--kc) 14%, white);
    color: var(--kc)
}

.kpi-ic svg {
    width: 19px;
    height: 19px
}

.kpi b {
    display: block;
    font: 800 26px/1.05 var(--f-disp);
    letter-spacing: -.02em
}

.kpi label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--slate)
}

[dir="rtl"] .kpi label {
    letter-spacing: .02em
}

.kpi .delta {
    margin-top: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    color: var(--kc)
}

.spark {
    margin-inline-start: auto;
    align-self: flex-end
}

/* ============ PANELS / CHARTS ============ */
.grid12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 13px
}

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--sh);
    padding: 16px
}

.panel h3 {
    font-size: 12.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px
}

.panel h3::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--pc, var(--teal));
    transform: rotate(45deg)
}

.sp4 {
    grid-column: span 4
}

.sp5 {
    grid-column: span 5
}

.sp6 {
    grid-column: span 6
}

.sp7 {
    grid-column: span 7
}

.sp8 {
    grid-column: span 8
}

.sp12 {
    grid-column: span 12
}

.donut-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap
}

.donut-svg {
    transform: rotate(-90deg)
}

.donut-svg circle {
    fill: none;
    stroke-width: 20;
    transition: stroke-dasharray 1s cubic-bezier(.2, .8, .3, 1)
}

.donut-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center
}

.donut-center b {
    font: 800 24px var(--f-disp)
}

.donut-center span {
    font-size: 9.5px;
    color: var(--mist);
    font-weight: 700;
    letter-spacing: .1em
}

.legend {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 600
}

.legend-row .sq {
    width: 10px;
    height: 10px;
    border-radius: 3px
}

.legend-row b {
    margin-inline-start: auto;
    font-family: var(--f-disp)
}

.legend-row small {
    color: var(--mist);
    font-weight: 700
}

.mchart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 180px;
    padding-top: 8px
}

.mcol {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    height: 100%;
    justify-content: flex-end
}

.mbars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 100%;
    width: 100%;
    justify-content: center
}

.mbar {
    width: 13px;
    border-radius: 4px 4px 0 0;
    transition: height .9s cubic-bezier(.2, .8, .3, 1), filter .2s;
    cursor: pointer
}

.mbar:hover {
    filter: brightness(1.15)
}

.mbar.in {
    background: linear-gradient(180deg, var(--teal), #0A7C70)
}

.mbar.out {
    background: linear-gradient(180deg, var(--amber), #DB8E0A)
}

.mcol span {
    font-size: 10px;
    font-weight: 700;
    color: var(--mist)
}

.ch-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--slate)
}

.ch-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-inline-end: 6px
}

.catrow {
    display: grid;
    grid-template-columns: 110px 1fr 34px;
    align-items: center;
    gap: 10px;
    margin-bottom: 11px;
    font-size: 11.5px;
    font-weight: 600
}

.catrow .track {
    height: 10px;
    border-radius: 99px;
    background: #EDF2F4;
    overflow: hidden
}

.catrow .fill {
    height: 100%;
    border-radius: 99px;
    width: 0;
    transition: width 1s cubic-bezier(.2, .8, .3, 1)
}

.catrow b {
    text-align: end;
    font-family: var(--f-disp)
}

.recent-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: .18s;
    border-bottom: 1px solid var(--line-soft)
}

.recent-row:hover {
    background: #F4F9F8;
    transform: translateX(3px)
}

[dir="rtl"] .recent-row:hover {
    transform: translateX(-3px)
}

.recent-row:last-child {
    border: none
}

.r-type {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 13px
}

.recent-row .rt {
    flex: 1;
    min-width: 0
}

.recent-row .rt b {
    display: block;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.recent-row .rt small {
    font-size: 10px;
    color: var(--mist);
    font-weight: 600
}

/* ============ FILTERS ============ */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 14px 16px;
    margin-bottom: 13px
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px
}

.field label {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--slate)
}

[dir="rtl"] .field label {
    letter-spacing: .02em
}



.inp {
    height: 34px;
    border: 1.5px solid var(--line);
    border-radius: 9px;
    padding: 0 11px;
    background: #fff;
    transition: .2s;
    min-width: 0
}


.inp:hover {
    border-color: #B9CBD3
}

.inp:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(14, 147, 132, .16)
}

select.inp {
    appearance: none;
    padding-inline-end: 30px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235B7285' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center right 11px
}

[dir="rtl"] select.inp {
    background-position: center left 11px;
    padding-inline-end: 11px;
    padding-inline-start: 30px
}

.field.grow {
    flex: 1;
    min-width: 190px
}

.field.grow .inp {
    width: 100%
}

.result-note {
    font-size: 11px;
    font-weight: 700;
    color: var(--slate);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
    padding-bottom: 7px
}

.result-note b {
    color: var(--teal);
    font-family: var(--f-disp);
    font-size: 13px
}

.type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px
}

.tchip-btn {
    padding: 6px 13px;
    border-radius: 99px;
    border: 1.5px solid var(--line);
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    color: var(--slate);
    transition: .2s
}

.tchip-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--sh)
}

.tchip-btn.on {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff
}

/* ============ TABLE ============ */
.tablewrap {
    padding: 0;
    overflow: hidden
}

table {
    width: 100%;
    border-collapse: collapse
}

thead th {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--slate);
    text-align: start;
    padding: 12px 14px;
    background: #F6FAFA;
    border-bottom: 2px solid var(--line)
}

[dir="rtl"] thead th {
    letter-spacing: .02em
}

tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12px;
    vertical-align: middle
}

tbody tr {
    transition: .16s
}

tbody tr:hover {
    background: #F4FAF9
}

tbody tr:last-child td {
    border-bottom: none
}

.doc-num b {
    font-family: var(--f-disp);
    font-size: 12px;
    display: block
}

.doc-num small {
    font-size: 10px;
    color: var(--mist);
    font-weight: 600
}

.doc-title b {
    display: block;
    font-size: 12px;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.doc-title small {
    display: block;
    font-size: 10.5px;
    color: var(--slate);
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.row-acts {
    display: flex;
    gap: 6px
}

.unread-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--coral);
    margin-inline-start: 6px;
    animation: pulse 1.8s infinite
}

.empty-state {
    text-align: center;
    padding: 44px 20px;
    color: var(--mist)
}

.empty-state .big {
    font-size: 34px
}

.empty-state p {
    font-weight: 700;
    margin-top: 8px;
    color: var(--slate)
}

/* ============ CARDS ============ */
.cardgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
    gap: 13px
}

.dcard {
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 3.5px solid var(--tc);
    border-radius: 13px;
    padding: 14px 15px;
    box-shadow: var(--sh);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: .25s;
    position: relative
}

.dcard:hover {
    transform: translateY(-5px);
    box-shadow: var(--sh-lg)
}

.dcard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px
}

.tchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: 800 10.5px var(--f-disp);
    color: var(--tc);
    background: color-mix(in srgb, var(--tc) 12%, white);
    padding: 4px 9px;
    border-radius: 7px
}

.dcard h3 {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    min-height: 35px
}

.dcard .dsub {
    font-size: 11px;
    color: var(--slate);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px
}

.dcard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--mist)
}

.dcard-meta .sep {
    opacity: .5
}

.dcard-actions {
    display: flex;
    gap: 7px;
    margin-top: auto;
    padding-top: 9px;
    border-top: 1px dashed var(--line)
}

.dcard-actions .btn.sm {
    flex: 1
}

/* ============ FORM ============ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px
}

.fsec {
    position: relative;
    overflow: hidden
}

.fsec::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 70px;
    height: 3.5px;
    background: var(--fc, var(--teal));
    border-radius: 0 0 4px 0
}

.fsec-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px
}

.fsec-ic {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--fc, var(--teal)) 14%, white);
    color: var(--fc, var(--teal))
}

.fsec-ic svg {
    width: 16px;
    height: 16px
}

.fsec-head b {
    font-family: var(--f-disp);
    font-size: 13px
}

.fsec-head small {
    display: block;
    font-size: 10px;
    color: var(--mist);
    font-weight: 600
}

.frows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.frows.c3 {
    grid-template-columns: 1fr 1fr 1fr
}

.frows.c1 {
    grid-template-columns: 1fr
}

.field .inp,
.field textarea.inp {
    width: 100%
}

textarea.inp {
    height: auto;
    padding: 9px 11px;
    resize: vertical;
    line-height: 1.6
}

.inp_color {
    padding: 0 !important;
}

.err .inp{border-color:var(--coral);box-shadow:0 0 0 3px rgba(240,86,74,.14)}
.err .emsg{display:block}
.err .ic{color:var(--coral)}


.terms-err{display:block;font-size:10.5px;font-weight:700;color:var(--coral);margin-top:5px}



.chips-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 7px
}

.uchip {
    padding: 5px 12px;
    border-radius: 99px;
    border: 1.5px solid var(--line);
    font-size: 11px;
    font-weight: 700;
    color: var(--slate);
    transition: .18s;
    background: #fff
}

.uchip:hover {
    border-color: var(--teal)
}

.uchip.on {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
    box-shadow: 0 3px 8px -3px rgba(14, 147, 132, .6)
}

.drop {
    border: 2px dashed #A7D8CF;
    border-radius: 12px;
    background: color-mix(in srgb, var(--teal) 5%, white);
    padding: 26px 16px;
    text-align: center;
    transition: .2s;
    cursor: pointer
}

.drop:hover,
.drop.over {
    border-color: var(--teal);
    background: color-mix(in srgb, var(--teal) 11%, white);
    transform: scale(1.005)
}

.drop .dic {
    font-size: 26px
}

.drop b {
    display: block;
    font-size: 12.5px;
    margin-top: 5px
}

.drop small {
    font-size: 10.5px;
    color: var(--mist);
    font-weight: 600
}

.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    margin-top: 8px;
    background: #fff;
    animation: viewIn .3s
}

.file-ic {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: .05em
}

.file-row .fn {
    flex: 1;
    min-width: 0
}

.file-row .fn b {
    display: block;
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.file-row .fn small {
    font-size: 10px;
    color: var(--mist);
    font-weight: 600
}

.form-bar {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 15px 16px
}

.form-bar .spacer {
    margin-inline-start: auto;
    display: flex;
    gap: 10px
}

/* ============ DETAIL ============ */
.det-band {
    border-radius: 15px;
    padding: 20px 22px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
    background: linear-gradient(110deg, var(--tc), color-mix(in srgb, var(--tc) 70%, #132A35))
}

.det-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-55deg, rgba(255, 255, 255, .06) 0 9px, transparent 9px 24px)
}

.det-band-in {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-start
}

.det-stamp {
    flex: none;
    background: rgba(255, 255, 255, .16);
    border: 1.5px dashed rgba(255, 255, 255, .6);
    border-radius: 11px;
    padding: 9px 14px;
    text-align: center
}

.det-stamp small {
    display: block;
    font-size: 8.5px;
    letter-spacing: .2em;
    font-weight: 800;
    opacity: .85
}

.det-stamp b {
    font: 800 16px var(--f-disp)
}

.det-band h1 {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
    flex: 1;
    min-width: 240px
}

.det-band .dets {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px
}

.det-band .dets .chip {
    background: rgba(255, 255, 255, .2);
    color: #fff
}

.stepper {
    display: flex;
    align-items: center;
    padding: 16px 18px
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: none;
    width: 86px
}

.step .sc {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 11px;
    background: #EDF2F4;
    color: var(--mist);
    transition: .3s
}

.step.done .sc {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 4px 10px -3px rgba(14, 147, 132, .6)
}

.step.cur .sc {
    box-shadow: 0 0 0 5px rgba(14, 147, 132, .18);
    animation: pulse 2s infinite
}

.step span {
    font-size: 9.5px;
    font-weight: 800;
    color: var(--slate);
    text-align: center;
    letter-spacing: .04em
}

.step-line {
    flex: 1;
    height: 2.5px;
    background: #EDF2F4;
    border-radius: 3px;
    position: relative;
    top: -11px
}

.step-line.done {
    background: var(--teal)
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1px;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
    border-radius: 11px;
    overflow: hidden;
    margin-bottom: 14px
}

.mi {
    background: #fff;
    padding: 11px 13px
}

.mi label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mist);
    margin-bottom: 3px
}

[dir="rtl"] .mi label {
    letter-spacing: .02em
}

.mi div {
    font-size: 12px;
    font-weight: 600
}

.subject-box {
    background: #FFFBF0;
    border: 1px solid #F4E3BC;
    border-inline-start: 4px solid var(--amber);
    border-radius: 11px;
    padding: 14px 16px;
    margin-bottom: 14px
}

.subject-box label {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #B08420
}

[dir="rtl"] .subject-box label {
    letter-spacing: .02em
}

.subject-box p {
    margin-top: 5px;
    font-size: 12.5px;
    line-height: 1.7
}

.attach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 11px
}

.attach-card {
    display: flex;
    gap: 11px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 11px 12px;
    transition: .2s
}

.attach-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-lg);
    border-color: color-mix(in srgb, var(--fc2) 45%, white)
}

.attach-card .fn {
    flex: 1;
    min-width: 0
}

.attach-card .fn b {
    display: block;
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.attach-card .fn small {
    font-size: 10px;
    color: var(--mist);
    font-weight: 700
}

.tl {
    list-style: none;
    position: relative;
    padding-inline-start: 20px
}

.tl::before {
    content: "";
    position: absolute;
    inset-inline-start: 6px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--line)
}

.tl li {
    position: relative;
    padding: 0 0 14px 14px
}

[dir="rtl"] .tl li {
    padding: 0 14px 14px 0
}

.tl li::before {
    content: "";
    position: absolute;
    inset-inline-start: -19px;
    top: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--teal)
}

.tl li b {
    display: block;
    font-size: 11.5px
}

.tl li small {
    font-size: 10px;
    color: var(--mist);
    font-weight: 600
}

/* ============ MISC ============ */
.toasts {
    position: fixed;
    bottom: 20px;
    inset-inline-end: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 9px
}

.toast {
    background: var(--ink);
    color: #fff;
    padding: 12px 16px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--sh-lg);
    display: flex;
    gap: 10px;
    align-items: center;
    animation: toastIn .35s cubic-bezier(.2, .9, .3, 1.3);
    border-inline-start: 4px solid var(--green)
}

.toast.warn {
    border-color: var(--amber)
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.96)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--slate);
    margin-bottom: 12px;
    padding: 6px 11px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    transition: .2s
}

.back-link:hover {
    color: var(--teal-d);
    border-color: var(--teal);
    transform: translateX(-3px)
}

[dir="rtl"] .back-link:hover {
    transform: translateX(3px)
}

footer {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px 30px;
    font-size: 10.5px;
    color: var(--mist);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap
}

.mobile-panel {
    display: none
}

/* ============ RESPONSIVE ============ */
@media(max-width:1020px) {

    .sp4,
    .sp5,
    .sp6,
    .sp7,
    .sp8 {
        grid-column: span 12
    }

    .stamp {
        display: none
    }
}

@media(max-width:880px) {
    .nav-links {
        display: none
    }

    .burger {
        display: grid
    }

    .mobile-panel {
        display: none;
        position: sticky;
        top: 58px;
        z-index: 55;
        background: #0E4A44;
        padding: 12px 18px 16px;
        flex-direction: column;
        gap: 4px;
        box-shadow: 0 14px 26px rgba(12, 50, 48, .35)
    }

    .mobile-panel.open {
        display: flex
    }

    .mobile-panel a {
        padding: 11px 14px;
        border-radius: 10px;
        color: #DFF2EE;
        font-weight: 700;
        font-size: 13px
    }

    .mobile-panel a.active,
    .mobile-panel a:hover {
        background: rgba(255, 255, 255, .12);
        color: #fff
    }

    .ledger-cell {
        padding: 8px 18px;
        border: none
    }

    .ledger-actions {
        margin: 8px 0 0;
        width: 100%
    }

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

    .frows,
    .frows.c3 {
        grid-template-columns: 1fr 1fr
    }

    .avatar-btn small {
        display: none
    }
}

/* responsive table -> stacked cards */
@media(max-width:920px) {
    .tablewrap {
        background: transparent;
        border: none;
        box-shadow: none;
        overflow: visible
    }

    table,
    tbody,
    tr,
    td {
        display: block
    }

    thead {
        display: none
    }

    tbody tr {
        background: var(--card);
        border: 1px solid var(--line);
        border-inline-start: 4px solid var(--rowc, var(--teal));
        border-radius: 13px;
        margin-bottom: 11px;
        padding: 6px 4px;
        box-shadow: var(--sh)
    }

    tbody tr:hover {
        background: var(--card)
    }

    tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        border: none;
        padding: 8px 14px
    }

    tbody td::before {
        content: attr(data-label);
        font-size: 9.5px;
        font-weight: 800;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--mist);
        flex: none
    }

    [dir="rtl"] tbody td::before {
        letter-spacing: .01em
    }

    .doc-title b,
    .doc-title small {
        max-width: 60vw;
        white-space: normal
    }

    .row-acts {
        justify-content: flex-end
    }
}

@media(max-width:560px) {

    .frows,
    .frows.c3 {
        grid-template-columns: 1fr
    }

    .kpi b {
        font-size: 22px
    }

    .dd-panel {
        position: fixed;
        top: 64px;
        inset-inline: 10px;
        min-width: 0
    }
}

@media print {

    .topbar,
    .filters,
    .no-print,
    .form-bar {
        display: none !important
    }

    body {
        background: #fff
    }
}
