/* ==========================================================================
   Notch — redesign v2 ("Clarity")
   Loaded AFTER app.css. Same class names, new language: cool neutral canvas,
   white elevated cards with generous radii, one confident brand red, quiet
   typography (no mono/uppercase labels), soft shadows, and a real dark mode.
   Per-company brand colour still flows through --company.
   ========================================================================== */

:root {
    --ink:        #F4F5F9;
    --surface:    #FFFFFF;
    --surface-2:  #F1F3F8;
    --surface-3:  #E7EAF2;
    --line:       #E3E6EE;
    --line-soft:  #EDEFF5;
    --text:       #12141D;
    --text-muted: #566077;
    --text-dim:   #8991A5;
    --red:        #C8102E;
    --red-bright: #D81B3C;
    --gold:       #D97706;
    --gold-soft:  #F0A53A;
    --ok:         #128A5B;
    --warn:       #D97706;
    --info:       #2563EB;
    --company:    var(--red);

    --radius:     16px;
    --radius-md:  12px;
    --radius-sm:  10px;
    --shell:      1280px;
    --shadow-card: 0 1px 2px rgba(18,20,29,.04), 0 8px 24px -8px rgba(18,20,29,.08);
    --shadow-pop:  0 2px 6px rgba(18,20,29,.06), 0 18px 40px -12px rgba(18,20,29,.18);

    --font: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "Cairo", system-ui, sans-serif;
}

[data-theme="dark"] {
    --ink:        #0B0D13;
    --surface:    #12151D;
    --surface-2:  #181C26;
    --surface-3:  #20252F;
    --line:       #262B37;
    --line-soft:  #1C2029;
    --text:       #ECEEF4;
    --text-muted: #A4ABBD;
    --text-dim:   #6F7790;
    --red:        #E5304F;
    --red-bright: #FF5C77;
    --gold:       #F0A53A;
    --gold-soft:  #F5BE6B;
    --ok:         #2FBF86;
    --warn:       #F0A53A;
    --info:       #5B93F5;
    --shadow-card: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px -10px rgba(0,0,0,.5);
    --shadow-pop:  0 2px 6px rgba(0,0,0,.4), 0 22px 44px -12px rgba(0,0,0,.6);
}

body { font-size: 15px; line-height: 1.7; background: var(--ink); }
::selection { background: color-mix(in srgb, var(--company) 22%, transparent); }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--company) 70%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---- top bar ------------------------------------------------------------ */
.topbar {
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(16px);
    -webkit-backdrop-filter: saturate(1.4) blur(16px);
    border-bottom: 1px solid var(--line);
}
.topbar::after { display: none; }
.topbar__inner { height: 62px; gap: var(--s4); }
.brand { font-weight: 800; font-size: 16px; letter-spacing: -.01em; gap: 10px; }
.brand__mark {
    width: 32px; height: 32px; border-radius: 10px;
    background: linear-gradient(145deg, var(--company), color-mix(in srgb, var(--company) 55%, #000));
    font-family: var(--font); font-size: 13px; font-weight: 800;
    box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--company) 70%, transparent);
}
.crumb { font-family: var(--font); font-size: 13.5px; letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.crumb__here { color: var(--text); font-weight: 700; }
.crumb__dot { width: 8px; height: 8px; border-radius: 50%; }
.navlink {
    font-family: var(--font); font-size: 13.5px; font-weight: 600; letter-spacing: 0;
    padding: 8px 12px; border-radius: 10px; border: 0; background: none; cursor: pointer;
}
.navlink:hover { background: var(--surface-2); color: var(--text); }
.usermenu { border-inline-start: 1px solid var(--line); }
.usermenu__name { font-family: var(--font); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--text-muted); font-weight: 600; }
.avatar { width: 34px; height: 34px; background: color-mix(in srgb, var(--company) 12%, var(--surface-2)); border-color: transparent; color: var(--company); font-weight: 800; }
.theme-toggle { border-radius: 10px; }
.navdrop__menu { border-radius: 14px; box-shadow: var(--shadow-pop); border: 1px solid var(--line); padding: 6px; background: var(--surface); }
.navdrop__menu a { border-radius: 8px; }
.navdrop__menu a:hover { background: var(--surface-2); }

