/* ==========================================================================
   مِصناع / Misnaa — نظام التصميم (كحلي/نحاسي)
   يعتمد الخصائص المنطقية (logical properties) لدعم RTL/LTR تلقائياً.
   ========================================================================== */

:root {
    /* الهوية اللونية (القسم 5 بالوثيقة) */
    --navy:        #081B33;
    --navy-2:      #0D294B;
    --navy-3:      #12365F;
    --blue:        #3C6EA8;
    --blue-soft:   #e8f0f9;
    --copper:      #D98A43;
    --copper-dark: #bd722f;
    --ivory:       #F8F5EF;
    --white:       #FFFFFF;
    --green:       #2f9e6f;
    --green-soft:  #e6f6ef;
    --red:         #d64541;
    --red-soft:    #fbe9e8;
    --gold-soft:   #fbeede;
    --success:     var(--green);
    --danger:      var(--red);
    --surface-2:   var(--ivory);

    --ink:         #1c2733;
    --ink-soft:    #5a6b7b;
    --muted:       var(--ink-soft);
    --line:        #e4e8ee;
    --line-2:      #eef1f5;

    --radius:      14px;
    --radius-sm:   10px;
    --radius-lg:   20px;
    --shadow-sm:   0 1px 2px rgba(8,27,51,.06), 0 1px 3px rgba(8,27,51,.04);
    --shadow:      0 4px 16px rgba(8,27,51,.08);
    --shadow-lg:   0 18px 48px rgba(8,27,51,.18);

    --sidebar-w:   264px;
    --font-ar:     'Almarai', 'Cairo', system-ui, sans-serif;
    --font-en:     'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ======================= المواعيد والمعاينات والقياسات ======================= */
.appointment-filters,.measurement-filters{display:flex;flex-wrap:wrap;gap:.65rem;align-items:center;margin-bottom:1rem}.appointment-filters__search,.measurement-filters__search{flex:1 1 260px}.appointment-filters>.field__input,.measurement-filters>.field__input{width:auto;min-width:150px}.calendar-nav{display:flex;align-items:center;gap:.35rem}.calendar-nav input{width:145px}.appointment-stats{display:grid;grid-template-columns:repeat(6,minmax(115px,1fr));gap:.65rem;margin-bottom:1rem}.appointment-stat{display:flex;align-items:center;gap:.7rem;background:#fff;border:1px solid var(--line);border-radius:14px;padding:.8rem;box-shadow:var(--shadow-sm)}.appointment-stat>span{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:var(--surface-2);color:var(--navy)}.appointment-stat strong,.appointment-stat small{display:block}.appointment-stat strong{font-size:1.15rem}.appointment-stat small{color:var(--muted);font-size:.74rem;margin-top:.15rem}.appointment-calendar{display:grid;gap:.7rem;padding:1rem;overflow:auto}.appointment-calendar--week{grid-template-columns:repeat(7,minmax(190px,1fr))}.appointment-calendar--day{grid-template-columns:minmax(260px,1fr)}.appointment-calendar--month{grid-template-columns:repeat(7,minmax(150px,1fr))}.appointment-day{min-height:180px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2);overflow:hidden}.appointment-day.is-today{border-color:var(--copper);box-shadow:0 0 0 2px color-mix(in srgb,var(--copper) 18%,transparent)}.appointment-day>header{display:flex;align-items:center;gap:.45rem;padding:.65rem .75rem;background:#fff;border-bottom:1px solid var(--line)}.appointment-day>header strong{font-size:1.1rem;color:var(--navy)}.appointment-day>header span{font-size:.72rem;color:var(--muted);flex:1}.appointment-day>header em{font-style:normal;background:var(--navy);color:#fff;border-radius:999px;padding:.1rem .45rem;font-size:.7rem}.appointment-day__items{display:grid;gap:.55rem;padding:.55rem}.appointment-card{display:grid;gap:.3rem;background:#fff;border:1px solid var(--line);border-inline-start:4px solid var(--blue);border-radius:11px;padding:.65rem;box-shadow:var(--shadow-sm)}.appointment-card--confirmed,.appointment-card--completed{border-inline-start-color:var(--success)}.appointment-card--cancelled,.appointment-card--no_show{border-inline-start-color:var(--danger);opacity:.78}.appointment-card__time{display:flex;gap:.25rem;align-items:center;color:var(--copper-dark);font-size:.72rem;font-weight:700}.appointment-card__time time:last-child{display:none}.appointment-card>span,.appointment-card>small{font-size:.75rem;color:var(--muted)}.appointment-card footer{display:flex;align-items:center;justify-content:space-between;gap:.4rem}.appointment-card__links{display:flex;flex-wrap:wrap;gap:.55rem;border-top:1px dashed var(--line);padding-top:.4rem;font-size:.72rem}.check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.45rem;padding:.65rem;border:1px solid var(--line);border-radius:12px;max-height:180px;overflow:auto}.conflict-override{background:#fff8ed;border:1px solid #efc99f;border-radius:12px;padding:.75rem}.conflict-override textarea{margin-top:.55rem}.measurement-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.measurement-form .form-actions{display:flex;justify-content:flex-end;margin-top:1rem}.measurement-detail-grid{align-items:start}.required-mark{color:var(--danger)}.inline-action{display:inline-flex;align-items:center;gap:.5rem;margin-top:.7rem}.status--scheduled,.status--draft{background:#eef4fb;color:#315e8d}.status--confirmed,.status--approved{background:#e9f8f1;color:#16704f}.status--on_the_way,.status--in_progress,.status--completed{background:#fff4e7;color:#925014}.status--cancelled,.status--no_show,.status--revision_needed{background:#fdecec;color:#a12d2d}.status--rescheduled{background:#f0ecfb;color:#6246a4}
@media (max-width:1100px){.appointment-stats{grid-template-columns:repeat(3,1fr)}.appointment-calendar--week,.appointment-calendar--month{grid-template-columns:repeat(7,minmax(175px,1fr))}}
@media (max-width:700px){.appointment-filters,.measurement-filters{display:grid;grid-template-columns:1fr}.appointment-filters>.field__input,.measurement-filters>.field__input{width:100%}.calendar-nav{justify-content:space-between}.appointment-stats{grid-template-columns:repeat(2,1fr)}.appointment-calendar{padding:.65rem}.appointment-calendar--week,.appointment-calendar--month{grid-template-columns:repeat(7,minmax(160px,1fr))}.measurement-fields{grid-template-columns:1fr}.appointment-card__time time:last-child{display:inline}.check-grid{grid-template-columns:1fr}}
.template-grid{display:grid;gap:1rem}.template-card .panel__head small{display:block;color:var(--muted);margin-top:.25rem}.template-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:.6rem}.template-field{display:grid;grid-template-columns:auto 1fr auto;gap:.25rem .55rem;align-items:center;text-align:start;border:1px solid var(--line);background:var(--surface-2);border-radius:12px;padding:.7rem;color:inherit;cursor:pointer}.template-field>span{grid-row:1/3;display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:var(--navy);color:#fff}.template-field strong,.template-field small{grid-column:2}.template-field small{color:var(--muted)}.template-field>.icon{grid-column:3;grid-row:1/3}.template-field.is-disabled{opacity:.55}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-ar);
    color: var(--ink);
    background: var(--ivory);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { font-family: var(--font-en); }

h1, h2, h3, h4 { margin: 0; font-weight: 800; color: var(--navy); line-height: 1.3; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }

.icon { width: 1.15em; height: 1.15em; stroke-width: 2; flex: none; }
[data-lucide] { width: 1.15em; height: 1.15em; }

.container { width: min(1160px, 92%); margin-inline: auto; }

/* ---------- الأزرار ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: inherit; font-size: .95rem; font-weight: 700;
    padding: .7rem 1.25rem; border-radius: var(--radius-sm);
    border: 1.5px solid transparent; cursor: pointer;
    transition: transform .06s ease, background .2s ease, box-shadow .2s ease, border-color .2s;
    white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn--block { width: 100%; }
.btn--sm { padding: .5rem .85rem; font-size: .875rem; }
.btn--lg { padding: .85rem 1.6rem; font-size: 1.05rem; }
.btn--primary { background: var(--copper); color: #fff; box-shadow: 0 6px 16px rgba(217,138,67,.28); }
.btn--primary:hover { background: var(--copper-dark); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.btn .icon { width: 1.1em; height: 1.1em; }

.link { color: var(--blue); font-weight: 600; }
.link:hover { text-decoration: underline; }
.link--strong { color: var(--copper-dark); font-weight: 700; }

.badge { display: inline-flex; align-items: center; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge--gold { background: var(--gold-soft); color: var(--copper-dark); }

/* ==========================================================================
   الحقول والنماذج
   ========================================================================== */
.form { display: flex; flex-direction: column; gap: 1.05rem; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form__row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: .4rem; }
.field__label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .9rem; color: var(--navy-2); }
.field__ico { color: var(--copper); width: 1.05em; height: 1.05em; }
.field__input {
    font-family: inherit; font-size: .95rem; color: var(--ink);
    padding: .72rem .9rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: #fff; width: 100%; transition: border-color .18s, box-shadow .18s;
}
.field__input::placeholder { color: #aab4c0; }
.field__input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(60,110,168,.15); }
.field__input.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(214,69,65,.12); }
.field__hint { font-size: .8rem; color: var(--ink-soft); }
.field__error { font-size: .82rem; color: var(--red); font-weight: 600; display: flex; gap: .3rem; }

.field__with-action { position: relative; display: flex; align-items: center; }
.field__with-action .field__input { padding-inline-end: 2.6rem; }
.field__toggle {
    position: absolute; inset-inline-end: .5rem; background: none; border: none; cursor: pointer;
    color: var(--ink-soft); display: inline-flex; padding: .3rem; border-radius: 8px;
}
.field__toggle:hover { color: var(--blue); background: var(--blue-soft); }

.checkbox { display: inline-flex; align-items: flex-start; gap: .55rem; font-size: .9rem; cursor: pointer; color: var(--ink-soft); }
.checkbox input { margin-block-start: .2rem; width: 1.05rem; height: 1.05rem; accent-color: var(--copper); flex: none; }
.checkbox--terms { background: var(--ivory); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .8rem .9rem; }

.captcha { display: flex; align-items: center; gap: .75rem; }
.captcha__question {
    font-weight: 800; font-size: 1.05rem; color: var(--navy); background: var(--blue-soft);
    padding: .6rem 1rem; border-radius: var(--radius-sm); letter-spacing: .05em; white-space: nowrap;
    border: 1.5px dashed var(--blue);
}
.captcha__input { max-width: 130px; }

/* ==========================================================================
   شاشات المصادقة
   ========================================================================== */
.auth-body { min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

.auth-brand {
    background: radial-gradient(120% 120% at 80% 0%, var(--navy-3) 0%, var(--navy-2) 45%, var(--navy) 100%);
    color: #fff; display: flex; align-items: center; justify-content: center; padding: 3rem; position: relative; overflow: hidden;
}
.auth-brand::after {
    content: ""; position: absolute; inset-block-start: -30%; inset-inline-end: -20%;
    width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(217,138,67,.35), transparent 62%);
}
.auth-brand__inner { position: relative; max-width: 360px; }
.auth-brand__logo { width: 68px; height: 68px; margin-bottom: 1.2rem; }
.auth-brand__title { color: #fff; font-size: 2.1rem; }
.auth-brand__tagline { color: #b9c8db; margin-block-start: .5rem; font-size: 1.02rem; }
.auth-brand__points { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-direction: column; gap: 1rem; }
.auth-brand__points li { display: flex; align-items: center; gap: .75rem; color: #dce6f1; font-weight: 600; }
.auth-brand__points .icon, .auth-brand__points [data-lucide] { color: var(--copper); width: 1.35rem; height: 1.35rem; }

.auth-main { display: flex; flex-direction: column; padding: 2rem clamp(1.2rem, 5vw, 3.5rem); background: var(--ivory); }
.auth-main__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.auth-home-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--navy); }
.auth-card { margin: auto; width: 100%; max-width: 440px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: clamp(1.5rem, 4vw, 2.4rem); }
.auth-card__head { margin-bottom: 1.5rem; text-align: center; }
.auth-card__title { font-size: 1.6rem; }
.auth-card__sub { color: var(--ink-soft); margin-block-start: .35rem; font-size: .92rem; }
.auth-card__foot { text-align: center; margin-block-start: 1.4rem; color: var(--ink-soft); font-size: .92rem; }
.auth-foot { text-align: center; color: var(--ink-soft); font-size: .8rem; padding-block: 1rem; }

/* مبدّل اللغة */
.lang-switch { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: .2rem; gap: .1rem; }
.lang-chip { padding: .3rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
.lang-chip.is-active { background: var(--navy); color: #fff; }

/* ==========================================================================
   الموقع العام
   ========================================================================== */
.site-header { background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; inset-block-start: 0; z-index: 40; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding-block: .8rem; gap: 1rem; }
.site-brand { display: inline-flex; align-items: center; gap: .6rem; }
.site-brand__logo { width: 40px; height: 40px; }
.site-brand__name { font-weight: 800; font-size: 1.25rem; color: var(--navy); }
.site-nav { display: flex; align-items: center; gap: .6rem; }

.hero { background: radial-gradient(120% 130% at 100% 0%, #fff 0%, var(--ivory) 60%); padding-block: clamp(2.5rem, 7vw, 5rem); }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 2.5rem; }
.hero__badge { display: inline-flex; align-items: center; gap: .4rem; background: var(--gold-soft); color: var(--copper-dark); font-weight: 700; font-size: .85rem; padding: .35rem .8rem; border-radius: 999px; }
.hero__title { font-size: clamp(1.9rem, 4vw, 3rem); margin-block: 1rem; }
.hero__sub { color: var(--ink-soft); font-size: 1.08rem; max-width: 48ch; }
.hero__actions { display: flex; gap: .8rem; margin-block-start: 1.8rem; flex-wrap: wrap; }
.hero__art { display: flex; justify-content: center; }
.hero__card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.5rem; width: min(360px, 100%); border: 1px solid var(--line-2); }
.hero__card-row { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--navy); }
.hero__card-row .badge { margin-inline-start: auto; }
.hero__bar { height: 10px; background: var(--line-2); border-radius: 999px; margin-block: 1rem .8rem; overflow: hidden; }
.hero__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--copper), var(--copper-dark)); border-radius: 999px; }
.hero__stages { display: flex; gap: .5rem; }
.hero__stages .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.hero__stages .dot.done { background: var(--green); }
.hero__stages .dot.active { background: var(--copper); box-shadow: 0 0 0 4px var(--gold-soft); }

