/* ==========================================================================
   Safa Client Portal - layout & components
   Brand colours + site typography (pingAR) applied to the new portal design.
   Scope: everything is namespaced under .safa-portal / .sp-* / .safa-auth
   ========================================================================== */

:root {
    /* bronze ramp - mapped onto the Safa brand palette */
    --sp-bronze-300: #E7CFBC;
    --sp-bronze-400: #D29E7E;
    --sp-bronze-450: #C38A67;
    --sp-bronze-500: #A87758;
    --sp-bronze-600: #8F6449;
    --sp-bronze-700: #6F4C36;
    --sp-bronze-tint: #F7EFE9;
    --sp-bronze-tint-bd: #EBD6C4;

    /* neutrals */
    --sp-white: #FFFFFF;
    --sp-grey-50: #F4F5F5;
    --sp-grey-75: #ECEDEF;
    --sp-grey-100: #E9EAEC;
    --sp-grey-200: #C9CCD0;
    --sp-grey-300: #B4B6B8;
    --sp-grey-400: #808285;
    --sp-grey-600: #4D5356;
    --sp-grey-800: #383D40;
    --sp-grey-900: #313537;
    --sp-grey-950: #1D1F20;

    --sp-line: #DCDEE1;
    --sp-line-soft: #E9EAEC;

    --sp-ink: #1D1F20;
    --sp-ink-2: #4D5356;
    --sp-muted: #6B7280;
    --sp-faint: #9DA1A8;

    --sp-on-dark: #EDEAE6;
    --sp-on-dark-2: #B9BDC4;

    --sp-ok-bg: #EAF3E9;
    --sp-ok-fg: #4E7D49;
    --sp-ok-bd: #B7D4B3;
    --sp-danger-bg: #F7EAE8;
    --sp-danger-fg: #A4443C;

    --sp-dark: linear-gradient(150deg, #4D5356 0%, #383D40 48%, #1D1F20 100%);
    --sp-card-bg: rgba(255, 255, 255, .88);
    --sp-card-sh: 0 14px 34px -20px rgba(23, 25, 27, .30), inset 0 1px 0 #fff;

    --sp-r-card: 16px;
    --sp-r-tile: 12px;
    --sp-r-pill: 999px;
}

/* --------------------------------------------------------------- page ---- */
.safa-portal {
    font-family: var(--font-Family-Light), sans-serif;
    color: var(--sp-ink);
    line-height: 1.6;
    background-color: var(--sp-grey-100);
    background-image:
        radial-gradient(rgba(35, 38, 41, .06) 1px, transparent 1.3px),
        radial-gradient(52% 42% at 74% 0%, rgba(210, 158, 126, .16), transparent 70%),
        linear-gradient(165deg, #F3F4F4 0%, #E9EAEC 50%, #ECEDEF 100%);
    background-size: 22px 22px, cover, cover;
    background-attachment: fixed;
    /* clears the site's absolutely positioned navbar (top:20px + ~78px tall) */
    padding-top: 118px;
    padding-bottom: 46px;
    min-height: 60vh;
}

.safa-portal a { text-decoration: none; }

.sp-wrap {
    display: grid;
    grid-template-columns: 285px minmax(0, 1fr);
    gap: 26px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 26px 24px;
}

.sp-side {
    position: sticky;
    top: 24px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.sp-main { min-width: 0; animation: spFade .5s cubic-bezier(.32, .72, 0, 1); }

@keyframes spFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ sidebar ---- */
.sp-usercard {
    background: var(--sp-dark);
    color: var(--sp-on-dark);
    border-radius: var(--sp-r-card);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px -26px rgba(15, 30, 45, .45), inset 0 1px 0 rgba(255, 255, 255, .10);
}
.sp-usercard::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(210, 158, 126, .55), transparent);
}
.sp-usercard::after {
    content: "";
    position: absolute; width: 180px; height: 180px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(210, 158, 126, .26), transparent 70%);
    bottom: -70px; inset-inline-start: -50px; pointer-events: none;
}
.sp-u-top { display: flex; align-items: center; gap: 12px; position: relative; }
.sp-avatar {
    width: 56px; height: 56px; border-radius: 50%; flex: none; overflow: hidden;
    background: linear-gradient(140deg, var(--sp-bronze-500), var(--sp-bronze-700));
    color: #FFF2E6; display: grid; place-items: center;
    font-size: 22px; font-weight: 700;
    box-shadow: 0 0 16px rgba(168, 119, 88, .45);
}
.sp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-u-id { flex: 1; min-width: 0; }
.sp-u-name {
    font-weight: 700; font-size: 15.5px; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-u-role {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
    background: rgba(168, 119, 88, .32); color: #E7CFBC;
    padding: 2px 12px; border-radius: var(--sp-r-pill); margin-top: 4px;
}
.sp-u-meta {
    display: flex; flex-direction: column; gap: 8px; position: relative;
    border-top: 1px solid rgba(255, 255, 255, .10); padding-top: 12px;
}
.sp-u-meta > div {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px;
}
.sp-u-meta span { color: var(--sp-on-dark-2); flex: none; }
.sp-u-meta b {
    color: var(--sp-on-dark); font-weight: 700; direction: ltr; unicode-bidi: embed;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}

.sp-nav {
    background: var(--sp-card-bg);
    backdrop-filter: blur(14px);
    border: 1px solid var(--sp-line);
    box-shadow: var(--sp-card-sh);
    border-radius: var(--sp-r-card);
    padding: 10px;
    display: flex; flex-direction: column; gap: 2px;
}
.sp-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--sp-r-tile);
    color: var(--sp-ink-2); font-weight: 700; font-size: 15px;
    transition: background .2s ease, color .2s ease;
}
.sp-nav a svg { flex: none; }
.sp-nav a:hover { background: var(--sp-grey-50); color: var(--sp-bronze-600); }
.sp-nav a.active {
    background: linear-gradient(140deg, var(--sp-bronze-500), var(--sp-bronze-700));
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(168, 119, 88, .85);
}
.sp-nav a.active:hover { color: #fff; }
.sp-nav a.sp-logout { color: var(--sp-danger-fg); }
.sp-nav a.sp-logout:hover { background: var(--sp-danger-bg); color: var(--sp-danger-fg); }
.sp-nav-sep { height: 1px; background: var(--sp-line-soft); margin: 8px 10px; }

.sp-help {
    background: var(--sp-bronze-tint);
    border: 1px solid var(--sp-bronze-tint-bd);
    border-radius: var(--sp-r-card);
    padding: 18px; font-size: 13.5px; color: var(--sp-ink-2);
}
.sp-help strong { display: block; color: var(--sp-ink); font-size: 15px; margin-bottom: 4px; }
.sp-help a { color: var(--sp-bronze-600); font-weight: 700; display: inline-block; margin-top: 8px; direction: ltr; }

/* --------------------------------------------------------- page header ---- */
.sp-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.sp-crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--sp-faint); margin-bottom: 6px; }
.sp-crumbs a { color: var(--sp-faint); }
.sp-crumbs a:hover { color: var(--sp-bronze-600); }
.sp-head h1 { font-size: 28px; font-weight: 700; line-height: 1.25; margin: 0; color: var(--sp-ink); }
.sp-head h1 small { font-size: 17px; font-weight: 400; color: var(--sp-muted); margin-inline-end: 8px; }
.sp-head p { color: var(--sp-muted); font-size: 15px; margin: 4px 0 0; }
.sp-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* -------------------------------------------------------------- cards ---- */
.sp-card {
    background: var(--sp-card-bg);
    backdrop-filter: blur(14px);
    border: 1px solid var(--sp-line);
    box-shadow: var(--sp-card-sh);
    border-radius: var(--sp-r-card);
    padding: 22px;
}
.sp-stack { display: flex; flex-direction: column; gap: 16px; }

