/* =========================================================================
   Furniture ERP – design system (RTL, self-hosted fonts & icons)
   ========================================================================= */

/* ---------- fonts ---------- */
/* Tajawal (Google Fonts, self-hosted) — primary typeface; IBM Plex Sans Arabic stays as the fallback */
@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/tajawal-arabic-400-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/tajawal-latin-400-normal.woff2') format('woff2'); 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, U+FFFD; }
@font-face { font-family: 'Tajawal'; font-weight: 500; font-display: swap; src: url('../vendor/fonts/tajawal-arabic-500-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'Tajawal'; font-weight: 500; font-display: swap; src: url('../vendor/fonts/tajawal-latin-500-normal.woff2') format('woff2'); 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, U+FFFD; }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap; src: url('../vendor/fonts/tajawal-arabic-700-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap; src: url('../vendor/fonts/tajawal-latin-700-normal.woff2') format('woff2'); 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, U+FFFD; }
@font-face { font-family: 'Tajawal'; font-weight: 800; font-display: swap; src: url('../vendor/fonts/tajawal-arabic-800-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: 'Tajawal'; font-weight: 800; font-display: swap; src: url('../vendor/fonts/tajawal-latin-800-normal.woff2') format('woff2'); 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, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 500; font-display: swap; src: url('../vendor/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 600; font-display: swap; src: url('../vendor/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 700; font-display: swap; src: url('../vendor/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 500; font-display: swap; src: url('../vendor/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 600; font-display: swap; src: url('../vendor/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-weight: 700; font-display: swap; src: url('../vendor/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens ---------- */
:root {
    --bg: #f5f3f0;
    --surface: #ffffff;
    --surface-2: #faf8f6;
    --border: #e8e3dd;
    --border-strong: #d8d0c7;
    --text: #18212f;
    --muted: #667085;
    --faint: #98a2b3;

    --brand: #8c5530;
    --brand-600: #744325;
    --brand-50: #f9f3ec;
    --brand-100: #efdfcd;
    --gold: #c49a4a;       /* brass accent */
    --gold-50: #faf3e1;

    --ink: #1d1713;        /* sidebar */
    --ink-2: #271f19;
    --ink-line: rgba(255, 255, 255, .08);

    --green: #1b9a62;  --green-50: #e8f6ef;
    --amber: #c7800a;  --amber-50: #fdf3dd;
    --red: #d23f3f;    --red-50: #fdeaea;
    --blue: #2563c9;   --blue-50: #e8f0fd;
    --violet: #6d4bd0; --violet-50: #efeafc;
    --teal: #0f8f94;   --teal-50: #e1f5f5;
    --slate-50: #eef0f4;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .12);
    --sidebar-w: 268px;

    /* Bootstrap overrides */
    --bs-body-font-family: 'Tajawal', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --bs-body-font-size: .92rem;
    --bs-body-color: var(--text);
    --bs-body-bg: var(--bg);
    --bs-border-color: var(--border);
    --bs-primary: var(--brand);
    --bs-primary-rgb: 140, 85, 48;
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 140, 85, 48;
    --bs-link-hover-color: var(--brand-600);
    --bs-border-radius: var(--radius-sm);
    --bs-focus-ring-color: rgba(140, 85, 48, .2);
}

html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-feature-settings: 'kern', 'liga'; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: 0; }
a { text-decoration: none; }
::selection { background: var(--brand-100); }
.num, .money, .num-ltr { font-variant-numeric: tabular-nums; }
.num-ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.money { white-space: nowrap; }
.text-muted { color: var(--muted) !important; }
.fw-600 { font-weight: 600; }
.nowrap { white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { --bs-btn-font-weight: 500; --bs-btn-border-radius: var(--radius-sm); --bs-btn-padding-y: .5rem; --bs-btn-padding-x: .95rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-padding-x: 1.3rem; --bs-btn-font-size: 1rem; }
.btn-sm { --bs-btn-padding-y: .32rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .82rem; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); --bs-btn-active-bg: var(--brand-600); --bs-btn-active-border-color: var(--brand-600); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); --bs-btn-focus-shadow-rgb: 140, 85, 48; box-shadow: 0 1px 2px rgba(132, 73, 31, .35); }
.btn-success { --bs-btn-bg: var(--green); --bs-btn-border-color: var(--green); --bs-btn-hover-bg: #148050; --bs-btn-hover-border-color: #148050; --bs-btn-active-bg: #148050; --bs-btn-active-border-color: #148050; }
.btn-warning { --bs-btn-bg: #f2b230; --bs-btn-border-color: #f2b230; --bs-btn-color: #3b2a00; --bs-btn-hover-bg: #e5a11a; --bs-btn-hover-border-color: #e5a11a; --bs-btn-hover-color: #3b2a00; --bs-btn-active-bg: #e5a11a; }
.btn-danger { --bs-btn-bg: var(--red); --bs-btn-border-color: var(--red); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand-100); --bs-btn-hover-bg: var(--brand-50); --bs-btn-hover-color: var(--brand-600); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-50); --bs-btn-active-color: var(--brand-600); }
.btn-outline-secondary { --bs-btn-color: #344054; --bs-btn-border-color: var(--border-strong); --bs-btn-bg: #fff; --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--border-strong); --bs-btn-active-bg: var(--slate-50); --bs-btn-active-color: var(--text); }
.btn-outline-danger { --bs-btn-color: var(--red); --bs-btn-border-color: #f3c0c0; --bs-btn-hover-bg: var(--red-50); --bs-btn-hover-color: var(--red); --bs-btn-hover-border-color: var(--red); --bs-btn-active-bg: var(--red-50); --bs-btn-active-color: var(--red); }
.btn-soft { background: var(--slate-50); color: #344054; border-color: transparent; }
.btn-soft:hover { background: #e4e7ee; color: var(--text); }
.btn-icon { width: 2.2rem; height: 2.2rem; padding: 0; }

/* ---------- forms ---------- */
.form-label { font-weight: 500; font-size: .84rem; color: #344054; margin-bottom: .35rem; }
.form-control, .form-select { border-color: var(--border-strong); border-radius: var(--radius-sm); padding: .55rem .8rem; background-color: #fff; font-size: .92rem; min-height: 2.6rem; }
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(140, 85, 48, .16); }
.form-control-sm, .form-select-sm { min-height: 2.15rem; padding: .3rem .6rem; font-size: .85rem; }
.form-text { color: var(--faint); font-size: .78rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; inset-inline-start: .8rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon > .form-control { padding-inline-start: 2.4rem; }
.req { color: var(--red); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: .95rem 1.25rem; font-weight: 600; display: flex; align-items: center; gap: .6rem; border-radius: var(--radius) var(--radius) 0 0; }
.card-header .ch-icon { width: 2rem; height: 2rem; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: inline-grid; place-items: center; font-size: 1rem; flex: none; }
.card-header .ch-step { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--brand); color: #fff; display: inline-grid; place-items: center; font-size: .8rem; flex: none; }
.card-header .ch-actions { margin-inline-start: auto; display: flex; gap: .5rem; align-items: center; }
.card-body { padding: 1.25rem; }
.card-footer { background: transparent; border-top: 1px solid var(--border); padding: .8rem 1.25rem; }
.card-flat { box-shadow: none; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--ink); color: #c9ced8; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.1rem .85rem; z-index: 1040; overflow-y: auto; }
.sb-brand { display: flex; align-items: center; gap: .75rem; padding: .35rem .6rem 1.2rem; color: #fff; }
.sb-logo { width: 2.5rem; height: 2.5rem; border-radius: 12px; background: linear-gradient(145deg, #c07a43, #8a4f24); display: grid; place-items: center; font-size: 1.25rem; color: #fff; box-shadow: 0 6px 14px -6px rgba(192, 122, 67, .8); flex: none; }
.sb-brand strong { display: block; font-weight: 600; font-size: .98rem; line-height: 1.25; }
.sb-brand small { color: #8b93a3; font-size: .74rem; }
.sb-label { font-size: .7rem; color: #6f7788; padding: 1rem .8rem .4rem; letter-spacing: .02em; }
.sb-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 10px; color: #b4bbc8; font-weight: 500; font-size: .9rem; position: relative; transition: background .15s, color .15s; }
.sb-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; opacity: .9; }
.sb-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb-link.active { background: rgba(192, 122, 67, .16); color: #fff; }
.sb-link.active::before { content: ''; position: absolute; inset-inline-start: -.85rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: #d08a4e; }
[dir=rtl] .sb-link.active::before { border-radius: 4px 0 0 4px; }
.sb-link .count { margin-inline-start: auto; background: rgba(255, 255, 255, .1); color: #fff; font-size: .72rem; border-radius: 20px; padding: .05rem .5rem; }
.sb-user { margin-top: auto; background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 12px; padding: .75rem; }
.sb-user .who { display: flex; gap: .65rem; align-items: center; }
.avatar { width: 2.3rem; height: 2.3rem; border-radius: 50%; background: linear-gradient(145deg, #c07a43, #8a4f24); color: #fff; display: inline-grid; place-items: center; font-weight: 600; flex: none; font-size: .95rem; }
.sb-user .name { color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.2; }
.sb-user .role { color: #8b93a3; font-size: .75rem; }
.sb-user .btn { width: 100%; margin-top: .65rem; background: transparent; color: #aab1be; border: 1px solid var(--ink-line); }
.sb-user .btn:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.sb-backdrop { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--border); padding: .7rem 1.75rem; display: flex; align-items: center; gap: 1rem; }
.topbar .search { flex: 1; max-width: 460px; }
.topbar .search .form-control { background: var(--surface-2); border-color: transparent; }
.topbar .search .form-control:focus { background: #fff; border-color: var(--brand); }
.topbar .today { color: var(--muted); font-size: .84rem; display: flex; align-items: center; gap: .4rem; margin-inline-start: auto; }
.content { padding: 1.6rem 1.75rem 3rem; max-width: 1560px; width: 100%; margin-inline: auto; }
.menu-btn { display: none; }

@media (max-width: 991.98px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w); transform: translateX(100%); transition: transform .22s ease; }
    [dir=ltr] .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .45); }
    .sb-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(10, 14, 22, .5); z-index: 1035; }
    .menu-btn { display: inline-flex; }
    .topbar { padding: .6rem 1rem; }
    .topbar .today { display: none; }
    .content { padding: 1.1rem 1rem 2.5rem; }
}

/* ---------- page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; }
.page-head h1 { font-size: 1.45rem; margin: 0; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: .88rem; margin-top: .2rem; }
.page-head .actions { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.crumbs { font-size: .8rem; color: var(--faint); margin-bottom: .35rem; display: flex; gap: .4rem; align-items: center; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }

/* ---------- callouts / flash ---------- */
.callout { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 1rem; position: relative; }
.callout > i { font-size: 1.15rem; margin-top: .1rem; }
.callout .t { font-weight: 600; }
.callout-success { background: var(--green-50); border-color: #bfe6d2; color: #0e6b43; }
.callout-danger { background: var(--red-50); border-color: #f4c4c4; color: #9a2424; }
.callout-warning { background: var(--amber-50); border-color: #f3dca0; color: #8a5a05; }
.callout-info { background: var(--blue-50); border-color: #c2d7f7; color: #1b4a96; }
.callout .btn-close { position: absolute; inset-inline-end: .6rem; top: .6rem; font-size: .65rem; }
.callout ul { margin: .3rem 0 0; padding-inline-start: 1.1rem; }

/* ---------- status pills / chips ---------- */
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--slate-50); color: #475467; }
.pill::before { content: ''; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .85; }
.pill-gray { background: var(--slate-50); color: #475467; }
.pill-red { background: var(--red-50); color: #b42323; }
.pill-amber { background: var(--amber-50); color: #98600a; }
.pill-blue { background: var(--blue-50); color: #1d4fa6; }
.pill-violet { background: var(--violet-50); color: #5a3bb8; }
.pill-teal { background: var(--teal-50); color: #0b7377; }
.pill-green { background: var(--green-50); color: #11784b; }
.pill-dark { background: #e4e6eb; color: #2b3240; }

.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 8px; font-size: .76rem; font-weight: 600; }
.chip-ready { background: var(--teal-50); color: #0b7377; }
.chip-custom { background: var(--violet-50); color: #5a3bb8; }
.chip-sofa { background: var(--amber-50); color: #8a5a07; }
.chip-bedroom { background: var(--blue-50); color: #1d4f9f; }
.chip-curtain { background: var(--violet-50); color: #5a3bb8; }
.chip-drawn { background: var(--brand-50); color: var(--brand-600); }

.dept { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; white-space: nowrap; }
.dept .di { width: 1.75rem; height: 1.75rem; border-radius: 8px; display: inline-grid; place-items: center; font-size: .9rem; flex: none; }
.dept-seller .di { background: var(--blue-50); color: var(--blue); }
.dept-accountant .di { background: var(--amber-50); color: var(--amber); }
.dept-operations_manager .di { background: var(--violet-50); color: var(--violet); }
.dept-quality_inspector .di { background: var(--green-50); color: var(--green); }
.dept-admin .di { background: var(--slate-50); color: #475467; }
.dept-none { color: var(--faint); }

/* ---------- KPI ---------- */
.kpi { display: flex; gap: .9rem; align-items: center; padding: 1.1rem 1.15rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; height: 100%; color: inherit; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); color: inherit; }
.kpi .ki { width: 2.9rem; height: 2.9rem; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; flex: none; }
.kpi .kv { font-size: 1.75rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .kl { color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.kpi-seller .ki { background: var(--blue-50); color: var(--blue); }
.kpi-accountant .ki { background: var(--amber-50); color: var(--amber); }
.kpi-operations_manager .ki { background: var(--violet-50); color: var(--violet); }
.kpi-quality_inspector .ki { background: var(--green-50); color: var(--green); }
.kpi-danger .ki { background: var(--red-50); color: var(--red); }
.kpi-danger.has { border-color: #f3c0c0; background: linear-gradient(180deg, #fff, #fff6f6); }
.kpi-danger.has .kv { color: var(--red); }
.kpi-money .kv { font-size: 1.3rem; }

/* ---------- tables ---------- */
.table-modern { width: 100%; margin: 0; --bs-table-bg: transparent; }
.table-modern thead th { background: var(--surface-2); color: var(--muted); font-size: .76rem; font-weight: 600; padding: .7rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: start; }
.table-modern tbody td { padding: .9rem 1rem; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-modern tbody tr { transition: background .1s; }
.table-modern tbody tr:hover { background: #fbfaf8; }
.table-modern tr.row-late { background: #fff8f8; box-shadow: inset 3px 0 0 var(--red); }
[dir=rtl] .table-modern tr.row-late { box-shadow: inset -3px 0 0 var(--red); }
.table-modern .ono { font-weight: 700; color: var(--text); }
.table-modern .ono:hover { color: var(--brand); }
.cell-2 { line-height: 1.35; }
.cell-2 .sub { color: var(--faint); font-size: .78rem; }
.due { white-space: nowrap; line-height: 1.35; }
.due .d { font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.due .d i { color: var(--faint); }
.due .r { font-size: .76rem; font-weight: 600; }
.due .r.late { color: var(--red); } .due .r.soon { color: var(--amber); } .due .r.ok { color: var(--faint); font-weight: 500; }
.table-responsive { border-radius: var(--radius); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2.4rem; color: var(--border-strong); display: block; margin-bottom: .6rem; }

/* ---------- pipeline ---------- */
.pipeline { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; }
.pipeline .step { text-align: center; position: relative; padding: 0 .25rem; }
.pipeline .step::after { content: ''; position: absolute; top: 1.35rem; inset-inline-start: calc(50% + 1.6rem); width: calc(100% - 3.2rem); height: 3px; background: var(--border); border-radius: 2px; }
.pipeline .step:last-child::after { display: none; }
.pipeline .step-done::after { background: var(--green); }
.pipeline .dot { width: 2.7rem; height: 2.7rem; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: #fff; border: 2px solid var(--border-strong); color: var(--faint); font-size: 1.1rem; position: relative; z-index: 1; }
.pipeline .lbl { display: block; margin-top: .55rem; font-size: .82rem; color: var(--muted); font-weight: 500; }
.pipeline .who { display: block; font-size: .72rem; color: var(--faint); }
.pipeline .step-done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.pipeline .step-done .lbl { color: var(--text); }
.pipeline .step-active .dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 6px rgba(140, 85, 48, .16); animation: pulse 2.2s infinite; }
.pipeline .step-active .lbl { color: var(--brand); font-weight: 700; }
.pipeline .step-problem .dot { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 0 6px rgba(210, 63, 63, .16); }
.pipeline .step-problem .lbl { color: var(--red); font-weight: 700; }
.pipeline.is-cancelled { opacity: .4; filter: grayscale(1); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 5px rgba(140, 85, 48, .16); } 50% { box-shadow: 0 0 0 9px rgba(140, 85, 48, .06); } }
@media (max-width: 575.98px) { .pipeline .lbl { font-size: .68rem; } .pipeline .who { display: none; } .pipeline .dot { width: 2.2rem; height: 2.2rem; font-size: .95rem; } .pipeline .step::after { top: 1.1rem; inset-inline-start: calc(50% + 1.3rem); width: calc(100% - 2.6rem); } }

/* ---------- order hero ---------- */
.hero { padding: 1.35rem 1.5rem; }
.hero .ono { font-size: 1.6rem; font-weight: 700; letter-spacing: .01em; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px dashed var(--border-strong); }
.hero-meta .m { min-width: 9rem; }
.hero-meta .k { color: var(--muted); font-size: .76rem; margin-bottom: .2rem; }
.hero-meta .v { font-weight: 600; }

.next-action { border-inline-start: 4px solid var(--brand); background: linear-gradient(90deg, #fff, #fffaf5); }
[dir=rtl] .next-action { background: linear-gradient(270deg, #fff, #fffaf5); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.1rem 1.5rem; }
.info-grid .k { color: var(--muted); font-size: .76rem; margin-bottom: .15rem; }
.info-grid .v { font-weight: 500; }

/* ---------- finance card ---------- */
.fin-row { display: flex; justify-content: space-between; align-items: baseline; padding: .42rem 0; }
.fin-row .k { color: var(--muted); }
.fin-row.total { border-top: 1px dashed var(--border-strong); margin-top: .35rem; padding-top: .8rem; font-weight: 700; font-size: 1.02rem; }
.fin-remaining { border-radius: 12px; padding: .9rem 1rem; display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; font-weight: 700; }
.fin-remaining.due-now { background: var(--red-50); color: #a22626; }
.fin-remaining.clear { background: var(--green-50); color: #0f6e45; }
.progress { height: .55rem; border-radius: 99px; background: var(--slate-50); overflow: hidden; }
.progress-bar { background: var(--green); }
.pay-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.pay-list li { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-top: 1px solid #eef0f3; }
.pay-list .pi { width: 2rem; height: 2rem; border-radius: 9px; background: var(--green-50); color: var(--green); display: grid; place-items: center; flex: none; }
.pay-list .pm { flex: 1; line-height: 1.3; }
.pay-list .pm small { color: var(--faint); display: block; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-inline-start: 2rem; padding-bottom: 1.15rem; }
.timeline li::before { content: ''; position: absolute; inset-inline-start: .55rem; top: 1.25rem; bottom: -.1rem; width: 2px; background: var(--border); }
.timeline li:last-child { padding-bottom: 0; } .timeline li:last-child::before { display: none; }
.timeline .tdot { position: absolute; inset-inline-start: 0; top: .1rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }
.timeline li.t-ok .tdot { border-color: var(--green); background: var(--green); }
.timeline li.t-bad .tdot { border-color: var(--red); background: var(--red); }
.timeline li.t-info .tdot { border-color: var(--border-strong); }
.timeline .tt { font-weight: 600; font-size: .88rem; line-height: 1.4; }
.timeline .tn { font-size: .82rem; color: #475467; background: var(--surface-2); border-radius: 8px; padding: .4rem .65rem; margin-top: .3rem; }
.timeline .tm { color: var(--faint); font-size: .74rem; margin-top: .2rem; }

/* ---------- gallery ---------- */
.sketch-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; transition: box-shadow .15s, transform .15s; }
.sketch-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.sketch-card .thumb { aspect-ratio: 4 / 3; background: repeating-conic-gradient(#f4f5f7 0% 25%, #fff 0% 50%) 50% / 18px 18px; display: grid; place-items: center; cursor: zoom-in; width: 100%; border: 0; padding: 0; }
.sketch-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.sketch-card .cap { padding: .6rem .8rem; display: flex; align-items: center; gap: .5rem; font-size: .82rem; }
.sketch-card .cap .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }

.sig-box-view { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: .6rem; display: inline-block; }
.sig-box-view img { max-height: 110px; max-width: 100%; display: block; }

/* ---------- order form ---------- */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
@media (max-width: 1199.98px) { .form-layout { grid-template-columns: 1fr; } }
.sticky-side { position: sticky; top: 5rem; }
.type-card { cursor: pointer; border: 2px solid var(--border); border-radius: 14px; padding: 1.1rem 1.2rem; display: flex; gap: 1rem; align-items: flex-start; height: 100%; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
.type-card:hover { border-color: var(--border-strong); }
.type-card .ti { width: 2.8rem; height: 2.8rem; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; flex: none; background: var(--slate-50); color: #475467; }
.type-card .tt { font-weight: 700; }
.type-card small { color: var(--muted); }
.btn-check:checked + .type-card { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 4px rgba(140, 85, 48, .12); }
.btn-check:checked + .type-card .ti { background: var(--brand); color: #fff; }
.btn-check:focus-visible + .type-card { outline: 2px solid var(--brand); outline-offset: 2px; }
.item-row { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.item-row + .item-row { margin-top: .85rem; }
.item-row .ir-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.item-row .ir-n { width: 1.7rem; height: 1.7rem; border-radius: 8px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; font-weight: 700; font-size: .82rem; }
.item-row .line-total { font-weight: 700; padding-top: .55rem; }
.summary-line { display: flex; justify-content: space-between; padding: .4rem 0; }
.summary-line.big { font-weight: 700; font-size: 1.1rem; border-top: 1px dashed var(--border-strong); margin-top: .4rem; padding-top: .8rem; }

/* ---------- sketch editor ---------- */
.sk { border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden; }
.sk-tabs { display: flex; align-items: center; gap: .35rem; padding: .55rem .7rem 0; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow-x: auto; }
.sk-tab { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 10px 10px 0 0; background: transparent; border: 1px solid transparent; border-bottom: 0; cursor: pointer; font-weight: 500; color: var(--muted); white-space: nowrap; font-size: .85rem; }
.sk-tab.active { background: #fff; color: var(--text); border-color: var(--border); position: relative; top: 1px; }
.sk-tab .x { color: var(--faint); border: 0; background: none; padding: 0; line-height: 1; }
.sk-tab .x:hover { color: var(--red); }
.sk-tab-add { margin-inline-start: .3rem; margin-bottom: .35rem; }
.sk-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; padding: .7rem; border-bottom: 1px solid var(--border); align-items: center; background: #fff; }
.sk-group { display: flex; gap: .2rem; padding: .2rem; background: var(--surface-2); border-radius: 11px; border: 1px solid var(--border); align-items: center; }
.sk-btn { border: 0; background: transparent; width: 2.3rem; height: 2.3rem; border-radius: 9px; display: inline-grid; place-items: center; color: #475467; font-size: 1.08rem; cursor: pointer; transition: background .12s, color .12s; position: relative; }
.sk-btn:hover:not(:disabled) { background: #e9ecf1; color: var(--text); }
.sk-btn.active { background: var(--brand); color: #fff; box-shadow: 0 2px 6px -2px rgba(132, 73, 31, .6); }
.sk-btn:disabled { opacity: .35; cursor: not-allowed; }
.sk-btn.on { background: var(--brand-50); color: var(--brand-600); }
.sk-swatch { width: 1.45rem; height: 1.45rem; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; }
.sk-swatch.active { box-shadow: 0 0 0 2px var(--brand); }
.sk-select { border: 0; background: transparent; font-size: .82rem; padding: .3rem .4rem; color: #344054; font-weight: 500; }
.sk-stage { position: relative; background-color: #fff; background-image: linear-gradient(#eceff3 1px, transparent 1px), linear-gradient(90deg, #eceff3 1px, transparent 1px); touch-action: none; line-height: 0; }
.sk-stage .canvas-container { margin: 0 auto; }
.sk-pop { position: absolute; z-index: 5; background: #fff; border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); padding: .6rem; display: none; gap: .4rem; align-items: center; line-height: 1.3; }
.sk-pop.show { display: flex; }
.sk-pop input { width: 6rem; }
.sk-piece { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .6rem .7rem; border-top: 1px dashed var(--border); background: var(--surface-2); }
.sk-piece .form-control { width: auto; min-height: 2.1rem; padding: .25rem .55rem; font-size: .84rem; }
.sk-hint { font-size: .78rem; color: var(--muted); padding: .55rem .8rem; border-top: 1px solid var(--border); display: flex; gap: 1rem; flex-wrap: wrap; }
.sk-hint kbd { background: var(--slate-50); color: #344054; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 .35rem; font-size: .72rem; }
.sk-title-input { border: 0; background: transparent; font-weight: 600; font-size: .9rem; width: 12rem; border-bottom: 1px dashed var(--border-strong); border-radius: 0; padding: .1rem .2rem; }
.sk-title-input:focus { outline: 0; border-bottom-color: var(--brand); }

/* ---------- signature screen ---------- */
.sign-body { background: #eceef2; min-height: 100vh; }
.sign-wrap { max-width: 1080px; margin: 0 auto; padding: 1.25rem; }
.sign-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.sign-head { padding: 1.2rem 1.5rem; display: flex; align-items: center; gap: 1rem; border-bottom: 1px solid var(--border); }
.sign-head .sb-logo { width: 3rem; height: 3rem; }
.sign-terms { max-height: 11rem; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1.1rem 0; font-size: .88rem; }
.sign-terms li { margin-bottom: .45rem; }
.sig-area { position: relative; border: 2px dashed var(--border-strong); border-radius: 16px; background: #fff; touch-action: none; }
.sig-area canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.sig-area .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #c3c9d4; font-size: 1.6rem; font-weight: 600; pointer-events: none; transition: opacity .2s; }
.sig-area .baseline { position: absolute; inset-inline: 7%; bottom: 22%; border-bottom: 1px solid #c3c9d4; pointer-events: none; }
.sig-area.has-ink { border-color: var(--brand); border-style: solid; }
.sig-area.has-ink .ph { opacity: 0; }
.sign-total { background: var(--ink); color: #fff; border-radius: 14px; padding: 1rem 1.25rem; }
.sign-total .k { color: #9aa3b4; font-size: .8rem; }
.sign-total .v { font-size: 1.3rem; font-weight: 700; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-art { background: radial-gradient(1200px 600px at 20% 10%, rgba(208, 138, 78, .35), transparent 60%), linear-gradient(160deg, #1b2030, #12151d 70%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(circle at 70% 80%, #000, transparent 70%); }
.login-art > * { position: relative; z-index: 1; }
.login-art h2 { font-size: 2rem; font-weight: 700; line-height: 1.4; max-width: 28rem; }
.login-art .feat { display: flex; gap: .8rem; align-items: center; color: #b9c0cf; margin-top: .8rem; }
.login-art .feat i { width: 2.1rem; height: 2.1rem; border-radius: 10px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; color: #e2a875; }
.login-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.login-form .box { width: 100%; max-width: 390px; }
@media (max-width: 991.98px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- misc ---------- */
.modal { --bs-modal-bg: #fff; }
.modal-content { border: 0; border-radius: 16px; box-shadow: 0 20px 60px -10px rgba(16, 24, 40, .35); }
.modal-header { border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; }
.modal-footer { border-top: 1px solid var(--border); }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--text); margin: 0; }
.dropdown-menu { border-radius: 12px; border-color: var(--border); box-shadow: var(--shadow); }
.legend-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; }
.filters .form-label { font-size: .75rem; color: var(--muted); }
.section-title { font-size: .78rem; color: var(--muted); font-weight: 600; margin: 1.1rem 0 .6rem; }

/* ---------- print sheets ---------- */
.sheet { background: #fff; max-width: 210mm; margin: 1rem auto; padding: 14mm 15mm; box-shadow: 0 0 14px rgba(0, 0, 0, .12); color: #111; font-size: 11pt; }
.sheet h1 { font-size: 1.5rem; font-weight: 700; }
.sheet h5 { font-weight: 700; margin-top: 1rem; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { border: 1px solid #8a8f98; padding: .35rem .55rem; font-size: .93rem; }
.sheet th { background: #f0f1f3; }
.sig-line { height: 80px; border-bottom: 1px solid #222; display: flex; align-items: flex-end; justify-content: center; }
.sig-line img { max-height: 74px; max-width: 100%; }
.sheet .sketch-print { max-width: 100%; max-height: 125mm; display: block; margin: .5rem auto; border: 1px solid #aaa; }
.print-toolbar { text-align: center; padding: .8rem; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }

@media print {
    body, .app-body, .sign-body { background: #fff !important; }
    .no-print, .sidebar, .topbar, .callout, .print-toolbar { display: none !important; }
    .sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; }
    .sketch-print { page-break-inside: avoid; }
    @page { size: A4; margin: 12mm; }
}

/* =====================================================================
   v3 – feedback, bell, toasts, responsive & layout polish
   ===================================================================== */

.hero-meta .v > .num-ltr { display: block; }

/* ---------- top progress bar ---------- */
#page-progress { position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 0; z-index: 3000; background: linear-gradient(90deg, #d08a4e, var(--brand)); box-shadow: 0 0 10px rgba(140, 85, 48, .6); opacity: 0; transition: width .25s ease, opacity .3s ease; pointer-events: none; }

/* ---------- topbar end / bell ---------- */
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 1rem; }
.topbar .today { margin-inline-start: 0; }
.bell { position: relative; }
.bell-btn { position: relative; width: 2.5rem; height: 2.5rem; border-radius: 12px; border: 1px solid var(--border); background: #fff; color: #475467; display: grid; place-items: center; font-size: 1.15rem; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.bell-btn:hover, .bell.open .bell-btn { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-600); }
.bell-btn:active { transform: scale(.94); }
.bell-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bell-btn.ringing i { animation: ring 1.1s ease-in-out 1; transform-origin: 50% 0; }
@keyframes ring { 0% { transform: rotate(0); } 10% { transform: rotate(18deg); } 20% { transform: rotate(-16deg); } 30% { transform: rotate(13deg); } 40% { transform: rotate(-10deg); } 50% { transform: rotate(6deg); } 60% { transform: rotate(-3deg); } 100% { transform: rotate(0); } }
.bell-badge { position: absolute; top: -.35rem; inset-inline-end: -.35rem; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1; border: 2px solid #fff; font-variant-numeric: tabular-nums; }
.bell-badge[hidden] { display: none; }
.bell-badge.pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }

.bell-panel { position: absolute; top: calc(100% + .65rem); inset-inline-end: 0; width: 390px; max-width: calc(100vw - 1.5rem); background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 50px -12px rgba(16, 24, 40, .3); overflow: hidden; z-index: 1100; animation: dropIn .18s ease-out; }
.bell-panel[hidden] { display: none; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.bp-head { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.bp-head .btn-link { font-size: .8rem; text-decoration: none; }
.bp-list { max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain; }
.bp-item { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border-bottom: 1px solid #f0f1f4; color: inherit; position: relative; transition: background .12s; }
.bp-item:hover { background: var(--surface-2); color: inherit; }
.bp-item.unread { background: #fffaf5; }
.bp-ic { width: 2.2rem; height: 2.2rem; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--slate-50); color: #475467; font-size: 1.05rem; }
.tone-success .bp-ic { background: var(--green-50); color: var(--green); }
.tone-warning .bp-ic { background: var(--amber-50); color: var(--amber); }
.tone-danger .bp-ic { background: var(--red-50); color: var(--red); }
.tone-info .bp-ic { background: var(--blue-50); color: var(--blue); }
.tone-primary .bp-ic { background: var(--violet-50); color: var(--violet); }
.bp-txt { display: flex; flex-direction: column; min-width: 0; gap: .1rem; flex: 1; }
.bp-txt b { font-size: .88rem; font-weight: 600; line-height: 1.4; }
.bp-item:not(.unread) .bp-txt b { font-weight: 500; color: #475467; }
.bp-txt small { color: var(--muted); font-size: .78rem; line-height: 1.5; overflow-wrap: anywhere; }
.bp-txt em { font-style: normal; color: var(--faint); font-size: .72rem; }
.bp-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--brand); flex: none; margin-top: .45rem; }
.bp-empty { padding: 2.2rem 1rem; text-align: center; color: var(--muted); font-size: .88rem; }
.bp-empty i { display: block; font-size: 2rem; color: var(--border-strong); margin-bottom: .4rem; }
.bp-foot { display: flex; justify-content: center; gap: .4rem; padding: .7rem; font-size: .85rem; font-weight: 600; border-top: 1px solid var(--border); background: var(--surface-2); }
.bp-foot:hover { background: var(--brand-50); }

@media (max-width: 575.98px) {
    .bell-panel { position: fixed; top: 3.6rem; inset-inline: .75rem; width: auto; max-width: none; }
    .topbar-end { gap: .5rem; }
}

/* full notifications page */
.notice-row { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.25rem; border-bottom: 1px solid #eef0f3; color: inherit; transition: background .12s; }
.notice-row:last-child { border-bottom: 0; }
.notice-row:hover { background: var(--surface-2); color: inherit; }
.notice-row.unread { background: #fffaf5; box-shadow: inset -3px 0 0 var(--brand); }
.notice-row .bp-ic { width: 2.6rem; height: 2.6rem; font-size: 1.2rem; }

/* sidebar counters */
.sb-link .count-hot { background: var(--red); animation: none; font-weight: 700; }

/* ---------- toasts ---------- */
.toast-stack { position: fixed; top: 4.6rem; inset-inline-start: 1.1rem; width: min(390px, calc(100vw - 2.2rem)); display: flex; flex-direction: column; gap: .6rem; z-index: 2500; pointer-events: none; }
.toast-card { pointer-events: auto; position: relative; display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 1rem; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 14px 36px -10px rgba(16, 24, 40, .35); overflow: hidden; animation: toastIn .32s cubic-bezier(.2, .9, .3, 1.15); }
.toast-card.leaving { animation: toastOut .26s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-24px) scale(.96); } }
.tc-icon { width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; flex: none; background: var(--blue-50); color: var(--blue); }
.toast-success .tc-icon { background: var(--green-50); color: var(--green); }
.toast-error .tc-icon { background: var(--red-50); color: var(--red); }
.toast-warning .tc-icon { background: var(--amber-50); color: var(--amber); }
.toast-success { border-inline-start: 4px solid var(--green); }
.toast-error { border-inline-start: 4px solid var(--red); }
.toast-warning { border-inline-start: 4px solid #f2b230; }
.toast-info { border-inline-start: 4px solid var(--blue); }
.tc-body { flex: 1; min-width: 0; }
.tc-title { font-weight: 600; font-size: .9rem; }
.tc-msg { color: var(--muted); font-size: .84rem; line-height: 1.55; overflow-wrap: anywhere; }
.tc-link { display: inline-block; margin-top: .3rem; font-size: .82rem; font-weight: 600; }
.tc-close { border: 0; background: transparent; color: var(--faint); font-size: .75rem; padding: .2rem; border-radius: 6px; line-height: 1; }
.tc-close:hover { background: var(--slate-50); color: var(--text); }
.tc-bar { position: absolute; bottom: 0; inset-inline: 0; height: 3px; background: currentColor; opacity: .25; transform-origin: right; animation: toastBar linear forwards; }
.toast-success .tc-bar { color: var(--green); } .toast-error .tc-bar { color: var(--red); } .toast-warning .tc-bar { color: #e5a11a; } .toast-info .tc-bar { color: var(--blue); }
.toast-card.paused .tc-bar { animation-play-state: paused; }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 575.98px) { .toast-stack { inset-inline: .75rem; width: auto; top: 3.9rem; } }

/* ---------- confirm dialog ---------- */
.confirm-box { text-align: center; }
.confirm-ic { width: 3.6rem; height: 3.6rem; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; font-size: 1.6rem; background: var(--brand-50); color: var(--brand); }
.confirm-ic.tone-danger { background: var(--red-50); color: var(--red); }
.confirm-ic.tone-success { background: var(--green-50); color: var(--green); }
.confirm-ic.tone-warning { background: var(--amber-50); color: var(--amber); }
.modal.fade .modal-dialog { transition: transform .22s cubic-bezier(.2, .9, .3, 1.1), opacity .15s; transform: translateY(14px) scale(.97); }
.modal.show .modal-dialog { transform: none; }

/* ---------- buttons: states & hierarchy ---------- */
.btn { transition: background .15s, border-color .15s, box-shadow .15s, transform .08s, color .15s; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; box-shadow: none; }
.btn-primary:hover { box-shadow: 0 6px 14px -6px rgba(132, 73, 31, .7); transform: translateY(-1px); }
.btn-success:hover, .btn-danger:hover, .btn-warning:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(16, 24, 40, .5); }
.btn:active { transform: translateY(1px) scale(.99); box-shadow: none; }
.btn:disabled, .btn.disabled { opacity: .6; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading > * { opacity: 0; }
.btn.is-loading::after { content: ''; position: absolute; width: 1.05rem; height: 1.05rem; inset: 0; margin: auto; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-soft.is-loading::after, .btn-outline-secondary.is-loading::after, .btn-outline-primary.is-loading::after, .btn-outline-danger.is-loading::after, .btn-warning.is-loading::after { border-color: rgba(0, 0, 0, .15); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-soft-primary { background: var(--brand-50); color: var(--brand-600); border-color: transparent; }
.btn-soft-primary:hover { background: var(--brand-100); color: var(--brand-600); }
.btn-soft-success { background: var(--green-50); color: #11784b; border-color: transparent; }
.btn-soft-success:hover { background: #d3efe2; color: #0e6b43; }
.btn-soft-danger { background: var(--red-50); color: #b42323; border-color: transparent; }
.btn-soft-danger:hover { background: #fbd7d7; color: #9a2424; }
.btn-group-split { display: inline-flex; gap: .35rem; flex-wrap: wrap; }

/* actions area: primary action first, secondary grouped, stacks on phones */
.page-head .actions { align-items: center; }
.page-head .actions .dropdown-toggle::after { margin-inline-start: .15rem; }
.dropdown-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .9rem; border-radius: 8px; font-size: .88rem; }
.dropdown-item i { color: var(--muted); width: 1.1rem; text-align: center; }
.dropdown-menu { padding: .4rem; }
.dropdown-item:active { background: var(--brand-50); color: var(--text); }
@media (max-width: 575.98px) {
    .page-head { align-items: stretch; }
    .page-head .actions { width: 100%; margin-inline-start: 0; }
    .page-head .actions > .btn, .page-head .actions > .dropdown, .page-head .actions > form { flex: 1 1 auto; }
    .page-head .actions > .dropdown > .btn { width: 100%; }
}

/* ---------- inputs: invalid + shake ---------- */
.form-control.is-invalid, .form-select.is-invalid { background-image: none; padding-inline-end: .75rem; }
.shake { animation: shake .42s ease; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }

/* ---------- entrance motion ---------- */
@media (prefers-reduced-motion: no-preference) {
    /* short and all at once: staff open dozens of pages a day, content must not wait for an animation */
    .content > * { animation: rise .16s ease-out both; }
    /* fixed overlays manage their own visibility: the entrance animation must not force them visible */
    .content > .next-bar, .content > .modal { animation: none; }
    @keyframes rise { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.card { transition: box-shadow .2s, border-color .2s; }
.card-hover:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }

/* ---------- tabs (reports) ---------- */
.tabs-pill { display: flex; gap: .35rem; padding: .3rem; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; scrollbar-width: none; width: fit-content; max-width: 100%; }
.tabs-pill::-webkit-scrollbar { display: none; }
.tabs-pill a { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .88rem; white-space: nowrap; transition: background .15s, color .15s; }
.tabs-pill a:hover { background: var(--surface-2); color: var(--text); }
.tabs-pill a.active { background: var(--brand); color: #fff; box-shadow: 0 4px 10px -4px rgba(132, 73, 31, .6); }

.preset-row { display: flex; gap: .35rem; flex-wrap: wrap; }
.preset-row a { padding: .22rem .7rem; border-radius: 999px; background: var(--slate-50); color: #475467; font-size: .78rem; font-weight: 500; border: 1px solid transparent; transition: all .15s; }
.preset-row a:hover { background: var(--brand-50); color: var(--brand-600); }
.preset-row a.active { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); font-weight: 700; }

.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.meter { height: .5rem; background: var(--slate-50); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .6s ease; }
.meter.green > span { background: var(--green); } .meter.red > span { background: var(--red); } .meter.amber > span { background: #e5a11a; } .meter.blue > span { background: var(--blue); }
.stat-line { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.stat-line:last-child { border-bottom: 0; }
.stat-line b { font-variant-numeric: tabular-nums; }
.kpi .kv small { font-size: .7em; font-weight: 500; color: var(--muted); }

/* ---------- service request ---------- */
.type-opt { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem; border: 1.5px solid var(--border); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; height: 100%; }
.type-opt:hover { border-color: var(--border-strong); }
.type-opt .ti { width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--slate-50); color: #475467; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.btn-check:checked + .type-opt { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 4px rgba(140, 85, 48, .12); }
.btn-check:checked + .type-opt .ti { background: var(--brand); color: #fff; }
.btn-check:disabled + .type-opt { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
.btn-check:focus-visible + .type-opt { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- responsive tables → cards (phones and tablets in portrait) ---------- */
@media (max-width: 991.98px) {
    .table-modern.table-cards thead { display: none; }
    .table-modern.table-cards, .table-modern.table-cards tbody, .table-modern.table-cards tr, .table-modern.table-cards td { display: block; width: 100%; }
    .table-modern.table-cards tbody tr { padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
    .table-modern.table-cards tbody td { padding: .3rem 0; border: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: end; }
    .table-modern.table-cards tbody td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 600; text-align: start; flex: none; }
    .table-modern.table-cards tbody td[data-label=""]::before, .table-modern.table-cards tbody td:not([data-label])::before { display: none; }
    .table-modern.table-cards tbody td.cell-main { display: block; text-align: start; padding-bottom: .5rem; }
    .table-modern.table-cards tbody td.cell-main::before { display: none; }
    .table-modern.table-cards tr.row-late { box-shadow: inset -3px 0 0 var(--red); }
    .table-modern.table-cards tbody td.cell-actions { justify-content: flex-end; padding-top: .5rem; }
}

/* ---------- sticky save bar (forms) ---------- */
.sticky-actions { position: sticky; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--border); margin: 1.5rem -1.75rem -3rem; padding: .8rem 1.75rem; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
@media (max-width: 991.98px) { .sticky-actions { margin-inline: -1rem; padding-inline: 1rem; } .sticky-actions .btn { flex: 1 1 auto; } }

@media print { .bell, .toast-stack, #page-progress { display: none !important; } }

/* ======================================================================
   Order wizard + "تعميد" spec forms + Tom Select / Flatpickr theming
   ====================================================================== */
[x-cloak] { display: none !important; }
.fs-contents { display: contents; border: 0; padding: 0; margin: 0; min-width: 0; }

.wiz-steps { display: flex; gap: 0; padding: 1.25rem 1rem 1.1rem; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-sm); overflow-x: auto; scrollbar-width: thin; margin-bottom: 1.5rem; counter-reset: ws; }
.ws { position: relative; flex: 1 0 6.6rem; min-width: 6.6rem; display: flex; flex-direction: column; align-items: center; gap: .55rem; background: none; border: 0; padding: 0 .35rem; color: var(--muted); text-align: center; cursor: pointer; }
/* connector to the next stage (RTL: runs from this circle toward the left) */
.ws:not(:last-child)::after { content: ''; position: absolute; top: 1.2rem; inset-inline-start: calc(50% + 1.65rem); width: calc(100% - 3.3rem); height: 3px; border-radius: 3px; background: var(--border); transition: background .25s; }
.ws.done:not(:last-child)::after { background: var(--green); }
.ws-dot { position: relative; z-index: 1; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); background: #fff; font-size: .95rem; font-weight: 700; color: var(--muted); flex: none; transition: background .2s, border-color .2s, color .2s, box-shadow .2s; }
.ws-dot .bi { font-size: 1.1rem; }
.ws-label { display: flex; flex-direction: column; align-items: center; gap: .1rem; line-height: 1.3; font-weight: 600; font-size: .84rem; color: var(--text); max-width: 8.5rem; }
.ws-label small { font-weight: 500; font-size: .72rem; color: var(--faint); }
.ws:hover .ws-dot { border-color: var(--brand); color: var(--brand); }
.ws.active .ws-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 5px rgba(140, 85, 48, .16); }
.ws.active .ws-label { color: var(--brand-600); }
.ws.active .ws-label small { color: var(--brand); }
.ws.done .ws-dot { background: var(--green); border-color: var(--green); color: #fff; }
.ws.done .ws-label small { color: var(--green); }
.ws.warn .ws-dot { background: var(--amber-50); border-color: var(--amber); color: var(--amber); }
.ws.warn .ws-label small { color: var(--amber); }
.ws.error .ws-dot { background: var(--red); border-color: var(--red); color: #fff; }
.ws.error .ws-label, .ws.error .ws-label small { color: var(--red); }
.ws:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 12px; }
@media (max-width: 767.98px) {
    .wiz-steps { padding: 1rem .5rem .9rem; }
    .ws { flex: 0 0 5.6rem; min-width: 5.6rem; }
    .ws-label { font-size: .78rem; }
}
.wiz-panel { animation: wizIn .18s ease both; }
@keyframes wizIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wiz-panel { animation: none; } }

.wiz-nav { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; gap: .75rem; margin-top: 1.1rem; padding: .8rem 1rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -6px 24px -14px rgba(16, 24, 40, .25); }
.wiz-total { display: flex; flex-direction: column; line-height: 1.2; padding-inline: .9rem; border-inline-start: 1px solid var(--border); }
.wiz-total span { font-size: .72rem; color: var(--muted); }
.wiz-total strong { font-size: 1.02rem; }

.type-card-v { flex-direction: column; align-items: flex-start; gap: .5rem; position: relative; padding: 1.2rem; min-height: 11rem; }
.type-card-v .ti { width: 3.2rem; height: 3.2rem; font-size: 1.6rem; }
.type-card-v .tick { position: absolute; inset-block-start: .8rem; inset-inline-end: .8rem; color: var(--brand); font-size: 1.25rem; opacity: 0; transform: scale(.6); transition: all .18s; }
.btn-check:checked + .type-card-v .tick { opacity: 1; transform: none; }
.type-card-v:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.type-card-v { transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; }

.spec-block { padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; margin-bottom: 1rem; }
.spec-block:last-child { margin-bottom: 0; }
.spec-title { display: flex; align-items: center; gap: .5rem; font-weight: 700; margin-bottom: .9rem; color: var(--brand-600); }
.spec-title i { width: 1.9rem; height: 1.9rem; border-radius: 9px; background: var(--brand-50); display: inline-grid; place-items: center; font-size: 1rem; }
.spec-row { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .8rem .9rem .9rem; }
.spec-row .sr-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .6rem; }
.spec-row .ir-n { width: 1.7rem; height: 1.7rem; border-radius: 8px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; font-weight: 700; font-size: .82rem; }
.spec-row .form-label { font-size: .8rem; margin-bottom: .25rem; }

.choice-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice-group .choice { cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.1rem; border: 2px solid var(--border); border-radius: 11px; background: #fff; font-weight: 500; transition: all .15s; }
.choice-group .choice:hover { border-color: var(--border-strong); }
.choice-group .btn-check:checked + .choice { border-color: var(--brand); background: var(--brand-50); color: var(--brand-600); box-shadow: 0 0 0 3px rgba(140, 85, 48, .12); }
.choice-group .btn-check:focus-visible + .choice { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice-group.is-invalid .choice { border-color: var(--red); }

.lookup-menu { position: absolute; z-index: 40; inset-inline: .5rem; top: calc(100% - .2rem); background: #fff; border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); padding: .35rem; max-height: 17rem; overflow: auto; }
.lookup-item { display: flex; align-items: center; gap: .65rem; width: 100%; border: 0; background: none; text-align: start; padding: .5rem .6rem; border-radius: 9px; }
.lookup-item:hover, .lookup-item:focus-visible { background: var(--brand-50); outline: 0; }
.lookup-item .li-ic { width: 2rem; height: 2rem; border-radius: 50%; background: var(--green-50); color: var(--green); display: grid; place-items: center; }

/* Tom Select (the wrapper carries .form-control, so it owns the border) */
.ts-wrapper { direction: rtl; }
.ts-wrapper.form-control, .ts-wrapper.form-select { padding: 0 !important; display: flex; align-items: stretch; min-height: 2.6rem; height: auto; background-image: none; }
.ts-wrapper .ts-control { border: 0 !important; box-shadow: none !important; background: transparent !important; min-height: 2.5rem; padding: .35rem .8rem !important; font-size: .92rem; align-items: center; }
.ts-wrapper .ts-control > input { font-size: .92rem !important; }
.ts-wrapper.form-control.focus, .ts-wrapper.form-control.dropdown-active { border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(140, 85, 48, .16); }
.ts-wrapper.form-control.is-invalid, .is-invalid ~ .ts-wrapper.form-control { border-color: var(--red); }
.ts-dropdown { border-radius: 12px; border: 1px solid var(--border-strong); box-shadow: var(--shadow); margin-top: 4px; z-index: 1056; text-align: start; padding: .25rem; font-size: .9rem; }
.ts-dropdown .option, .ts-dropdown .create, .ts-dropdown .no-results { border-radius: 8px; padding: .5rem .7rem; }
.ts-dropdown .active { background: var(--brand-50); color: var(--brand-600); }
.ts-dropdown .create { color: var(--brand-600); font-weight: 600; }
.ts-dropdown .no-results { color: var(--muted); }
.ts-wrapper.plugin-clear_button .clear-button,
.ts-wrapper.plugin-clear_button.single .clear-button { right: auto !important; left: .5rem; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border-radius: 50%; margin: 0 !important; pointer-events: none; z-index: 2; }
.ts-wrapper.plugin-clear_button.has-items:hover .clear-button,
.ts-wrapper.plugin-clear_button.focus.has-items .clear-button { pointer-events: auto; }
.ts-wrapper.plugin-clear_button .clear-button:hover { background: var(--slate-50) !important; }
.ts-wrapper.single .ts-control::after { right: auto; left: .8rem; }
.ts-wrapper.single .ts-control { padding-inline-end: .8rem !important; padding-inline-start: 2rem !important; }

/* Flatpickr */
.flatpickr-calendar { font-family: inherit; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); direction: rtl; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected:hover { background: var(--brand); border-color: var(--brand); }
.flatpickr-day.today { border-color: var(--brand); }
.flatpickr-day.today:hover { background: var(--brand-50); color: var(--brand-600); }
.flatpickr-months .flatpickr-month, .flatpickr-weekdays, span.flatpickr-weekday { color: var(--text); fill: var(--text); }
.flatpickr-current-month .flatpickr-monthDropdown-months, .flatpickr-current-month input.cur-year { font-weight: 600; }
input.flatpickr-input[readonly], input.form-control[readonly].flatpickr-input { background-color: #fff; cursor: pointer; }
.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after { display: none; }

/* read-only spec view */
.spec-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem 1.25rem; margin: 0 0 1rem; }
.spec-dl > div { padding: .15rem 0; border-bottom: 1px dashed var(--border); }
.spec-dl > div.wide { grid-column: 1 / -1; }
.spec-dl dt { font-size: .76rem; color: var(--muted); font-weight: 500; }
.spec-dl dd { margin: 0; font-weight: 600; }
.spec-group-title { font-weight: 700; color: var(--brand-600); margin: .5rem 0 .4rem; }
.spec-table th { background: var(--surface-2); font-size: .8rem; white-space: nowrap; }
.spec-deadline { display: flex; gap: .55rem; align-items: center; padding: .65rem .9rem; border-radius: 10px; background: var(--amber-50); color: #7a4f06; margin-bottom: 1rem; }
.spec-view-print .spec-dl dd { font-weight: 700; }
.spec-view-print .spec-deadline { background: none; border: 1px solid #999; color: #000; }

.btn-whatsapp { --bs-btn-color: #fff; background: #25d366; border-color: #25d366; color: #fff; box-shadow: 0 1px 2px rgba(18, 140, 126, .35); }
.btn-whatsapp:hover, .btn-whatsapp:focus { background: #1ebe5b; border-color: #1ebe5b; color: #fff; }


/* =========================================================================
   Dashboard: sections, hero figures, status tiles, charts
   ========================================================================= */
body { font-size: .95rem; letter-spacing: 0; }
h1, h2, h3, h4, h5, h6, .card-header, .kv, .sh-value, .st-value { font-weight: 700; }

.dash-section { margin-bottom: 2.75rem; }
.sec-head { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; margin-bottom: 1.1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--border); }
.sec-head h2 { font-size: 1.12rem; margin: 0; display: flex; align-items: center; gap: .55rem; }
.sec-head h2 i { color: var(--brand); font-size: 1.05rem; }
.sec-head > span { color: var(--muted); font-size: .84rem; }

/* 4-column grid: hero cards span 2, small cards span 1 */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
.span-2 { grid-column: span 2; }
@media (max-width: 767.98px) { .stat-grid { grid-template-columns: 1fr; gap: 1.1rem; } .span-2 { grid-column: auto; } }

.stat-hero { position: relative; overflow: hidden; border-radius: 20px; padding: 1.75rem 1.9rem 1.5rem; color: #fff; box-shadow: 0 18px 40px -22px rgba(29, 23, 19, .55); isolation: isolate; }
.stat-hero::after { content: ''; position: absolute; width: 18rem; height: 18rem; inset-inline-start: -6rem; top: -8rem; border-radius: 50%; background: rgba(255, 255, 255, .07); z-index: -1; }
.stat-hero::before { content: ''; position: absolute; width: 12rem; height: 12rem; inset-inline-end: -4rem; bottom: -6rem; border-radius: 50%; background: rgba(255, 255, 255, .05); z-index: -1; }
.stat-hero-brand { background: linear-gradient(135deg, #3b2616 0%, #6a4125 55%, #8c5530 100%); }
.stat-hero-green { background: linear-gradient(135deg, #0d3f2e 0%, #137150 55%, #1b9a62 100%); }
.sh-top { display: flex; align-items: center; gap: .75rem; }
.sh-ic { width: 2.8rem; height: 2.8rem; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; background: rgba(255, 255, 255, .16); flex: none; }
.sh-label { font-size: 1rem; font-weight: 500; opacity: .92; }
.sh-trend { margin-inline-start: auto; display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .65rem; border-radius: 99px; font-size: .82rem; font-weight: 700; background: rgba(255, 255, 255, .16); }
.sh-trend.up { background: rgba(120, 240, 180, .22); color: #c9ffe3; }
.sh-trend.down { background: rgba(255, 130, 130, .25); color: #ffd6d6; }
.sh-value { font-size: clamp(1.9rem, 3.2vw, 2.6rem); line-height: 1.15; margin-top: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sh-desc { margin-top: .45rem; font-size: .88rem; opacity: .82; }
.sh-progress { height: .5rem; border-radius: 99px; background: rgba(255, 255, 255, .2); margin-top: 1.1rem; overflow: hidden; }
.sh-progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8ff0bd, #fff); transition: width .8s ease; }
.sh-foot { display: flex; justify-content: space-between; gap: 1rem; margin-top: .65rem; font-size: .8rem; opacity: .8; }

.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (min-width: 992px) { .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; } }
@media (min-width: 1700px) { .tile-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 479.98px) { .tile-grid { grid-template-columns: 1fr; } }
.stat-tile { --tc: var(--muted); --tb: var(--slate-50); position: relative; display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.15rem; background: #fff; border: 1px solid var(--border); border-radius: 16px; color: inherit; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.stat-tile::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--tc); opacity: .85; }
a.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); color: inherit; }
.st-ic { width: 2.7rem; height: 2.7rem; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; background: var(--tb); color: var(--tc); flex: none; }
.st-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.st-value { font-size: 1.7rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.st-label { font-weight: 600; font-size: .86rem; }
.st-desc { color: var(--muted); font-size: .76rem; margin-top: .1rem; }
.st-go { margin-inline-start: auto; color: var(--faint); font-size: .8rem; }
.tone-amber { --tc: var(--amber); --tb: var(--amber-50); }
.tone-blue { --tc: var(--blue); --tb: var(--blue-50); }
.tone-brand { --tc: var(--brand); --tb: var(--brand-50); }
.tone-violet { --tc: var(--violet); --tb: var(--violet-50); }
.tone-red { --tc: var(--red); --tb: var(--red-50); }
.tone-green { --tc: var(--green); --tb: var(--green-50); }
.stat-tile.is-alert { border-color: #f1bcbc; background: linear-gradient(180deg, #fff, #fff5f5); }
.stat-tile.is-alert .st-value { color: var(--red); }

.chart-box.lg { height: 320px; }
.chart-card .card-body { padding: 1.35rem 1.5rem; }
.pill-brand { background: var(--brand-50); color: var(--brand-600); }
.page-head { margin-bottom: 1.75rem; }

/* ---------- WhatsApp send screen ---------- */
.wa-file { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); }
.wa-file-ic { width: 3rem; height: 3.4rem; border-radius: 10px; background: var(--red-50); color: var(--red); display: grid; place-items: center; font-size: 1.7rem; flex: none; }
.wa-text { line-height: 1.8; font-size: .92rem; }

/* ===== ntfy linking page ===== */
.ntfy-steps { padding-inline-start: 1.2rem; display: grid; gap: .9rem; margin: 0; }
.ntfy-steps li { line-height: 1.9; }
.ntfy-steps li::marker { font-weight: 800; color: var(--primary, #8a5a2b); }

/* ---------- stat tiles on phones: two per row must fit, long amounts shrink and wrap ---------- */
.kpi > .min-w-0 { min-width: 0; }
.kpi .kv { overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
    .kpi { padding: .8rem .75rem; gap: .55rem; }
    .kpi .ki { width: 2.1rem; height: 2.1rem; font-size: .95rem; flex: none; }
    .kpi .kv { font-size: 1.3rem; }
    .kpi-money .kv { font-size: 1rem; }
    .kpi .kl { font-size: .74rem; }
}