main { padding: var(--s6) 0 64px; }

/* ---- sidebar ------------------------------------------------------------ */
.worknav { width: 264px; padding: var(--s4) var(--s3) var(--s6); background: var(--surface); border-inline-end: 1px solid var(--line); top: 62px; height: calc(100vh - 62px); }
.worknav__head { border-bottom: 0; padding: var(--s2) var(--s2) var(--s3); margin-bottom: 0; }
.worknav__head-link { padding: 8px; margin: 0; border-radius: 12px; background: var(--surface-2); }
.worknav__head-link:hover { background: var(--surface-3); }
.worknav__chip { width: 34px; height: 34px; border-radius: 10px; font-size: 12.5px; }
.worknav__logo { width: 34px; height: 34px; }
.worknav__company { font-size: 14.5px; }
.worknav__section { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: none; padding: var(--s5) var(--s3) var(--s2); color: var(--text-dim); }
.worknav__item { border-radius: 10px; padding: 10px var(--s3); font-weight: 600; font-size: 14px; }
.worknav__item:hover { background: var(--surface-2); }
.worknav__item.is-active { background: color-mix(in srgb, var(--company) 10%, transparent); color: var(--company); font-weight: 700; }
.worknav__item.is-active::before { inset-block: 9px; width: 3px; border-radius: 3px; inset-inline-start: -2px; }
.worknav__item svg { opacity: .8; }
.worknav__sub { border-inline-start: 1.5px solid var(--line); margin-inline-start: 18px; }
.worknav__link { border-radius: 8px; font-size: 13px; }
.worknav__link.is-active { background: color-mix(in srgb, var(--company) 9%, transparent); }
.worklayout__main > .shell { padding-inline: 32px; padding-top: var(--s5); }
@media (max-width: 900px) {
    .worknav { top: 0; height: 100vh; }
    .worklayout__main > .shell { padding-inline: var(--s4); }
}

/* ---- headings ----------------------------------------------------------- */
.eyebrow, .mhead__eyebrow {
    font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: none;
    color: var(--company); margin-bottom: 6px;
}
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { font-size: 15px; }

.mhead { border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-card); margin-bottom: var(--s5); }
.mhead::before { height: 100%; width: 4px; inset-inline-end: auto; inset-inline-start: 0; background: linear-gradient(180deg, var(--company), color-mix(in srgb, var(--company) 30%, transparent)); }
.mhead__id { padding: 22px 26px; }
.mhead__icon { width: 50px; height: 50px; border-radius: 14px; background: color-mix(in srgb, var(--company, var(--red)) 11%, transparent); border: 0; }
.mhead__title { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.mhead__tag { font-size: 13.5px; }

/* ---- cards / panels ----------------------------------------------------- */
.panel { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-card); padding: 24px; }
.panel__head h2, .panel h3 { font-weight: 800; letter-spacing: -.01em; }

/* ---- company cards ------------------------------------------------------ */
.plates { gap: 18px; }
.plate { border-radius: 20px; padding: 26px 26px 20px; border-color: var(--line); overflow: hidden; }
.plate::before { height: 100%; width: 100%; inset: 0; opacity: 0; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--company) 10%, transparent), transparent 60%); border-radius: 0; }
.plate:hover, .plate:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--company) 35%, var(--line)); }
.plate > * { position: relative; }
.plate__logo { margin-bottom: 22px; }
.plate__wordmark { font-family: var(--font); font-weight: 800; font-size: 20px; }
.plate__name { font-size: 17px; font-weight: 800; }
.plate__foot { border-top: 1px solid var(--line-soft); margin-top: 18px; padding-top: 14px; font-family: var(--font); font-size: 12.5px; color: var(--text-dim); display: flex; justify-content: space-between; }