.sp-title {
    font-size: 17px; font-weight: 700; color: var(--sp-ink);
    margin: 0 0 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.sp-title::before {
    content: ""; width: 4px; height: 18px; border-radius: 2px;
    background: var(--sp-bronze-500); flex: none;
}
.sp-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sp-title-row .sp-title { margin: 0; }

/* -------------------------------------------------------------- stats ---- */
.sp-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px; margin-bottom: 22px;
}
.sp-stat {
    background: var(--sp-card-bg); backdrop-filter: blur(14px);
    border: 1px solid var(--sp-line); box-shadow: var(--sp-card-sh);
    border-radius: var(--sp-r-card); padding: 18px 20px;
    display: flex; align-items: center; gap: 14px;
}
.sp-stat-ic {
    width: 46px; height: 46px; border-radius: var(--sp-r-tile); flex: none;
    display: grid; place-items: center;
    background: var(--sp-bronze-tint); color: var(--sp-bronze-600);
}
.sp-stat-ic.ok { background: var(--sp-ok-bg); color: var(--sp-ok-fg); }
.sp-stat-ic.neutral { background: var(--sp-grey-75); color: var(--sp-ink-2); }
.sp-stat-v { font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--sp-ink); }
.sp-stat-v small { font-size: 13px; font-weight: 400; color: var(--sp-faint); }
.sp-stat-v img { width: 15px; height: auto; }
.sp-stat-l { font-size: 13.5px; color: var(--sp-muted); }
.sp-stat.dark {
    background: var(--sp-dark); border-color: rgba(255, 255, 255, .10); color: var(--sp-on-dark);
}
.sp-stat.dark .sp-stat-ic { background: rgba(168, 119, 88, .28); color: #E7CFBC; }
.sp-stat.dark .sp-stat-v { color: var(--sp-on-dark); }
.sp-stat.dark .sp-stat-v img { filter: invert(1) brightness(1.6); }
.sp-stat.dark .sp-stat-v small,
.sp-stat.dark .sp-stat-l { color: var(--sp-on-dark-2); }

/* ------------------------------------------------------------ toolbar ---- */
.sp-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.sp-search {
    flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid var(--sp-line);
    border-radius: var(--sp-r-pill); padding: 9px 18px; margin: 0;
}
.sp-search svg { color: var(--sp-faint); flex: none; }
.sp-search input {
    border: none; outline: none; flex: 1; min-width: 0;
    font-size: 15px; background: transparent; font-family: inherit; color: var(--sp-ink);
}
.sp-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-filters button {
    font-family: inherit; cursor: pointer;
    padding: 8px 18px; border-radius: var(--sp-r-pill);
    border: 1px solid var(--sp-line); background: #fff;
    color: var(--sp-ink-2); font-size: 13.5px; font-weight: 700;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.sp-filters button:hover { color: var(--sp-bronze-600); border-color: var(--sp-bronze-300); }
.sp-filters button.active {
    background: var(--sp-grey-950); border-color: var(--sp-grey-950); color: #fff;
}

/* ------------------------------------------------------------- badges ---- */
.sp-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 700; padding: 4px 12px;
    border-radius: var(--sp-r-pill);
    background: var(--sp-grey-75); color: var(--sp-ink-2);
}
.sp-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.sp-badge.ok { background: var(--sp-ok-bg); color: var(--sp-ok-fg); border: 1px solid var(--sp-ok-bd); }
.sp-badge.danger { background: var(--sp-danger-bg); color: var(--sp-danger-fg); }
.sp-badge.bronze { background: var(--sp-bronze-tint); color: var(--sp-bronze-600); }

.sp-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--sp-grey-75); color: var(--sp-ink-2);
    font-size: 13px; padding: 5px 12px; border-radius: var(--sp-r-pill);
}
.sp-chip svg { flex: none; }
.sp-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.sp-mono { direction: ltr; unicode-bidi: embed; font-family: ui-monospace, monospace; }
.sp-ltr { direction: ltr; unicode-bidi: embed; }