.features { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-title { text-align: center; font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 2.2rem; }
.features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }
.feature-card { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-card__ico { width: 52px; height: 52px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; margin-bottom: 1rem; }
.feature-card__ico .icon, .feature-card__ico [data-lucide] { width: 1.6rem; height: 1.6rem; }
.feature-card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.feature-card p { color: var(--ink-soft); font-size: .95rem; }
.phase-note { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-block-start: 2.2rem; color: var(--ink-soft); font-size: .9rem; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: .8rem; }
.phase-note .icon, .phase-note [data-lucide] { color: var(--copper); }

.site-footer { background: var(--navy); color: #9fb2c9; text-align: center; padding-block: 1.4rem; font-size: .88rem; }

/* ==========================================================================
   هيكل التطبيق (الشريط الجانبي الكحلي يميناً في RTL)
   ========================================================================== */
.app-body { background: var(--ivory); }
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex: none; background: var(--navy); color: #cdd9e8;
    display: flex; flex-direction: column; position: sticky; inset-block-start: 0; height: 100vh; overflow-y: auto;
}
.sidebar__brand { display: flex; align-items: center; gap: .65rem; padding: 1.2rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar__logo { width: 36px; height: 36px; }
.sidebar__name { font-weight: 800; color: #fff; font-size: 1.2rem; }
.sidebar__close { margin-inline-start: auto; background: none; border: none; color: #cdd9e8; cursor: pointer; display: none; }
.sidebar__nav { display: flex; flex-direction: column; padding: .8rem; gap: .2rem; }
.sidebar__link { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border-radius: var(--radius-sm); color: #cdd9e8; font-weight: 600; font-size: .93rem; position: relative; }
.sidebar__ico { color: #8ea3bd; width: 1.2rem; height: 1.2rem; }
.sidebar__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar__link.is-active { background: linear-gradient(90deg, var(--copper), var(--copper-dark)); color: #fff; box-shadow: 0 6px 16px rgba(217,138,67,.3); }
.sidebar__link.is-active .sidebar__ico { color: #fff; }
.sidebar__link.is-disabled { opacity: .55; cursor: default; }
.sidebar__soon { margin-inline-start: auto; font-size: .62rem; background: rgba(255,255,255,.1); padding: .1rem .45rem; border-radius: 999px; font-style: normal; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem clamp(1rem, 3vw, 1.8rem); background: #fff; border-bottom: 1px solid var(--line); position: sticky; inset-block-start: 0; z-index: 30; }
.topbar__start { display: flex; align-items: center; gap: .8rem; }
.topbar__title { font-size: 1.2rem; }
.topbar__menu { display: none; background: none; border: none; cursor: pointer; color: var(--navy); }
.topbar__end { display: flex; align-items: center; gap: .7rem; }
.topbar__icon-btn { position: relative; background: var(--ivory); border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--navy-2); }
.topbar__dot { position: absolute; inset-block-start: 8px; inset-inline-end: 9px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid #fff; }

.usermenu { position: relative; }
.usermenu__trigger { display: flex; align-items: center; gap: .55rem; background: var(--ivory); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem .3rem .3rem; cursor: pointer; font-family: inherit; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; }
.usermenu__name { font-weight: 700; font-size: .9rem; color: var(--navy); }
.usermenu__caret { color: var(--ink-soft); width: 1rem; height: 1rem; }
.usermenu__dropdown { position: absolute; inset-block-start: calc(100% + .5rem); inset-inline-end: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); min-width: 220px; padding: .5rem; z-index: 50; }
.usermenu__email { display: block; font-size: .82rem; color: var(--ink-soft); padding: .4rem .5rem; }
.usermenu__dropdown hr { border: none; border-top: 1px solid var(--line-2); margin: .3rem 0; }
.usermenu__item { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .6rem .5rem; border-radius: 8px; background: none; border: none; font-family: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; text-align: start; }
.usermenu__item:hover { background: var(--ivory); }
.usermenu__item--danger { color: var(--red); }
.usermenu__item.is-disabled { opacity: .55; cursor: default; }
.usermenu__item em { margin-inline-start: auto; font-size: .62rem; font-style: normal; background: var(--line-2); padding: .1rem .4rem; border-radius: 999px; }

.app-content { padding: clamp(1rem, 3vw, 1.8rem); flex: 1; }

.welcome { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; border-radius: var(--radius-lg); padding: 1.5rem 1.8rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.welcome__title { color: #fff; font-size: 1.4rem; }
.welcome__sub { color: #b9c8db; margin-block-start: .3rem; font-size: .92rem; }
.welcome__badge { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.12); padding: .4rem .8rem; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.welcome__badge .icon, .welcome__badge [data-lucide] { color: #7ee0ab; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.stat-card { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 1.1rem; display: flex; align-items: center; gap: .9rem; box-shadow: var(--shadow-sm); }
.stat-card__ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat-card__ico .icon, .stat-card__ico [data-lucide] { width: 1.5rem; height: 1.5rem; }
.stat-card__ico--blue { background: var(--blue-soft); color: var(--blue); }
.stat-card__ico--gold { background: var(--gold-soft); color: var(--copper-dark); }
.stat-card__ico--green { background: var(--green-soft); color: var(--green); }
.stat-card__ico--red { background: var(--red-soft); color: var(--red); }
.stat-card__body { display: flex; flex-direction: column; }
.stat-card__value { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.stat-card__label { font-size: .85rem; color: var(--ink-soft); }

.panel { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel__head { padding: 1rem 1.3rem; border-bottom: 1px solid var(--line-2); }
.panel__head h3 { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.panel__head .icon, .panel__head [data-lucide] { color: var(--copper); }
.panel__body { padding: 1.3rem; }
.empty-state { text-align: center; color: var(--ink-soft); padding-block: 2.5rem; }
.empty-state__ico { width: 3rem; height: 3rem; color: var(--line); margin-inline: auto; margin-bottom: .8rem; }

/* ==========================================================================
   صفحات الأخطاء
   ========================================================================== */
.page-centered { display: grid; place-items: center; min-height: 100vh; background: var(--ivory); padding: 1.5rem; }
.error-page { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.error-page__card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 3rem 2.5rem; text-align: center; max-width: 460px; }
.error-page__code { font-size: 4.5rem; font-weight: 800; color: var(--copper); line-height: 1; }
.error-page__title { font-size: 1.3rem; margin-block: 1rem 1.6rem; color: var(--navy); }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-stack { position: fixed; inset-block-end: 1.2rem; inset-inline-end: 1.2rem; z-index: 100; display: flex; flex-direction: column; gap: .6rem; max-width: min(360px, 90vw); }
.toast { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--blue); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .8rem 1rem; font-size: .92rem; animation: toast-in .3s ease; }
.toast--success { border-inline-start-color: var(--green); }
.toast--success .toast-ico { color: var(--green); }
.toast--error { border-inline-start-color: var(--red); }
.toast--error .toast-ico { color: var(--red); }
.toast-close { margin-inline-start: auto; background: none; border: none; font-size: 1.2rem; line-height: 1; color: var(--ink-soft); cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.sidebar-overlay { display: none; }

/* ==========================================================================
   الاستجابة (Responsive)
   ========================================================================== */
@media (max-width: 980px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__art { order: -1; }
    .features__grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}

@media (max-width: 760px) {
    .form__grid { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; inset-inline-start: 0; inset-block: 0; z-index: 60; height: 100vh;
        transform: translateX(-105%); transition: transform .25s ease;
    }
    html[dir="rtl"] .sidebar { inset-inline-start: auto; inset-inline-end: 0; transform: translateX(105%); }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar__close { display: inline-flex; }
    .topbar__menu { display: inline-flex; }
    .usermenu__name { display: none; }
    body.sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(8,27,51,.5); z-index: 55; }
}

@media (max-width: 460px) {
    .stat-grid { grid-template-columns: 1fr; }
    .welcome { padding: 1.2rem; }
}

/* ==========================================================================
   المرحلة 2 — واجهات الإدارة (جداول، نوافذ، مصفوفة صلاحيات)
   ========================================================================== */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.page-head__title { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.35rem; }
.page-head__title .icon, .page-head__title [data-lucide] { color: var(--copper); }

.toolbar { display: flex; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-box { position: relative; display: flex; align-items: center; flex: 1; max-width: 360px; }
.search-box__ico { position: absolute; inset-inline-start: .7rem; color: var(--ink-soft); pointer-events: none; }
.search-box__input { width: 100%; padding: .6rem .9rem; padding-inline-start: 2.4rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; background: #fff; }
.search-box__input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(60,110,168,.15); }

.panel--narrow { max-width: 520px; }
.panel__body--flush { padding: 0; }
.table-wrap { overflow-x: auto; max-width: 100%; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; }
.form-actions { margin-top: 1.2rem; display: flex; justify-content: flex-start; }

/* الجداول */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .85rem 1rem; text-align: start; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table thead th { background: var(--ivory); color: var(--navy-2); font-weight: 700; font-size: .82rem; white-space: nowrap; }
.table tbody tr:hover { background: #fbfaf7; }
.table tbody tr:last-child td { border-bottom: none; }
.table__actions-col { text-align: end; }
.table__empty { text-align: center; color: var(--ink-soft); padding: 2.5rem 1rem; }
.cell-ltr { direction: ltr; }
.cell-user { display: flex; align-items: center; gap: .55rem; }
.text-muted { color: var(--ink-soft); }

.avatar--sm { width: 28px; height: 28px; font-size: .8rem; }

.chip { display: inline-flex; align-items: center; padding: .12rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--blue-soft); color: var(--blue); margin-inline-end: .25rem; }
.chip--count { background: var(--navy); color: #fff; min-width: 26px; justify-content: center; }
.chip--muted { background: var(--line-2); color: var(--ink-soft); }
.chip--action { background: var(--gold-soft); color: var(--copper-dark); font-family: ui-monospace, monospace; }

.status { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.status--active { background: var(--green-soft); color: var(--green); }
.status--off { background: var(--red-soft); color: var(--red); }
.status--gold { background: var(--gold-soft); color: var(--copper-dark); }

.row-actions { display: inline-flex; gap: .35rem; justify-content: flex-end; }
.row-actions form { display: inline; margin: 0; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1.5px solid var(--line); background: #fff; border-radius: 9px; cursor: pointer; color: var(--navy-2); transition: all .15s; }
.icon-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.icon-btn .icon, .icon-btn [data-lucide] { width: 1.05rem; height: 1.05rem; }
.icon-btn--warn:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.icon-btn--ok:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }

/* قسم الإدارة في الشريط الجانبي */
.sidebar__section { padding: 1rem .85rem .35rem; font-size: .72rem; font-weight: 800; letter-spacing: .04em; color: #6c82a0; text-transform: uppercase; }

/* ملاحظات */
.note { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 1rem; }
.note--info { background: var(--blue-soft); color: #2b527d; }
.note--info .icon, .note--info [data-lucide] { color: var(--blue); }
.note--warn { background: var(--gold-soft); color: var(--copper-dark); }
.note--warn .icon, .note--warn [data-lucide] { color: var(--copper-dark); }

/* شبكة اختيارات (أدوار/فروع/صلاحيات) */
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.check-pill { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: .86rem; transition: all .12s; background: #fff; }
.check-pill:hover { border-color: var(--blue); }
.check-pill input { accent-color: var(--copper); width: 1rem; height: 1rem; flex: none; }
.check-pill input:checked ~ span { color: var(--navy); font-weight: 700; }
.check-pill span { direction: ltr; unicode-bidi: plaintext; }

.perm-matrix { border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); padding: 1rem; }
.perm-matrix__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.perm-group { margin-bottom: 1rem; }
.perm-group:last-child { margin-bottom: 0; }
.perm-group__title { font-weight: 700; color: var(--copper-dark); font-size: .82rem; margin-bottom: .5rem; text-transform: capitalize; direction: ltr; }
.checkbox--sm { font-size: .82rem; }

/* ==========================================================================
   النوافذ (Modals)
   ========================================================================== */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(8,27,51,.55); backdrop-filter: blur(2px); animation: fade-in .2s ease; }
.modal__dialog { position: relative; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(640px, 100%); max-height: 92vh; display: flex; flex-direction: column; animation: modal-in .22s ease; }
.modal__dialog--sm { width: min(420px, 100%); }
.modal__dialog--lg { width: min(820px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line-2); }
.modal__title { font-size: 1.15rem; }
.modal__close { background: none; border: none; cursor: pointer; color: var(--ink-soft); display: inline-flex; padding: .3rem; border-radius: 8px; }
.modal__close:hover { background: var(--ivory); color: var(--red); }
.modal__body { padding: 1.3rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1.05rem; }
.modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; padding: 1rem 1.3rem; border-top: 1px solid var(--line-2); }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.confirm-body { text-align: center; align-items: center; }
.confirm-ico { width: 2.6rem; height: 2.6rem; color: var(--copper); margin-inline: auto; }

.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: #b8383400; background: #b53a36; }

/* Account security / TOTP */
.security-panel { margin-inline: 0; }
.security-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-block-end: 1.2rem; }
.security-heading h3 { margin: 0 0 .35rem; }
.security-heading p { margin: 0; color: var(--ink-soft); line-height: 1.7; }
.security-meta { color: var(--ink-soft); margin-block: 1rem; }
.security-links { margin-block-start: 1rem; }
.two-factor-setup { border-top: 1px solid var(--line); margin-block-start: 1rem; padding-block-start: 1.2rem; }
.setup-steps { margin: 0 0 1.2rem; padding-inline-start: 1.4rem; line-height: 1.9; }
.qr-wrap { width: 265px; min-height: 265px; display: grid; place-items: center; margin: 0 auto 1.1rem; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.qr-wrap img { max-width: 100%; height: auto; image-rendering: pixelated; }
.qr-wrap.is-error { color: var(--red); text-align: center; }
.manual-secret { display: flex; align-items: center; gap: .7rem; padding: .8rem; margin-block-end: 1rem; border-radius: var(--radius); background: var(--ivory); flex-wrap: wrap; }
.manual-secret code { direction: ltr; unicode-bidi: isolate; letter-spacing: .08em; overflow-wrap: anywhere; flex: 1; }
.otp-input { direction: ltr; text-align: center; letter-spacing: .25em; font-size: 1.15rem; font-weight: 700; }
.security-recovery { max-width: 760px; margin-block-end: 1rem; border-color: var(--copper); }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.recovery-grid code { display: block; text-align: center; padding: .7rem; border: 1px dashed var(--copper); border-radius: 8px; background: #fffaf3; letter-spacing: .08em; }

@media (max-width: 620px) {
    .security-heading { flex-direction: column; }
    .qr-wrap { width: min(100%, 265px); }
    .recovery-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { border: 1px solid var(--line-2); border-radius: var(--radius-sm); margin-bottom: .7rem; padding: .3rem; }
    .table td { border: none; padding: .5rem .7rem; text-align: start; }
    .table__actions-col, .row-actions { justify-content: flex-start; }
    .checks-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   تحديث بصري لواجهات الإدارة (المرحلة 2) — جداول وأزرار أنظف وأوضح
   ========================================================================== */
.app-content { max-width: 1240px; margin-inline: auto; width: 100%; }

.page-head { padding-block-end: 1rem; margin-block-end: 1.5rem; border-block-end: 1px solid var(--line); }
.page-head__title { font-size: 1.5rem; letter-spacing: -.01em; }

.toolbar { margin-block-end: 1.2rem; }
.search-box { max-width: 420px; }
.search-box__input { padding-block: .68rem; border-radius: 999px; background: #fff; }

/* البطاقة الحاوية للجدول */
.panel { border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 26px rgba(8,27,51,.06); overflow: hidden; }

/* الجداول — أوضح وأكثر تنفّساً */
.table { font-size: .93rem; }
.table thead th {
    background: #fbfaf7; color: var(--ink-soft); font-weight: 700;
    font-size: .8rem; letter-spacing: .01em; padding: 1rem 1.15rem;
    border-block-end: 2px solid var(--line); white-space: nowrap;
}
.table tbody td { padding: 1rem 1.15rem; border-block-end: 1px solid var(--line-2); }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:nth-child(even) { background: #fdfcfa; }
.table tbody tr:hover { background: var(--blue-soft); }
.table tbody tr:last-child td { border-block-end: none; }

/* عمود الإجراءات: لا يتكسّر ويبقى ملتصقاً */
.table__actions-col { width: 1%; white-space: nowrap; text-align: end; }
.row-actions { display: inline-flex; flex-wrap: nowrap; gap: .4rem; align-items: center; }
.row-actions form { display: inline-flex; margin: 0; }

/* أزرار أيقونية أكبر وأوضح */
.icon-btn { width: 38px; height: 38px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.icon-btn .icon, .icon-btn [data-lucide] { width: 1.1rem; height: 1.1rem; }

/* صورة المستخدم بتدرّج الهوية */
.cell-user { gap: .65rem; }
.cell-user .avatar,
.avatar--sm { background: linear-gradient(135deg, var(--navy-2), var(--blue)); color: #fff; box-shadow: 0 3px 8px rgba(8,27,51,.18); }
.cell-user span:last-child { font-weight: 700; color: var(--navy); }

/* IP والقيم اللاتينية لا تكسر التخطيط */
.cell-ltr { word-break: break-word; }
.table--audit .cell-ltr { font-size: .82rem; color: var(--ink-soft); }

/* شرائح الأدوار أنيقة */
.chip { border: 1px solid transparent; padding: .22rem .65rem; font-size: .78rem; }
.chip { background: #eef3fa; color: #2f527d; border-color: #dce7f4; }
.chip--count { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip--muted { background: #f1f3f6; color: var(--ink-soft); border-color: var(--line); }
.chip--action { background: var(--gold-soft); color: var(--copper-dark); border-color: #f0dcc2; }

/* حالات أوضح */
.status { padding: .3rem .75rem; font-size: .8rem; }
.status--active { background: var(--green-soft); color: #1e8a5f; }
.status--active::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.status--off::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* رأس الصفحة: زر الإضافة أبرز */
.page-head .btn--primary { box-shadow: 0 8px 20px rgba(217,138,67,.32); }

/* نافذة الإعدادات: مسافات أعرض بين البطاقات */
.js-form .panel + .panel { margin-block-start: 1.2rem; }

/* تحسين شكل مصفوفة الصلاحيات */
.perm-group { background: #fbfaf7; border-radius: 12px; padding: .9rem 1rem; }
.perm-group__title { color: var(--copper-dark); }

/* نص عربي في شريحة الإجراء (بدل الخط الأحادي) */
.chip--action { font-family: inherit; letter-spacing: 0; }
.perm-group__title { direction: rtl; text-transform: none; }
html[lang="en"] .perm-group__title { direction: ltr; }

/* ==========================================================================
   إصلاح تمرير النافذة + ترتيب شرائح الصلاحيات (تحسين)
   ========================================================================== */
/* السبب الجذري لعدم التمرير: جسم النافذة يحتاج min-height:0 حتى يتقلّص ويظهر شريط التمرير */
.modal__dialog { max-height: 90vh; }
.modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal__head, .modal__foot { flex: 0 0 auto; }

/* شرائح الصلاحيات: مدمجة بحجم المحتوى بدل صناديق ممدودة فارغة */
.perm-group .checks-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.perm-group .check-pill { width: auto; flex: 0 0 auto; min-width: 110px; }
.check-pill { gap: .5rem; padding: .5rem .85rem; justify-content: flex-start; }
.check-pill span { direction: rtl; unicode-bidi: plaintext; }
html[lang="en"] .check-pill span { direction: ltr; }

/* مجموعات الصلاحيات: تباعد أوضح وعنوان أبرز */
.perm-matrix { padding: 1rem 1.1rem; }
.perm-group { margin-bottom: .9rem; padding: .95rem 1.05rem; }
.perm-group__title { font-size: .92rem; font-weight: 800; margin-bottom: .7rem; }

/* ==========================================================================
   إصلاح نهائي وموثوق لتمرير النافذة — الغطاء نفسه يسكرول (يضمن الوصول لزر الحفظ)
   ========================================================================== */
.modal { align-items: flex-start; overflow-y: auto; padding: 4vh 1rem; -webkit-overflow-scrolling: touch; }
.modal__dialog { max-height: none; margin: auto; }
.modal__body { overflow: visible; min-height: 0; }

/* ==========================================================================
   المرحلة 3أ — تفاصيل العميل + منتقي الخريطة
   ========================================================================== */
.crumb { display: flex; flex-direction: column; gap: .3rem; }
.crumb .link { font-size: .85rem; }
.page-head__title .avatar { width: 34px; height: 34px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.panel--wide { grid-column: 1 / -1; }
.panel__head--action { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.info-list { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.2rem; }
.info-list > div { display: flex; flex-direction: column; gap: .2rem; }
.info-list dt { font-size: .78rem; color: var(--ink-soft); font-weight: 700; }
.info-list dd { margin: 0; font-weight: 600; color: var(--navy); }

.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.mini-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .8rem .9rem; background: var(--ivory); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.mini-list strong { color: var(--navy); }
.mini-list small { display: block; }
.mini-list__meta { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; color: var(--ink-soft); margin-inline-start: .5rem; }
.muted-empty { color: var(--ink-soft); text-align: center; padding: 1.2rem; }

.note-form { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: 1rem; }
.note-form textarea { flex: 1; resize: vertical; font-family: inherit; }
.notes-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.notes-list li { padding: .8rem .9rem; background: var(--gold-soft); border-radius: var(--radius-sm); }
.notes-list p { color: var(--ink); }
.notes-list__meta { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--copper-dark); margin-top: .4rem; }

.map-picker { height: 320px; width: 100%; border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid var(--line); background: #eef1f5; z-index: 1; }
.map-search { display: flex; gap: .5rem; margin-bottom: .6rem; }
.map-search .field__input { flex: 1; }
.map-fallback { display: grid; place-items: center; height: 100%; color: var(--ink-soft); font-size: .9rem; text-align: center; padding: 1rem; }
/* Leaflet داخل نافذة: منع تعارض z-index مع الغطاء */
.leaflet-pane, .leaflet-top, .leaflet-bottom { z-index: 2 !important; }

@media (max-width: 820px) {
    .detail-grid { grid-template-columns: 1fr; }
    .info-list { grid-template-columns: 1fr; }
    .note-form { flex-direction: column; }
}

/* ==========================================================================
   المرحلة 3ب — العملاء المحتملون والمتابعات
   ========================================================================== */
.page-head__sub { margin-block-start: .35rem; color: var(--ink-soft); max-width: 720px; }
.page-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.field[hidden] { display: none !important; }

.lead-filters {
    display: grid; grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(145px, .75fr)) auto;
    gap: .65rem; align-items: center; margin-block-end: 1rem;
}
.lead-filters .field__input { padding-block: .62rem; }
.lead-filters__search { max-width: none; }
.view-switch { display: inline-flex; gap: .35rem; }
.view-switch .icon-btn.is-active { color: #fff; background: var(--navy); border-color: var(--navy); }
#leadContent { transition: opacity .15s ease; }
#leadContent.is-loading { opacity: .55; pointer-events: none; }

.lead-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-block-end: 1rem; }
.lead-stat { display: flex; align-items: center; gap: .8rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.lead-stat > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: var(--blue-soft); }
.lead-stat > span .icon, .lead-stat > span [data-lucide] { width: 1.25rem; height: 1.25rem; }
.lead-stat strong, .lead-stat small { display: block; }
.lead-stat strong { color: var(--navy); font-size: 1.15rem; }
.lead-stat small { color: var(--ink-soft); font-size: .76rem; }
.lead-stat--danger > span { color: var(--red); background: var(--red-soft); }

.lead-stage::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lead-stage--new { color: #356da8; background: #e8f0f9; }
.lead-stage--contacted { color: #7664c6; background: #eeeafd; }
.lead-stage--qualified { color: #198c72; background: #e5f7f1; }
.lead-stage--proposal { color: #a36a24; background: #fbeede; }
.lead-stage--won { color: #1e8a5f; background: var(--green-soft); }
.lead-stage--lost { color: var(--red); background: var(--red-soft); }
.local-datetime { white-space: nowrap; font-size: .84rem; }
.local-datetime.is-overdue { color: var(--red); font-weight: 700; }

.lead-board { display: grid; grid-template-columns: repeat(6, minmax(250px, 1fr)); gap: .85rem; overflow-x: auto; padding-block-end: .8rem; scroll-snap-type: x proximity; }
.lead-column { background: #eef1f5; border: 1px solid var(--line); border-radius: var(--radius); min-height: 330px; scroll-snap-align: start; }
.lead-column > header { display: flex; justify-content: space-between; align-items: center; padding: .8rem .9rem; color: var(--navy); font-weight: 800; border-block-start: 4px solid var(--blue); border-radius: var(--radius) var(--radius) 0 0; }
.lead-column--contacted > header { border-color: #7664c6; }
.lead-column--qualified > header { border-color: #198c72; }
.lead-column--proposal > header { border-color: var(--copper); }
.lead-column--won > header { border-color: var(--green); }
.lead-column--lost > header { border-color: var(--red); }
.lead-column__cards { display: flex; flex-direction: column; gap: .65rem; padding: .65rem; }
.lead-card { display: flex; flex-direction: column; gap: .45rem; padding: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-sm); }
.lead-card__name { font-weight: 800; color: var(--navy); }
.lead-card > small { color: var(--ink-soft); }
.lead-card__meta { display: flex; flex-direction: column; gap: .3rem; color: var(--ink-soft); font-size: .78rem; }
.lead-card__meta span, .lead-card footer span { display: inline-flex; align-items: center; gap: .3rem; }
.lead-card > p { font-size: .84rem; }
.lead-card footer { display: flex; flex-direction: column; gap: .3rem; padding-block-start: .55rem; border-block-start: 1px solid var(--line-2); color: var(--ink-soft); font-size: .75rem; }

.lead-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.lead-timeline::before { content: ""; position: absolute; inset-block: .5rem; inset-inline-start: 18px; width: 2px; background: var(--line); }
.lead-timeline li { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: .8rem; padding-block-end: 1.1rem; }
.lead-timeline li:last-child { padding-block-end: 0; }
.lead-timeline__icon { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--copper-dark); background: var(--gold-soft); border: 3px solid #fff; z-index: 1; }
.lead-timeline__head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.lead-timeline p { margin-block: .35rem; white-space: normal; overflow-wrap: anywhere; }
.lead-timeline small { display: block; color: var(--ink-soft); }
.lead-next-follow { display: inline-flex !important; align-items: center; gap: .3rem; color: var(--copper-dark) !important; margin-block-start: .25rem; }

.lead-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.lead-files li { display: grid; grid-template-columns: 42px 1fr auto; gap: .75rem; align-items: center; padding: .75rem; background: var(--ivory); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.lead-file__icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 10px; }
.lead-files strong, .lead-files small { display: block; overflow-wrap: anywhere; }
.lead-files small { color: var(--ink-soft); font-size: .76rem; }

@media (max-width: 1180px) {
    .lead-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lead-filters__search { grid-column: span 2; }
}
@media (max-width: 820px) {
    .lead-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lead-filters { grid-template-columns: 1fr 1fr; }
    .lead-filters__search { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .lead-filters { grid-template-columns: 1fr; }
    .lead-filters__search { grid-column: auto; }
    .lead-stats { grid-template-columns: 1fr; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .lead-files li { grid-template-columns: 38px 1fr; }
    .lead-files .row-actions { grid-column: 2; }
}

/* ======================== المشاريع وسير العمل ======================== */
.project-filters { display: flex; flex-wrap: wrap; gap: .65rem; margin-block-end: 1rem; align-items: center; }
.project-filters__search { flex: 2 1 310px; max-width: none; }
.project-filters > .field__input { flex: 1 1 155px; min-width: 145px; width: auto; }
.project-filters > .view-switch { flex: 0 0 auto; margin-inline-start: auto; }
.project-table-wrap { overflow: visible; }
.project-table { width: 100%; table-layout: fixed; }
.project-table th { white-space: nowrap; }
.project-table th, .project-table td { padding-inline: .65rem; overflow-wrap: anywhere; }
.project-table th:nth-child(1) { width: 14%; }
.project-table th:nth-child(2) { width: 16%; }
.project-table th:nth-child(3) { width: 13%; }
.project-table th:nth-child(4) { width: 17%; }
.project-table th:nth-child(5) { width: 10%; }
.project-table th:nth-child(6) { width: 12%; }
.project-table th:nth-child(7) { width: 13%; }
.project-table th:last-child { width: 5%; }
.project-table td:nth-child(1), .project-table td:nth-child(5), .project-table td:nth-child(6) { white-space: nowrap; }
.project-table td:last-child { text-align: center; }
.project-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; margin-block-end: 1rem; }
.project-stat { display: flex; align-items: center; gap: .75rem; padding: .95rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.project-stat > span { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 12px; }
.project-stat strong, .project-stat small { display: block; }
.project-stat strong { color: var(--navy); font-size: 1.12rem; }
.project-stat small { color: var(--ink-soft); font-size: .74rem; }
.project-stat--danger > span { color: var(--red); background: var(--red-soft); }
.project-stage { --stage-color: var(--blue); display: inline-flex; align-items: center; gap: .35rem; color: var(--stage-color); background: color-mix(in srgb, var(--stage-color) 11%, white); border: 1px solid color-mix(in srgb, var(--stage-color) 28%, white); border-radius: 999px; padding: .28rem .58rem; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.project-stage::before { content: ""; width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.table-sub { display: block; margin-block-start: .2rem; color: var(--ink-soft); font-size: .72rem; }
.text-danger { color: var(--red) !important; }
.row--attention { background: #fffaf6; }
.mini-progress { min-width: 80px; height: 7px; overflow: hidden; background: var(--line-2); border-radius: 99px; }
.mini-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--copper-dark), var(--copper)); border-radius: inherit; }

.project-board { display: grid; grid-template-columns: repeat(10, minmax(260px, 1fr)); gap: .85rem; overflow-x: auto; padding-block-end: .8rem; scroll-snap-type: x proximity; }
.project-column { --stage-color: var(--blue); min-height: 330px; background: #eef1f5; border: 1px solid var(--line); border-radius: var(--radius); scroll-snap-align: start; }
.project-column > header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .8rem .9rem; border-block-start: 4px solid var(--stage-color); border-radius: var(--radius) var(--radius) 0 0; color: var(--navy); font-weight: 800; }
.project-column__cards { display: flex; flex-direction: column; gap: .65rem; padding: .65rem; }
.project-card { display: flex; flex-direction: column; gap: .48rem; padding: .82rem; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.project-card.is-delayed { border-inline-start: 4px solid var(--red); }
.project-card > small, .project-card > span, .project-card footer { color: var(--ink-soft); font-size: .76rem; }
.project-card > span, .project-card footer { display: flex; align-items: center; gap: .35rem; }
.project-card footer { justify-content: space-between; }

.live-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .42rem .65rem; color: var(--green); background: var(--green-soft); border-radius: 999px; font-size: .75rem; font-weight: 800; }
.live-badge .icon { width: 14px; animation: live-pulse 1.8s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
.project-path-panel { margin-block-end: 1rem; }
.project-path-panel .panel__head > strong { color: var(--copper-dark); font-size: 1.25rem; }
.project-progress { height: 11px; margin-block-end: 1.1rem; overflow: hidden; background: var(--line-2); border-radius: 99px; }
.project-progress > span { display: block; width: var(--progress-value, 0%); min-width: 0; height: 100%; border-radius: inherit; transition: width .55s cubic-bezier(.2,.8,.2,1), background-color .35s ease; }
.project-progress--low > span { background: linear-gradient(90deg, #c66b2e, var(--copper)); }
.project-progress--mid > span { background: linear-gradient(90deg, var(--copper), #e8aa3e); }
.project-progress--high > span { background: linear-gradient(90deg, #27a06d, #4cc38a); }
html[dir="rtl"] .project-progress > span { margin-inline-start: 0; }
.project-path { display: flex; gap: 0; margin: 0; padding: 0 0 .5rem; list-style: none; overflow-x: auto; }
.project-path li { --stage-color: var(--blue); position: relative; flex: 1 0 125px; display: flex; flex-direction: column; align-items: center; gap: .38rem; padding-inline: .35rem; text-align: center; color: var(--ink-soft); font-size: .75rem; }
.project-path li::before { content: ""; position: absolute; inset-block-start: 17px; inset-inline-start: -50%; width: 100%; height: 3px; background: var(--line); }
.project-path li:first-child::before { display: none; }
.project-path__dot { position: relative; z-index: 1; width: 36px; height: 36px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; color: var(--ink-soft); background: var(--line); box-shadow: 0 0 0 1px var(--line); font-weight: 900; }
.project-path .is-complete::before, .project-path .is-current::before { background: var(--copper); }
.project-path .is-complete .project-path__dot { color: #fff; background: var(--copper); box-shadow: 0 0 0 1px var(--copper); }
.project-path .is-current .project-path__dot { color: #fff; background: var(--stage-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-color) 22%, white); }
.project-path .is-current strong { color: var(--navy); }
.stage-progress-form { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin-block-start: 1rem; padding-block-start: 1rem; border-block-start: 1px solid var(--line-2); }
.stage-progress-form .field__input { width: 115px; }
.stage-progress-form .field__hint { flex-basis: 100%; }

.smart-service-picker { display: grid; gap: .75rem; margin-block: .85rem 1rem; padding: 1rem; border: 1px solid #ead9c7; border-radius: 16px; background: linear-gradient(135deg,#fffaf4,#fff); }
.service-additions { border-top: 1px dashed #e7d7c5; padding-top: .75rem; }
.service-additions > summary { display: flex; align-items: center; gap: .45rem; width: max-content; color: var(--copper-dark); font-weight: 700; cursor: pointer; }
.service-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; margin-top: .75rem; }
.service-check-grid fieldset { display: flex; flex-wrap: wrap; gap: .45rem; min-width: 0; padding: .7rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.service-check-grid legend { padding-inline: .35rem; color: var(--navy); font-size: .78rem; font-weight: 800; }
.service-check { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.service-check:has(input:checked) { border-color: var(--copper); background: var(--gold-soft); color: var(--copper-dark); }
.service-check input { accent-color: var(--copper); }
.service-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.smart-plan-note { display: flex; align-items: flex-start; gap: .7rem; padding: .85rem; border: 1px solid #d7e6f4; border-radius: 13px; background: #f4f9fd; color: var(--navy); }
.smart-code-note { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; padding: .7rem .8rem; border: 1px solid #d7e6f4; border-radius: 11px; background: #f4f9fd; color: #315e8d; font-size: .8rem; }
.smart-plan-note > svg { flex: none; color: var(--copper); }
.smart-plan-note strong,.smart-plan-note p { display: block; margin: 0; }
.smart-plan-note p { margin-top: .18rem; color: var(--muted); font-size: .78rem; }
.smart-measurement { display: grid; gap: 1rem; }
.measurement-section { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.measurement-section > header { display: flex; align-items: center; gap: .55rem; padding: .75rem .9rem; border-bottom: 1px solid var(--line); background: linear-gradient(135deg,#fff9f1,#fff); }
.measurement-section > header > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--gold-soft); color: var(--copper-dark); }
.measurement-section h4 { margin: 0; color: var(--navy); }
.measurement-section .measurement-fields { padding: .9rem; }
.calculated-output { display: flex; align-items: center; min-height: 45px; padding: .65rem .8rem; border: 1px solid #cce1d6; border-radius: 10px; background: #f0faf5; color: #16704f; font-size: 1.05rem; font-weight: 800; direction: ltr; }
.field[hidden] { display: none !important; }

@media (max-width: 760px) {
    .service-check-grid { grid-template-columns: 1fr; }
    .smart-service-picker { padding: .8rem; }
    .measurement-section .measurement-fields { grid-template-columns: 1fr; padding: .75rem; }
}

.project-detail-grid { align-items: start; }
.project-description { margin-block-start: 1rem; padding-block-start: 1rem; border-block-start: 1px solid var(--line-2); }
.project-description p { margin-block-start: .45rem; white-space: normal; overflow-wrap: anywhere; }
.project-timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.project-timeline::before { content: ""; position: absolute; inset-block: .6rem; inset-inline-start: 19px; width: 2px; background: var(--line); }
.project-timeline li { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: .85rem; padding-block-end: 1.15rem; }
.project-timeline li:last-child { padding-block-end: 0; }
.project-timeline__dot { --stage-color: var(--blue); position: relative; z-index: 1; width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: var(--stage-color); border: 3px solid #fff; border-radius: 50%; }
.project-timeline__head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.project-timeline p { margin-block: .35rem; }
.project-timeline blockquote { margin: .45rem 0; padding: .55rem .75rem; color: var(--ink-soft); background: var(--ivory); border-inline-start: 3px solid var(--copper); border-radius: var(--radius-sm); }
.project-timeline small { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; color: var(--ink-soft); }
.project-notes, .project-files { display: flex; flex-direction: column; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.project-notes li { padding: .75rem; background: var(--ivory); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.project-note__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.project-notes p { margin-block: .5rem; white-space: normal; overflow-wrap: anywhere; }
.project-notes time { color: var(--ink-soft); font-size: .72rem; }
.project-files li { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: .75rem; padding: .72rem; background: var(--ivory); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.project-file__icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 10px; }
.project-files strong, .project-files small { display: block; overflow-wrap: anywhere; }
.project-files small { margin-block: .18rem; color: var(--ink-soft); font-size: .72rem; }
.customer-projects { display: flex; flex-direction: column; gap: .6rem; }
.customer-project { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem; color: var(--ink); background: var(--ivory); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.customer-project > div:first-child { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.customer-project__progress { min-width: 120px; text-align: end; }
.customer-project__progress .mini-progress { margin-block-start: .25rem; }
.dashboard-projects { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.dashboard-project { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .8rem; color: var(--ink); background: var(--ivory); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.dashboard-project > div { display: flex; flex-direction: column; gap: .3rem; }
.dashboard-project > div:last-child { align-items: flex-end; }
.dashboard-project small, .dashboard-project span { color: var(--ink-soft); font-size: .75rem; }

@media (max-width: 1200px) {
    .project-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .project-filters__search { grid-column: span 2; }
    .project-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .project-table, .project-table tbody { display: block; width: 100%; }
    .project-table thead { display: none; }
    .project-table tr { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .15rem 1rem; margin: .8rem; padding: .75rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
    .project-table tbody tr:hover { background: #fff; }
    .project-table td { display: grid; grid-template-columns: minmax(92px,.75fr) minmax(0,1.25fr); align-items: center; gap: .55rem; padding: .48rem .35rem; border-bottom: 1px solid var(--line-2); white-space: normal !important; }
    .project-table td::before { content: attr(data-label); color: var(--ink-soft); font-size: .74rem; font-weight: 700; }
    .project-table .project-table__action { display: flex; justify-content: flex-end; align-items: center; border-bottom: 0; }
    .project-table .project-table__action::before { display: none; }
    .project-table .mini-progress { width: 100%; }
}
@media (max-width: 760px) {
    .project-filters > .project-filters__search { flex-basis: 100%; }
    .project-filters > .field__input { flex-basis: calc(50% - .4rem); }
    .project-filters { grid-template-columns: 1fr 1fr; }
    .project-filters__search { grid-column: 1 / -1; }
    .project-stats { grid-template-columns: 1fr 1fr; }
    .project-path li { flex-basis: 108px; }
    .dashboard-projects { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .project-table tr { grid-template-columns: 1fr; margin: .65rem; }
    .project-table td { grid-template-columns: minmax(90px,.7fr) minmax(0,1.3fr); }
    .project-filters > .field__input { flex-basis: 100%; }
    .project-filters > .view-switch { margin-inline-start: 0; }
    .project-filters, .project-stats { grid-template-columns: 1fr; }
    .project-filters__search { grid-column: auto; }
    .project-files li { grid-template-columns: 38px minmax(0,1fr); }
    .project-files .row-actions { grid-column: 2; }
    .customer-project { align-items: stretch; flex-direction: column; }
    .customer-project__progress { width: 100%; text-align: start; }
}

/* تجاوب بلا تمرير أفقي: اللوحات والتقويم تتحول إلى شبكات مرنة. */
.project-board, .lead-board { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); overflow: visible; }
.appointment-calendar { overflow: visible; }
.appointment-calendar--week, .appointment-calendar--month { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.project-path { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; overflow: visible; }
.project-path li { min-width: 0; }
.project-path li::before { display: none; }

@media (max-width: 1100px) {
    .appointment-calendar--week, .appointment-calendar--month { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-path { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .project-table .project-table__action { grid-column: 1 / -1; }
    .project-table tr.row--attention, .project-table tbody tr.row--attention:hover { background: #fffaf6; border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
}
@media (max-width: 700px) {
    .appointment-calendar--week, .appointment-calendar--month { grid-template-columns: 1fr; }
    .project-path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-board, .lead-board { grid-template-columns: 1fr; }
    .data-table, .data-table tbody { display: block; width: 100%; }
    .data-table thead { display: none; }
    .data-table tr { display: grid; grid-template-columns: 1fr; gap: .1rem; margin: .65rem; padding: .65rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
    .data-table td { display: grid; grid-template-columns: minmax(96px,.7fr) minmax(0,1.3fr); align-items: center; gap: .55rem; padding: .48rem .35rem; border-bottom: 1px solid var(--line-2); white-space: normal; overflow-wrap: anywhere; }
    .data-table td::before { content: attr(data-label); color: var(--ink-soft); font-size: .74rem; font-weight: 700; }
    .data-table .data-table__action { display: flex; justify-content: flex-end; border-bottom: 0; }
    .data-table .data-table__action::before { display: none; }
}
@media (max-width: 520px) {
    .project-filters > .project-filters__search,
    .project-filters > .field__input { flex: 1 1 100%; width: 100%; min-width: 0; }
    .project-filters > .view-switch { width: 100%; justify-content: flex-start; }
    .project-table .icon-btn { width: 44px; height: 44px; }
    .project-path { grid-template-columns: 1fr 1fr; }
}

/* إعداد المنشأة والفروع: خرائط مترابطة وحقول مناسبة للمس. */
.settings-form { display: grid; gap: 1.1rem; }
.settings-location { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-2); }
.settings-location__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.settings-location__head h4 { display: flex; align-items: center; gap: .45rem; }
.settings-location__head h4 .icon { color: var(--copper); }
.settings-map { height: 360px; margin-bottom: .8rem; }
.branch-map { height: 285px; margin-bottom: .8rem; }
.settings-location .map-search { align-items: stretch; }
.settings-location .map-search .btn { flex: 0 0 auto; }

@media (max-width: 700px) {
    .settings-location__head { align-items: stretch; flex-direction: column; }
    .settings-location__head .btn { width: 100%; min-height: 44px; }
    .settings-location .map-search { display: grid; grid-template-columns: minmax(0,1fr) 48px; }
    .settings-location .map-search .btn { min-width: 48px; padding-inline: .65rem; }
    .settings-map, .branch-map { height: 260px; }
}

/* الأدوار والصلاحيات: نافذة عمل واضحة، قابلة للبحث، ومتجاوبة بالكامل. */
.role-modal__dialog { width: min(1080px, 100%); max-height: 92vh; overflow: hidden; margin: auto; }
.role-modal__dialog > form { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; }
.role-modal__dialog .role-modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; background: #f8f7f4; }
.role-modal__dialog .modal__head, .role-modal__dialog .modal__foot { background: #fff; }
.role-identity { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.role-identity__head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.role-identity__head h4 { margin: 0 0 .18rem; color: var(--navy); }
.role-identity__head p, .perm-matrix__head p { margin: 0; color: var(--ink-soft); font-size: .82rem; line-height: 1.55; }
.role-identity__icon { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 12px; color: var(--copper-dark); background: var(--gold-soft); }
.role-identity__icon .icon { width: 21px; height: 21px; }
.role-modal__dialog .perm-matrix { padding: 0; border: 0; }
.role-modal__dialog .perm-matrix__head { gap: 1rem; margin: 0 0 .75rem; }
.perm-selection { display: inline-flex; align-items: center; gap: .3rem; flex: none; padding: .5rem .75rem; border: 1px solid #dce7f4; border-radius: 999px; color: #2f527d; background: #eef3fa; font-size: .78rem; }
.perm-selection strong { color: var(--navy); font-size: .94rem; }
.perm-toolbar { position: sticky; top: -.05rem; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .85rem; padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.96); box-shadow: var(--shadow-sm); backdrop-filter: blur(8px); }
.perm-search { position: relative; display: block; flex: 1 1 340px; max-width: 480px; }
.perm-search > .icon { position: absolute; inset-inline-start: .85rem; top: 50%; width: 17px; height: 17px; color: var(--ink-soft); transform: translateY(-50%); pointer-events: none; }
.perm-search .field__input { min-height: 42px; padding-inline-start: 2.45rem; border-radius: 999px; }
.perm-toolbar__actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.perm-check-all { min-height: 40px; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.perm-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .8rem; }
.role-modal__dialog .perm-group { margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.role-modal__dialog .perm-group[open] { box-shadow: 0 4px 14px rgba(8,27,51,.05); }
.role-modal__dialog .perm-group__title { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin: 0; padding: .9rem 1rem; cursor: pointer; list-style: none; color: var(--navy); background: #fbfaf7; }
.role-modal__dialog .perm-group__title::-webkit-details-marker { display: none; }
.role-modal__dialog .perm-group__title::before { content: '›'; color: var(--copper); font-size: 1.25rem; line-height: 1; transition: transform .15s ease; }
[dir="rtl"] .role-modal__dialog .perm-group[open] > .perm-group__title::before { transform: rotate(-90deg); }
[dir="ltr"] .role-modal__dialog .perm-group[open] > .perm-group__title::before { transform: rotate(90deg); }
.role-modal__dialog .perm-group__title > span:first-child { flex: 1; }
.perm-group__count { flex: none; min-width: 52px; padding: .18rem .48rem; border-radius: 999px; text-align: center; color: var(--blue); background: var(--blue-soft); font-size: .72rem; direction: ltr; }
.perm-group__tools { display: flex; justify-content: flex-end; padding: .55rem .85rem 0; }
.role-modal__dialog .perm-group .checks-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; padding: .65rem .85rem .9rem; }
.role-modal__dialog .perm-group .check-pill { width: 100%; min-width: 0; min-height: 42px; margin: 0; }
.role-modal__dialog .check-pill:has(input:checked) { border-color: #b7cce5; background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(54,104,164,.08); }
.role-modal__dialog [data-perm-item][hidden], .role-modal__dialog [data-perm-group][hidden] { display: none; }
.perm-empty { margin: 1rem 0 0; padding: 1.4rem; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--ink-soft); background: #fff; }

@media (max-width: 820px) {
    .role-modal__dialog { max-height: calc(100dvh - 1rem); }
    .perm-groups { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .modal:has(.role-modal__dialog) { padding: .5rem; }
    .role-modal__dialog { border-radius: 16px; }
    .role-modal__dialog .modal__head, .role-modal__dialog .modal__foot { padding: .85rem 1rem; }
    .role-modal__dialog .role-modal__body { padding: .85rem; }
    .role-identity .form__grid { grid-template-columns: 1fr; }
    .perm-matrix__head, .perm-toolbar { align-items: stretch; flex-direction: column; }
    .perm-selection { align-self: flex-start; }
    .perm-search { flex-basis: auto; width: 100%; max-width: none; }
    .perm-toolbar__actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .perm-toolbar__actions .btn, .perm-check-all { width: 100%; justify-content: center; }
    .role-modal__dialog .perm-group .checks-grid { grid-template-columns: 1fr; }
    .role-modal__dialog .modal__foot .btn { min-height: 44px; flex: 1; }
}

/* تصحيح الجوال: درج جانبي حقيقي، طبقة تعتيم، ومنع أي تمدد خارج الشاشة. */
@media (max-width: 760px) {
    html, body, .app-shell, .app-main { width: 100%; max-width: 100%; }
    html, body { overflow-x: clip; }
    .app-main { overflow-x: clip; }
    body.sidebar-open { overflow: hidden; touch-action: none; }
    .sidebar {
        width: min(88vw, 420px); max-width: calc(100vw - 44px); height: 100vh; height: 100dvh;
        z-index: 110; box-shadow: -18px 0 42px rgba(8,27,51,.28); overscroll-behavior: contain;
    }
    html[dir="ltr"] .sidebar { box-shadow: 18px 0 42px rgba(8,27,51,.28); }
    .sidebar__brand { position: sticky; inset-block-start: 0; z-index: 2; min-height: 68px; background: var(--navy); }
    .sidebar__close { width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 12px; }
    .sidebar__close:hover { color: #fff; background: rgba(255,255,255,.08); }
    .sidebar__link { min-height: 48px; padding-block: .78rem; }
    .sidebar-overlay {
        display: block; position: fixed; inset: 0; z-index: 105; visibility: hidden;
        opacity: 0; pointer-events: none; background: rgba(8,27,51,.58); backdrop-filter: blur(2px);
        transition: opacity .22s ease, visibility .22s ease;
    }
    body.sidebar-open .sidebar-overlay,
    .sidebar.is-open + .sidebar-overlay { visibility: visible; opacity: 1; pointer-events: auto; }
    .topbar { gap: .45rem; padding: .65rem .75rem; }
    .topbar__start, .topbar__end { min-width: 0; gap: .45rem; }
    .topbar__start { flex: 1 1 auto; }
    .topbar__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
    .topbar__menu { width: 42px; height: 42px; flex: none; align-items: center; justify-content: center; border-radius: 11px; background: var(--ivory); border: 1px solid var(--line); }
    .topbar .lang-switch { padding: .15rem; }
    .topbar .lang-chip { padding: .28rem .55rem; font-size: .74rem; }
    .topbar .usermenu__trigger { width: 42px; height: 42px; justify-content: center; padding: 0; }
    .topbar .usermenu__caret { display: none; }
    .app-content { width: 100%; min-width: 0; padding: .85rem; }
}

/* جدول الفروع: كل قيمة أسفل عنوان عمودها بدقة، وبطاقات واضحة على الجوال. */
.branch-table .cell-ltr { display: inline-block; direction: ltr; unicode-bidi: isolate; }
@media (min-width: 701px) {
    .branch-table { width: 100%; table-layout: fixed; }
    .branch-table__name { width: 28%; }
    .branch-table__code { width: 19%; text-align: center !important; }
    .branch-table__phone { width: 21%; text-align: center !important; }
    .branch-table__status { width: 16%; text-align: center !important; }
    .branch-table__actions { width: 16%; text-align: center !important; }
    .branch-table__actions .row-actions { justify-content: center; }
}
@media (max-width: 700px) {
    .branch-table td { text-align: start !important; }
    .branch-table .branch-table__actions { justify-content: flex-end; }
    .branch-table .branch-table__code > span,
    .branch-table .branch-table__phone > span { justify-self: end; }
}

/* أولوية اتجاه RTL: حالة الفتح يجب أن تتغلب على إزاحة الإخفاء. */
@media (max-width: 760px) {
    html[dir="rtl"] .sidebar.is-open,
    html[dir="ltr"] .sidebar.is-open { transform: translate3d(0, 0, 0); }
}
/* ========================================================================== 
   المرحلة الرابعة: الموقع العام وبوابة العميل
   ========================================================================== */
.public-main{min-height:70vh}.site-menu-toggle{display:none;width:44px;height:44px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--navy);align-items:center;justify-content:center}.site-nav{align-items:center;gap:1.1rem}.site-nav>a{color:var(--navy);font-size:.9rem;font-weight:700;white-space:nowrap}.site-nav__actions{display:flex;align-items:center;gap:.55rem}.site-footer__grid{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:2rem}.site-footer__grid p{margin:.35rem 0 0;opacity:.75}.site-footer__grid nav{display:flex;flex-wrap:wrap;gap:1rem}.site-footer__grid a{color:inherit}.hero--customer{padding-block:clamp(3rem,8vw,7rem)}.hero--customer .hero__actions{flex-wrap:wrap}.hero-portal-card{width:min(100%,470px);padding:1.5rem;border-radius:24px;background:#fff;box-shadow:0 28px 70px rgba(8,27,51,.16);transform:rotate(-1deg)}[dir=rtl] .hero-portal-card{transform:rotate(1deg)}.hero-portal-card__head{display:flex;align-items:center;gap:.85rem}.hero-portal-card__head>span{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;background:#f7e7d7;color:var(--copper)}.hero-portal-card__head div{display:grid;gap:.2rem;flex:1}.hero-portal-card__head small{color:var(--muted)}.hero-portal-card__head em{font-style:normal;font-size:1.35rem;font-weight:800;color:var(--copper)}.hero-portal-stages{display:flex;align-items:center;margin:1.4rem 0}.hero-portal-stages span{width:33px;height:33px;border:2px solid #dbe3eb;border-radius:50%;display:grid;place-items:center;color:#718096;font-weight:800}.hero-portal-stages span.is-done{background:var(--copper);border-color:var(--copper);color:#fff}.hero-portal-stages span.is-active{border-color:#3c6ea8;color:#3c6ea8;box-shadow:0 0 0 5px #e9f1fa}.hero-portal-stages i{height:2px;flex:1;background:#dbe3eb}.hero-portal-update{display:flex;gap:.8rem;align-items:center;padding:1rem;border-radius:16px;background:#f5f8fb}.hero-portal-update>.icon{color:var(--copper)}.hero-portal-update div{display:grid}.hero-portal-update small{color:var(--muted)}.public-section{padding:clamp(3rem,7vw,6rem) 0}.public-section--soft{background:#f4f0e9}.section-heading{display:flex;align-items:center;justify-content:center;gap:.65rem;margin-bottom:2rem}.section-heading>span{color:var(--copper)}.section-heading h2{margin:0}.section-heading--action{justify-content:space-between}.section-heading--action>div{display:flex;align-items:center;gap:.65rem}.how-grid,.home-service-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.how-grid article,.home-service-grid article{position:relative;padding:1.7rem;border:1px solid var(--line);border-radius:20px;background:#fff}.how-grid article>b{position:absolute;inset-block-start:1rem;inset-inline-end:1rem;color:#dce3eb;font-size:2rem}.how-grid article>.icon,.home-service-grid article>span{color:var(--copper);width:34px;height:34px}.home-service-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.home-service-grid article{display:grid;gap:.5rem}.home-service-grid h3{margin:0}.home-service-grid small{color:var(--muted)}.public-final-cta{background:var(--navy);color:#fff}.public-final-cta>.container{display:flex;justify-content:space-between;align-items:center;gap:2rem}.public-final-cta h2{margin:.5rem 0}.public-final-cta p{opacity:.75}.public-final-cta>div>div:last-child{display:flex;gap:.7rem;flex-wrap:wrap}.public-page-head{padding:4.5rem 0 3.5rem;background:linear-gradient(135deg,var(--navy),#12365f);color:#fff}.public-page-head--compact{padding:3rem 0}.public-page-head span{display:flex;align-items:center;gap:.5rem;color:#f1b679;font-weight:700}.public-page-head h1{font-size:clamp(2rem,5vw,3.5rem);margin:.7rem 0}.public-page-head p{max-width:720px;font-size:1.05rem;line-height:1.9;opacity:.82}.about-layout{display:grid;grid-template-columns:1.1fr .9fr;gap:3rem;align-items:start}.about-story{padding:2rem;border-radius:24px;background:#fff;border:1px solid var(--line)}.about-story p{line-height:2;color:var(--muted)}.value-list{display:grid;gap:.8rem}.value-list article{display:flex;gap:.8rem;align-items:center;padding:1.15rem;background:#fff;border:1px solid var(--line);border-radius:16px}.value-list .icon{color:var(--copper)}.service-catalog{display:grid;gap:2rem}.service-category{padding:1.5rem;border-radius:24px;background:#fff;border:1px solid var(--line)}.service-category__head{display:flex;align-items:center;gap:1rem;margin-bottom:1.2rem}.service-category__head>span{display:grid;place-items:center;width:52px;height:52px;border-radius:16px;background:#f7e7d7;color:var(--copper)}.service-category__head h2{margin:0}.service-category__head small{color:var(--muted)}.service-category__grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}.service-category__grid article{padding:1.1rem;border-radius:16px;background:#f8f6f2}.service-category__grid article>span{color:#3c6ea8}.service-category__grid h3{margin:.6rem 0}.service-category__grid p{margin:0;color:var(--muted);line-height:1.7}.public-cta{padding:2rem;border-radius:22px;background:var(--navy);color:#fff;display:flex;justify-content:space-between;align-items:center}.branch-public-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.branch-public-grid article{display:grid;gap:.8rem;padding:1.5rem;background:#fff;border:1px solid var(--line);border-radius:20px}.branch-public-grid__icon{display:grid;place-items:center;width:52px;height:52px;border-radius:15px;background:#f7e7d7;color:var(--copper)}.branch-public-grid h2,.branch-public-grid p{margin:0}.branch-public-grid a:not(.btn){color:#3c6ea8}.legal-card{max-width:850px;padding:2rem;background:#fff;border:1px solid var(--line);border-radius:24px;line-height:2}.legal-card small{color:var(--muted)}
.request-builder{padding-top:2rem}.request-steps{display:grid;grid-template-columns:repeat(4,1fr);gap:.6rem;margin-bottom:1.4rem}.request-steps span{display:flex;align-items:center;gap:.55rem;padding:.8rem;border-radius:14px;color:var(--muted);font-weight:700}.request-steps b{width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:#e9edf2}.request-steps span.is-active{background:#fff;color:var(--navy);box-shadow:var(--shadow-sm)}.request-steps span.is-active b,.request-steps span.is-done b{background:var(--copper);color:#fff}.public-request-form{padding:clamp(1rem,3vw,2rem);background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow-sm)}.request-step{animation:portalFade .25s ease}.request-step__head{display:flex;align-items:center;gap:1rem;padding-bottom:1.2rem;margin-bottom:1.2rem;border-bottom:1px solid var(--line)}.request-step__head>span{display:grid;place-items:center;width:50px;height:50px;border-radius:15px;background:#f7e7d7;color:var(--copper)}.request-step__head h2,.request-step__head p{margin:0}.request-step__head p{color:var(--muted);margin-top:.35rem}.public-request-map{height:330px;margin:1rem 0}.request-review{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;margin-bottom:1.2rem}.request-review div{display:flex;align-items:center;gap:.6rem;padding:1rem;border-radius:14px;background:#f5f7fa}.request-review .icon{color:var(--copper)}.request-privacy{align-items:flex-start}.request-nav{display:flex;justify-content:space-between;gap:.7rem;margin-top:1.5rem;padding-top:1.2rem;border-top:1px solid var(--line)}.request-success{min-height:68vh;display:grid;place-items:center;padding:3rem 1rem}.request-success__card{text-align:center;max-width:620px;padding:clamp(2rem,6vw,4rem);background:#fff;border:1px solid var(--line);border-radius:28px;box-shadow:var(--shadow)}.request-success__card>span{width:84px;height:84px;display:grid;place-items:center;margin:auto;border-radius:50%;background:#e6f7ef;color:#16865c}.request-success__card>span .icon{width:44px;height:44px}.request-success__card p{line-height:1.9;color:var(--muted)}.request-success__card>div{display:flex;justify-content:center;gap:.7rem;flex-wrap:wrap}.tracking-page{padding:clamp(3rem,8vw,7rem) 0}.tracking-page__grid{display:grid;grid-template-columns:1fr minmax(340px,480px);gap:4rem;align-items:center}.tracking-page__intro>span{display:grid;place-items:center;width:70px;height:70px;border-radius:22px;background:#f7e7d7;color:var(--copper)}.tracking-page__intro>span .icon{width:36px;height:36px}.tracking-page__intro h1{font-size:clamp(2rem,5vw,3.5rem);margin:1rem 0}.tracking-page__intro p{font-size:1.05rem;line-height:1.9;color:var(--muted)}.tracking-security{display:flex;gap:.6rem;padding:1rem;border-radius:14px;background:#e9f3ff;color:#295f99}.tracking-card{padding:2rem;background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow)}
.portal-auth{min-height:68vh;display:grid;place-items:center;padding:3rem 1rem}.portal-auth__card{width:min(100%,500px);padding:clamp(1.4rem,5vw,2.5rem);background:#fff;border:1px solid var(--line);border-radius:26px;box-shadow:var(--shadow)}.portal-auth__intro{display:grid;justify-items:center;text-align:center;margin-bottom:1.5rem}.portal-auth__intro h1{margin:.8rem 0 .35rem}.portal-auth__intro p{color:var(--muted);line-height:1.7}.portal-auth__intro small{margin-top:.3rem;color:var(--muted)}.portal-auth__icon{display:grid;place-items:center;width:64px;height:64px;border-radius:20px;background:#f7e7d7;color:var(--copper)}.portal-auth__icon .icon{width:32px;height:32px}.portal-auth__icon--warn{background:#fee9e9;color:#c63f3f}.portal-auth__links{display:flex;justify-content:space-between;gap:1rem;margin-top:1rem}.portal-auth__links a{color:#3c6ea8;font-weight:700}.portal-auth__help{display:flex;gap:.5rem;margin:1.2rem 0 0;padding:1rem;border-radius:14px;background:#f5f7fa;color:var(--muted);font-size:.86rem}.portal-auth__card--center{text-align:center}.portal-auth__card--center>.portal-auth__icon{margin:auto}.btn--block{width:100%;justify-content:center}
.customer-body{background:#f5f2ec;color:var(--navy)}.customer-header{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.94);border-bottom:1px solid var(--line);backdrop-filter:blur(14px)}.customer-header__inner{min-height:74px;display:flex;align-items:center;justify-content:space-between;gap:1rem}.customer-header .site-brand span{display:grid}.customer-header .site-brand small{font-size:.72rem;color:var(--muted)}.customer-header nav{display:flex;align-items:center;gap:.5rem}.customer-main{min-height:75vh;padding:2rem 0 4rem}.portal-page{display:grid;gap:1.4rem}.portal-welcome{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:clamp(1.4rem,4vw,2.2rem);border-radius:24px;background:linear-gradient(135deg,var(--navy),#12365f);color:#fff}.portal-welcome span{color:#f1b679;font-weight:700}.portal-welcome h1{margin:.45rem 0}.portal-welcome p{margin:0;opacity:.75}.portal-section-head{display:flex;align-items:center;justify-content:space-between}.portal-section-head h2{display:flex;align-items:center;gap:.6rem;margin:0}.portal-section-head p{margin:.25rem 0 0;color:var(--muted)}.portal-project-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.portal-project-card{display:grid;gap:1.2rem;padding:1.3rem;border:1px solid var(--line);border-radius:20px;background:#fff}.portal-project-card.is-delayed{border-color:#e8aaaa}.portal-project-card__top{display:flex;align-items:start;justify-content:space-between;gap:1rem}.portal-project-card__top small{color:var(--muted)}.portal-project-card__top h3{margin:.3rem 0}.portal-progress>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.5rem}.portal-progress__track{height:10px;overflow:hidden;border-radius:999px;background:#e8edf3}.portal-progress__track>span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#3c6ea8,var(--copper));transition:width .6s ease}.portal-project-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;margin:0}.portal-project-meta>div{padding:.8rem;border-radius:13px;background:#f6f8fa}.portal-project-meta dt{display:flex;align-items:center;gap:.35rem;color:var(--muted);font-size:.76rem}.portal-project-meta dd{margin:.4rem 0 0;font-weight:700}.portal-delay{display:flex;align-items:flex-start;gap:.5rem;padding:.8rem;border-radius:12px;background:#fff0f0;color:#a73232}.portal-empty{display:grid;justify-items:center;gap:.5rem;padding:3rem;border:1px dashed #cbd5df;border-radius:20px;color:var(--muted)}.portal-empty>.icon{width:38px;height:38px}.portal-empty--compact{padding:1.3rem}.portal-appointment-list{display:grid;gap:.7rem}.portal-appointment-list article{display:flex;align-items:center;gap:1rem;padding:1rem;border-radius:16px;background:#fff;border:1px solid var(--line)}.portal-appointment-list__date{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:#e9f3ff;color:#3c6ea8}.portal-appointment-list article>div{display:grid;flex:1}.portal-appointment-list small{color:var(--muted)}
.portal-project-hero{padding:clamp(1.4rem,4vw,2.2rem);border-radius:24px;background:linear-gradient(135deg,var(--navy),#12365f);color:#fff}.portal-project-hero__head{display:flex;justify-content:space-between;align-items:start;gap:1rem}.portal-project-hero h1{margin:.35rem 0}.portal-project-hero p{margin:0;opacity:.72}.portal-live-badge{display:flex;align-items:center;gap:.45rem;padding:.55rem .8rem;border-radius:999px;background:rgba(255,255,255,.12);color:#bdebd8;font-size:.82rem}.portal-live-badge .icon{animation:portalPulse 1.7s infinite}.portal-progress--hero{margin-top:1.5rem}.portal-progress--hero .portal-progress__track{background:rgba(255,255,255,.16)}.portal-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}.portal-summary-grid article{display:flex;align-items:center;gap:.8rem;padding:1rem;background:#fff;border:1px solid var(--line);border-radius:16px}.portal-summary-grid article>span{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:#f7e7d7;color:var(--copper)}.portal-summary-grid article>div{display:grid}.portal-summary-grid small{color:var(--muted)}.portal-content-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,.75fr);gap:1rem;align-items:start}.portal-content-grid>div{display:grid;gap:1rem}.portal-panel{background:#fff;border:1px solid var(--line);border-radius:20px;overflow:hidden}.portal-panel__head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.2rem;border-bottom:1px solid var(--line)}.portal-panel__head h2{display:flex;align-items:center;gap:.55rem;margin:0;font-size:1.05rem}.portal-service-list{display:flex;gap:.55rem;flex-wrap:wrap;padding:1.2rem}.portal-timeline{list-style:none;display:grid;gap:0;margin:0;padding:1rem 1.2rem}.portal-timeline li{display:flex;gap:.8rem;position:relative;padding-bottom:1.2rem}.portal-timeline li:not(:last-child):before{content:"";position:absolute;inset-inline-start:17px;top:34px;bottom:0;width:2px;background:#e1e7ed}.portal-timeline li>span{z-index:1;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#e9f3ff;color:#3c6ea8}.portal-timeline li>div{display:grid;gap:.25rem}.portal-timeline time{font-size:.77rem;color:var(--muted)}.portal-empty-event{color:var(--muted)}.portal-appointments{display:grid;gap:.8rem;padding:1rem}.portal-appointments article{padding:1rem;border-radius:15px;background:#f6f8fa}.portal-appointments__top{display:flex;justify-content:space-between;gap:.7rem}.portal-appointments time{display:block;margin:.65rem 0;font-weight:700}.portal-appointments p{display:flex;gap:.4rem;color:var(--muted)}.portal-appointment-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.8rem}.portal-admin-status{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}.portal-admin-status small{color:var(--muted)}.portal-resend{margin-inline-start:auto}
@keyframes portalFade{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}@keyframes portalPulse{50%{opacity:.35}}
@media(max-width:1050px){.site-menu-toggle{display:flex}.site-nav{display:none;position:absolute;top:calc(100% + 1px);inset-inline:0;padding:1rem;background:#fff;border-bottom:1px solid var(--line);box-shadow:var(--shadow);flex-direction:column;align-items:stretch}.site-nav.is-open{display:flex}.site-nav>a{padding:.75rem}.site-nav__actions{flex-wrap:wrap}.site-nav__actions .btn{flex:1}.site-header__inner{position:relative}.service-category__grid{grid-template-columns:repeat(2,minmax(0,1fr))}.branch-public-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-content-grid{grid-template-columns:1fr}}
@media(max-width:760px){.site-footer__grid{grid-template-columns:1fr}.site-footer__grid nav{display:grid;grid-template-columns:repeat(2,1fr)}.hero--customer .hero__inner{grid-template-columns:1fr}.hero--customer .hero__content{text-align:center}.hero--customer .hero__actions{justify-content:center}.hero-portal-card{transform:none!important}.how-grid,.home-service-grid,.service-category__grid,.branch-public-grid,.portal-project-grid,.portal-summary-grid,.about-layout{grid-template-columns:1fr}.section-heading--action,.public-cta,.public-final-cta>.container,.portal-welcome{align-items:flex-start;flex-direction:column}.request-steps{grid-template-columns:repeat(4,auto);overflow:hidden}.request-steps span{font-size:0;justify-content:center;padding:.5rem}.request-steps b{font-size:.85rem}.request-review,.portal-project-meta{grid-template-columns:1fr}.tracking-page__grid{grid-template-columns:1fr;gap:2rem}.tracking-page__intro{text-align:center}.tracking-page__intro>span{margin:auto}.tracking-security{text-align:start}.customer-header__inner{align-items:flex-start;padding-block:.7rem}.customer-header nav{flex-wrap:wrap;justify-content:flex-end}.customer-header nav>.btn span{display:none}.portal-project-card__top,.portal-project-hero__head{flex-direction:column}.portal-live-badge{align-self:flex-start}.portal-admin-status{align-items:flex-start}.portal-resend{margin-inline-start:0;width:100%}.portal-resend .btn{width:100%;justify-content:center}}
@media(max-width:480px){.hero__actions .btn,.public-final-cta .btn{width:100%;justify-content:center}.site-nav__actions{display:grid;grid-template-columns:1fr}.site-footer__grid nav{grid-template-columns:1fr}.public-request-form,.tracking-card,.portal-auth__card{border-radius:18px}.request-nav .btn{flex:1}.customer-header .site-brand__name{display:none}.portal-appointment-list article{align-items:flex-start;flex-wrap:wrap}.portal-appointment-list article>div{min-width:calc(100% - 64px)}.portal-appointment-actions,.portal-appointment-actions form,.portal-appointment-actions .btn{width:100%}.portal-appointment-actions .btn{justify-content:center}}
.portal-note-list,.portal-file-list{display:grid;gap:.7rem;padding:1rem}.portal-note-list article{padding:1rem;border-radius:14px;background:#f6f8fa}.portal-note-list p{margin:0 0 .55rem;line-height:1.8}.portal-note-list time{color:var(--muted);font-size:.77rem}.portal-file-list a{display:flex;align-items:center;gap:.75rem;padding:.85rem;border:1px solid var(--line);border-radius:14px;color:var(--navy)}.portal-file-list a>span{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#e9f3ff;color:#3c6ea8}.portal-file-list a>div{display:grid;flex:1}.portal-file-list small{color:var(--muted)}.portal-file-list em{font-style:normal;color:#3c6ea8;font-size:.8rem;font-weight:700}
.portal-profile-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:1.25rem;align-items:start}.portal-profile-form,.portal-address-add form{padding:1.1rem;display:grid;gap:1rem}.portal-address-list{display:grid;gap:.8rem;padding:1rem}.portal-address-list article{display:flex;justify-content:space-between;gap:1rem;padding:1rem;border:1px solid var(--line);border-radius:16px;background:#fff}.portal-address-list article>div:first-child{min-width:0}.portal-address-list article>div:last-child{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.portal-address-list p{margin:.45rem 0;line-height:1.7}.portal-address-list small{color:var(--muted)}.portal-address-add{padding:0 1rem 1rem}.portal-address-add>summary{list-style:none;display:inline-flex}.portal-address-add>summary::-webkit-details-marker{display:none}.portal-profile-map{height:280px}.portal-hero--compact{padding-block:1.4rem}
@media(max-width:900px){.portal-profile-grid{grid-template-columns:1fr}.customer-header__inner{align-items:flex-start;flex-wrap:wrap}.customer-header nav{width:100%;flex-wrap:wrap;overflow:visible;padding-bottom:.3rem}}
@media(max-width:600px){.portal-address-list article{display:grid}.portal-address-list article>div:last-child{justify-content:stretch}.portal-address-list .btn,.portal-address-list form{flex:1}.portal-address-list button{width:100%}.portal-profile-map{height:230px}}
.public-empty{display:grid;place-items:center;text-align:center;min-height:260px;color:var(--muted);border:1px dashed var(--line);border-radius:22px;background:#fff}.public-empty svg{width:44px;height:44px;margin-bottom:.7rem}.public-portfolio-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.2rem}.public-portfolio-grid article{overflow:hidden;border-radius:22px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow-sm)}.public-portfolio-grid img,.portfolio-video-cover{width:100%;height:260px;object-fit:cover}.public-portfolio-grid article>div:last-child{padding:1.15rem}.public-portfolio-grid h2{margin:0 0 .55rem;font-size:1.15rem}.public-portfolio-grid p{margin:0;color:var(--muted);line-height:1.8}.portfolio-video-cover{display:grid;place-items:center;align-content:center;gap:1rem;background:linear-gradient(145deg,var(--navy),#173a5c);color:#fff}.portfolio-video-cover>svg{width:48px;height:48px}.portfolio-create{padding:1rem;margin-bottom:1.2rem}.portfolio-create>summary{list-style:none;display:inline-flex}.portfolio-create>summary::-webkit-details-marker{display:none}.portfolio-form{display:grid;gap:1rem}.portfolio-admin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.portfolio-admin-grid>article{overflow:hidden}.portfolio-admin-grid>article>img,.portfolio-admin-video{width:100%;height:230px;object-fit:cover}.portfolio-admin-video{display:grid;place-items:center;align-content:center;gap:.7rem;background:#eaf0f5}.portfolio-admin-grid details{padding:1rem}.portfolio-admin-grid summary{display:flex;justify-content:space-between;gap:1rem;cursor:pointer}.portfolio-admin-grid details>.portfolio-form{margin-top:1rem}.portfolio-delete{padding-top:1rem;border-top:1px solid var(--line)}
@media(max-width:900px){.public-portfolio-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.portfolio-admin-grid{grid-template-columns:1fr}}
@media(max-width:600px){.public-portfolio-grid{grid-template-columns:1fr}.public-portfolio-grid img,.portfolio-video-cover{height:220px}}
.dashboard-public-requests{display:flex;align-items:center;gap:1rem;margin:0 0 1rem;padding:1rem 1.1rem;border:1px solid #f0c99e;border-radius:16px;background:#fff6eb;color:var(--navy)}.dashboard-public-requests>span{display:grid;grid-template-columns:auto 1fr;gap:.15rem .65rem;align-items:center;flex:1}.dashboard-public-requests>span>svg{grid-row:1/3;color:var(--orange)}.dashboard-public-requests small{color:var(--muted)}.dashboard-public-requests em{display:grid;place-items:center;min-width:36px;height:36px;padding:0 .6rem;border-radius:999px;background:var(--orange);color:#fff;font-style:normal;font-weight:800}

/* نموذج الطلب الذكي: المدينة والحي والخريطة وأزرار المراحل. */
.request-step[hidden],.request-nav [hidden],.smart-choice__custom[hidden]{display:none!important}.smart-location{margin-bottom:1rem;padding:1rem;border:1px solid #dfe7ef;border-radius:18px;background:linear-gradient(145deg,#f8fafc,#fff)}.smart-choice{align-content:start}.smart-choice__custom{animation:portalFade .2s ease}.map-required-hint{display:flex;align-items:center;gap:.45rem;margin:.9rem 0 .2rem;padding:.75rem .9rem;border-radius:12px;background:#edf5fc;color:#315e8d}.map-required-hint .icon{width:18px;height:18px}.public-request-form textarea[readonly]{background:#f8fafc;cursor:default}.public-request-form [data-branch-auto-status].is-selected{color:#16704f;font-weight:700}.request-prefill-note{max-width:none}

/* تفاصيل الفرصة: مساحة عمل تشغيلية بألوان دلالية حسب المرحلة. */
.lead-detail-shell{display:grid;gap:1.2rem;min-width:0}.lead-detail-hero{--lead-accent:#4b83b7;position:relative;overflow:hidden;padding:clamp(1.2rem,3vw,2rem);border-radius:24px;background:radial-gradient(circle at 12% 0,color-mix(in srgb,var(--lead-accent) 40%,transparent),transparent 38%),linear-gradient(135deg,#0a2746,#102f51);color:#fff;box-shadow:0 18px 40px rgba(8,27,51,.16);border-top:5px solid var(--lead-accent)}.lead-detail-hero--contacted{--lead-accent:#7969c9}.lead-detail-hero--qualified,.lead-detail-hero--won{--lead-accent:#25a67c}.lead-detail-hero--proposal{--lead-accent:#dfa04d}.lead-detail-hero--lost{--lead-accent:#d95b5b}.lead-detail-hero__top,.lead-detail-hero__identity,.lead-detail-hero__badges,.lead-detail-actions,.lead-detail-metrics article,.lead-card__head>div,.lead-request-status,.lead-request-description,.lead-request-facts article,.lead-contact-person,.lead-contact-actions,.lead-conversion-links a,.lead-section-head__actions{display:flex;align-items:center}.lead-detail-hero__top{justify-content:space-between;gap:1rem}.lead-detail-back{display:inline-flex;align-items:center;gap:.45rem;color:#d7e5f2;font-weight:700}.lead-detail-back:hover{color:#fff}.lead-detail-actions{gap:.55rem;flex-wrap:wrap}.lead-detail-hero .btn--ghost{border-color:rgba(255,255,255,.3);background:rgba(255,255,255,.08);color:#fff}.lead-detail-hero__identity{gap:1rem;margin:1.5rem 0}.lead-detail-hero__icon{display:grid;place-items:center;flex:none;width:66px;height:66px;border-radius:20px;background:var(--lead-accent);box-shadow:0 10px 25px color-mix(in srgb,var(--lead-accent) 40%,transparent)}.lead-detail-hero__icon .icon{width:32px;height:32px}.lead-detail-hero__eyebrow{display:flex;align-items:center;gap:.7rem;color:#bed0e1;font-size:.8rem}.lead-detail-hero__eyebrow span+span:before{content:"•";margin-inline-end:.7rem}.lead-detail-hero h1{margin:.35rem 0 .6rem;font-size:clamp(1.7rem,4vw,2.65rem)}.lead-detail-hero__badges{gap:.5rem;flex-wrap:wrap}.lead-detail-hero__badges>span{display:inline-flex;align-items:center;gap:.35rem;padding:.38rem .65rem;border-radius:999px;background:rgba(255,255,255,.1);color:#e6eef6;font-size:.75rem}.lead-detail-hero__badges .lead-hero-stage{background:var(--lead-accent);color:#fff;font-weight:800}.lead-detail-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.7rem}.lead-detail-metrics article{gap:.7rem;min-width:0;padding:.9rem;border:1px solid rgba(255,255,255,.12);border-radius:15px;background:rgba(255,255,255,.07)}.lead-detail-metrics article>span{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:11px;background:rgba(255,255,255,.11);color:#f4bd83}.lead-detail-metrics article>div{display:grid;min-width:0}.lead-detail-metrics small{color:#b9ccdd;font-size:.7rem}.lead-detail-metrics strong{margin-top:.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.84rem}.lead-follow--overdue{border-color:rgba(245,118,118,.55)!important;background:rgba(158,37,37,.25)!important}.lead-follow--today{border-color:rgba(242,180,83,.55)!important}.lead-follow--upcoming{border-color:rgba(74,190,147,.45)!important}.lead-conversion-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.lead-conversion-links a{gap:.6rem;padding:.9rem 1rem;border:1px solid #cfe4da;border-radius:14px;background:#f0faf5;color:#165f48}.lead-conversion-links a>span{color:#547568}.lead-conversion-links a>strong{flex:1}.lead-detail-dashboard{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;align-items:start;min-width:0}.lead-card{min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:20px;background:#fff;box-shadow:var(--shadow-sm)}.lead-card--wide{grid-column:1/-1}.lead-card--request{border-top:4px solid #e28b3b}.lead-card__head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.15rem;border-bottom:1px solid var(--line)}.lead-card__head>div{gap:.7rem}.lead-card__head h2,.lead-card__head small{display:block;margin:0}.lead-card__head h2{font-size:1.08rem}.lead-card__head small{margin-bottom:.18rem;color:var(--muted);font-size:.7rem}.lead-card__icon{display:grid;place-items:center;flex:none;width:42px;height:42px;border-radius:13px;background:#fff0df;color:#c66d21}.lead-card__body{padding:1.15rem}.lead-request-status{gap:.35rem;padding:.42rem .7rem;border-radius:999px;background:#e8f7f0;color:#167453;font-size:.76rem;font-weight:800}.lead-request-description{align-items:flex-start;gap:.8rem;padding:1rem;border-radius:15px;background:#f7f9fb;border-inline-start:4px solid #e28b3b}.lead-request-description>span{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:12px;background:#fff;color:#e28b3b}.lead-request-description small,.lead-request-facts small{display:block;color:var(--muted);font-size:.72rem}.lead-request-description p{margin:.35rem 0 0;line-height:1.8;font-weight:700}.lead-request-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.7rem;margin-top:.8rem}.lead-request-facts article{align-items:flex-start;gap:.6rem;min-width:0;padding:.8rem;border:1px solid #e5ebf0;border-radius:13px}.lead-request-facts article>span{color:#3c6ea8}.lead-request-facts article>div{display:grid;gap:.25rem;min-width:0}.lead-request-facts strong,.lead-request-facts a{overflow-wrap:anywhere;color:var(--navy);font-size:.82rem;font-weight:800}.lead-request-facts a{color:#316ca4}.lead-request-location{grid-column:1/-1}.lead-contact-person{gap:.7rem;padding:.8rem;border-radius:14px;background:#f7f9fb}.lead-contact-person>span{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#e9f2fb;color:#356da8}.lead-contact-person>div{display:grid}.lead-contact-person small{color:var(--muted)}.lead-contact-actions{gap:.5rem;flex-wrap:wrap;margin:.8rem 0}.lead-contact-actions a{display:inline-flex;align-items:center;gap:.35rem;padding:.48rem .7rem;border:1px solid #dbe4ec;border-radius:10px;background:#fff;color:#315e8d;font-size:.76rem;font-weight:800}.lead-contact-actions a:hover{border-color:#94b6d5;background:#f2f7fc}.lead-info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;margin:0}.lead-info-grid>div{min-width:0;padding:.72rem;border-radius:12px;background:#f8f7f4}.lead-info-grid dt{color:var(--muted);font-size:.7rem;font-weight:700}.lead-info-grid dd{margin:.25rem 0 0;overflow-wrap:anywhere;color:var(--navy);font-weight:800}.lead-info-wide{grid-column:1/-1}.lead-lost-reason{background:#fff0f0!important;border:1px solid #f0c4c4}.lead-section-head__actions{gap:.55rem}.lead-count-badge{display:grid;place-items:center;min-width:30px;height:30px;padding:0 .45rem;border-radius:999px;background:#edf2f7;color:#496174;font-size:.75rem;font-weight:800}.lead-card .panel__head{background:#fff}.lead-card .panel__body{padding:1.15rem}.lead-empty-state{display:grid;place-items:center;gap:.6rem;padding:2rem;border:1px dashed #cad6e1;border-radius:14px;color:var(--muted);text-align:center}.lead-empty-state .icon{width:32px;height:32px;color:#8ba2b8}.lead-timeline__content{padding:.1rem 0 .9rem}.lead-timeline__head strong{color:var(--navy)}.lead-timeline--call .lead-timeline__icon{background:#e8f1fb;color:#356da8}.lead-timeline--whatsapp .lead-timeline__icon{background:#e6f8ef;color:#16865c}.lead-timeline--email .lead-timeline__icon{background:#eeeafd;color:#7664c6}.lead-timeline--meeting .lead-timeline__icon{background:#fff0df;color:#b56322}.lead-next-follow{display:inline-flex!important;align-items:center;gap:.3rem;margin-top:.45rem;padding:.35rem .5rem;border-radius:8px;background:#fff5e8;color:#8a531b!important}.lead-file__icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:#eaf2fb;color:#356da8}.lead-file__icon--pdf{background:#fdecec;color:#a12d2d}.lead-file__icon--xls,.lead-file__icon--xlsx{background:#e8f7ef;color:#16704f}.lead-file__icon--jpg,.lead-file__icon--jpeg,.lead-file__icon--png,.lead-file__icon--webp{background:#f1ecfb;color:#6d51a8}
@media(max-width:980px){.lead-detail-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.lead-request-facts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.lead-detail-hero__top{align-items:flex-start;flex-direction:column}.lead-detail-actions,.lead-detail-actions .btn{width:100%}.lead-detail-actions .btn{justify-content:center}.lead-detail-hero__identity{align-items:flex-start}.lead-detail-hero__icon{width:54px;height:54px;border-radius:16px}.lead-detail-metrics,.lead-detail-dashboard,.lead-conversion-links,.lead-request-facts,.lead-info-grid{grid-template-columns:1fr}.lead-detail-metrics strong{white-space:normal}.lead-request-location,.lead-info-wide{grid-column:auto}.lead-card__head{align-items:flex-start;flex-wrap:wrap}.lead-contact-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.lead-contact-actions a{justify-content:center}.lead-section-head{align-items:flex-start}.lead-section-head__actions{width:100%;justify-content:space-between}.lead-files li{grid-template-columns:42px minmax(0,1fr)}.lead-files .row-actions{grid-column:2}}
/* ===== Phase 5A: quotation engine ===== */
.quotation-filters{display:grid;grid-template-columns:minmax(280px,1fr) 220px 220px;gap:12px;margin-bottom:20px}.quotation-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:18px}.quotation-stats article{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--border,#dfe6ed);border-radius:16px;padding:17px;box-shadow:0 5px 18px rgba(8,27,51,.04)}.quotation-stats article>span,.quotation-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#fff2e6;color:#d77929;flex:0 0 auto}.quotation-stats strong{display:block;font-size:20px;color:#0b2340}.quotation-stats small{display:block;color:#687b8e;margin-top:3px}.quotation-list{display:grid;gap:10px}.quotation-card{display:grid;grid-template-columns:minmax(240px,1.35fr) minmax(0,3fr) 42px;align-items:center;gap:18px;background:#fff;border:1px solid #dfe6ed;border-radius:17px;padding:15px 18px;box-shadow:0 5px 18px rgba(8,27,51,.04)}.quotation-card__identity{display:flex;align-items:center;gap:12px;min-width:0}.quotation-card__identity a{display:block;color:#0b3c70;font-weight:800;text-decoration:none}.quotation-card__identity small{display:block;color:#687b8e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:5px}.quotation-card dl{display:grid;grid-template-columns:1.25fr 1fr .55fr 1fr 1fr;gap:12px;margin:0}.quotation-card dl div{min-width:0}.quotation-card dt{color:#77889a;font-size:11px}.quotation-card dd{margin:5px 0 0;font-weight:700;color:#18334f;overflow-wrap:anywhere}.quote-status{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border-radius:999px;background:#eef3f7;color:#4d6378;font-size:11px;font-weight:800}.quote-status--approved{background:#e5f6ed;color:#14704c}.quote-status--rejected,.quote-status--expired{background:#fce9e9;color:#a53a3a}.quote-status--sent,.quote-status--viewed{background:#e7f1fb;color:#2b679c}.quote-status--revision_requested{background:#fff1dd;color:#9b5d16}.quote-status--draft{background:#f0effc;color:#6655a8}.quotation-empty{text-align:center;padding:34px;color:#6b7e90}.quotation-hero{display:flex;justify-content:space-between;gap:20px;align-items:flex-end;background:linear-gradient(135deg,#0a2948,#123d68);color:#fff;border-radius:22px;padding:25px;margin-bottom:18px}.quotation-back{color:#cbd9e6;text-decoration:none;font-size:13px}.quotation-hero__title{display:flex;align-items:center;gap:14px;margin-top:17px}.quotation-hero__title h2{margin:4px 0;font-size:25px}.quotation-hero__title p,.quotation-hero__title small{color:#c8d7e5}.quotation-hero__status{text-align:end}.quotation-hero__status strong{display:block;font-size:25px;margin-top:13px}.quotation-editor{display:grid;gap:18px}.quotation-items{display:grid;gap:10px}.quotation-item{display:grid;grid-template-columns:34px minmax(170px,1.25fr) minmax(160px,1.4fr) 125px 110px 125px 105px 110px 42px;align-items:end;gap:9px;background:#f8fafc;border:1px solid #e3e9ef;border-radius:15px;padding:12px}.quotation-item__seq{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#e9f0f6;color:#355b7d;font-weight:800;margin-bottom:7px}.quotation-item .field{margin:0}.quotation-item .field__label{font-size:10px}.quotation-tax{display:flex;align-items:center;gap:6px;min-height:43px;font-size:12px;color:#53677c}.quotation-item__total{min-height:43px;display:flex;align-items:center;justify-content:center;color:#0b3c70}.quotation-item__remove{margin-bottom:2px}.quotation-lower{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px}.quotation-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.quotation-fields .field{margin:0}.quotation-fields .field--wide{grid-column:1/-1}.quotation-totals{background:#0b2949;color:#fff;border-radius:20px;padding:22px;height:max-content}.quotation-totals dl{margin:0}.quotation-totals dl div{display:flex;justify-content:space-between;gap:20px;padding:12px 0;border-bottom:1px solid rgba(255,255,255,.12)}.quotation-totals dt{color:#c9d7e6}.quotation-totals dd{margin:0;font-weight:800}.quotation-totals__grand{font-size:20px;border:0!important;padding-top:20px!important}.quotation-actions,.quotation-send-form{display:flex;gap:10px;justify-content:flex-end;margin:0 0 18px}.quotation-history-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:18px}.quotation-history{display:grid;gap:9px}.quotation-history article{display:grid;grid-template-columns:60px 1fr auto;align-items:center;gap:10px;padding:11px;border:1px solid #e4e9ef;border-radius:12px}.quotation-events{list-style:none;padding:0;margin:0;display:grid;gap:12px}.quotation-events li{display:flex;gap:10px}.quotation-events li>span{display:grid;place-items:center;width:28px;height:28px;border-radius:9px;background:#e5f6ed;color:#14704c}.quotation-events strong,.quotation-events small,.quotation-events time{display:block}.quotation-events small,.quotation-events time{font-size:11px;color:#758799;margin-top:3px}.portal-quotation-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.portal-quotation-card{position:relative;background:#fff;border:1px solid #dfe6ed;border-radius:20px;padding:20px;color:#0b2340;text-decoration:none;box-shadow:0 8px 24px rgba(8,27,51,.05)}.portal-quotation-card>div{display:flex;gap:13px}.portal-quotation-card h2{font-size:17px;margin:6px 0}.portal-quotation-card p,.portal-quotation-card small{color:#6a7c8e}.portal-quotation-card dl{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:19px 0 0;padding-top:15px;border-top:1px solid #e8edf2}.portal-quotation-card dt{font-size:11px;color:#7a8b9c}.portal-quotation-card dd{margin:5px 0 0;font-weight:700}.portal-quotation-card__arrow{position:absolute;inset-inline-end:18px;top:18px}.portal-quote__hero{display:flex;justify-content:space-between;gap:20px;align-items:flex-end;background:#0b2949;color:#fff;padding:28px;border-radius:22px;margin-bottom:18px}.portal-quote__hero a,.portal-quote__hero p,.portal-quote__hero small{color:#cbd8e6}.portal-quote__hero h1{font-size:28px;margin:10px 0}.portal-quote__hero>div:last-child{text-align:end}.portal-quote__hero>div:last-child strong{display:block;font-size:26px;margin-top:14px}.portal-quote__grid{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px}.portal-quote-items{display:grid;gap:10px}.portal-quote-items article{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px;background:#f8fafc;border:1px solid #e4eaf0;border-radius:14px}.portal-quote-items article>span{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#e9f1f7}.portal-quote-items p,.portal-quote-items small{color:#687b8e;margin:5px 0 0}.portal-quote-total dl{margin:0}.portal-quote-total dl div{display:flex;justify-content:space-between;padding:11px 0;border-bottom:1px solid #e7ebef}.portal-quote-total dl div:last-child{font-size:20px;color:#0b3c70;border:0}.portal-quote-total dd{margin:0;font-weight:800}.portal-quote-total p{color:#687b8e;font-size:12px}.portal-quote-terms{margin-top:16px}.portal-quote-terms p{line-height:1.9;color:#53677c}.portal-decision{margin-top:18px}.portal-decision__choices{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px}.portal-decision__choices input{position:absolute;opacity:0}.portal-decision__choices span{display:flex;align-items:center;gap:9px;padding:17px;border:2px solid #e2e8ee;border-radius:15px;cursor:pointer}.portal-decision__choices input:checked+span{border-color:#e28b3b;background:#fff7ed;color:#a75b18}.portal-decision-banner{display:flex;gap:12px;align-items:center;padding:18px;border-radius:16px;margin-bottom:18px}.portal-decision-banner--success{background:#e6f7ee;color:#126746}.portal-decision-banner p{margin:4px 0 0}.portal-project-quotes{display:grid;gap:9px}.portal-project-quotes a{display:grid;grid-template-columns:1fr auto 22px;align-items:center;gap:12px;padding:13px;border:1px solid #e3e9ef;border-radius:13px;color:#163853;text-decoration:none}.portal-project-quotes small{display:block;margin-top:4px;color:#6d7f91}
@media(max-width:1100px){.quotation-stats{grid-template-columns:repeat(3,1fr)}.quotation-card{grid-template-columns:1fr 42px}.quotation-card dl{grid-column:1/-1;grid-row:2}.quotation-item{grid-template-columns:34px repeat(3,minmax(0,1fr))}.quotation-item__title,.quotation-item__desc{grid-column:span 2}.quotation-lower,.portal-quote__grid{grid-template-columns:1fr}.quotation-totals{width:100%}.portal-quote__grid aside{display:grid;grid-template-columns:1fr 1fr;gap:16px}.portal-quote-terms{margin:0}}
@media(max-width:720px){.quotation-filters{grid-template-columns:1fr}.quotation-stats{grid-template-columns:1fr 1fr}.quotation-stats article:last-child{grid-column:1/-1}.quotation-card{grid-template-columns:1fr 38px;padding:14px}.quotation-card dl{grid-template-columns:1fr 1fr}.quotation-card dl div:last-child{grid-column:1/-1}.quotation-hero,.portal-quote__hero{display:grid;align-items:start;padding:20px}.quotation-hero__status,.portal-quote__hero>div:last-child{text-align:start}.quotation-item{grid-template-columns:32px 1fr 1fr;padding:12px}.quotation-item__title,.quotation-item__desc{grid-column:2/-1}.quotation-item .field:not(.quotation-item__title):not(.quotation-item__desc){grid-column:span 1}.quotation-tax{grid-column:1/3}.quotation-item__total{grid-column:3}.quotation-item__remove{position:absolute;inset-inline-end:17px;margin-top:2px}.quotation-item{position:relative}.quotation-fields{grid-template-columns:1fr}.quotation-fields .field--wide{grid-column:auto}.quotation-history-grid,.portal-quotation-grid{grid-template-columns:1fr}.portal-quotation-card dl{grid-template-columns:1fr 1fr}.portal-quotation-card dl div:last-child{grid-column:1/-1}.portal-quote__grid aside{grid-template-columns:1fr}.portal-decision__choices{grid-template-columns:1fr}.customer-header__inner nav{overflow-x:auto;max-width:100%;padding-bottom:4px}.customer-header__inner nav .btn{white-space:nowrap}.quotation-actions,.quotation-send-form{justify-content:stretch}.quotation-actions .btn,.quotation-send-form .btn{width:100%}}
@media(max-width:420px){.quotation-stats{grid-template-columns:1fr}.quotation-stats article:last-child{grid-column:auto}.quotation-card dl{grid-template-columns:1fr}.quotation-card dl div:last-child{grid-column:auto}.quotation-item{grid-template-columns:28px 1fr}.quotation-item__title,.quotation-item__desc,.quotation-item .field:not(.quotation-item__title):not(.quotation-item__desc),.quotation-tax,.quotation-item__total{grid-column:1/-1}.quotation-item__seq{grid-column:1}.portal-quote-items article{grid-template-columns:30px 1fr}.portal-quote-items article>strong{grid-column:2}.portal-quotation-card dl{grid-template-columns:1fr}.portal-quotation-card dl div:last-child{grid-column:auto}}

/* ===== Customer quotation document — professional responsive layout ===== */
.customer-quotation{--cq-navy:#0b2949;--cq-blue:#164d7d;--cq-orange:#df8737;--cq-ink:#102a43;--cq-muted:#667b8f;--cq-line:#dce5ed;--cq-soft:#f6f9fc;--cq-green:#187451;--cq-red:#a64242;max-width:1240px;margin-inline:auto;padding-bottom:36px;color:var(--cq-ink)}
.customer-quotation *{box-sizing:border-box;min-width:0}
.customer-quotation svg{width:19px;height:19px;flex:0 0 auto}
.customer-quotation__back{display:inline-flex;align-items:center;gap:8px;margin-bottom:14px;color:#42617c;font-weight:800;text-decoration:none}
.customer-quotation__back:hover{color:var(--cq-orange)}
.customer-quotation__hero{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:28px;padding:30px 32px;border-radius:24px;background:linear-gradient(135deg,#071f38 0%,#0b3157 60%,#11466f 100%);color:#fff;box-shadow:0 18px 44px rgba(7,31,56,.16)}
.customer-quotation__hero:after{content:"";position:absolute;z-index:-1;width:330px;height:330px;border:70px solid rgba(255,255,255,.04);border-radius:50%;inset-inline-end:-80px;top:-160px}
.customer-quotation__hero-main{display:flex;align-items:center;gap:20px}
.customer-quotation__seal{display:grid;place-items:center;width:62px;height:62px;border:1px solid rgba(255,255,255,.28);border-radius:18px;background:rgba(255,255,255,.1);color:#ffb46f;box-shadow:inset 0 1px rgba(255,255,255,.18)}
.customer-quotation__seal svg{width:30px;height:30px}
.customer-quotation__eyebrow{margin:0 0 6px;color:#a9bfd2;font-size:12px;font-weight:800}
.customer-quotation__hero h1{margin:0;color:#fff;font-size:clamp(25px,3vw,36px);line-height:1.3;overflow-wrap:anywhere}
.customer-quotation__reference{display:flex;flex-wrap:wrap;gap:8px 16px;margin-top:11px;color:#c7d6e4;font-size:12px}
.customer-quotation__reference span{display:inline-flex;align-items:center;gap:6px}
.customer-quotation__reference svg{width:15px;height:15px;color:#ffae61}
.customer-quotation__hero-total{display:grid;justify-items:end;gap:4px;flex:0 0 auto;text-align:end}
.customer-quotation__hero-total>.quote-status{margin-bottom:7px;border:1px solid rgba(255,255,255,.16)}
.customer-quotation__hero-total>small{display:flex;align-items:center;gap:6px;color:#b9cbd9;font-weight:700}
.customer-quotation__hero-total>small svg{color:#ffae61}
.customer-quotation__hero-total>strong{color:#fff;font-size:34px;line-height:1.1;font-variant-numeric:tabular-nums}
.customer-quotation__hero-total>span:last-child{color:#c7d6e4;font-size:12px}
.customer-quotation__trust{display:flex;align-items:flex-start;gap:13px;margin:14px 10px 20px;padding:13px 17px;border:1px solid #cfe3d9;border-radius:14px;background:#f1faf5;color:#235c46}
.customer-quotation__trust>span{display:grid;place-items:center;width:36px;height:36px;border-radius:11px;background:#dcefe5;color:var(--cq-green)}
.customer-quotation__trust strong{display:block;font-size:13px}.customer-quotation__trust p{margin:3px 0 0;color:#557466;font-size:12px;line-height:1.7}
.customer-quotation__meta{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-bottom:18px}
.customer-quotation__meta article{display:flex;align-items:center;gap:11px;padding:15px;background:#fff;border:1px solid var(--cq-line);border-radius:16px;box-shadow:0 5px 18px rgba(16,42,67,.045)}
.customer-quotation__meta article>span{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#edf4fa;color:var(--cq-blue)}
.customer-quotation__meta small,.customer-quotation__meta strong,.customer-quotation__meta bdi{display:block}
.customer-quotation__meta small{color:var(--cq-muted);font-size:11px}.customer-quotation__meta strong{margin-top:4px;font-size:13px;overflow-wrap:anywhere}.customer-quotation__meta bdi{margin-top:3px;color:#728599;font-size:10px}
.customer-quotation__body{display:grid;grid-template-columns:minmax(0,1fr) 355px;align-items:start;gap:18px}
.customer-quotation__side{display:grid;gap:18px}
.customer-quotation__panel{overflow:hidden;background:#fff;border:1px solid var(--cq-line);border-radius:20px;box-shadow:0 8px 28px rgba(16,42,67,.055)}
.customer-quotation__panel-head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 20px;border-bottom:1px solid #e6edf3}
.customer-quotation__panel-head>div{display:flex;align-items:center;gap:12px}
.customer-quotation__panel-head>div>span{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#fff0e3;color:#c86d20}
.customer-quotation__panel-head h2{margin:0;font-size:17px}.customer-quotation__panel-head p{margin:4px 0 0;color:var(--cq-muted);font-size:11px}
.customer-quotation__panel-head>b{display:grid;place-items:center;min-width:34px;height:30px;padding-inline:10px;border-radius:999px;background:#edf4fa;color:var(--cq-blue);font-size:12px}
.customer-quotation__items{padding:0 16px 16px}
.customer-quotation__items-head,.customer-quotation__item{display:grid;grid-template-columns:34px minmax(185px,1.7fr) minmax(80px,.75fr) minmax(72px,.62fr) minmax(90px,.82fr) minmax(98px,.9fr);gap:10px;align-items:center}
.customer-quotation__items-head{padding:13px 10px 10px;color:#718397;font-size:10px;font-weight:800}
.customer-quotation__items-head span{display:flex;align-items:center;gap:5px}.customer-quotation__items-head svg{width:14px;height:14px;color:#c86d20}
.customer-quotation__item{margin-bottom:9px;padding:14px 10px;border:1px solid #e2e9ef;border-radius:14px;background:var(--cq-soft)}
.customer-quotation__item:last-child{margin-bottom:0}.customer-quotation__item-no{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#e6f0f8;color:#285b83;font-weight:900}
.customer-quotation__item>div{color:#334f68;font-size:12px}.customer-quotation__item-title strong{display:block;color:var(--cq-ink);font-size:14px}.customer-quotation__item-title p{margin:5px 0 0;color:var(--cq-muted);font-size:11px;line-height:1.6;overflow-wrap:anywhere}
.customer-quotation__line-total strong{color:#0b4677;font-size:14px}.customer-quotation__mobile-icon{display:none}
.customer-quotation__summary dl{margin:0;padding:7px 18px 14px}.customer-quotation__summary dl>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 2px;border-bottom:1px dashed #dfe6ed}
.customer-quotation__summary dt{display:flex;align-items:center;gap:8px;color:#526b80;font-size:12px}.customer-quotation__summary dt>span{display:grid;place-items:center;width:29px;height:29px;border-radius:9px;background:#edf4fa;color:#35678e}.customer-quotation__summary dt svg{width:15px;height:15px}.customer-quotation__summary dd{margin:0;color:#183b59;font-weight:900;font-variant-numeric:tabular-nums}
.customer-quotation__summary .customer-quotation__grand{margin-top:8px;padding:15px;border:0;border-radius:14px;background:linear-gradient(135deg,#0b2949,#124a78);color:#fff}.customer-quotation__grand dt,.customer-quotation__grand dd{color:#fff}.customer-quotation__grand dt>span{background:rgba(255,255,255,.12);color:#ffb36a}.customer-quotation__grand dd{text-align:end}.customer-quotation__grand strong,.customer-quotation__grand small{display:block}.customer-quotation__grand strong{font-size:21px}.customer-quotation__grand small{margin-top:3px;color:#bfd0de;font-size:10px}
.customer-quotation__validity{display:flex;align-items:center;gap:7px;margin:0 18px 18px;padding:11px 12px;border-radius:11px;background:#fff7ed;color:#8a511d;font-size:11px}.customer-quotation__validity svg{color:#db8031}.customer-quotation__validity strong{margin-inline-start:auto}
.customer-quotation__terms>p{margin:0;padding:18px 20px;color:#4c657a;font-size:13px;line-height:1.9;overflow-wrap:anywhere;word-break:break-word}
.customer-quotation__decision{margin-top:18px}.customer-quotation__decision form{padding:18px 20px 20px}.customer-quotation__choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.customer-quotation__choice{position:relative}.customer-quotation__choice input{position:absolute;opacity:0;pointer-events:none}.customer-quotation__choice>span{display:grid;grid-template-columns:44px 1fr;grid-template-rows:auto auto;align-items:center;column-gap:11px;padding:15px;border:2px solid #e0e7ed;border-radius:15px;background:#fff;cursor:pointer;transition:border-color .18s,background .18s,transform .18s}.customer-quotation__choice>span:hover{transform:translateY(-1px);border-color:#b8c8d6}.customer-quotation__choice i{display:grid;grid-row:1/3;place-items:center;width:44px;height:44px;border-radius:13px;background:#edf4fa;color:#396987;font-style:normal}.customer-quotation__choice strong{font-size:13px}.customer-quotation__choice small{margin-top:3px;color:#7a8b9c;font-size:10px}.customer-quotation__choice input:focus-visible+span{outline:3px solid rgba(37,99,235,.2);outline-offset:2px}.customer-quotation__choice--approve input:checked+span{border-color:#39a275;background:#f0fbf6}.customer-quotation__choice--approve input:checked+span i{background:#dff4e9;color:#14714d}.customer-quotation__choice--revision input:checked+span{border-color:#df8737;background:#fff8ef}.customer-quotation__choice--revision input:checked+span i{background:#ffe9d3;color:#b65f17}.customer-quotation__choice--reject input:checked+span{border-color:#d56262;background:#fff5f5}.customer-quotation__choice--reject input:checked+span i{background:#fbe3e3;color:#a53a3a}
.customer-quotation__comment{margin:17px 0 0}.customer-quotation__comment .field__label{display:flex;align-items:center;gap:7px}.customer-quotation__comment .field__label svg{color:#d77929}.customer-quotation__comment textarea{resize:vertical;min-height:104px;line-height:1.7}.customer-quotation__submit{display:flex;justify-content:flex-end;margin-top:14px}.customer-quotation__submit .btn{min-width:170px;justify-content:center}
@media(max-width:1100px){.customer-quotation__meta{grid-template-columns:repeat(3,minmax(0,1fr))}.customer-quotation__body{grid-template-columns:1fr}.customer-quotation__side{grid-template-columns:1fr 1fr}.customer-quotation__items-panel{grid-column:1/-1}}
@media(max-width:760px){.customer-quotation{width:100%;overflow:hidden}.customer-quotation__hero{align-items:flex-start;padding:22px}.customer-quotation__hero-main{align-items:flex-start}.customer-quotation__seal{width:50px;height:50px;border-radius:15px}.customer-quotation__seal svg{width:24px;height:24px}.customer-quotation__hero-total>strong{font-size:28px}.customer-quotation__trust{margin-inline:0}.customer-quotation__meta{grid-template-columns:1fr 1fr}.customer-quotation__meta article:last-child{grid-column:1/-1}.customer-quotation__side{grid-template-columns:1fr}.customer-quotation__items{padding:12px}.customer-quotation__items-head{display:none}.customer-quotation__item{position:relative;display:grid;grid-template-columns:1fr 1fr;gap:0;padding:14px}.customer-quotation__item-no{position:absolute;inset-inline-end:13px;top:13px}.customer-quotation__item-title{grid-column:1/-1;padding-inline-end:42px;padding-bottom:12px;margin-bottom:4px;border-bottom:1px solid #e0e7ed}.customer-quotation__item>div:not(.customer-quotation__item-title){display:grid;grid-template-columns:23px 1fr;align-items:center;padding:11px 4px;border-bottom:1px dashed #dfe6ed}.customer-quotation__item>div:not(.customer-quotation__item-title):before{content:attr(data-label);grid-column:2;display:block;margin-bottom:4px;color:#78899a;font-size:9px}.customer-quotation__item>div:not(.customer-quotation__item-title)>strong{grid-column:2}.customer-quotation__mobile-icon{display:grid;grid-column:1;grid-row:1/3;place-items:center;color:#c86d20}.customer-quotation__mobile-icon svg{width:16px;height:16px}.customer-quotation__line-total{border-bottom:0!important;background:#edf5fb;border-radius:10px;margin-top:5px;padding-inline:9px!important}.customer-quotation__choices{grid-template-columns:1fr}.customer-quotation__decision form{padding:15px}.customer-quotation__panel-head{padding:16px}.customer-quotation__submit .btn{width:100%}}
@media(max-width:520px){.customer-quotation__hero{display:grid;gap:20px}.customer-quotation__hero-main{gap:12px}.customer-quotation__hero-total{width:100%;grid-template-columns:1fr auto;align-items:end;justify-items:start;padding-top:16px;border-top:1px solid rgba(255,255,255,.15);text-align:start}.customer-quotation__hero-total>.quote-status{grid-column:1/-1}.customer-quotation__hero-total>small{grid-column:1}.customer-quotation__hero-total>strong{grid-column:2;grid-row:2/4}.customer-quotation__hero-total>span:last-child{grid-column:1}.customer-quotation__meta{grid-template-columns:1fr}.customer-quotation__meta article:last-child{grid-column:auto}.customer-quotation__item{grid-template-columns:1fr}.customer-quotation__item>div:not(.customer-quotation__item-title){grid-column:1}.customer-quotation__panel-head{align-items:flex-start}.customer-quotation__panel-head>div{align-items:flex-start}.customer-quotation__trust{align-items:flex-start}.customer-quotation__reference{display:grid;gap:6px}.customer-quotation__summary dl{padding-inline:13px}}

/* ===== Customer quotations index — trusted portal presentation ===== */
.customer-quotes{--cql-navy:#0a2948;--cql-blue:#174f7d;--cql-copper:#df8737;--cql-ink:#102a43;--cql-muted:#687d91;--cql-line:#dce5ed;max-width:1240px;margin-inline:auto;padding-bottom:34px;color:var(--cql-ink)}
.customer-quotes *{box-sizing:border-box;min-width:0}.customer-quotes svg{width:19px;height:19px;flex:0 0 auto}
.customer-quotes__hero{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:30px;padding:34px 36px;border-radius:25px;background:linear-gradient(135deg,#071f38 0%,#0d355d 62%,#17527e 100%);color:#fff;box-shadow:0 18px 46px rgba(7,31,56,.16)}
.customer-quotes__hero:before,.customer-quotes__hero:after{content:"";position:absolute;z-index:-1;border-radius:50%;border:60px solid rgba(255,255,255,.035)}.customer-quotes__hero:before{width:320px;height:320px;inset-inline-end:-95px;top:-190px}.customer-quotes__hero:after{width:240px;height:240px;inset-inline-start:34%;bottom:-210px}
.customer-quotes__hero-copy{display:flex;align-items:center;gap:20px}.customer-quotes__hero-icon{display:grid;place-items:center;width:64px;height:64px;border:1px solid rgba(255,255,255,.24);border-radius:19px;background:rgba(255,255,255,.1);color:#ffb46f}.customer-quotes__hero-icon svg{width:30px;height:30px}.customer-quotes__hero-copy small{display:flex;align-items:center;gap:6px;color:#b9cddd;font-size:12px;font-weight:800}.customer-quotes__hero-copy small svg{width:15px;height:15px;color:#ffb46f}.customer-quotes__hero h1{margin:6px 0 5px;color:#fff;font-size:clamp(28px,3vw,38px)}.customer-quotes__hero p{max-width:700px;margin:0;color:#c7d6e3;line-height:1.8}.customer-quotes__hero-mark{display:grid;place-items:center;width:98px;height:98px;border-radius:28px;background:rgba(255,255,255,.075);color:rgba(255,180,111,.8);transform:rotate(-6deg)}.customer-quotes__hero-mark svg{width:49px;height:49px}
.customer-quotes__stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin-top:-15px;padding-inline:26px;position:relative;z-index:2}.customer-quotes__stats article{display:flex;align-items:center;gap:13px;padding:17px 18px;border:1px solid var(--cql-line);border-radius:17px;background:#fff;box-shadow:0 9px 26px rgba(16,42,67,.08)}.customer-quotes__stats article>span{display:grid;place-items:center;width:43px;height:43px;border-radius:13px;background:#edf4fa;color:var(--cql-blue)}.customer-quotes__stats article:nth-child(2)>span{background:#fff3e7;color:#bd651f}.customer-quotes__stats article:nth-child(3)>span{background:#e9f7ef;color:#187451}.customer-quotes__stats small,.customer-quotes__stats strong{display:block}.customer-quotes__stats small{color:var(--cql-muted);font-size:11px}.customer-quotes__stats strong{margin-top:3px;font-size:21px}
.customer-quotes__section-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:12px;padding:13px 4px 2px}.customer-quotes__section-head>div{display:flex;align-items:center;gap:11px}.customer-quotes__section-head>div>span{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#fff0e3;color:#c86d20}.customer-quotes__section-head h2{margin:0;font-size:19px}.customer-quotes__section-head p{margin:4px 0 0;color:var(--cql-muted);font-size:11px}.customer-quotes__section-head>b{display:grid;place-items:center;min-width:37px;height:32px;padding-inline:11px;border-radius:999px;background:#eaf2f8;color:#285c83}
.customer-quotes__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.customer-quote-card{position:relative;overflow:hidden;display:grid;gap:18px;padding:21px;border:1px solid var(--cql-line);border-radius:21px;background:#fff;color:var(--cql-ink);text-decoration:none;box-shadow:0 8px 27px rgba(16,42,67,.055);transition:transform .18s,border-color .18s,box-shadow .18s}.customer-quote-card:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:4px;background:#5c83a3}.customer-quote-card--approved:before{background:#2c9870}.customer-quote-card--rejected:before,.customer-quote-card--expired:before{background:#c95555}.customer-quote-card--revision_requested:before{background:#db8739}.customer-quote-card:hover{transform:translateY(-3px);border-color:#b8cad8;box-shadow:0 15px 38px rgba(16,42,67,.1)}
.customer-quote-card__top{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:12px}.customer-quote-card__document{display:grid;place-items:center;width:48px;height:48px;border-radius:15px;background:#fff0e3;color:#c86d20}.customer-quote-card__document svg{width:24px;height:24px}.customer-quote-card__identity>span,.customer-quote-card__identity>bdi,.customer-quote-card__identity>small{display:block}.customer-quote-card__identity>span{color:#788b9d;font-size:10px}.customer-quote-card__identity>bdi{margin-top:2px;color:#174f7d;font-size:13px;font-weight:900}.customer-quote-card__identity>small{display:flex;align-items:center;gap:5px;margin-top:5px;color:#74879a;font-size:10px}.customer-quote-card__identity>small svg{width:13px;height:13px;color:#c86d20}
.customer-quote-card__project{display:flex;align-items:center;gap:12px;padding:15px;border-radius:15px;background:#f6f9fc}.customer-quote-card__project>span{display:grid;place-items:center;width:39px;height:39px;border-radius:12px;background:#e6f0f8;color:#2d638b}.customer-quote-card__project small,.customer-quote-card__project bdi{display:block;color:#72869a;font-size:10px}.customer-quote-card__project h2{margin:3px 0;color:#102a43;font-size:17px;overflow-wrap:anywhere}.customer-quote-card__project bdi{margin-top:4px}
.customer-quote-card__meta{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0}.customer-quote-card__meta>div{padding:13px;border:1px solid #e4ebf1;border-radius:13px}.customer-quote-card__meta dt{display:flex;align-items:center;gap:6px;color:#718497;font-size:10px}.customer-quote-card__meta dt svg{width:15px;height:15px;color:#c86d20}.customer-quote-card__meta dd{margin:7px 0 0;color:#173b59;font-size:13px;font-weight:800}.customer-quote-card__meta dd strong,.customer-quote-card__meta dd small{display:block}.customer-quote-card__meta dd strong{font-size:17px}.customer-quote-card__meta dd small{margin-top:3px;color:#74879a;font-size:9px;font-weight:700}
.customer-quote-card__open{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:14px;border-top:1px solid #e5ebf0;color:#1d5a88;font-size:12px;font-weight:900}.customer-quote-card__open span{display:flex;align-items:center;gap:7px}.customer-quote-card__open svg{width:17px;height:17px}.customer-quote-card__open>svg{transition:transform .18s}.customer-quote-card:hover .customer-quote-card__open>svg{transform:translateX(calc(var(--dir,1)*-3px))}
.customer-quotes__assurance{display:flex;align-items:flex-start;gap:12px;margin-top:18px;padding:16px 18px;border:1px solid #cfe3d9;border-radius:16px;background:#f1faf5;color:#245f48}.customer-quotes__assurance>span{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#dcefe5;color:#187451}.customer-quotes__assurance strong{display:block;font-size:12px}.customer-quotes__assurance p{margin:4px 0 0;color:#557466;font-size:11px;line-height:1.7}
.customer-quotes__empty{display:grid;justify-items:center;padding:48px 24px;border:1px dashed #bfcdd8;border-radius:20px;background:#fff;text-align:center}.customer-quotes__empty>span{display:grid;place-items:center;width:62px;height:62px;border-radius:18px;background:#edf4fa;color:#35678e}.customer-quotes__empty>span svg{width:29px;height:29px}.customer-quotes__empty h2{margin:15px 0 5px;font-size:18px}.customer-quotes__empty p{max-width:520px;margin:0;color:var(--cql-muted);font-size:12px;line-height:1.8}
@media(max-width:900px){.customer-quotes__grid{grid-template-columns:1fr}.customer-quotes__hero-mark{width:78px;height:78px}.customer-quotes__hero-mark svg{width:38px;height:38px}}
@media(max-width:700px){.customer-quotes{width:100%;overflow:hidden}.customer-quotes__hero{padding:24px}.customer-quotes__hero-mark{display:none}.customer-quotes__stats{grid-template-columns:1fr;margin-top:12px;padding-inline:0}.customer-quotes__stats article{padding:14px 16px}.customer-quotes__section-head{align-items:flex-start}.customer-quote-card{padding:16px}.customer-quote-card__top{grid-template-columns:44px 1fr}.customer-quote-card__document{width:44px;height:44px}.customer-quote-card__top>.quote-status{grid-column:1/-1;justify-self:start}.customer-quotes__assurance{align-items:flex-start}}
@media(max-width:480px){.customer-quotes__hero-copy{align-items:flex-start;gap:13px}.customer-quotes__hero-icon{width:50px;height:50px;border-radius:15px}.customer-quotes__hero-icon svg{width:24px;height:24px}.customer-quotes__hero h1{font-size:27px}.customer-quotes__hero p{font-size:12px}.customer-quote-card__meta{grid-template-columns:1fr}.customer-quote-card__project{align-items:flex-start}.customer-quotes__section-head p{display:none}}

/* ===== Structured customer appointment reschedule request ===== */
.customer-reschedule-modal .modal__dialog{width:min(610px,calc(100% - 28px));overflow:hidden;border-radius:22px}
.customer-reschedule-modal .modal__head{align-items:flex-start;padding:19px 21px;background:linear-gradient(180deg,#fff,#fbfcfd)}
.customer-reschedule-modal__title{display:flex;align-items:flex-start;gap:12px}.customer-reschedule-modal__title>span{display:grid;place-items:center;width:45px;height:45px;border-radius:14px;background:#fff0e3;color:#c96d20}.customer-reschedule-modal__title>span svg{width:22px;height:22px}.customer-reschedule-modal__title h3{margin:0;color:#102a43;font-size:18px}.customer-reschedule-modal__title p{margin:5px 0 0;color:#687d91;font-size:11px;line-height:1.7}.customer-reschedule-modal .modal__body{display:grid;gap:16px;padding:19px 21px}
.customer-reschedule-current{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid #d9e5ee;border-radius:14px;background:#f5f9fc}.customer-reschedule-current>span{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#e5f0f8;color:#2e648d}.customer-reschedule-current small,.customer-reschedule-current time{display:block}.customer-reschedule-current small{color:#718597;font-size:10px}.customer-reschedule-current time{margin-top:4px;color:#143b5a;font-size:13px;font-weight:900}
.customer-reschedule-fields{display:grid;grid-template-columns:1fr 1fr;gap:13px}.customer-reschedule-fields .field,.customer-reschedule-note{margin:0}.customer-reschedule-fields .field__label,.customer-reschedule-note .field__label{display:flex;align-items:center;gap:7px}.customer-reschedule-fields .field__ico,.customer-reschedule-note .field__ico{color:#d77929}.customer-reschedule-fields input{font-variant-numeric:tabular-nums}.customer-reschedule-error{margin:-8px 0 0}.customer-reschedule-note textarea{min-height:88px;resize:vertical;line-height:1.7}.customer-reschedule-time-note{display:flex;align-items:center;gap:7px;margin:0;padding:10px 12px;border-radius:11px;background:#fff7ed;color:#82501f;font-size:10px;line-height:1.6}.customer-reschedule-time-note svg{width:16px;height:16px;color:#d77929}.customer-reschedule-modal .modal__foot{padding:15px 21px;background:#fafcfd}.customer-reschedule-modal .modal__foot .btn--primary{min-width:150px;justify-content:center}
.appointment-customer-request{display:flex;align-items:flex-start;gap:9px;margin-top:9px;padding:11px;border:1px solid #f0d1ad;border-radius:12px;background:#fff8ef;color:#754517}.appointment-customer-request>span{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:#ffe8cf;color:#bd651f}.appointment-customer-request small,.appointment-customer-request strong{display:block}.appointment-customer-request small{color:#99632e;font-size:10px}.appointment-customer-request strong{margin-top:3px}.appointment-customer-request p{display:flex;align-items:flex-start;gap:5px;margin:6px 0 0!important;color:#76593d!important;font-size:10px}.appointment-customer-request p svg{width:14px;height:14px}.appointment-requested-time{display:flex!important;align-items:flex-start;gap:4px;margin-top:7px!important;color:#a35d20!important}.appointment-requested-time svg{width:14px;height:14px}
.portal-reschedule-request{display:flex;align-items:flex-start;gap:9px;margin-top:10px;padding:11px;border:1px solid #f0d1ad;border-radius:12px;background:#fff8ef}.portal-reschedule-request>span{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#ffe8cf;color:#bd651f}.portal-reschedule-request small,.portal-reschedule-request strong,.portal-reschedule-request em{display:block}.portal-reschedule-request small{color:#99632e;font-size:9px}.portal-reschedule-request strong{margin-top:3px;color:#704418;font-size:12px}.portal-reschedule-request strong time{margin:0}.portal-reschedule-request em{margin-top:5px;color:#876646;font-size:9px;font-style:normal;line-height:1.5}
@media(max-width:560px){.customer-reschedule-fields{grid-template-columns:1fr}.customer-reschedule-modal .modal__head,.customer-reschedule-modal .modal__body,.customer-reschedule-modal .modal__foot{padding-inline:16px}.customer-reschedule-modal .modal__foot{display:grid;grid-template-columns:1fr 1fr}.customer-reschedule-modal .modal__foot .btn{width:100%;justify-content:center}.customer-reschedule-modal__title p{max-width:260px}}
/* ===== Designs & customer approvals — phase 5B ===== */
.design-filters{display:grid;grid-template-columns:minmax(260px,1fr) 220px 220px;gap:12px;margin:18px 0}.design-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:18px 0}.design-stats article{display:flex;align-items:center;gap:12px;padding:16px;background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow-sm)}.design-stats article>span{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#edf5fb;color:#2f608f}.design-stats strong,.design-stats small{display:block}.design-stats strong{font-size:1.3rem}.design-stats small{color:var(--muted);margin-top:3px}.design-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.design-card{position:relative;display:flex;flex-direction:column;gap:12px;min-width:0;padding:20px;background:#fff;border:1px solid var(--border);border-radius:20px;color:var(--navy);text-decoration:none;box-shadow:var(--shadow-sm);overflow:hidden;transition:.2s ease}.design-card:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:4px;background:#8294a8}.design-card--approved:before{background:#1b9a6c}.design-card--revision_requested:before{background:#d5693b}.design-card--sent:before,.design-card--viewed:before{background:#3e7fb7}.design-card:hover{transform:translateY(-3px);box-shadow:0 16px 35px rgba(8,27,51,.1)}.design-card__top,.design-card__ref,.design-card dl,.design-card__open{display:flex;align-items:center;justify-content:space-between;gap:10px}.design-card__icon{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:#fff2e5;color:var(--orange)}.design-card__ref bdi{font-weight:800;letter-spacing:.3px}.design-card__ref small{display:flex;align-items:center;gap:5px;color:var(--muted)}.design-card h3{font-size:1.05rem;margin:0}.design-card p{display:flex;align-items:center;gap:7px;margin:0;color:var(--muted);min-width:0}.design-card dl{margin:0;padding-top:12px;border-top:1px solid var(--border)}.design-card dl div{min-width:0}.design-card dt{display:flex;gap:5px;color:var(--muted);font-size:.76rem}.design-card dd{margin:4px 0 0;font-weight:700}.design-card__open{justify-content:flex-end;color:#2f608f;font-weight:700}.design-status{display:inline-flex;align-items:center;width:max-content;max-width:100%;padding:6px 10px;border-radius:999px;background:#eef2f6;color:#53677c;font-size:.75rem;font-style:normal;font-weight:800}.design-status--sent,.design-status--viewed{background:#e8f2fb;color:#276896}.design-status--revision_requested{background:#fff0e9;color:#b25127}.design-status--approved{background:#e7f7ef;color:#167453}.design-empty{margin-top:20px}.design-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:24px;margin-bottom:16px;border-radius:22px;background:linear-gradient(135deg,#0b2949,#123c65);color:#fff;overflow:hidden}.design-back{display:inline-flex;align-items:center;gap:6px;color:#d7e4f0;text-decoration:none;margin-bottom:18px}.design-hero__identity{display:flex;gap:16px;align-items:center}.design-hero__identity>span{display:grid;place-items:center;flex:0 0 58px;height:58px;border-radius:18px;background:#e28b3b}.design-hero__identity h2{margin:5px 0;font-size:1.65rem}.design-hero__identity p,.design-hero__identity small{margin:0;color:#d2dfeb}.design-hero>aside{display:flex;flex-direction:column;align-items:flex-end;gap:10px}.design-hero>aside small{display:flex;align-items:center;gap:6px}.design-lock-note{display:flex;align-items:center;gap:14px;padding:15px 18px;margin-bottom:16px;border:1px solid #cfe3f2;border-radius:16px;background:#edf6fc;color:#285d86}.design-lock-note>svg{flex:0 0 28px}.design-lock-note strong,.design-lock-note p{display:block;margin:0}.design-lock-note p{margin-top:4px;color:#58738a;font-size:.86rem}.design-detail-grid{display:grid;grid-template-columns:minmax(0,1fr) 350px;align-items:start;gap:18px}.design-detail-grid>main,.design-detail-grid>aside{display:grid;gap:18px;min-width:0}.design-files{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.design-file{min-width:0;border:1px solid var(--border);border-radius:16px;overflow:hidden;background:#f8fafc}.design-file.is-primary{border-color:#e7a566;box-shadow:0 0 0 2px #fff0e1}.design-file__preview{display:grid;place-items:center;height:210px;background:#eaf0f5;color:#2f608f}.design-file__preview img{width:100%;height:100%;object-fit:cover}.design-file__preview span{display:grid;place-items:center;gap:6px}.design-file__preview svg{width:38px;height:38px}.design-file__meta{display:grid;gap:7px;padding:13px}.design-file__meta strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.design-file__meta small{color:var(--muted)}.design-file__meta>div{display:flex;gap:7px}.design-files-empty{display:grid;place-items:center;gap:7px;min-height:180px;text-align:center;color:var(--muted)}.design-files-empty svg{width:38px;height:38px}.design-comments{display:grid;gap:12px}.design-comment{display:flex;gap:11px;padding:13px;border:1px solid var(--border);border-radius:14px;background:#f8fafc}.design-comment>span{display:grid;place-items:center;flex:0 0 36px;height:36px;border-radius:11px;background:#e8f2fb;color:#2f608f}.design-comment>div{min-width:0;flex:1}.design-comment header{display:flex;justify-content:space-between;gap:10px}.design-comment em{font-size:.72rem;color:var(--muted)}.design-comment p{margin:7px 0}.design-comment time{font-size:.72rem;color:var(--muted)}.design-comment--internal{background:#fff9f1}.design-comment-form{display:grid;grid-template-columns:180px minmax(0,1fr) auto;align-items:end;gap:10px;margin-top:14px}.design-editor{margin:0}.design-send{margin:0}.design-versions{display:grid;gap:9px}.design-versions article{display:grid;grid-template-columns:auto auto 1fr;align-items:center;gap:8px;padding:10px;border-radius:12px;background:#f7f9fb}.design-versions small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.design-events{display:grid;gap:0;margin:0;padding:0;list-style:none}.design-events li{display:flex;gap:9px;padding:10px 0;border-bottom:1px solid var(--border)}.design-events li>span{display:grid;place-items:center;flex:0 0 27px;height:27px;border-radius:50%;background:#e8f2fb;color:#2f608f}.design-events strong,.design-events small,.design-events time{display:block}.design-events small,.design-events time{margin-top:3px;color:var(--muted);font-size:.72rem}
.customer-designs__hero{display:flex;align-items:center;gap:18px;padding:28px;border-radius:24px;background:linear-gradient(135deg,#0b2949,#154b77);color:#fff}.customer-designs__hero>span{display:grid;place-items:center;flex:0 0 62px;height:62px;border-radius:19px;background:#e28b3b}.customer-designs__hero h1{margin:3px 0;font-size:2rem}.customer-designs__hero p,.customer-designs__hero small{margin:0;color:#d5e1ec}.customer-designs__stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:18px 0}.customer-designs__stats article{display:flex;align-items:center;gap:12px;padding:18px;border:1px solid var(--border);border-radius:18px;background:#fff}.customer-designs__stats article>svg{color:var(--orange)}.customer-designs__stats small,.customer-designs__stats strong{display:block}.customer-designs__stats small{color:var(--muted)}.customer-designs__stats strong{font-size:1.35rem;margin-top:3px}.customer-designs__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.customer-design-card{display:grid;gap:16px;padding:20px;border:1px solid var(--border);border-radius:20px;background:#fff;color:var(--navy);text-decoration:none;box-shadow:var(--shadow-sm);transition:.2s}.customer-design-card:hover{transform:translateY(-3px);box-shadow:0 16px 35px rgba(8,27,51,.1)}.customer-design-card header{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px}.customer-design-card header>span{display:grid;place-items:center;width:45px;height:45px;border-radius:14px;background:#fff1e4;color:var(--orange)}.customer-design-card h2{margin:4px 0 0;font-size:1.05rem}.customer-design-card header small{color:var(--muted)}.customer-design-card__project{display:flex;gap:10px;padding:13px;border-radius:14px;background:#f7f9fb}.customer-design-card__project small,.customer-design-card__project strong,.customer-design-card__project bdi{display:block}.customer-design-card__project small{color:var(--muted)}.customer-design-card footer{display:flex;align-items:center;gap:15px;flex-wrap:wrap;padding-top:13px;border-top:1px solid var(--border);font-size:.8rem;color:var(--muted)}.customer-design-card footer span,.customer-design-card footer b{display:flex;align-items:center;gap:5px}.customer-design-card footer b{margin-inline-start:auto;color:#2f608f}.customer-designs__empty{display:grid;place-items:center;gap:8px;min-height:260px;margin-top:18px;border:1px dashed #c9d5df;border-radius:22px;background:#fff;text-align:center}.customer-design-review__back{display:inline-flex;align-items:center;gap:6px;margin-bottom:14px;color:#2f608f;text-decoration:none;font-weight:700}.customer-design-review__hero{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:28px;border-radius:24px;background:linear-gradient(135deg,#0b2949,#154b77);color:#fff}.customer-design-review__identity{display:flex;align-items:center;gap:16px}.customer-design-review__identity>span{display:grid;place-items:center;flex:0 0 62px;height:62px;border-radius:19px;background:#e28b3b}.customer-design-review__identity h1{margin:5px 0;font-size:1.75rem}.customer-design-review__identity p,.customer-design-review__identity small,.customer-design-review__hero>div:last-child p{margin:0;color:#d5e1ec}.customer-design-review__hero>div:last-child{display:grid;justify-items:end;gap:10px}.customer-design-review__trust,.customer-design-review__approved{display:flex;gap:13px;align-items:center;padding:16px 18px;margin:16px 0;border:1px solid #cde4d8;border-radius:17px;background:#edfaf3;color:#167453}.customer-design-review__trust strong,.customer-design-review__trust p,.customer-design-review__approved strong,.customer-design-review__approved p{display:block;margin:0}.customer-design-review__trust p,.customer-design-review__approved p{margin-top:3px;color:#4f7664}.customer-design-review__meta{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}.customer-design-review__meta article{display:flex;align-items:center;gap:11px;padding:15px;border:1px solid var(--border);border-radius:16px;background:#fff}.customer-design-review__meta article>svg{color:var(--orange)}.customer-design-review__meta small,.customer-design-review__meta strong{display:block}.customer-design-review__meta small{color:var(--muted);font-size:.74rem}.customer-design-review__brief,.customer-design-review__files,.customer-design-review__notes,.customer-design-review__decision{padding:22px;margin-bottom:16px;border:1px solid var(--border);border-radius:20px;background:#fff}.customer-design-review__brief{display:flex;gap:14px}.customer-design-review__brief>span,.customer-design-review__files>header>div>svg,.customer-design-review__decision>header>svg{color:var(--orange)}.customer-design-review__brief h2,.customer-design-review__brief p{margin:0}.customer-design-review__brief p{margin-top:7px;color:#4f6275;line-height:1.9}.customer-design-review__files>header,.customer-design-review__files>header>div,.customer-design-review__decision>header{display:flex;align-items:center;justify-content:space-between;gap:12px}.customer-design-review__files>header>div,.customer-design-review__decision>header{justify-content:flex-start}.customer-design-review__files h2,.customer-design-review__files p,.customer-design-review__decision h2,.customer-design-review__decision p{margin:0}.customer-design-review__files p,.customer-design-review__decision p{margin-top:4px;color:var(--muted)}.customer-design-review__gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin-top:18px}.customer-design-file{min-width:0;border:1px solid var(--border);border-radius:17px;overflow:hidden;background:#f8fafc}.customer-design-file.is-primary{border-color:#e4a161;box-shadow:0 0 0 2px #fff0e1}.customer-design-file>a{display:grid;place-items:center;height:260px;background:#eaf0f5}.customer-design-file>a img{width:100%;height:100%;object-fit:contain;background:#fff}.customer-design-file>a span{display:grid;place-items:center;gap:7px;color:#2f608f}.customer-design-file>a svg{width:45px;height:45px}.customer-design-file>div{display:grid;gap:7px;padding:14px}.customer-design-file>div>span{width:max-content;padding:5px 9px;border-radius:999px;background:#e8f2fb;color:#276896;font-size:.72rem}.customer-design-file>div strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.customer-design-file nav{display:flex;gap:8px}.customer-design-file nav a{display:flex;align-items:center;gap:5px;padding:7px 10px;border:1px solid var(--border);border-radius:9px;color:#2f608f;text-decoration:none;font-size:.78rem}.customer-design-review__notes>header{display:flex;align-items:center;gap:8px}.customer-design-review__notes article{display:flex;gap:11px;margin-top:12px;padding:13px;border-radius:14px;background:#f7f9fb}.customer-design-review__notes article>span{display:grid;place-items:center;flex:0 0 36px;height:36px;border-radius:11px;background:#e8f2fb;color:#2f608f}.customer-design-review__notes p{margin:6px 0}.customer-design-review__notes time{color:var(--muted);font-size:.72rem}.customer-design-review__decision>form{margin-top:18px}.customer-design-review__choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:15px}.customer-design-review__choices label{cursor:pointer}.customer-design-review__choices input{position:absolute;opacity:0}.customer-design-review__choices label>span{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;align-items:center;padding:16px;border:2px solid var(--border);border-radius:16px}.customer-design-review__choices label>span svg{grid-row:1/3;color:#2f608f}.customer-design-review__choices label>span small{color:var(--muted)}.customer-design-review__choices input:checked+span{border-color:#e28b3b;background:#fff8ef}.customer-design-review__decision button{margin-top:12px}
@media(max-width:1100px){.design-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.design-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.design-detail-grid{grid-template-columns:1fr}.design-detail-grid>aside{grid-template-columns:repeat(2,minmax(0,1fr))}.design-detail-grid>aside .design-editor{grid-column:1/-1}.customer-design-review__meta{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.design-filters{grid-template-columns:1fr}.design-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.design-grid,.customer-designs__grid,.customer-design-review__gallery{grid-template-columns:1fr}.design-hero,.customer-design-review__hero{align-items:flex-start;flex-direction:column}.design-hero>aside,.customer-design-review__hero>div:last-child{align-items:flex-start;justify-items:start}.design-files{grid-template-columns:1fr}.design-comment-form{grid-template-columns:1fr}.design-detail-grid>aside{grid-template-columns:1fr}.customer-designs__stats{grid-template-columns:1fr}.customer-design-review__meta{grid-template-columns:1fr 1fr}.customer-design-review__choices{grid-template-columns:1fr}.customer-design-file>a{height:220px}.customer-designs__hero{align-items:flex-start}.customer-design-card header{grid-template-columns:auto 1fr}.customer-design-card header .design-status{grid-column:1/-1}.customer-header__inner nav{max-width:100%;flex-wrap:wrap;overflow:visible;padding-bottom:4px}}
@media(max-width:480px){.design-stats,.customer-design-review__meta{grid-template-columns:1fr}.design-hero,.customer-designs__hero,.customer-design-review__hero{padding:20px}.design-hero__identity,.customer-design-review__identity{align-items:flex-start}.design-hero__identity>span,.customer-design-review__identity>span{flex-basis:48px;height:48px}.customer-design-review__brief,.customer-design-review__files,.customer-design-review__notes,.customer-design-review__decision{padding:16px}.customer-design-file nav{flex-direction:column}.customer-design-file nav a{justify-content:center}}

/* استوديو التصميم الهندسي وإعادة تنظيم صفحة التصميم */
.design-hero h2{color:#fff}.design-delete-button{display:inline-flex;align-items:center;gap:7px;border:1px solid rgba(255,255,255,.28);border-radius:11px;padding:9px 12px;background:rgba(255,255,255,.08);color:#fff;font:inherit;font-size:.78rem;font-weight:700;cursor:pointer;transition:.2s}.design-delete-button:hover{background:#b84040;border-color:#b84040}.design-lock-note.is-editable{border-color:#f0d3a9;background:#fff8ed;color:#95601d}.design-lock-note.is-editable p{color:#7a674e}.design-workspace{display:grid;grid-template-columns:minmax(0,1fr) 350px;align-items:start;gap:18px}.design-workspace__main,.design-workspace__rail{display:grid;gap:18px;min-width:0}.design-package__head,.design-package__actions,.design-file__labels,.design-file__actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.design-package__head{justify-content:space-between}.design-package__actions{justify-content:flex-end}.design-file{position:relative;background:#fff;box-shadow:0 8px 24px rgba(10,35,61,.05)}.design-file.is-drawing{border-color:#bfd8e9}.design-file__labels{justify-content:space-between}.design-file__labels .chip svg{width:13px;height:13px}.design-file__meta small{display:flex;align-items:center;gap:5px}.design-file__actions{padding-top:4px;border-top:1px solid var(--border)}.design-file__actions form{display:inline-flex}.icon-btn--danger{color:#b53a3a}.icon-btn--danger:hover{border-color:#efcaca;background:#fff1f1}.design-studio-modal{z-index:1300}.design-studio-dialog{width:min(1480px,calc(100vw - 32px));max-height:calc(100vh - 24px);overflow:auto}.design-studio-dialog>.modal__head{align-items:flex-start}.design-studio-dialog>.modal__head p{margin:4px 0 0;color:var(--muted);font-size:.84rem}.design-studio{min-width:0}.design-studio__toolbar{position:sticky;top:0;z-index:4;display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:12px 18px;border-bottom:1px solid var(--border);background:#f7f9fb}.design-studio__toolbar>button,.design-studio__toolbar>label{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:8px 11px;border:1px solid #d8e1e9;border-radius:10px;background:#fff;color:var(--navy);font:inherit;font-size:.78rem;cursor:pointer}.design-studio__toolbar>button:hover,.design-studio__toolbar>button.is-active{border-color:#2f608f;background:#e8f2fb;color:#25577f}.design-studio__toolbar>button.is-danger{color:#a93c3c}.design-studio__toolbar>button.is-armed{border-color:#cc4848;background:#cc4848;color:#fff}.design-studio__toolbar>button:disabled{opacity:.4;cursor:not-allowed}.design-studio__toolbar>button svg,.design-studio__toolbar>label svg{width:17px;height:17px}.design-studio__toolbar>i{width:1px;height:28px;background:#d8e1e9}.design-studio__toolbar select{border:0;background:transparent;color:inherit;font:inherit;outline:0}.design-studio__toolbar input[type=color]{width:25px;height:25px;padding:0;border:0;background:transparent}.design-studio__toggle input{accent-color:#2f608f}.design-studio__scale b{font-size:.72rem;color:var(--muted)}.design-studio__body{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px;padding:18px;background:#eef3f7}.design-studio__board{position:relative;min-width:0;padding:28px 0 0 28px;direction:ltr}.design-ruler{position:absolute;border:1px solid #cbd7e2;background-color:#f9fbfc;background-image:repeating-linear-gradient(90deg,transparent 0,transparent 24px,#8ca0b2 24px,#8ca0b2 25px),repeating-linear-gradient(90deg,transparent 0,transparent 124px,#536d83 124px,#536d83 126px)}.design-ruler--top{inset:0 0 auto 28px;height:28px}.design-ruler--side{inset:28px auto 0 0;width:28px;transform:rotate(180deg);background-image:repeating-linear-gradient(0deg,transparent 0,transparent 24px,#8ca0b2 24px,#8ca0b2 25px),repeating-linear-gradient(0deg,transparent 0,transparent 124px,#536d83 124px,#536d83 126px)}.design-canvas-wrap{position:relative;width:100%;aspect-ratio:12/7;border:1px solid #aebdca;border-radius:0 0 12px 0;background:#fff;box-shadow:0 12px 30px rgba(10,35,61,.1);overflow:hidden}.design-canvas-wrap canvas{display:block;width:100%;height:100%;touch-action:none;cursor:crosshair}.design-studio__preview{display:flex;flex-direction:column;gap:13px;min-width:0;padding:16px;border:1px solid var(--border);border-radius:16px;background:#fff}.design-studio__preview h4{display:flex;align-items:center;gap:7px;margin:0}.design-studio__preview-frame{position:relative;display:grid;place-items:center;min-height:180px;border:1px dashed #b9c9d7;border-radius:13px;background:#f4f7f9;overflow:hidden;text-align:center}.design-studio__preview-frame img{display:block;width:100%;height:auto}.design-studio__preview-frame p{padding:18px;color:var(--muted);font-size:.82rem}.design-studio__preview>.field__hint{display:flex;align-items:flex-start;gap:7px;line-height:1.6}.design-studio__status{min-height:22px;margin:0;color:#2f608f;font-size:.78rem;font-weight:700}.design-studio>.modal__foot{position:sticky;bottom:0;z-index:5;background:#fff}.design-studio-modal .field__error{margin:5px 0 0}
@media(max-width:1100px){.design-workspace{grid-template-columns:1fr}.design-workspace__rail{grid-template-columns:repeat(2,minmax(0,1fr))}.design-workspace__rail>.design-editor{grid-column:1/-1}.design-studio__body{grid-template-columns:1fr}.design-studio__preview{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,.7fr);align-items:start}.design-studio__preview h4{grid-column:2}.design-studio__preview-frame{grid-column:2;grid-row:2/6}.design-studio__preview>.field__hint,.design-studio__preview>.field__error,.design-studio__preview>.design-studio__status{grid-column:1}}
@media(max-width:760px){.design-workspace__rail{grid-template-columns:1fr}.design-package__head{align-items:flex-start}.design-package__actions{width:100%;justify-content:stretch}.design-package__actions .btn{flex:1}.design-delete-button span{display:none}.design-studio-dialog{width:100vw;max-height:100dvh;height:100dvh;border-radius:0}.design-studio__toolbar{padding:10px}.design-studio__toolbar>button span{display:none}.design-studio__toolbar>i{display:none}.design-studio__scale{width:100%}.design-studio__body{padding:10px;gap:12px}.design-studio__board{padding:22px 0 0 22px}.design-ruler--top{left:22px;height:22px}.design-ruler--side{top:22px;width:22px}.design-studio__preview{display:flex;padding:12px}.design-studio__preview h4{order:2}.design-studio__preview-frame{order:3;min-height:130px}.design-studio__preview>.field__hint{order:4}.design-studio__preview>.field__error,.design-studio__preview>.design-studio__status{order:5}}
@media(max-width:480px){.design-package__actions{flex-direction:column}.design-package__actions .btn{width:100%}.design-file__preview{height:190px}.design-studio-dialog>.modal__head p{display:none}.design-studio__toolbar>button,.design-studio__toolbar>label{min-height:38px;padding:7px 9px}.design-studio__toggle span{font-size:.7rem}}
.design-stats{grid-template-columns:repeat(6,minmax(0,1fr))}.design-card--ready_review:before{background:#8a6bb8}.design-status--ready_review{background:#f0eafb;color:#6f4a9b}
@media(max-width:1100px){.design-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:760px){.design-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:480px){.design-stats{grid-template-columns:1fr}}

/* المرحلة 6أ — أوامر العمل والإنتاج */
.production-filters{display:grid;grid-template-columns:minmax(250px,1.8fr) repeat(3,minmax(145px,.8fr)) auto;gap:10px;margin:18px 0}.production-filters>*{min-width:0}.production-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:18px}.production-stats article{display:flex;align-items:center;gap:11px;min-width:0;padding:16px;border:1px solid var(--border);border-radius:17px;background:#fff;box-shadow:var(--shadow-sm)}.production-stats article>span{display:grid;place-items:center;flex:0 0 42px;height:42px;border-radius:13px;background:#e8f2fb;color:#2f608f}.production-stats strong,.production-stats small{display:block}.production-stats strong{font-size:1.25rem}.production-stats small{overflow:hidden;color:var(--muted);font-size:.74rem;text-overflow:ellipsis;white-space:nowrap}.production-stats .is-warning>span{background:#fff1dc;color:#b76d19}.production-stats .is-danger>span{background:#fde8e8;color:#b84040}.production-stats .is-success>span{background:#e6f7ed;color:#198257}.production-order-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.production-order-card{position:relative;display:grid;gap:13px;min-width:0;padding:18px;border:1px solid var(--border);border-radius:19px;background:#fff;color:var(--navy);text-decoration:none;box-shadow:var(--shadow-sm);overflow:hidden;transition:.2s}.production-order-card:before{position:absolute;inset:0 0 0 auto;width:5px;background:#8ca0b2;content:""}.production-order-card:hover{transform:translateY(-2px);box-shadow:0 14px 32px rgba(10,35,61,.1)}.production-order-card--in_progress:before{background:#2f79a4}.production-order-card--on_hold:before{background:#d08a28}.production-order-card--completed:before{background:#1f9562}.production-order-card--cancelled:before{background:#b84040}.production-order-card header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px}.production-order-card__icon{display:grid;place-items:center;width:43px;height:43px;border-radius:13px;background:#fff0e1;color:var(--orange)}.production-order-card header b,.production-order-card header small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.production-order-card header small,.production-order-card>p{color:var(--muted);font-size:.78rem}.production-order-card h3,.production-order-card p{margin:0}.production-order-card p,.production-order-card footer,.production-order-card dl dt{display:flex;align-items:center;gap:6px}.production-status,.task-status{display:inline-flex;align-items:center;width:max-content;padding:6px 9px;border-radius:999px;background:#edf2f6;color:#4f6275;font-size:.7rem;font-weight:800}.production-status--draft{background:#f2f0fa;color:#6d55a1}.production-status--planned{background:#e8f2fb;color:#2f608f}.production-status--in_progress,.task-status--in_progress{background:#e1f3fa;color:#17688c}.production-status--on_hold,.task-status--blocked{background:#fff0dd;color:#a86314}.production-status--completed,.task-status--completed{background:#e4f7ed;color:#187a52}.production-status--cancelled,.task-status--cancelled{background:#fde8e8;color:#a93636}.task-status--awaiting_approval{background:#f0eafb;color:#6b4b98}.production-progress{display:flex;align-items:center;gap:10px}.production-progress>span,.production-task__progress>span{position:relative;display:block;flex:1;height:8px;border-radius:999px;background:#e7edf2;overflow:hidden}.production-progress>span:after,.production-task__progress>span i{position:absolute;inset:0 auto 0 0;width:var(--value);border-radius:inherit;background:linear-gradient(90deg,#2f79a4,#e28b3b);content:""}.production-progress b,.production-task__progress b{font-size:.75rem}.production-order-card dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:0}.production-order-card dl>div{padding:9px;border-radius:11px;background:#f7f9fb}.production-order-card dt{color:var(--muted);font-size:.68rem}.production-order-card dd{margin:5px 0 0;font-weight:800}.production-order-card .is-warning{background:#fff9ef}.production-order-card .is-danger{background:#fff1f1}.production-order-card footer{padding-top:11px;border-top:1px solid var(--border);color:var(--muted);font-size:.73rem}.production-order-card footer time,.production-order-card footer em{margin-inline-start:auto}.production-board{display:grid;grid-template-columns:repeat(5,minmax(260px,1fr));gap:12px;align-items:start}.production-board>section{display:grid;gap:10px;min-width:0;padding:11px;border:1px solid var(--border);border-radius:17px;background:#eef3f6}.production-board>section>header{display:flex;align-items:center;justify-content:space-between;padding:4px}.production-board>section>div{display:grid;gap:10px}.production-board .production-order-card header{grid-template-columns:auto 1fr}.production-board .production-order-card header>.production-status{grid-column:1/-1}.production-board .production-order-card dl{grid-template-columns:1fr}.production-board .production-order-card{padding:14px}.production-empty{min-height:250px}
.production-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px;padding:25px;border-radius:23px;background:linear-gradient(135deg,#0a2b4c,#164f7a);color:#fff}.production-back{display:inline-flex;align-items:center;gap:6px;margin-bottom:17px;color:#d7e6f2;text-decoration:none;font-size:.78rem}.production-hero__identity{display:flex;align-items:center;gap:14px}.production-hero__identity>span{display:grid;place-items:center;flex:0 0 58px;height:58px;border-radius:17px;background:#e28b3b}.production-hero__identity h2{margin:4px 0;color:#fff}.production-hero__identity p,.production-hero__identity small,.production-hero>aside>small{display:flex;align-items:center;gap:6px;margin:0;color:#d3e0eb;font-size:.78rem}.production-hero>aside{display:grid;justify-items:end;gap:10px}.production-hero>aside nav{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.production-hero .production-status{background:rgba(255,255,255,.16);color:#fff}.production-hero .design-delete-button{font-size:.72rem}.production-overview .panel__head>strong{color:var(--orange);font-size:1.7rem}.production-progress--large>span{height:12px}.production-overview__metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-top:16px}.production-overview__metrics article{display:flex;align-items:center;gap:10px;padding:13px;border-radius:14px;background:#f7f9fb}.production-overview__metrics article>svg{color:#2f608f}.production-overview__metrics b,.production-overview__metrics small{display:block}.production-overview__metrics small{color:var(--muted);font-size:.7rem}.production-overview__metrics .is-warning{background:#fff8ec}.production-overview__metrics .is-danger{background:#fff0f0}.production-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;align-items:start;gap:17px}.production-layout>main,.production-layout>aside{display:grid;gap:17px;min-width:0}.production-stages{display:grid;gap:14px}.production-stage{border:1px solid var(--border);border-radius:17px;background:#fbfcfd;overflow:hidden}.production-stage>header{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(110px,180px);align-items:center;gap:11px;padding:14px;border-bottom:1px solid var(--border)}.production-stage__number{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#e8f2fb;color:#2f608f;font-weight:800}.production-stage h4,.production-stage small{display:block;margin:0}.production-stage small{margin-top:4px;color:var(--muted);font-size:.7rem}.production-stage__progress{display:flex;align-items:center;gap:8px}.production-stage__progress>span{position:relative;display:block;flex:1;height:7px;border-radius:999px;background:#e7edf2;overflow:hidden}.production-stage__progress i{position:absolute;inset:0 auto 0 0;width:var(--value);background:#2f79a4}.production-task-list{display:grid;gap:11px;padding:12px}.production-task{display:grid;gap:11px;padding:14px;border:1px solid var(--border);border-radius:14px;background:#fff}.production-task--blocked{border-color:#efc783;background:#fffaf1}.production-task--completed{border-color:#bee5d1}.production-task>header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.production-task>header>div{display:flex;align-items:center;gap:9px;min-width:0}.production-task__status{display:grid;place-items:center;flex:0 0 36px;height:36px;border-radius:11px;background:#e8f2fb;color:#2f608f}.production-task h5,.production-task small{display:block;margin:0}.production-task h5{margin-top:3px}.production-task dl{display:grid;grid-template-columns:2fr 1fr 1fr;gap:8px;margin:0}.production-task dl>div{min-width:0;padding:9px;border-radius:10px;background:#f7f9fb}.production-task dt{display:flex;align-items:center;gap:5px;color:var(--muted);font-size:.68rem}.production-task dd{margin:5px 0 0;font-size:.78rem}.production-task__progress{display:flex;align-items:center;gap:8px}.task-assignees{display:flex;gap:5px;flex-wrap:wrap}.task-assignees i{padding:4px 7px;border-radius:999px;background:#e8f2fb;font-style:normal;font-size:.68rem}.production-task__description{margin:0;color:#4f6275;line-height:1.7}.production-task__blocker{display:flex;gap:9px;padding:10px;border-radius:11px;background:#fff0dc;color:#935810}.production-task__blocker p{margin:3px 0 0}.production-task>footer{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.production-task>footer>details{width:100%;margin-top:3px}.production-task details summary{display:flex;align-items:center;gap:6px;padding:9px;border-radius:9px;background:#f5f8fa;cursor:pointer;font-size:.76rem}.production-task-files{display:grid;gap:8px;padding-top:9px}.production-task-files>article{display:grid;grid-template-columns:auto minmax(0,1fr) repeat(3,auto);align-items:center;gap:7px;padding:8px;border:1px solid var(--border);border-radius:10px}.production-task-files>article strong,.production-task-files>article small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.production-task-files>article small{color:var(--muted)}.production-file-upload{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}.production-file-upload .field__error{grid-column:1/-1}.production-plan__list{display:grid;gap:0;margin:0}.production-plan__list>div{padding:11px 0;border-bottom:1px solid var(--border)}.production-plan__list dt{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:.7rem}.production-plan__list dd{margin:5px 0 0;font-size:.78rem;font-weight:700}.production-actions .panel__body{display:grid;gap:8px}.production-events{display:grid;gap:0;margin:0;padding:0;list-style:none}.production-events li{display:flex;gap:9px;padding:10px 0;border-bottom:1px solid var(--border)}.production-events li>span{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:50%;background:#e8f2fb;color:#2f608f}.production-events strong,.production-events small,.production-events time{display:block}.production-events small,.production-events time{margin-top:3px;color:var(--muted);font-size:.69rem}.production-assignee-picker{margin:0;padding:13px;border:1px solid var(--border);border-radius:13px}.production-assignee-picker legend{display:flex;align-items:center;gap:6px;padding:0 6px;font-weight:800}.production-assignee-picker>p{margin:2px 0 11px;color:var(--muted);font-size:.72rem}.production-assignee-picker>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.production-assignee-picker label{cursor:pointer}.production-assignee-picker input{position:absolute;opacity:0}.production-assignee-picker span{display:flex;align-items:center;gap:6px;padding:10px;border:1px solid var(--border);border-radius:10px}.production-assignee-picker input:checked+span{border-color:#2f79a4;background:#e8f2fb;color:#215b81}.production-check{display:flex;align-items:center;gap:8px;padding:11px;border:1px solid #efcf9e;border-radius:11px;background:#fff8ec;cursor:pointer}.production-check input{accent-color:#e28b3b}.my-production-tasks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.my-production-task{display:grid;gap:13px;padding:17px;border:1px solid var(--border);border-radius:18px;background:#fff;box-shadow:var(--shadow-sm)}.my-production-task--blocked{border-color:#efc783}.my-production-task>header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:start}.my-production-task>header>span{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#e8f2fb;color:#2f608f}.my-production-task h3,.my-production-task p{margin:3px 0}.my-production-task p,.my-production-task small{color:var(--muted);font-size:.73rem}.my-production-task dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0}.my-production-task dl>div{padding:10px;border-radius:11px;background:#f7f9fb}.my-production-task dt{display:flex;align-items:center;gap:5px;color:var(--muted);font-size:.68rem}.my-production-task dd{margin:4px 0 0;font-size:.76rem;font-weight:700}.my-production-task footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding-top:11px;border-top:1px solid var(--border)}
@media(max-width:1180px){.production-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.production-filters{grid-template-columns:minmax(220px,1fr) repeat(2,minmax(145px,.7fr))}.production-filters .view-switch{grid-column:-2/-1}.production-board{grid-template-columns:repeat(2,minmax(260px,1fr))}.production-layout{grid-template-columns:1fr}.production-layout>aside{grid-template-columns:repeat(2,minmax(0,1fr))}.production-layout>aside .production-actions{grid-column:1/-1}}
@media(max-width:760px){.production-filters{grid-template-columns:1fr}.production-filters .view-switch{grid-column:auto}.production-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.production-order-grid,.production-board,.my-production-tasks{grid-template-columns:1fr}.production-hero{align-items:flex-start;flex-direction:column;padding:19px}.production-hero>aside{justify-items:start;width:100%}.production-hero>aside nav{justify-content:flex-start}.production-overview__metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.production-layout>aside{grid-template-columns:1fr}.production-stage>header{grid-template-columns:auto minmax(0,1fr)}.production-stage__progress{grid-column:1/-1}.production-task dl,.my-production-task dl{grid-template-columns:1fr}.production-assignee-picker>div{grid-template-columns:1fr 1fr}.production-file-upload{grid-template-columns:1fr}.production-task-files>article{grid-template-columns:auto minmax(0,1fr) repeat(2,auto)}.production-task-files>article form{grid-column:-2/-1}.production-order-card header{grid-template-columns:auto minmax(0,1fr)}.production-order-card header>.production-status{grid-column:1/-1}.my-production-task>header{grid-template-columns:auto minmax(0,1fr)}.my-production-task>header>.task-status{grid-column:1/-1}}
@media(max-width:480px){.production-stats,.production-overview__metrics{grid-template-columns:1fr}.production-order-card dl{grid-template-columns:1fr}.production-assignee-picker>div{grid-template-columns:1fr}.production-task>header{flex-direction:column}.production-task-files>article{grid-template-columns:auto minmax(0,1fr) auto}.production-task-files>article>a:nth-of-type(2),.production-task-files>article form{grid-row:2}.my-production-task footer{align-items:stretch;flex-direction:column}.my-production-task footer .btn{justify-content:center;width:100%}.production-hero__identity{align-items:flex-start}.production-hero__identity>span{flex-basis:46px;height:46px}}
.project-production-orders,.portal-production>[data-production-orders]{display:grid;gap:10px}.project-production-orders>a{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(130px,220px) auto;align-items:center;gap:11px;padding:13px;border:1px solid var(--border);border-radius:13px;background:#f8fafc;color:var(--navy);text-decoration:none}.project-production-orders__icon{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#fff0e1;color:var(--orange)}.project-production-orders small{display:block;margin-top:3px;color:var(--muted)}.project-production-orders__progress{display:flex;align-items:center;gap:7px}.project-production-orders__progress>span{position:relative;display:block;flex:1;height:7px;border-radius:999px;background:#e4ebf0;overflow:hidden}.project-production-orders__progress i{position:absolute;inset:0 auto 0 0;width:var(--value);background:linear-gradient(90deg,#2f79a4,#e28b3b)}.portal-production__order{display:grid;gap:10px;padding:14px;border:1px solid var(--border);border-radius:14px;background:#f8fafc}.portal-production__order header,.portal-production__order header>div{display:flex;align-items:center;justify-content:space-between;gap:9px}.portal-production__order header>div{justify-content:flex-start}.portal-production__order p{display:flex;align-items:center;gap:6px;margin:0;color:var(--muted);font-size:.75rem}@media(max-width:600px){.project-production-orders>a{grid-template-columns:auto minmax(0,1fr) auto}.project-production-orders__progress{grid-column:1/-1}.portal-production__order header{align-items:flex-start}.portal-production__order header>div{align-items:flex-start;flex-direction:column}}
.production-board{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}

/* مسار تصنيع متتابع: إجراء رئيسي واحد في كل حالة */
.production-flow{margin-bottom:16px;border-color:#cbdbe8;background:linear-gradient(180deg,#fff,#f8fbfd)}.production-flow .panel__head>strong{padding:7px 11px;border-radius:999px;background:#e8f2fb;color:#2f608f;font-size:.75rem}.production-flow ol{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin:0;padding:0;list-style:none}.production-flow li{position:relative;display:grid;justify-items:center;gap:7px;min-width:0;text-align:center}.production-flow li:not(:last-child):after{position:absolute;z-index:0;inset-block-start:18px;inset-inline-start:calc(50% + 22px);width:calc(100% - 36px);height:2px;background:#dfe7ee;content:""}.production-flow li>span{z-index:1;display:grid;place-items:center;width:36px;height:36px;border:2px solid #d7e1e9;border-radius:50%;background:#fff;color:#7c8c9b;font-weight:900}.production-flow li small{color:#718092;font-size:.68rem;line-height:1.45}.production-flow li.is-done>span{border-color:#45a779;background:#e5f7ee;color:#187a52}.production-flow li.is-done:not(:last-child):after{background:#76c59f}.production-flow li.is-current>span{border-color:var(--orange);background:var(--orange);color:#fff;box-shadow:0 0 0 5px rgba(226,139,59,.14)}.production-flow li.is-current small{color:var(--navy);font-weight:900}.production-next-action{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:19px;padding:15px;border:1px solid #d6e4ef;border-radius:15px;background:#fff}.production-next-action>div{display:flex;align-items:center;gap:11px;min-width:0}.production-next-action>div>svg{flex:0 0 38px;padding:8px;border-radius:11px;background:#fff0e1;color:var(--orange)}.production-next-action p,.production-next-action strong,.production-next-action small{display:block;margin:0}.production-next-action small{margin-top:4px;color:var(--muted);line-height:1.55}.production-actions--secondary{box-shadow:none}.production-actions--secondary details>summary{display:flex;align-items:center;gap:7px;padding:14px;cursor:pointer;font-weight:800;list-style:none}.production-actions--secondary details>summary::-webkit-details-marker{display:none}.production-actions--secondary details>div{display:grid;gap:8px;padding:0 14px 14px}.production-task{scroll-margin-top:90px}.production-task--awaiting_approval{border-color:#cbb8e7;background:#fcfaff}.production-task--awaiting_approval>header{padding-bottom:8px;border-bottom:1px solid #eadff7}
@media(max-width:900px){.production-flow ol{grid-template-columns:repeat(4,minmax(0,1fr));row-gap:15px}.production-flow li:nth-child(4):after{display:none}}
@media(max-width:620px){.production-flow ol{grid-template-columns:1fr}.production-flow li{grid-template-columns:38px minmax(0,1fr);justify-items:start;align-items:center;text-align:start}.production-flow li:not(:last-child):after{inset-block-start:35px;inset-inline-start:17px;width:2px;height:calc(100% + 8px)}.production-flow li small{font-size:.76rem}.production-next-action{align-items:stretch;flex-direction:column}.production-next-action .btn{justify-content:center;width:100%}}

/* المرحلة 6ب — فحص الجودة المتسلسل */
.quality-filters{display:grid;grid-template-columns:minmax(260px,1.6fr) minmax(170px,.7fr) minmax(170px,.7fr);gap:10px;margin:18px 0}.quality-filters>*{min-width:0}.quality-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:18px}.quality-stat{display:flex;align-items:center;gap:11px;min-width:0;padding:16px;border:1px solid var(--border);border-radius:17px;background:#fff;box-shadow:var(--shadow-sm)}.quality-stat>span{display:grid;place-items:center;flex:0 0 42px;height:42px;border-radius:13px;background:#e8f2fb;color:#2f608f}.quality-stat--awaiting>span{background:#eee8fa;color:#7550a3}.quality-stat--rework>span{background:#fdeaea;color:#b64040}.quality-stat--approved>span{background:#e4f7ee;color:#19805a}.quality-stat strong,.quality-stat small{display:block}.quality-stat strong{font-size:1.25rem}.quality-stat small{margin-top:3px;color:var(--muted);font-size:.7rem}.quality-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.quality-card{display:grid;gap:14px;min-width:0;padding:18px;border:1px solid var(--border);border-radius:19px;background:#fff;color:var(--navy);text-decoration:none;box-shadow:var(--shadow-sm);transition:.2s}.quality-card:hover{transform:translateY(-2px);border-color:#bdd1df;box-shadow:0 14px 32px rgba(11,38,64,.09)}.quality-card__top,.quality-card__meta,.quality-card__progress>div,.quality-card__foot{display:flex;align-items:center;justify-content:space-between;gap:9px}.quality-card__icon{display:grid;place-items:center;width:43px;height:43px;border-radius:13px;background:#e7f6f0;color:#19805a}.quality-card h3,.quality-card p{margin:4px 0}.quality-card p,.quality-card small{color:var(--muted);font-size:.72rem}.quality-card__meta{align-items:flex-start;flex-wrap:wrap}.quality-card__meta span{display:flex;align-items:center;gap:5px;font-size:.7rem}.quality-card__progress progress{display:block;width:100%;height:8px;margin-top:7px;accent-color:#198c72}.quality-card__progress b{color:#19805a}.quality-card__foot{padding-top:12px;border-top:1px solid var(--border);font-size:.72rem}.quality-card__foot span,.quality-card__foot strong{display:flex;align-items:center;gap:5px}.quality-card__foot strong{color:#2f608f}.quality-empty{margin-top:15px}.quality-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px;padding:25px;border-radius:22px;background:linear-gradient(130deg,#0d2e4e,#15506b);color:#fff;box-shadow:0 17px 38px rgba(12,42,69,.17)}.quality-hero__main{display:flex;align-items:center;gap:14px;min-width:0}.quality-hero__icon{display:grid;place-items:center;flex:0 0 56px;height:56px;border-radius:17px;background:#e48d38;color:#fff}.quality-hero h2,.quality-hero p{margin:4px 0;color:#fff}.quality-hero small{color:#c8dae8}.quality-hero__status{display:grid;justify-items:end;gap:5px}.quality-hero__status strong{font-size:1.65rem}.quality-flow{margin-bottom:16px;border-color:#c9ded7;background:linear-gradient(180deg,#fff,#f7fbf9)}.quality-flow .panel__head>strong{padding:7px 11px;border-radius:999px;background:#e4f7ee;color:#19805a;font-size:.75rem}.quality-steps{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}.quality-step{position:relative;display:grid;justify-items:center;gap:7px;min-width:0;text-align:center}.quality-step:not(:last-child):after{position:absolute;z-index:0;inset-block-start:18px;inset-inline-start:calc(50% + 22px);width:calc(100% - 36px);height:2px;background:#dfe8e4;content:""}.quality-step>span{z-index:1;display:grid;place-items:center;width:36px;height:36px;border:2px solid #d8e4df;border-radius:50%;background:#fff;color:#7b8c85}.quality-step small{color:#71827b;font-size:.68rem;line-height:1.4}.quality-step.is-done>span{border-color:#45a779;background:#e5f7ee;color:#187a52}.quality-step.is-done:not(:last-child):after{background:#76c59f}.quality-step.is-current>span{border-color:#e28b3b;background:#e28b3b;color:#fff;box-shadow:0 0 0 5px rgba(226,139,59,.14)}.quality-step.is-current small{color:var(--navy);font-weight:900}.quality-primary-action{display:flex;justify-content:center;margin-top:20px}.quality-primary-action .btn{min-width:220px}.quality-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;align-items:start;gap:17px}.quality-main,.quality-side{display:grid;gap:17px;min-width:0}.quality-items{display:grid;gap:12px}.quality-item{overflow:hidden;border:1px solid var(--border);border-inline-start:4px solid #aebbc6;border-radius:16px;background:#fff;transition:.2s}.quality-item--pass{border-inline-start-color:#2b9b6c;background:#fbfffd}.quality-item--fail{border-inline-start-color:#d54b4b;background:#fffafa}.quality-item--na{border-inline-start-color:#7b8792}.quality-item>header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:11px;padding:14px 15px;background:#f8fafb}.quality-item__number{display:grid;place-items:center;width:37px;height:37px;border-radius:11px;background:#e7eef4;color:#2c587c;font-size:.72rem;font-weight:900}.quality-item h4{margin:1px 0 5px}.quality-item header small{display:flex;align-items:center;gap:5px;color:var(--muted)}.quality-result-mark{color:#81909c}.quality-item--pass .quality-result-mark{color:#209267}.quality-item--fail .quality-result-mark{color:#c84040}.quality-item__instructions{margin:0;padding:12px 15px 0;color:var(--muted);font-size:.76rem}.quality-item__fields{display:grid;grid-template-columns:minmax(150px,.32fr) minmax(0,1fr);gap:12px;padding:13px 15px}.quality-item__note p{margin:9px 0}.quality-item>footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 15px;border-top:1px solid var(--border);background:#fbfcfd}.quality-item>footer>span{display:flex;align-items:center;gap:5px;font-size:.7rem}.quality-checklist__actions,.quality-submit-form{display:flex;justify-content:flex-end;margin-top:15px}.quality-submit-form{padding-top:15px;border-top:1px solid var(--border)}.quality-submit-form .btn{min-width:220px}.btn--dark{background:var(--navy);color:#fff}.quality-files{display:grid;gap:9px}.quality-files article{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:12px;border:1px solid var(--border);border-radius:13px;background:#f8fafb}.quality-files article>span{display:grid;place-items:center;width:39px;height:39px;border-radius:11px;background:#e8f2fb;color:#2f608f}.quality-files article>div:last-child{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.quality-files strong,.quality-files small{display:block;overflow-wrap:anywhere}.quality-files small{margin-top:3px;color:var(--muted);font-size:.68rem}.quality-decision-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.quality-decision-options input{position:absolute;opacity:0}.quality-decision-options label{cursor:pointer}.quality-decision-options span{display:grid;justify-items:center;gap:8px;min-height:95px;padding:15px;border:2px solid var(--border);border-radius:14px;text-align:center}.quality-decision-options input:checked+span{border-color:#e28b3b;background:#fff7ed;color:#a85e19}.quality-timeline{display:grid}.quality-timeline article{display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;padding:11px 0;border-bottom:1px solid var(--border)}.quality-timeline article>span{display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:#e5f7ee;color:#19805a}.quality-timeline strong,.quality-timeline small{display:block}.quality-timeline small{margin-top:4px;color:var(--muted);font-size:.68rem}.text-danger{color:#b93d3d!important}
@media(max-width:1180px){.quality-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.quality-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.quality-layout{grid-template-columns:1fr}.quality-side{grid-template-columns:repeat(2,minmax(0,1fr))}.quality-side>section:last-child{grid-column:1/-1}}
@media(max-width:820px){.quality-filters{grid-template-columns:1fr}.quality-grid{grid-template-columns:1fr}.quality-steps{grid-template-columns:repeat(4,minmax(0,1fr));row-gap:15px}.quality-step:nth-child(4):after{display:none}.quality-item__fields{grid-template-columns:1fr}.quality-decision-options{grid-template-columns:1fr}.quality-hero{align-items:flex-start;flex-direction:column}.quality-hero__status{justify-items:start}.quality-side{grid-template-columns:1fr}.quality-side>section:last-child{grid-column:auto}}
@media(max-width:560px){.quality-stats{grid-template-columns:1fr}.quality-steps{grid-template-columns:1fr}.quality-step{grid-template-columns:38px minmax(0,1fr);justify-items:start;align-items:center;text-align:start}.quality-step:not(:last-child):after{inset-block-start:35px;inset-inline-start:17px;width:2px;height:calc(100% + 8px)}.quality-step small{font-size:.76rem}.quality-hero{padding:18px}.quality-hero__main{align-items:flex-start}.quality-hero__icon{flex-basis:46px;height:46px}.quality-item>header{grid-template-columns:auto minmax(0,1fr)}.quality-result-mark{grid-column:1/-1}.quality-item>footer{align-items:stretch;flex-direction:column}.quality-item>footer .btn,.quality-checklist__actions .btn,.quality-submit-form .btn,.quality-primary-action .btn{justify-content:center;width:100%;min-width:0}.quality-files article{grid-template-columns:auto minmax(0,1fr)}.quality-files article>div:last-child{grid-column:1/-1;justify-content:flex-end}}

/* بوابة المشروع: تباين واضح وحالة موعد نهائية لا تعرض إجراءات متعارضة */
.portal-project-hero__head small{color:#dce9f5}.portal-project-hero h1{margin:.35rem 0;color:#f8fbff!important;text-shadow:0 1px 1px rgba(0,0,0,.16)}.portal-project-hero__head p{margin:0;color:#cbdbe9;opacity:1}.portal-project-hero .portal-progress--hero,.portal-project-hero .portal-progress--hero span,.portal-project-hero .portal-progress--hero strong{color:#f8fbff}.portal-appointment-state{display:flex;align-items:flex-start;gap:8px;margin-top:10px;padding:10px 11px;border:1px solid #d6e5ee;border-radius:12px;background:#f2f7fa;color:#315d78;font-size:.72rem;line-height:1.65}.portal-appointment-state>svg{flex:0 0 18px;margin-top:1px}.portal-appointment-state--confirmed,.portal-appointment-state--completed{border-color:#cce7da;background:#eef9f3;color:#237254}.portal-appointment-state--rescheduled{border-color:#f0d1ad;background:#fff8ef;color:#81501f}.portal-appointment-state--cancelled,.portal-appointment-state--no_show{border-color:#efd0d0;background:#fff5f5;color:#9b4141}.portal-appointment-actions .btn{min-height:38px}.portal-appointment-actions form{margin:0}
@media(max-width:560px){.portal-project-hero{padding:19px}.portal-project-hero h1{font-size:1.65rem}.portal-appointments article{padding:13px}.portal-appointment-actions{display:grid;grid-template-columns:1fr}.portal-appointment-actions form,.portal-appointment-actions .btn{width:100%}.portal-appointment-actions .btn{justify-content:center}}
