/* ============================================================
   HEXA — بنەمای ڕووکار
   ------------------------------------------------------------
   ڕەنگەکان لە دەفتەری بڕیارەکانەوە هاتوون:
     پێشەوە ڕووناک · شریتی ناونیشان #0C0E14
     کارلێکەر #4C5FF7 · مینت #12A594
   ============================================================ */

:root {
    --hexa-ink:        #0C0E14;   /* شریتی ناونیشان و دەقی سەرەکی */
    --hexa-accent:     #4C5FF7;   /* کارلێکەر — دوگمە، لینک، فۆکەس */
    --hexa-accent-dim: #3A4BD8;
    --hexa-mint:       #12A594;   /* سەرکەوتن، باڵانسی ئەرێنی */
    --hexa-danger:     #DC2626;
    --hexa-warn:       #D97706;

    --hexa-bg:         #F6F7F9;
    --hexa-surface:    #FFFFFF;
    --hexa-border:     #E3E6EC;
    --hexa-muted:      #6B7280;
    --hexa-hover:      #F0F2F7;

    --hexa-radius:     8px;
    --hexa-shadow:     0 1px 2px rgba(12, 14, 20, .06), 0 4px 12px rgba(12, 14, 20, .04);

    /* ⚠ ڕیزبەندییەکە بە ئەنقەستە. هەر ناوێک بۆ سەکۆیەکە:

         Noto Sans Arabic   ← ئەوەی لەگەڵ بەرنامەکەدا دەنێردرێت
                              (بڕوانە @font-face لە خوارەوە)
         Noto Naskh Arabic  ← فۆنتی عەرەبیی ئەندرۆید
         Droid Arabic Naskh ← وەشانە کۆنەکانی ئەندرۆید
         Segoe UI · Tahoma  ← ویندۆز

       ⚠ پشکنین کرا لەسەر ویندۆز: Segoe UI، Tahoma، Arial و
         Arabic Typesetting هەموو پیتە کوردییە تایبەتەکان
         (ڕ ڵ ێ ۆ ڤ گ چ پ ژ ک) هەڵدەگرن. بۆیە لەسەر ویندۆز
         تەنانەت بەبێ فۆنتی نێردراویش شێوەکە دروستە.

       ⚠ ئەوەی نازانرێت ئامێری سەنمییە. فێرمـوێرەکەی بڕاوەتەوە و
         دڵنیایی نییە فۆنتێکی عەرەبیی تەواوی تێدابێت. ئەگەر
         نەبوو، سندوقی بەتاڵ (□) دەردەکەوێت لەبری پیتەکان —
         بۆیە فۆنتەکە دەبێت لەگەڵ بەرنامەکەدا بنێردرێت، نەک
         پشتی پێببەسترێت. */
    --hexa-font: 'Noto Sans Arabic', 'Noto Naskh Arabic', 'Droid Arabic Naskh',
                 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ============================================================
   فۆنتی کوردی — Noto Sans Arabic
   ------------------------------------------------------------
   مۆڵەتی SIL Open Font License. ڕێگەپێدراوە لەگەڵ بەرنامەکەدا
   بنێردرێت و بفرۆشرێت. (فۆنتەکانی ویندۆز وەک Segoe UI و Tahoma
   ئەوە **نین** — ناکرێت دابەش بکرێن، بۆیە پشتیان پێنابەسترێت.)

   ⚠ چوار فایل، نەک دوو. هەر کێشێک دوو پارچەی هەیە:

       عەرەبی  ← پیتی کوردی (ڕ ڵ ێ ۆ ڤ گ چ پ ژ)   ١٦٢KB
       لاتینی  ← ژمارە، کۆدی کاڵا، HEXA            ٣١KB

   ⚠ `unicode-range` گرنگە. بەبێ ئەو، وێبگەڕ فایلی عەرەبی
     دادەگرێت تەنانەت بۆ لاپەڕەیەکی تەواو لاتینیش. لەگەڵ ئەو،
     تەنها ئەو پارچەیە دادەگیرێت کە بە ڕاستی پێویستە — و
     لەسەر داتای مۆبایلی نوێنەرێک ئەوە ١٦٢KBـە.

   ⚠ `font-display: swap` بە ئەنقەستە: دەقەکە یەکسەر بە فۆنتی
     سیستەم دەردەکەوێت و پاشان دەگۆڕدرێت. لەسەر ئامێرێکی هێواش
     ئەوە باشترە لە شاشەیەکی بەتاڵ.
   ============================================================ */

/* ── ئاسایی (٤٠٠) ─────────────────────────────────────────── */

@font-face {
    font-family: 'Noto Sans Arabic';
    src: url('fonts/NotoSansArabic-Regular-arabic.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891,
                   U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011,
                   U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: 'Noto Sans Arabic';
    src: url('fonts/NotoSansArabic-Regular-latin.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                   U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                   U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF;
}

/* ── ناوقەڵەو (٦٠٠) ───────────────────────────────────────── */

@font-face {
    font-family: 'Noto Sans Arabic';
    src: url('fonts/NotoSansArabic-SemiBold-arabic.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891,
                   U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011,
                   U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: 'Noto Sans Arabic';
    src: url('fonts/NotoSansArabic-SemiBold-latin.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                   U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                   U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF;
}

/* ── بنەڕەت ─────────────────────────────────────────────── */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--hexa-font);
    font-size: 15px;
    background: var(--hexa-bg);
    color: var(--hexa-ink);
    direction: rtl;
    text-align: right;
}

*, *::before, *::after { box-sizing: border-box; }

h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 600; line-height: 1.3; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

a { color: var(--hexa-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ژمارە هەمیشە بە لاتینی و لە چەپەوە — بۆ ئەوەی ستوونەکان ڕێک بن */
.hexa-num {
    font-variant-numeric: tabular-nums;
    direction: ltr;
    display: inline-block;
    unicode-bidi: embed;
}

/* ── چوارچێوە ───────────────────────────────────────────── */

.hexa-shell { display: flex; flex-direction: column; height: 100vh; }

.hexa-titlebar {
    background: var(--hexa-ink);
    color: #fff;
    padding: 0 1rem;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

.hexa-titlebar .brand { font-weight: 600; letter-spacing: .5px; }
.hexa-titlebar .spacer { flex: 1; }
.hexa-titlebar .who { font-size: .85rem; opacity: .75; }

.hexa-body { display: flex; flex: 1; min-height: 0; }

.hexa-sidebar {
    width: 232px;
    flex: 0 0 auto;
    background: var(--hexa-surface);
    border-inline-start: 1px solid var(--hexa-border);
    overflow-y: auto;
    padding: .75rem 0;
}

.hexa-sidebar .group {
    padding: .5rem 1rem .25rem;
    font-size: .72rem;
    font-weight: 600;
    color: var(--hexa-muted);
    letter-spacing: .3px;
}

.hexa-sidebar a {
    display: block;
    padding: .5rem 1rem;
    color: var(--hexa-ink);
    border-inline-start: 3px solid transparent;
}

.hexa-sidebar a:hover { background: var(--hexa-hover); text-decoration: none; }

.hexa-sidebar a.active {
    background: var(--hexa-hover);
    border-inline-start-color: var(--hexa-accent);
    color: var(--hexa-accent);
    font-weight: 600;
}

.hexa-main { flex: 1; overflow-y: auto; padding: 1.25rem; min-width: 0; }

.hexa-statusbar {
    flex: 0 0 auto;
    height: 26px;
    background: var(--hexa-surface);
    border-top: 1px solid var(--hexa-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
    font-size: .75rem;
    color: var(--hexa-muted);
}

/* ── کارت ───────────────────────────────────────────────── */

.hexa-card {
    background: var(--hexa-surface);
    border: 1px solid var(--hexa-border);
    border-radius: var(--hexa-radius);
    box-shadow: var(--hexa-shadow);
    padding: 1rem;
    margin-bottom: 1rem;
}

.hexa-toolbar {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.hexa-toolbar .spacer { flex: 1; }

/* ── خشتە ───────────────────────────────────────────────── */

.hexa-table { width: 100%; border-collapse: collapse; font-size: .9rem; }

.hexa-table th {
    text-align: right;
    padding: .55rem .65rem;
    border-bottom: 2px solid var(--hexa-border);
    color: var(--hexa-muted);
    font-weight: 600;
    font-size: .8rem;
    white-space: nowrap;
}

.hexa-table td {
    padding: .55rem .65rem;
    border-bottom: 1px solid var(--hexa-border);
}

.hexa-table tbody tr:hover { background: var(--hexa-hover); }
.hexa-table .num { text-align: left; font-variant-numeric: tabular-nums; direction: ltr; }

/* خشتەی پان لە خۆیدا دەخلیسکێت — لاپەڕەکە هەرگیز بەلایەکدا ناڕوات */
.hexa-table-wrap { overflow-x: auto; }

/* ── دوگمە ──────────────────────────────────────────────── */

.hexa-btn {
    font-family: inherit;
    font-size: .875rem;
    padding: .45rem .9rem;
    border-radius: var(--hexa-radius);
    border: 1px solid var(--hexa-border);
    background: var(--hexa-surface);
    color: var(--hexa-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.hexa-btn:hover:not(:disabled) { background: var(--hexa-hover); }
.hexa-btn:disabled { opacity: .5; cursor: not-allowed; }

.hexa-btn.primary {
    background: var(--hexa-accent);
    border-color: var(--hexa-accent);
    color: #fff;
}
.hexa-btn.primary:hover:not(:disabled) { background: var(--hexa-accent-dim); }

.hexa-btn.danger { background: var(--hexa-danger); border-color: var(--hexa-danger); color: #fff; }

/* ── فۆرم ───────────────────────────────────────────────── */

.hexa-field { margin-bottom: .85rem; }

.hexa-field label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--hexa-muted);
    margin-bottom: .3rem;
}

.hexa-field input,
.hexa-field select,
.hexa-field textarea {
    width: 100%;
    font-family: inherit;
    font-size: .9rem;
    padding: .45rem .6rem;
    border: 1px solid var(--hexa-border);
    border-radius: var(--hexa-radius);
    background: var(--hexa-surface);
    color: var(--hexa-ink);
}

.hexa-field input:focus,
.hexa-field select:focus,
.hexa-field textarea:focus {
    outline: 2px solid var(--hexa-accent);
    outline-offset: -1px;
    border-color: var(--hexa-accent);
}

.hexa-field input[type=number] { direction: ltr; text-align: right; }

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

/* ── پەیام ──────────────────────────────────────────────── */

.hexa-alert {
    padding: .6rem .85rem;
    border-radius: var(--hexa-radius);
    margin-bottom: 1rem;
    font-size: .875rem;
    border: 1px solid;
}

.hexa-alert.error   { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.hexa-alert.success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.hexa-alert.info    { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }

.hexa-empty { text-align: center; padding: 2.5rem 1rem; color: var(--hexa-muted); }

/* ── نیشانە ─────────────────────────────────────────────── */

.hexa-badge {
    display: inline-block;
    padding: .12rem .5rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

.hexa-badge.draft     { background: #F3F4F6; color: #4B5563; }
.hexa-badge.pending   { background: #FEF3C7; color: #92400E; }
.hexa-badge.ok        { background: #D1FAE5; color: #065F46; }
.hexa-badge.done      { background: #DBEAFE; color: #1E40AF; }
.hexa-badge.cancelled { background: #FEE2E2; color: #991B1B; }

/* ── چوونەژوورەوە ───────────────────────────────────────── */

.hexa-login {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--hexa-ink);
}

.hexa-login .box {
    background: var(--hexa-surface);
    padding: 2rem;
    border-radius: 12px;
    width: min(380px, 92vw);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.hexa-login .box h1 { text-align: center; margin-bottom: .25rem; }
.hexa-login .box .sub { text-align: center; color: var(--hexa-muted); font-size: .85rem; margin-bottom: 1.5rem; }

/* ── دیالۆگ ─────────────────────────────────────────────── */

.hexa-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 14, 20, .45);
    z-index: 40;
}

.hexa-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--hexa-surface);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
    padding: 1.25rem 1.5rem 1.5rem;
    width: min(720px, 94vw);
    max-height: 88vh;
    overflow-y: auto;
    z-index: 41;
}

@media (max-width: 820px) {
    .hexa-dialog { width: 96vw; padding: 1rem; }
}

/* ── مۆبایل: سایدبار دەبێتە هێڵی خوارەوە ────────────────── */

@media (max-width: 820px) {
    .hexa-body { flex-direction: column; }

    .hexa-sidebar {
        width: 100%;
        order: 2;
        display: flex;
        overflow-x: auto;
        border-inline-start: none;
        border-top: 1px solid var(--hexa-border);
        padding: 0;
    }

    .hexa-sidebar .group { display: none; }

    .hexa-sidebar a {
        white-space: nowrap;
        border-inline-start: none;
        border-top: 3px solid transparent;
        padding: .6rem .85rem;
    }

    .hexa-sidebar a.active { border-inline-start-color: transparent; border-top-color: var(--hexa-accent); }

    .hexa-main { order: 1; }
    .hexa-statusbar { display: none; }
}