/* ---- module tiles ------------------------------------------------------- */
.tile { border-radius: 18px; border-color: var(--line); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--company) 30%, var(--line)); }

/* ---- tables ------------------------------------------------------------- */
.table { font-size: 14px; }
.table th {
    font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none;
    color: var(--text-dim); background: var(--surface-2); padding: 12px var(--s3); border-bottom: 1px solid var(--line);
}
.table th:first-child { border-start-start-radius: 10px; }
.table th:last-child { border-start-end-radius: 10px; }
.panel--flush .table th { border-radius: 0; }
.table td { padding: 14px var(--s3); border-bottom: 1px solid var(--line-soft); }
.table--hover tbody tr:hover { background: color-mix(in srgb, var(--company) 5%, var(--surface)); }
.cell-sub { font-family: var(--font); font-size: 12.5px; }
.panel--flush { border-radius: var(--radius); }

/* ---- badges ------------------------------------------------------------- */
.tag { border-radius: 999px; padding: 3px 11px; font-family: var(--font); font-size: 12px; font-weight: 600; background: var(--surface-2); border-color: transparent; }
.status-badge { border-radius: 999px; font-family: var(--font); font-weight: 700; }
.pill { font-weight: 700; }

/* ---- forms -------------------------------------------------------------- */
.field label { font-family: var(--font); font-size: 13px; font-weight: 700; letter-spacing: 0; color: var(--text); margin-bottom: 8px; }
.input {
    padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
    font-size: 14.5px; transition: border-color .15s ease, box-shadow .15s ease;
}
.input:hover { border-color: color-mix(in srgb, var(--text-dim) 55%, var(--line)); }
.input:focus { border-color: var(--company); box-shadow: 0 0 0 4px color-mix(in srgb, var(--company) 14%, transparent); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238991A5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-inline-end: 14px; padding-inline-start: 14px; }
html[dir="rtl"] select.input { background-position: left 14px center; padding-left: 36px; }
html[dir="ltr"] select.input { background-position: right 14px center; padding-right: 36px; }
.field__hint { font-size: 12.5px; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
    padding: 11px 20px; border-radius: 12px; font-size: 14px; font-weight: 700;
    background: var(--company); border: 0;
    box-shadow: 0 1px 2px rgba(18,20,29,.12), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn:hover { filter: none; background: color-mix(in srgb, var(--company) 88%, #000); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--company) 70%, transparent); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: var(--surface); border: 1.5px solid var(--line); color: var(--text); box-shadow: none; }
.btn--ghost:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text-dim) 45%, var(--line)); box-shadow: none; }
.btn--sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.linkbtn { font-weight: 600; }

/* ---- flash / empty / pagination ---------------------------------------- */
.flash { border-radius: 14px; border: 1px solid var(--line); border-inline-start-width: 4px; background: var(--surface); box-shadow: var(--shadow-card); padding: 14px 18px; }
.flash--success { color: var(--ok); }
.flash--error { color: var(--red-bright); }
.empty { border-radius: 20px; background: var(--surface); border: 1.5px dashed var(--line); padding: 56px var(--s5); }
.empty__icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--company) 10%, transparent); color: var(--company); }
.pagination a, .pagination span { border-radius: 10px; }

/* ---- KPIs --------------------------------------------------------------- */
.dash__kpi { border-radius: 18px; box-shadow: var(--shadow-card); border: 1px solid var(--line); }
.dash__kpi-value { font-weight: 800; letter-spacing: -.02em; }
.dash__kpi-label { font-family: var(--font); letter-spacing: 0; text-transform: none; font-size: 12.5px; font-weight: 700; }

/* ---- auth --------------------------------------------------------------- */
.auth:has(.authx) { display: block; padding: 0; }
.auth__card { border-radius: 22px; max-width: 420px; padding: 36px 32px; box-shadow: var(--shadow-pop); }
.auth__head h1 { font-size: 22px; font-weight: 800; }
.auth__foot { font-family: var(--font); letter-spacing: .04em; }