/* ------------------------------------------------------------ buttons ---- */
.sp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 22px; border-radius: var(--sp-r-pill);
    font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1.4;
    border: 1.5px solid var(--sp-grey-200); background: #fff; color: var(--sp-grey-600);
    cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease;
    text-align: center;
}
.sp-btn:hover { background: var(--sp-grey-100); color: var(--sp-grey-800); }
.sp-btn svg { flex: none; }
.sp-btn img { width: 14px; height: auto; }
.sp-btn:disabled { opacity: .6; cursor: default; }
.sp-btn-primary { background: var(--sp-bronze-500); border-color: var(--sp-bronze-500); color: #fff; }
.sp-btn-primary:hover { background: var(--sp-bronze-600); border-color: var(--sp-bronze-600); color: #fff; }
.sp-btn-primary img { filter: invert(1) brightness(2); }
.sp-btn-dark { background: var(--sp-grey-950); border-color: var(--sp-grey-950); color: #fff; }
.sp-btn-dark:hover { background: var(--sp-grey-800); border-color: var(--sp-grey-800); color: #fff; }
.sp-btn-dark img { filter: invert(1) brightness(2); }
.sp-btn-lg { padding: 11px 30px; font-size: 15px; }
.sp-btn-sm { padding: 7px 16px; font-size: 13px; }
.sp-btn-block { width: 100%; }
.sp-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sp-link { color: var(--sp-bronze-600); font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.sp-link:hover { color: var(--sp-bronze-700); }

/* --------------------------------------------------------- list items ---- */
.sp-item {
    background: var(--sp-card-bg); backdrop-filter: blur(14px);
    border: 1px solid var(--sp-line); box-shadow: var(--sp-card-sh);
    border-radius: var(--sp-r-card); padding: 22px;
    display: flex; flex-direction: column; gap: 16px;
    transition: box-shadow .22s ease;
}
.sp-item:hover { box-shadow: 0 16px 36px -14px rgba(23, 25, 27, .22); }
.sp-item-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-item-no { font-size: 20px; font-weight: 700; color: var(--sp-ink); }
.sp-item-no span { color: var(--sp-faint); font-weight: 400; font-size: 14px; margin-inline-end: 6px; }
.sp-item-no a { color: inherit; }
.sp-item-no a:hover { color: var(--sp-bronze-600); }
.sp-item-date {
    margin-inline-start: auto; font-size: 13.5px; color: var(--sp-faint);
    display: inline-flex; align-items: center; gap: 6px;
}
.sp-item-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding-top: 16px; border-top: 1px dashed var(--sp-line); flex-wrap: wrap;
}
.sp-money {
    font-weight: 700; font-size: 20px; color: var(--sp-ink);
    display: inline-flex; align-items: center; gap: 5px; direction: ltr; unicode-bidi: embed;
}
.sp-money small { font-size: 12.5px; font-weight: 400; color: var(--sp-faint); }
.sp-money img { width: 14px; height: auto; }

/* --------------------------------------------------------------- steps --- */
.sp-steps {
    display: flex; align-items: flex-start; overflow-x: auto;
    padding: 4px 0 8px; gap: 0;
}
.sp-step {
    position: relative; flex: 1 0 96px; min-width: 96px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center; font-size: 12px; line-height: 1.35; color: var(--sp-faint);
    padding: 0 2px;
}
.sp-step::before {
    content: ""; position: absolute; top: 14px; height: 2px; width: 100%;
    inset-inline-end: 50%; background: #D8E1E8; z-index: 0;
}
.sp-step:first-child::before { display: none; }
.sp-step.done::before, .sp-step.current::before { background: var(--sp-bronze-400); }
.sp-pin {
    position: relative; z-index: 1; flex: none;
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: #fff; border: 2px solid #D8E1E8; color: var(--sp-faint);
    font-size: 12px; font-weight: 700;
}
.sp-step.done .sp-pin {
    background: linear-gradient(140deg, var(--sp-bronze-500), var(--sp-bronze-700));
    border-color: transparent; color: #FFF2E6;
}
.sp-step.current .sp-pin {
    border-color: var(--sp-bronze-450); color: var(--sp-bronze-600); background: #fff;
    box-shadow: 0 0 0 6px rgba(168, 119, 88, .15);
}
.sp-step.done .sp-step-l, .sp-step.current .sp-step-l { color: var(--sp-ink); font-weight: 700; }

/* ---------------------------------------------------------------- data --- */
.sp-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; }
.sp-dl > div {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--sp-line-soft); font-size: 15px;
}
.sp-dl dt { color: var(--sp-muted); margin: 0; font-weight: 400; flex: none; }
.sp-dl dd { font-weight: 700; margin: 0; color: var(--sp-ink); text-align: end; min-width: 0; word-break: break-word; }
.sp-dl dd img { width: 13px; height: auto; }

.sp-note {
    background: var(--sp-grey-50); border-radius: var(--sp-r-tile);
    padding: 16px; margin-top: 18px; font-size: 15px; line-height: 1.7; color: var(--sp-ink);
}
.sp-note strong { display: block; color: var(--sp-muted); font-size: 13px; font-weight: 400; margin-bottom: 2px; }

.sp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.sp-tile {
    background: var(--sp-grey-50); border-radius: var(--sp-r-tile); padding: 14px 16px;
    display: flex; flex-direction: column; gap: 4px; justify-content: center;
    /* keep both lines hugging the inline start of the (RTL or LTR) tile */
    align-items: flex-start;
}
.sp-tile-l { font-size: 13px; color: var(--sp-muted); }
.sp-tile-v {
    font-size: 19px; font-weight: 700; color: var(--sp-ink); line-height: 1.25;
    direction: ltr; unicode-bidi: embed;
    display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap;
}
.sp-tile-v small { font-size: 12px; font-weight: 400; color: var(--sp-faint); }
.sp-tile-v img { width: 13px; height: auto; }
.sp-tile.accent .sp-tile-v { color: var(--sp-bronze-600); }
.sp-tile.dark { background: var(--sp-dark); color: var(--sp-on-dark); }
.sp-tile.dark .sp-tile-l { color: var(--sp-on-dark-2); }
.sp-tile.dark .sp-tile-v { color: var(--sp-on-dark); }
.sp-tile.dark .sp-tile-v small { color: var(--sp-on-dark-2); }
.sp-tile.dark .sp-tile-v img { filter: invert(1) brightness(1.6); }

.sp-bar { height: 8px; border-radius: var(--sp-r-pill); background: #E1E4E7; overflow: hidden; }
.sp-bar span {
    display: block; height: 100%; border-radius: var(--sp-r-pill);
    background: linear-gradient(90deg, var(--sp-bronze-500), var(--sp-bronze-400));
}
.sp-bar-note { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: 14px; color: var(--sp-ink-2); margin-top: 12px; }
.sp-bar-note img { width: 12px; height: auto; }

/* --------------------------------------------------------- due / dark ---- */
.sp-due {
    background: var(--sp-dark); color: var(--sp-on-dark);
    border-radius: var(--sp-r-card); padding: 22px; position: relative; overflow: hidden;
    box-shadow: 0 20px 40px -26px rgba(15, 30, 45, .45), inset 0 1px 0 rgba(255, 255, 255, .10);
}
.sp-due::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(210, 158, 126, .55), transparent);
}
.sp-due-l { font-size: 13.5px; color: var(--sp-on-dark-2); position: relative; }
.sp-due-v {
    font-weight: 700; font-size: 32px; margin: 4px 0 14px; color: var(--sp-on-dark);
    direction: ltr; unicode-bidi: embed; display: inline-flex; align-items: center; gap: 6px; position: relative;
}
.sp-due-v img { width: 18px; height: auto; filter: invert(1) brightness(1.6); }
.sp-due .sp-btn, .sp-due .sp-invoices { position: relative; }
.sp-due-note { font-size: 12.5px; color: var(--sp-on-dark-2); margin: 10px 0 0; text-align: center; position: relative; }

/* --------------------------------------------------------------- docs ---- */
.sp-doc {
    display: flex; align-items: center; gap: 14px; padding: 15px 0;
    border-bottom: 1px solid var(--sp-line-soft); flex-wrap: wrap;
}
.sp-doc:last-child { border-bottom: none; padding-bottom: 0; }
.sp-doc-ic {
    width: 44px; height: 44px; border-radius: var(--sp-r-tile); flex: none;
    background: var(--sp-bronze-tint); color: var(--sp-bronze-600); display: grid; place-items: center;
}
.sp-doc-b { flex: 1; min-width: 180px; }
.sp-doc-t { font-size: 15px; font-weight: 700; color: var(--sp-ink); }
.sp-doc-d { font-size: 13px; color: var(--sp-muted); margin-top: 2px; }
.sp-doc-v {
    display: inline-flex; align-items: center; background: var(--sp-grey-75); color: var(--sp-ink-2);
    font-size: 13.5px; font-weight: 700; padding: 7px 18px; border-radius: var(--sp-r-pill);
    direction: ltr; unicode-bidi: embed; font-family: ui-monospace, monospace;
}
.sp-doc-v.empty { color: var(--sp-faint); }
.sp-upload input[type="file"] { display: none; }
.sp-upload { margin: 0; }

/* -------------------------------------------------------------- table ---- */
.sp-table-wrap { overflow-x: auto; border-radius: var(--sp-r-tile); border: 1px solid var(--sp-line); }
table.sp-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 720px; margin: 0; }
table.sp-table th {
    background: var(--sp-grey-50); color: var(--sp-ink-2); font-weight: 700; font-size: 13.5px;
    padding: 12px 16px; text-align: start; white-space: nowrap;
}
table.sp-table td { padding: 12px 16px; border-top: 1px solid var(--sp-line-soft); color: var(--sp-ink); vertical-align: middle; }
table.sp-table tfoot td { background: var(--sp-grey-50); font-weight: 700; border-top: 2px solid #D8E1E8; }
table.sp-table .num { direction: ltr; unicode-bidi: embed; font-weight: 700; white-space: nowrap; }
table.sp-table .num img { width: 12px; height: auto; }
table.sp-table .pct {
    display: inline-block; background: var(--sp-grey-75); padding: 3px 10px;
    border-radius: var(--sp-r-pill); font-size: 13px; font-weight: 700; direction: ltr;
}
table.sp-table a.dl { color: var(--sp-bronze-600); font-weight: 700; }
.sp-table-notes { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--sp-muted); margin-top: 12px; }

