        :root {
            --ink: #13243d;
            /* ??? ???? - ?????? ??????? */
            --ink-2: #1d3354;
            --ink-3: #2a456b;
            --bone: #f4f1e9;
            /* ????? ????? ????? */
            --paper: #ffffff;
            --brass: #b8893a;
            /* ?????/???? - ??????? ???????? */
            --brass-soft: #e9dcc2;
            --text: #1a2436;
            --muted: #6b7688;
            --line: #e4ded0;
            --line-2: #eef0f3;
            --green: #2f7d5b;
            --green-bg: #e6f2ec;
            --amber: #b87a14;
            --amber-bg: #fbf0d9;
            --red: #b23a3a;
            --red-bg: #f8e6e6;
            --slate: #5a6b85;
            --slate-bg: #eaeef4;
            --shadow: 0 1px 2px rgba(19, 36, 61, .06), 0 8px 24px rgba(19, 36, 61, .06);
            --shadow-lg: 0 12px 48px rgba(19, 36, 61, .18);
            --radius: 14px;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0
        }

        html,
        body {
            height: 100%
        }

        body {
            font-family: 'Tajawal', system-ui, sans-serif;
            background: var(--bone);
            color: var(--text);
            font-size: 15px;
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
        }

        h1,
        h2,
        h3,
        h4 {
            font-weight: 700;
            line-height: 1.3
        }

        .amiri {
            font-family: 'Amiri', serif
        }

        button {
            font-family: inherit;
            cursor: pointer;
            border: none;
            background: none
        }

        input,
        select,
        textarea {
            font-family: inherit;
            font-size: 15px
        }

        ::selection {
            background: var(--brass-soft)
        }

        :focus-visible {
            outline: 2px solid var(--brass);
            outline-offset: 2px;
            border-radius: 6px
        }

        /* ============ ???? ????? ============ */
        #lock {
            position: fixed;
            inset: 0;
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            background: radial-gradient(120% 120% at 50% 0%, #1d3354 0%, #0d1828 70%);
            padding: 24px
        }

        .lock-card {
            width: 100%;
            max-width: 380px;
            text-align: center;
            color: #fff
        }

        .lock-seal {
            width: 78px;
            height: 78px;
            margin: 0 auto 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            border: 2px solid var(--brass);
            color: var(--brass);
            background: rgba(184, 137, 58, .08)
        }

        .lock-card h1 {
            font-size: 24px;
            margin-bottom: 6px
        }

        .lock-card .sub {
            color: #9fb0c9;
            font-size: 14px;
            margin-bottom: 30px
        }

        .pin-dots {
            display: flex;
            gap: 14px;
            justify-content: center;
            margin-bottom: 26px;
            direction: ltr
        }

        .pin-dot {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            border: 1.5px solid #45617f;
            transition: .15s
        }

        .pin-dot.on {
            background: var(--brass);
            border-color: var(--brass);
            transform: scale(1.05)
        }

        .pin-dot.err {
            border-color: var(--red);
            animation: shake .35s
        }

        @keyframes shake {

            0%,
            100% {
                transform: translateX(0)
            }

            25% {
                transform: translateX(-6px)
            }

            75% {
                transform: translateX(6px)
            }
        }

        .keypad {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            max-width: 260px;
            margin: 0 auto
        }

        .key {
            height: 60px;
            border-radius: 14px;
            background: rgba(255, 255, 255, .06);
            color: #fff;
            font-size: 22px;
            font-weight: 500;
            border: 1px solid rgba(255, 255, 255, .08);
            transition: .12s
        }

        .key:hover {
            background: rgba(255, 255, 255, .13)
        }

        .key:active {
            transform: scale(.95)
        }

        .key.fn {
            font-size: 14px;
            color: #9fb0c9
        }

        .lock-hint {
            margin-top: 24px;
            font-size: 13px;
            color: #7e90ab
        }

        /* ============ ?????? ============ */
        #app {
            min-height: 100vh
        }

        .layout {
            display: flex;
            min-height: 100vh
        }

        .sidebar {
            width: 248px;
            background: var(--ink);
            color: #cdd7e5;
            display: flex;
            flex-direction: column;
            position: sticky;
            top: 0;
            height: 100vh;
            flex-shrink: 0
        }

        .brand {
            padding: 22px 22px 18px;
            border-bottom: 1px solid rgba(255, 255, 255, .07);
            display: flex;
            gap: 12px;
            align-items: center
        }

        .brand-seal {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            background: rgba(184, 137, 58, .14);
            color: var(--brass);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0
        }

        .brand-txt h1 {
            font-size: 16px;
            color: #fff;
            font-weight: 800;
            line-height: 1.25
        }

        .brand-txt span {
            font-size: 11.5px;
            color: #8295ae
        }

        .nav {
            flex: 1;
            padding: 14px 12px;
            overflow-y: auto
        }

        .nav-label {
            font-size: 11px;
            color: #5f7290;
            text-transform: uppercase;
            letter-spacing: .5px;
            padding: 14px 12px 6px;
            font-weight: 700
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 11px;
            padding: 10px 12px;
            border-radius: 10px;
            color: #cdd7e5;
            font-size: 14.5px;
            font-weight: 500;
            width: 100%;
            text-align: right;
            transition: .13s;
            margin-bottom: 2px
        }

        .nav-item svg {
            width: 19px;
            height: 19px;
            flex-shrink: 0;
            opacity: .85
        }

        .nav-item:hover {
            background: rgba(255, 255, 255, .06);
            color: #fff
        }

        .nav-item.active {
            background: var(--brass);
            color: #1a1206;
            font-weight: 700
        }

        .nav-item.active svg {
            opacity: 1
        }

        .nav-badge {
            margin-inline-start: auto;
            font-size: 11px;
            background: rgba(255, 255, 255, .12);
            color: #fff;
            padding: 1px 8px;
            border-radius: 20px;
            font-weight: 700
        }

        .nav-item.active .nav-badge {
            background: rgba(0, 0, 0, .18);
            color: #1a1206
        }

        .side-foot {
            padding: 14px;
            border-top: 1px solid rgba(255, 255, 255, .07)
        }

        .lock-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 10px 12px;
            border-radius: 10px;
            color: #9fb0c9;
            font-size: 14px;
            font-weight: 500;
            transition: .13s
        }

        .lock-btn:hover {
            background: rgba(255, 255, 255, .06);
            color: #fff
        }

        .main {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column
        }

        .topbar {
            background: var(--paper);
            border-bottom: 1px solid var(--line);
            padding: 16px 30px;
            display: flex;
            align-items: center;
            gap: 16px;
            position: sticky;
            top: 0;
            z-index: 50
        }

        .topbar h2 {
            font-size: 20px
        }

        .topbar .crumb {
            font-size: 13px;
            color: var(--muted);
            margin-top: 1px
        }

        .mobile-menu {
            display: none !important
        }

        .top-actions {
            margin-inline-start: auto;
            display: flex;
            gap: 10px;
            align-items: center
        }

        .clock {
            font-size: 13px;
            color: var(--muted);
            text-align: left
        }

        .content {
            padding: 28px 30px;
            flex: 1
        }

        /* ============ ?????? ============ */
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            padding: 9px 16px;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 700;
            transition: .13s;
            white-space: nowrap
        }

        .btn svg {
            width: 17px;
            height: 17px
        }

        .btn-primary {
            background: var(--ink);
            color: #fff
        }

        .btn-primary:hover {
            background: var(--ink-2)
        }

        .btn-brass {
            background: var(--brass);
            color: #1a1206
        }

        .btn-brass:hover {
            filter: brightness(1.05)
        }

        .btn-ghost {
            background: var(--paper);
            color: var(--text);
            border: 1px solid var(--line)
        }

        .btn-ghost:hover {
            background: var(--bone)
        }

        .btn-sm {
            padding: 6px 12px;
            font-size: 13px
        }

        .btn-danger {
            background: var(--red-bg);
            color: var(--red)
        }

        .btn-danger:hover {
            background: #f2d6d6
        }

        .grid {
            display: grid;
            gap: 18px
        }

        .cards-4 {
            grid-template-columns: repeat(4, 1fr)
        }

        .cards-3 {
            grid-template-columns: repeat(3, 1fr)
        }

        .cards-2 {
            grid-template-columns: repeat(2, 1fr)
        }

        .stat {
            background: var(--paper);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            padding: 18px 20px;
            box-shadow: var(--shadow);
            position: relative;
            overflow: hidden
        }

        .stat::before {
            content: "";
            position: absolute;
            inset-block: 0;
            inset-inline-start: 0;
            width: 4px;
            background: var(--brass)
        }

        .stat .ico {
            width: 38px;
            height: 38px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 12px;
            background: var(--slate-bg);
            color: var(--slate)
        }

        .stat .ico svg {
            width: 20px;
            height: 20px
        }

        .stat .num {
            font-size: 27px;
            font-weight: 800;
            line-height: 1;
            font-family: 'Tajawal'
        }

        .stat .lbl {
            font-size: 13px;
            color: var(--muted);
            margin-top: 6px;
            font-weight: 500
        }

        .stat.green .ico {
            background: var(--green-bg);
            color: var(--green)
        }

        .stat.green::before {
            background: var(--green)
        }

        .stat.amber .ico {
            background: var(--amber-bg);
            color: var(--amber)
        }

        .stat.amber::before {
            background: var(--amber)
        }

        .stat.red .ico {
            background: var(--red-bg);
            color: var(--red)
        }

        .stat.red::before {
            background: var(--red)
        }

        .panel {
            background: var(--paper);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: hidden
        }

        .panel-head {
            padding: 16px 20px;
            border-bottom: 1px solid var(--line-2);
            display: flex;
            align-items: center;
            gap: 12px
        }

        .panel-head h3 {
            font-size: 16px
        }

        .panel-head .btn {
            margin-inline-start: auto
        }

        .panel-body {
            padding: 6px 0
        }

        .empty {
            padding: 46px 24px;
            text-align: center;
            color: var(--muted)
        }

        .empty svg {
            width: 46px;
            height: 46px;
            opacity: .3;
            margin-bottom: 12px
        }

        .empty p {
            font-size: 14.5px
        }

        table {
            width: 100%;
            border-collapse: collapse
        }

        thead th {
            text-align: right;
            font-size: 12px;
            color: var(--muted);
            font-weight: 700;
            padding: 11px 20px;
            border-bottom: 1px solid var(--line-2);
            text-transform: none;
            white-space: nowrap
        }

        tbody td {
            padding: 13px 20px;
            border-bottom: 1px solid var(--line-2);
            font-size: 14px;
            vertical-align: middle
        }

        tbody tr:last-child td {
            border-bottom: none
        }

        tbody tr {
            transition: .1s
        }

        tbody tr:hover {
            background: #faf8f3
        }

        .t-title {
            font-weight: 700;
            color: var(--text)
        }

        .t-sub {
            font-size: 12.5px;
            color: var(--muted)
        }

        .row-actions {
            display: flex;
            gap: 6px;
            justify-content: flex-start
        }

        .icon-btn {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--muted);
            transition: .12s
        }

        .icon-btn svg {
            width: 16px;
            height: 16px
        }

        .icon-btn:hover {
            background: var(--slate-bg);
            color: var(--ink)
        }

        .icon-btn.del:hover {
            background: var(--red-bg);
            color: var(--red)
        }

        .badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 12px;
            font-weight: 700;
            padding: 3px 10px;
            border-radius: 20px;
            white-space: nowrap
        }

        .badge::before {
            content: "";
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor
        }

        .b-green {
            background: var(--green-bg);
            color: var(--green)
        }

        .b-amber {
            background: var(--amber-bg);
            color: var(--amber)
        }

        .b-red {
            background: var(--red-bg);
            color: var(--red)
        }

        .b-slate {
            background: var(--slate-bg);
            color: var(--slate)
        }

        .b-brass {
            background: var(--brass-soft);
            color: #86621f
        }

        .toolbar {
            display: flex;
            gap: 10px;
            margin-bottom: 18px;
            flex-wrap: wrap;
            align-items: center
        }

        .search {
            flex: 1;
            min-width: 200px;
            position: relative
        }

        .search svg {
            position: absolute;
            inset-inline-start: 13px;
            top: 50%;
            transform: translateY(-50%);
            width: 17px;
            height: 17px;
            color: var(--muted)
        }

        .search input {
            width: 100%;
            padding: 10px 40px 10px 14px;
            border: 1px solid var(--line);
            border-radius: 10px;
            background: var(--paper)
        }

        .search input:focus {
            outline: none;
            border-color: var(--brass)
        }

        select.filter {
            padding: 10px 14px;
            border: 1px solid var(--line);
            border-radius: 10px;
            background: var(--paper);
            color: var(--text);
            min-width: 130px
        }

        select.filter:focus {
            outline: none;
            border-color: var(--brass)
        }

        /* ============ ??????? (Modal) ============ */
        .overlay {
            position: fixed;
            inset: 0;
            background: rgba(13, 24, 40, .55);
            z-index: 200;
            display: none;
            align-items: flex-start;
            justify-content: center;
            padding: 40px 18px;
            overflow-y: auto;
            backdrop-filter: blur(2px)
        }

        .overlay.show {
            display: flex
        }

        .modal {
            background: var(--paper);
            border-radius: 18px;
            width: 100%;
            max-width: 560px;
            box-shadow: var(--shadow-lg);
            animation: pop .2s ease;
            margin: auto
        }

        @keyframes pop {
            from {
                transform: translateY(12px) scale(.98);
                opacity: 0
            }

            to {
                transform: none;
                opacity: 1
            }
        }

        .modal-head {
            padding: 20px 24px;
            border-bottom: 1px solid var(--line-2);
            display: flex;
            align-items: center
        }

        .modal-head h3 {
            font-size: 18px
        }

        .modal-head .x {
            margin-inline-start: auto;
            width: 34px;
            height: 34px;
            border-radius: 9px;
            color: var(--muted);
            display: flex;
            align-items: center;
            justify-content: center
        }

        .modal-head .x:hover {
            background: var(--bone);
            color: var(--ink)
        }

        .modal-body {
            padding: 22px 24px;
            max-height: 64vh;
            overflow-y: auto
        }

        .modal-foot {
            padding: 16px 24px;
            border-top: 1px solid var(--line-2);
            display: flex;
            gap: 10px;
            justify-content: flex-start
        }

        .field {
            margin-bottom: 16px
        }

        .field.half {
            display: inline-block;
            width: calc(50% - 7px)
        }

        .field.half:nth-of-type(odd) {
            margin-inline-end: 14px
        }

        .field label {
            display: block;
            font-size: 13px;
            font-weight: 700;
            margin-bottom: 6px;
            color: var(--text)
        }

        .field label .req {
            color: var(--red)
        }

        .field input,
        .field select,
        .field textarea {
            width: 100%;
            padding: 10px 13px;
            border: 1px solid var(--line);
            border-radius: 10px;
            background: #fdfcf9;
            transition: .12s
        }

        .field input:focus,
        .field select:focus,
        .field textarea:focus {
            outline: none;
            border-color: var(--brass);
            background: #fff
        }

        .field textarea {
            resize: vertical;
            min-height: 78px
        }

        .field .hint {
            font-size: 12px;
            color: var(--muted);
            margin-top: 5px
        }

        .form-row {
            display: flex;
            gap: 14px
        }

        .form-row>.field {
            flex: 1;
            margin-bottom: 16px
        }

        /* ============ ?????? ============ */
        #toast {
            position: fixed;
            bottom: 24px;
            inset-inline-start: 50%;
            transform: translateX(-50%) translateY(20px);
            background: var(--ink);
            color: #fff;
            padding: 12px 22px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 500;
            box-shadow: var(--shadow-lg);
            opacity: 0;
            pointer-events: none;
            transition: .25s;
            z-index: 500;
            display: flex;
            gap: 9px;
            align-items: center
        }

        #toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0)
        }

        #toast.ok {
            background: var(--green)
        }

        #toast.err {
            background: var(--red)
        }

        /* ============ ?????? ============ */
        .detail-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 14px 28px;
            margin-bottom: 6px
        }

        .detail-item .k {
            font-size: 12px;
            color: var(--muted);
            font-weight: 700;
            margin-bottom: 2px
        }

        .detail-item .v {
            font-size: 14.5px;
            font-weight: 500
        }

        .section-divider {
            font-size: 12px;
            font-weight: 700;
            color: var(--brass);
            text-transform: uppercase;
            letter-spacing: .5px;
            margin: 22px 0 12px;
            padding-bottom: 6px;
            border-bottom: 1px solid var(--line-2)
        }

        .mini-list {
            list-style: none
        }

        .mini-list li {
            padding: 11px 0;
            border-bottom: 1px solid var(--line-2);
            display: flex;
            gap: 12px;
            align-items: center
        }

        .mini-list li:last-child {
            border-bottom: none
        }

        .mini-date {
            width: 54px;
            text-align: center;
            flex-shrink: 0;
            background: var(--bone);
            border-radius: 9px;
            padding: 6px 0
        }

        .mini-date .d {
            font-size: 18px;
            font-weight: 800;
            line-height: 1
        }

        .mini-date .m {
            font-size: 11px;
            color: var(--muted)
        }

        .mini-date.urgent {
            background: var(--red-bg)
        }

        .mini-date.urgent .d {
            color: var(--red)
        }

        .mini-date.soon {
            background: var(--amber-bg)
        }

        .mini-date.soon .d {
            color: var(--amber)
        }

        .mini-body {
            flex: 1;
            min-width: 0
        }

        .mini-body .mt {
            font-weight: 700;
            font-size: 14px
        }

        .mini-body .ms {
            font-size: 12.5px;
            color: var(--muted)
        }

        .progress {
            height: 7px;
            background: var(--line-2);
            border-radius: 20px;
            overflow: hidden;
            margin-top: 8px
        }

        .progress span {
            display: block;
            height: 100%;
            background: var(--green);
            border-radius: 20px
        }

        /* ============ ????????? ============ */
        .set-group {
            padding: 18px 20px;
            border-bottom: 1px solid var(--line-2)
        }

        .set-group:last-child {
            border-bottom: none
        }

        .set-row {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 8px 0
        }

        .set-row .info {
            flex: 1
        }

        .set-row .info .t {
            font-weight: 700;
            font-size: 14.5px
        }

        .set-row .info .d {
            font-size: 13px;
            color: var(--muted)
        }

        @media(max-width:900px) {
            .cards-4 {
                grid-template-columns: repeat(2, 1fr)
            }

            .cards-3 {
                grid-template-columns: 1fr
            }

            .dash-cols {
                grid-template-columns: 1fr !important
            }
        }

        @media(max-width:760px) {
            .sidebar {
                position: fixed;
                inset-inline-start: 0;
                top: 0;
                z-index: 120;
                transform: translateX(100%);
                transition: .25s;
                box-shadow: var(--shadow-lg)
            }

            .sidebar.open {
                transform: none
            }

            .mobile-menu {
                display: flex !important
            }

            .content,
            .topbar {
                padding-inline: 18px
            }

            .cards-4,
            .cards-2 {
                grid-template-columns: 1fr
            }

            .detail-grid {
                grid-template-columns: 1fr
            }

            .field.half {
                width: 100%;
                margin-inline-end: 0 !important
            }

            .form-row {
                flex-direction: column;
                gap: 0
            }

            .clock {
                display: none
            }

            .scrim {
                position: fixed;
                inset: 0;
                background: rgba(0, 0, 0, .4);
                z-index: 110;
                display: none
            }

            .scrim.show {
                display: block
            }

            table {
                display: block;
                overflow-x: auto;
                white-space: nowrap
            }
        }