.authx { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.authx__side {
    position: relative; overflow: hidden; color: #fff; padding: 56px 56px 48px;
    display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(70% 60% at 90% 0%, rgba(255,255,255,.18), transparent 60%),
        radial-gradient(60% 50% at 0% 100%, rgba(0,0,0,.35), transparent 60%),
        linear-gradient(150deg, #E0203F 0%, #C8102E 45%, #7D0A1D 100%);
}
.authx__side::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); pointer-events: none; }
.authx__side > * { position: relative; z-index: 1; }
.authx__brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; }
.authx__brand .brand__mark { background: rgba(255,255,255,.18); box-shadow: none; backdrop-filter: blur(6px); }
.authx__pitch h2 { font-size: clamp(28px, 3.2vw, 42px); font-weight: 800; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 14px; }
.authx__pitch p { color: rgba(255,255,255,.82); font-size: 16.5px; max-width: 44ch; margin: 0; }
.authx__points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.authx__points li { display: flex; align-items: center; gap: 10px; font-weight: 600; color: rgba(255,255,255,.92); }
.authx__points li::before { content: ""; width: 22px; height: 22px; flex: none; border-radius: 50%; background: rgba(255,255,255,.2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.5l2.5 2.5 4.5-5'/%3E%3C/svg%3E") center no-repeat; }
.authx__legal { font-size: 12.5px; color: rgba(255,255,255,.6); }
.authx__main { display: grid; place-items: center; padding: 40px 24px; position: relative; }
.authx__form { width: 100%; max-width: 400px; }
.authx__form h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.authx__form > p { color: var(--text-muted); margin: 0 0 28px; }
.authx__links { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: 13.5px; color: var(--text-muted); }
.authx__links a { color: var(--company); font-weight: 700; }
.authx__links a:hover { text-decoration: underline; }
.authx__back { position: absolute; inset-block-start: 22px; inset-inline-start: 24px; font-size: 13.5px; font-weight: 700; color: var(--text-muted); }
.authx__back:hover { color: var(--text); }
@media (max-width: 900px) {
    .authx { grid-template-columns: 1fr; }
    .authx__side { padding: 28px 24px; gap: 20px; }
    .authx__pitch, .authx__points, .authx__legal { display: none; }
}

#lang-toggle { border-radius: 10px !important; }

/* ---- neutralise the older `.app-body` (pv3) skin in app.css -------------- */
.app-body .topbar { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-bottom: 1px solid var(--line); }
.app-body .brand__mark { background: linear-gradient(145deg, var(--company), color-mix(in srgb, var(--company) 55%, #000)); color: #fff; border-radius: 10px; font-family: var(--font); font-weight: 800; }
.app-body .crumb__root, .app-body .brand { color: var(--text); }
.app-body .crumb { color: var(--text-dim); }
.app-body .crumb__here { color: var(--text); }
.app-body .navlink, .app-body .usermenu__name, .app-body .theme-toggle { color: var(--text-muted); }
.app-body .theme-toggle:hover, .app-body .navlink:hover { color: var(--text); }
.app-body .worknav { background: var(--surface); border-inline-end-color: var(--line); }
.app-body .worknav__head { border-bottom: 0; }
.app-body .worknav__item:hover { background: var(--surface-2); }
.app-body .worknav__item.is-active { background: color-mix(in srgb, var(--company) 10%, transparent); }
.app-body .page-head { border-bottom: 0; padding-bottom: 0; }
.app-body .eyebrow { font-family: var(--font); }
.app-body .plate { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.app-body .plate:hover, .app-body .plate:focus-visible { box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--company) 35%, var(--line)); transform: translateY(-4px); }
.app-body .plate__foot { border-top-color: var(--line-soft); }
.app-body .empty { border-color: var(--line); }

/* error pages */
.errorpage__code { font-family: var(--font); font-weight: 800; color: var(--company); letter-spacing: -.03em; }

[hidden] { display: none !important; }