/* --------------------------------------------------------------- form ---- */
.sp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.sp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-field.full { grid-column: 1 / -1; }
.sp-field > label { font-size: 14px; font-weight: 700; color: var(--sp-ink-2); margin: 0; }
.sp-control {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--sp-grey-200); border-radius: var(--sp-r-tile);
    padding: 0 16px; height: 48px; background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.sp-control:focus-within { border-color: var(--sp-bronze-450); box-shadow: 0 0 0 3px rgba(168, 119, 88, .14); }
.sp-control input,
.sp-control select,
.sp-control textarea {
    border: none; outline: none; flex: 1; min-width: 0; height: 100%;
    font-size: 15px; background: transparent; font-family: inherit; color: var(--sp-ink);
}
.sp-control.disabled { background: var(--sp-grey-50); border-color: #D8E1E8; }
.sp-control.disabled input { color: var(--sp-faint); }
.sp-control .sp-prefix {
    font-size: 13px; color: var(--sp-faint); direction: ltr; flex: none;
    padding-inline-end: 10px; border-inline-end: 1px solid var(--sp-line-soft);
}
.sp-hint { font-size: 12.5px; color: var(--sp-faint); }
.sp-form-foot {
    display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px;
    padding-top: 22px; border-top: 1px solid var(--sp-line-soft);
}
.sp-control input[type=number]::-webkit-outer-spin-button,
.sp-control input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sp-control input[type=number] { -moz-appearance: textfield; }
.sp-control .iti { width: 100%; height: 100%; }
.sp-control .iti input { padding: 0; }

/* ------------------------------------------------------ profile header ---- */
.sp-profile-head {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--sp-line-soft);
}
.sp-avatar-lg {
    width: 88px; height: 88px; border-radius: 50%; flex: none; overflow: hidden;
    background: linear-gradient(140deg, var(--sp-bronze-500), var(--sp-bronze-700));
    color: #FFF2E6; display: grid; place-items: center; font-size: 32px; font-weight: 700;
    box-shadow: 0 0 16px rgba(168, 119, 88, .45);
}
.sp-avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-profile-b { flex: 1; min-width: 200px; }
.sp-profile-b h3 { font-size: 19px; font-weight: 700; margin: 0; color: var(--sp-ink); }
.sp-profile-b p { font-size: 14px; color: var(--sp-muted); margin: 0 0 10px; }

/* -------------------------------------------------------------- rating --- */
.sp-q { padding: 16px 0; border-bottom: 1px solid var(--sp-line-soft); }
.sp-q:last-of-type { border-bottom: none; }
.sp-q > p { font-size: 15px; font-weight: 700; color: var(--sp-ink); margin: 0 0 12px; }
.sp-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.sp-opt { position: relative; }
.sp-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.sp-opt span {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 9px 20px; border-radius: var(--sp-r-pill);
    border: 1.5px solid var(--sp-grey-200); background: #fff;
    color: var(--sp-ink-2); font-size: 14px; font-weight: 700;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.sp-opt span:hover { border-color: var(--sp-bronze-300); color: var(--sp-bronze-600); }
.sp-opt input:checked + span {
    background: var(--sp-bronze-500); border-color: var(--sp-bronze-500); color: #fff;
}
.sp-textarea {
    width: 100%; border: 1px solid var(--sp-grey-200); border-radius: var(--sp-r-tile);
    padding: 12px 16px; font-family: inherit; font-size: 15px; background: #fff;
    color: var(--sp-ink); min-height: 110px; resize: vertical;
}
.sp-textarea:focus { outline: none; border-color: var(--sp-bronze-450); box-shadow: 0 0 0 3px rgba(168, 119, 88, .14); }

/* --------------------------------------------------------------- misc ---- */
.sp-empty { text-align: center; padding: 34px 18px; }
.sp-empty img, .sp-empty svg { max-width: 190px; height: auto; }
.sp-empty p { color: var(--sp-muted); font-size: 15px; margin: 14px 0 18px; }
.sp-alert {
    border-radius: var(--sp-r-tile); padding: 12px 16px; font-size: 14px;
    margin-bottom: 16px; border: 1px solid transparent;
}
.sp-alert.err { background: var(--sp-danger-bg); color: var(--sp-danger-fg); border-color: #EBC9C4; }
.sp-alert.ok { background: var(--sp-ok-bg); color: var(--sp-ok-fg); border-color: var(--sp-ok-bd); }
.sp-alert ul { margin: 0; padding-inline-start: 18px; }
.sp-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.sp-timer {
    display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--sp-grey-50); border-radius: var(--sp-r-pill);
    padding: 8px 18px; font-size: 13px; color: var(--sp-ink-2);
}
.sp-timer .countdown { color: var(--sp-bronze-500); font-weight: 700; direction: ltr; }
.sp-invoices { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.sp-invoices a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border-radius: var(--sp-r-pill);
    background: var(--sp-grey-950); color: #fff; font-size: 13px; font-weight: 700;
}
.sp-invoices a:hover { background: var(--sp-grey-800); color: #fff; }
.sp-hidden { display: none !important; }
.sp-center { text-align: center; }

/* --------------------------------------------------------- responsive ---- */
@media (max-width: 1100px) {
    .sp-wrap { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .sp-side { position: static; }
    .sp-nav { flex-direction: row; overflow-x: auto; gap: 6px; }
    .sp-nav a { white-space: nowrap; }
    .sp-nav-sep { display: none; }
    .sp-help { display: none; }
    .sp-split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 991px) {
    /* the navbar becomes position:fixed below this width */
    .safa-portal { padding-top: 96px; }
    .safa-auth { padding-top: 96px; }
}

@media (max-width: 767px) {
    .sp-wrap { padding: 18px 14px; }
    .safa-portal { padding-bottom: 30px; }
    .sp-head h1 { font-size: 23px; }
    .sp-head h1 small { font-size: 15px; }
    .sp-head, .sp-head-actions { width: 100%; }
    .sp-head-actions .sp-btn { flex: 1; }
    .sp-card, .sp-item { padding: 16px; }
    .sp-dl { grid-template-columns: minmax(0, 1fr); }
    .sp-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .sp-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
    .sp-stat { padding: 14px; gap: 10px; }
    .sp-stat-ic { width: 38px; height: 38px; }
    .sp-stat-v { font-size: 21px; }
    .sp-item-no { font-size: 17px; }
    .sp-item-date { margin-inline-start: 0; width: 100%; }
    .sp-item-foot { gap: 12px; }
    .sp-item-foot .sp-btns { width: 100%; }
    .sp-item-foot .sp-btn { flex: 1 1 auto; }
    .sp-usercard { padding: 16px; }
    .sp-form-foot .sp-btn { flex: 1; }
    .sp-money { font-size: 18px; }
    .sp-due-v { font-size: 26px; }
    .sp-profile-head { gap: 14px; }
    .sp-avatar-lg { width: 66px; height: 66px; font-size: 24px; }
    .sp-doc { gap: 10px; }
    .sp-doc-b { min-width: 140px; }
}

@media (max-width: 420px) {
    .sp-stats { grid-template-columns: minmax(0, 1fr); }
    .sp-filters button { flex: 1; padding: 8px 12px; }
}

/* ==========================================================================
   Login / register / OTP cards + standalone rating pages
   ========================================================================== */
.safa-auth {
    font-family: var(--font-Family-Light), sans-serif;
    background-color: var(--sp-grey-100);
    background-image:
        radial-gradient(rgba(35, 38, 41, .06) 1px, transparent 1.3px),
        radial-gradient(52% 42% at 74% 0%, rgba(210, 158, 126, .16), transparent 70%),
        linear-gradient(165deg, #F3F4F4 0%, #E9EAEC 50%, #ECEDEF 100%);
    background-size: 22px 22px, cover, cover;
    background-repeat: repeat, no-repeat, no-repeat;
    background-position: 0 0, 0 0, 0 0;
    background-attachment: fixed;
    /* clears the site's absolutely positioned navbar */
    padding: 138px 0 60px;
}
/* neutralise the old full-bleed hero treatment of .new_login */
.safa-auth.new_login {
    height: auto;
    min-height: 100vh;
}

.safa-auth .formBox {
    background: var(--sp-card-bg);
    backdrop-filter: blur(14px);
    border: 1px solid var(--sp-line);
    box-shadow: var(--sp-card-sh);
    border-radius: var(--sp-r-card);
    max-width: 520px;
    margin: 0 auto;
    padding: 28px 26px;
    position: relative;
    overflow: hidden;
}
.safa-auth.new_login .formBox,
.safa-auth.new_login .formBox.register {
    display: block;
    position: static;
    width: 100%;
    height: auto;
    inset: auto;
}
.safa-auth.new_login .formBox .form h1 { margin-top: 0; }
.safa-auth.new_login .formBox .form p { color: var(--sp-muted); }
.safa-auth.new_login .formBox .form input,
.safa-auth.new_login .formBox.register .form input {
    background: #fff;
    border: 1px solid var(--sp-grey-200);
    backdrop-filter: none;
}
/* icons sit at the inline start of the field (as in the base sheet) - just re-centre them */
.safa-auth.new_login .formBox .form .icon,
.safa-auth.new_login .formBox.register .form .icon,
.rtl .safa-auth.new_login .formBox.register .form .icon { top: 14px; }
.safa-auth .form-group.text .form-control { padding-inline-end: 16px; }
.safa-auth.new_login .formBox .form .btn-main { margin-top: 0; padding: 12px 28px !important; }
.safa-auth.new_login .formBox .auth_card_bottom,
.safa-auth.new_login .formBox.register .auth_card_bottom { position: static; bottom: auto; }
.safa-auth .formBox::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--sp-bronze-500), var(--sp-bronze-400), var(--sp-bronze-500));
}
.safa-auth .formBoxHeader {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
    padding-bottom: 16px; border-bottom: 1px solid var(--sp-line-soft);
}
.safa-auth .formBoxHeader .logo { line-height: 0; }
.safa-auth .formBoxHeader .links { display: inline-flex; gap: 4px; background: var(--sp-grey-50); border-radius: var(--sp-r-pill); padding: 4px; }
.safa-auth .formBoxHeader .links a {
    padding: 7px 18px; border-radius: var(--sp-r-pill); font-size: 13.5px; font-weight: 700;
    color: var(--sp-ink-2); transition: background .2s ease, color .2s ease; margin: 0;
}
.safa-auth .formBoxHeader .links a:hover { background: var(--sp-grey-100); color: var(--sp-bronze-600); }
.safa-auth .formBoxHeader .links a.active { background: var(--sp-grey-950); color: #fff; }
.safa-auth .form h1 { font-size: 24px; font-weight: 700; color: var(--sp-ink); margin: 0 0 4px; }
.safa-auth .form > p { color: var(--sp-muted); font-size: 14.5px; margin: 0 0 18px; }
.safa-auth .form-group { position: relative; margin-bottom: 16px; }
.safa-auth .form-control {
    width: 100%; height: 48px; border-radius: var(--sp-r-tile) !important;
    border: 1px solid var(--sp-grey-200); background: #fff; padding: 0 16px;
    font-family: inherit; font-size: 15px; color: var(--sp-ink); box-shadow: none;
}
.safa-auth .iti__selected-flag { border-radius: var(--sp-r-tile) 0 0 var(--sp-r-tile) !important; }
.safa-auth textarea.form-control { height: auto; padding: 12px 16px; }
.safa-auth .form-control:focus {
    border-color: var(--sp-bronze-450); outline: none;
    box-shadow: 0 0 0 3px rgba(168, 119, 88, .14);
}
.safa-auth .form-group .icon { pointer-events: none; }
.safa-auth .btn-main,
.safa-auth .mainBtn {
    background: var(--sp-bronze-500); border: none; color: #fff;
    border-radius: var(--sp-r-pill); font-family: inherit; font-weight: 700;
    padding: 12px 28px; transition: background .25s ease;
}
.safa-auth .btn-main:hover,
.safa-auth .mainBtn:hover { background: var(--sp-bronze-600); color: #fff; }
.safa-auth .auth_card_bottom {
    display: block; text-align: center; margin-top: 18px;
    font-size: 14px; color: var(--sp-muted);
}
.safa-auth .auth_card_bottom .mainColor,
.safa-auth .mainColor { color: var(--sp-bronze-600) !important; }
.safa-auth .iti { width: 100%; }
.safa-auth .iti.iti--separate-dial-code.iti--show-flags { width: 100% !important; }
.safa-auth .otp-input-fields { gap: 10px; flex-wrap: wrap; padding: 6px 0 2px; }
.safa-auth .otp-input-fields .input-wrapper { flex: none; }
/* the base sheet paints the digits white and draws a placeholder dash - show real digits instead */
.safa-auth .otp-input-fields .input-wrapper::after { display: none; }
.safa-auth .otp-input-fields input.form-control {
    width: 56px !important; height: 58px !important;
    border-radius: var(--sp-r-tile) !important;
    border: 1px solid var(--sp-grey-200) !important;
    color: var(--sp-ink) !important; font-size: 22px !important;
    font-family: inherit; -moz-appearance: textfield;
}
.safa-auth .otp-input-fields input::-webkit-outer-spin-button,
.safa-auth .otp-input-fields input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.safa-auth .otp-input-fields input.form-control:focus {
    border-color: var(--sp-bronze-450) !important; outline: none;
    box-shadow: 0 0 0 3px rgba(168, 119, 88, .14);
}
.safa-auth .error { font-size: 13.5px; }
.safa-auth .form-group.phone { display: flex; align-items: flex-start; gap: 10px; }
.safa-auth .form-group.phone .btn-main { flex: none; padding: 12px 22px; margin: 0 !important; height: 48px; }
.safa-auth .g-recaptcha { display: flex; justify-content: center; }
.safa-auth .g-recaptcha > div { max-width: 100%; }

/* Standalone pages that reuse the portal cards (rating / confirmation) */
.safa-auth .sp-card { max-width: 760px; margin: 0 auto; }
.safa-auth .sp-page-head { max-width: 760px; margin: 0 auto 18px; }
.safa-auth .sp-page-head h1 { font-size: 26px; font-weight: 700; color: var(--sp-ink); margin: 0 0 4px; }
.safa-auth .sp-page-head p { color: var(--sp-muted); font-size: 15px; margin: 0; }

@media (max-width: 575px) {
    .safa-auth { padding: 92px 0 40px; }
    .safa-auth .formBox { padding: 20px 16px; border-radius: 14px; }
    .safa-auth .formBoxHeader { justify-content: center; }
    .safa-auth .otp-input-fields { gap: 8px; }
    .safa-auth .otp-input-fields input.form-control { width: 48px !important; height: 54px !important; font-size: 19px !important; }
    .safa-auth .form-group.phone { flex-wrap: wrap; }
    .safa-auth .form-group.phone .btn-main { width: 100%; }
    .safa-auth .sp-card { padding: 18px 16px; }
    .safa-auth .sp-page-head h1 { font-size: 22px; }
}
