
/* =====================================================================
   PLPM · Midnight & Gold — premium theme (layered over the base styles)
   ===================================================================== */
:root {
  --bg: #060918;
  --bg-2: #0a0f26;
  --card: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  --card-solid: #0e1430;
  --ink: #eef0fb;
  --ink-2: #c4c8e0;
  --muted: #8b91b4;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.05);
  --blue: #f2c14e;           /* links & accents become gold */
  --blue-600: #e0ab2c;
  --blue-50: rgba(242,193,78,.08);
  --blue-100: rgba(242,193,78,.25);
  --gold: #f2c14e;
  --gold-2: #ffe29a;
  --gold-deep: #b8860b;
  --gold-50: rgba(242,193,78,.08);
  --green: #3ccf91; --green-50: rgba(60,207,145,.12);
  --red: #ff6b6b; --red-50: rgba(255,107,107,.12);
  --amber: #f5b942; --amber-50: rgba(245,185,66,.12);
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 40px -24px rgba(0,0,0,.8);
  --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.85);
  --radius: 18px;
  --display: "Sora", "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
}
html { background: var(--bg); }
body {
  color: var(--ink); background: var(--bg);
  background-image:
    radial-gradient(900px 520px at 85% -10%, rgba(242,193,78,.10), transparent 60%),
    radial-gradient(800px 600px at 10% 110%, rgba(64,86,255,.10), transparent 60%);
  background-attachment: fixed;
}
::selection { background: rgba(242,193,78,.35); color: #fff; }
a { color: var(--gold); }
h1, h2, h3, .card-title, .site-name, .kpi b, .tile b { font-family: var(--display); letter-spacing: -.01em; }

/* ---- Sidebar */
.sidebar {
  background: linear-gradient(180deg, rgba(10,14,36,.92), rgba(5,7,20,.96));
  border-right: 1px solid rgba(242,193,78,.12);
  box-shadow: 1px 0 0 rgba(255,255,255,.02), 20px 0 60px -30px rgba(0,0,0,.9);
}
.brand { padding-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,.06); }
.nav-section { color: rgba(242,193,78,.55); letter-spacing: .18em; font-size: 10.5px; }
.nav-item { color: rgba(226,229,245,.72); border-radius: 12px; transition: background .2s, color .2s; }
.nav-item .ico { color: rgba(226,229,245,.5); transition: color .2s; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item:hover .ico { color: var(--gold); }
.nav-item.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(90deg, rgba(242,193,78,.18), rgba(242,193,78,.04));
  box-shadow: inset 0 0 0 1px rgba(242,193,78,.22);
}
.nav-item.active .ico { color: var(--gold); }
.nav-item.active::before { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.06); }
.avatar { background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-deep)); color: #1a1405; box-shadow: 0 0 0 2px rgba(242,193,78,.25); }
.user-meta small { color: rgba(242,193,78,.7); }

/* ---- Top bar */
.topbar { background: rgba(6,9,24,.72); backdrop-filter: saturate(1.3) blur(14px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 22px; color: #fff; }
.crumb { color: var(--gold); }
.menu-btn { color: var(--ink); border-color: var(--line); }

/* ---- Cards, panels */
.card, .kpi, .tile, .app-tile, .emp-list { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.card-head { border-bottom-color: var(--line); }
.card-foot { border-top-color: var(--line); }
.section-label { color: rgba(242,193,78,.75); letter-spacing: .2em; }
.empty { color: var(--muted); }

/* ---- Hero */
.hero {
  padding: 36px 36px; border-radius: 24px;
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(242,193,78,.28), transparent 55%),
    radial-gradient(60% 120% at 0% 100%, rgba(80,100,255,.22), transparent 60%),
    linear-gradient(135deg, #0d1335 0%, #0a0f28 60%, #120f1f 100%);
  border: 1px solid rgba(242,193,78,.22);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.06);
}
.hero::after { border-color: rgba(242,193,78,.45); border-left-color: transparent; border-bottom-color: transparent; filter: drop-shadow(0 0 18px rgba(242,193,78,.35)); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: radial-gradient(70% 90% at 70% 30%, #000, transparent);
}
.hero-date { color: var(--gold); opacity: .9; }
.hero h2 {
  font-family: var(--display); font-size: 34px; font-weight: 600;
  background: linear-gradient(90deg, #fff 0%, #fff 40%, var(--gold-2) 75%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: rgba(226,229,245,.72); }

/* ---- Tiles */
.tiles { gap: 18px; }
.tile { border-radius: 20px; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s; }
.tile::after { opacity: .16; filter: blur(30px); }
.tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(242,193,78,.55), transparent 35%, transparent 65%, rgba(242,193,78,.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .25s;
}
.tile:hover { transform: translateY(-4px); border-color: transparent; box-shadow: 0 30px 60px -28px rgba(0,0,0,.95), 0 0 0 1px rgba(242,193,78,.18); }
.tile:hover::before { opacity: 1; }
.tile:hover::after { opacity: .3; }
.tile-ico { border-radius: 16px; background: linear-gradient(140deg, color-mix(in srgb, var(--app) 70%, #fff 30%), var(--app) 55%, color-mix(in srgb, var(--app) 70%, #000 30%));
  box-shadow: 0 12px 28px -10px var(--app), inset 0 1px 0 rgba(255,255,255,.35); }
.tile b { color: #fff; }
.tile small { color: var(--muted); }
.tile-go { color: rgba(255,255,255,.25); }
.tile:hover .tile-go { color: var(--gold); }
.tile.add { background: transparent; border: 1.5px dashed rgba(242,193,78,.28); }
.tile.add:hover { border-color: var(--gold); color: var(--gold); background: rgba(242,193,78,.04); }

/* ---- KPIs */
.kpi { color: var(--ink); border-radius: 18px; }
.kpi b { color: #fff; font-weight: 600; }
.kpi b small { color: var(--muted); }
.kpi-top span, .kpi > span { color: var(--muted); }
.kpi-ico { background: rgba(242,193,78,.1); color: var(--gold); }
.kpi:hover { border-color: rgba(242,193,78,.3); transform: translateY(-2px); }
.kpi.danger b { color: var(--red); }
.kpi.warn b { color: var(--gold); }
.kpi.accent { background: linear-gradient(135deg, rgba(242,193,78,.22), rgba(242,193,78,.05)); border-color: rgba(242,193,78,.35); }
.kpi.accent b { color: var(--gold-2); }

/* ---- Buttons */
.btn { background: rgba(255,255,255,.04); border-color: var(--line); color: var(--ink); border-radius: 11px; transition: all .2s; }
.btn:not(.btn-primary):not(.btn-success):not(.btn-danger):hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.btn-primary {
  color: #1b1404; border: 0; font-weight: 600;
  background: linear-gradient(135deg, var(--gold-2) 0%, var(--gold) 45%, #d99a0b 100%);
  box-shadow: 0 10px 24px -12px rgba(242,193,78,.8), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--gold-2) 0%, var(--gold) 45%, #d99a0b 100%); filter: brightness(1.07); box-shadow: 0 14px 30px -12px rgba(242,193,78,.9), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-ghost { background: transparent; }
.btn-success { background: linear-gradient(135deg, #46d89b, #1fa56d); color: #04150d; border: 0; font-weight: 600; }
.btn-danger { background: rgba(255,107,107,.14); color: var(--red); border-color: rgba(255,107,107,.3); }
.danger-text { color: var(--red) !important; }

/* ---- Forms */
input, select, textarea {
  color: var(--ink); background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); border-radius: 11px;
}
input::placeholder, textarea::placeholder { color: rgba(200,205,230,.35); }
input:hover, select:hover, textarea:hover { border-color: rgba(255,255,255,.22); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,193,78,.15); }
select option { background: #0e1430; color: var(--ink); }
input[type=date], input[type=month], input[type=time] { color-scheme: dark; }
input[disabled] { opacity: .55; }
.field > span { color: var(--ink-2); }
.form-section { color: var(--gold); }
.note { background: rgba(242,193,78,.07); border-color: rgba(242,193,78,.25); color: var(--ink-2); }
.swatches input:checked + i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }

/* ---- Tables */
.table th { background: rgba(255,255,255,.025); color: rgba(242,193,78,.7); border-bottom-color: var(--line); }
.table td { border-bottom-color: var(--line-2); }
.table tbody tr, .table tr { transition: background .15s; }
.link-row:hover td, .table tr:hover td { background: rgba(255,255,255,.025); }
.row-warn td { background: rgba(255,107,107,.06) !important; }
.row-done td { opacity: .6; }
.table b { color: #fff; }

/* ---- Badges */
.badge { border: 1px solid transparent; font-weight: 600; }
.badge-gray { background: rgba(255,255,255,.07); color: var(--ink-2); border-color: rgba(255,255,255,.08); }
.badge-green { background: rgba(60,207,145,.12); color: #5fe0a8; border-color: rgba(60,207,145,.25); }
.badge-red { background: rgba(255,107,107,.12); color: #ff8a8a; border-color: rgba(255,107,107,.25); }
.badge-amber { background: rgba(245,185,66,.12); color: #ffcf6e; border-color: rgba(245,185,66,.25); }
.badge-blue { background: rgba(110,140,255,.14); color: #a7b7ff; border-color: rgba(110,140,255,.25); }
.pos { color: #5fe0a8; } .neg { color: #ff8a8a; }

/* ---- Flash */
.flash-success { background: rgba(60,207,145,.1); border-color: rgba(60,207,145,.3); color: #8ff0c5; }
.flash-error { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.3); color: #ffb0b0; }
.flash-info { background: rgba(110,140,255,.1); border-color: rgba(110,140,255,.3); color: #c3cdff; }

/* ---- Charts */
.c-grid { stroke: rgba(255,255,255,.06); }
.c-lbl { fill: var(--muted); }
.c-big { fill: #fff; }
.chart-tip { background: #141a3c; border: 1px solid rgba(242,193,78,.25); }

/* ---- Sites, counts, pickers */
.site-card .site-name { color: #fff; font-size: 17px; }
.site-stats dt { color: var(--muted); }
.site-stats dd { color: #fff; }
.count-head { background: rgba(255,255,255,.03); color: var(--muted); }
.count-row { border-bottom-color: var(--line-2); }
.emp-list { background: var(--card-solid); }
.emp-list li:hover, .emp-list li.on { background: rgba(242,193,78,.1); }
.emp-picked { background: rgba(242,193,78,.08); border-color: rgba(242,193,78,.25); }
.tally .badge { padding: 6px 10px; }
.tile-mini { box-shadow: 0 6px 14px -6px rgba(0,0,0,.8); }
.toast { background: #141a3c; border: 1px solid rgba(242,193,78,.3); }
.frame-wrap { background: var(--bg); }
.frame-help { color: var(--muted); border-top-color: var(--line); }

/* ---- Sign in / setup */
.login-body { background: var(--bg); }
.login-art {
  background:
    radial-gradient(80% 70% at 80% 10%, rgba(242,193,78,.30), transparent 60%),
    radial-gradient(70% 80% at 0% 100%, rgba(80,100,255,.28), transparent 60%),
    linear-gradient(150deg, #0d1335, #070a1c);
  border-right: 1px solid rgba(242,193,78,.15);
}
.login-art-text h2 { font-family: var(--display); font-size: 40px; background: linear-gradient(90deg, #fff, var(--gold-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.arc { border-color: rgba(242,193,78,.4); border-left-color: transparent; border-bottom-color: transparent; }
.login-card { background: transparent; color: var(--ink); }
.login-card h1, .install h1 { font-family: var(--display); color: #fff; }
.install .card { background: var(--card-solid); }

/* ---- Subtle entrance */
@media (prefers-reduced-motion: no-preference) {
  .content > * { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
  .content > *:nth-child(2) { animation-delay: .05s; } .content > *:nth-child(3) { animation-delay: .1s; } .content > *:nth-child(4) { animation-delay: .15s; }
  .tiles .tile { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; }
  .tiles .tile:nth-child(2) { animation-delay: .06s; } .tiles .tile:nth-child(3) { animation-delay: .12s; } .tiles .tile:nth-child(4) { animation-delay: .18s; }
  .tiles .tile:nth-child(5) { animation-delay: .24s; } .tiles .tile:nth-child(6) { animation-delay: .3s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 900px) { .hero h2 { font-size: 26px; } .sidebar { background: #070a1c; } }

/* ---- Print (payslips) stays clean and light */
@media print {
  :root { --ink: #0f1433; --ink-2: #3c4263; --muted: #747a98; --line: #e3e5ee; --line-2: #eef0f5; --card: #fff; --blue: #2636ab; --gold: #b8860b; }
  body { background: #fff !important; color: #0f1433; }
  .card { background: #fff !important; box-shadow: none; }
  .table b, .kpi b { color: #0f1433; }
  .table th { color: #747a98; background: #f8f9fc; }
}
.kpi b small { font-size: .5em; font-weight: 500; margin-left: 2px; }
.table td small[dir=rtl], .count-item small[dir=rtl] { text-align: left; }
.login-art { flex-direction: column; justify-content: space-between; align-items: flex-start; }
.login-art-logo { width: 170px; position: relative; z-index: 1; filter: drop-shadow(0 10px 30px rgba(0,0,0,.5)); }
.login-art .arc { display: none; }
.login-card h1 { font-size: 30px; margin-bottom: 4px; }
.site-stats { background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.site-stats div { border-right-color: var(--line); }
.card-foot { background: rgba(255,255,255,.02); }
.frame-help { background: transparent; }
.details > div { border-bottom-color: var(--line-2); }
/* VIP name in the greeting: elegant italic serif in gold */
.hero h2 { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: #fff; }
.hero h2 em.vip, .dash-hero h2 em {
  font-family: "Playfair Display", "Fraunces", Georgia, serif; font-style: italic; font-weight: 600; letter-spacing: .01em;
  background: linear-gradient(100deg, #ffe29a 0%, #f2c14e 45%, #d99a0b 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .08em; font-size: 1.08em;
}

/* ---- Sign-in art panel: live network of sites around the PLPM hub */
.login-art { position: relative; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; align-items: start; padding: 52px 60px; gap: 10px; }
.la-top { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 18px; }
.la-rule { width: 120px; height: 1px; background: linear-gradient(90deg, #f2c14e, transparent); }
.la-net { position: relative; align-self: center; justify-self: center; width: min(440px, 100%); aspect-ratio: 1; }
.la-net svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.la-net .ring { fill: none; stroke: rgba(242,193,78,.18); stroke-width: .25; stroke-dasharray: 1 1.4; animation: laSpin 80s linear infinite; transform-origin: 50px 50px; }
.la-net .ring.r2 { stroke: rgba(150,170,255,.16); animation-direction: reverse; animation-duration: 60s; }
.la-net .spoke { stroke: rgba(150,170,255,.18); stroke-width: .22; }
.la-net .pulse { fill: #ffe29a; filter: drop-shadow(0 0 1.5px #f2c14e); }
.la-net .hub { fill: #0b1030; stroke: #f2c14e; stroke-width: .5; }
.la-net .hub-glow { animation: laBreath 4s ease-in-out infinite; transform-origin: 50px 50px; }
@keyframes laSpin { to { transform: rotate(360deg); } }
@keyframes laBreath { 50% { transform: scale(1.25); opacity: .6; } }
.la-hub-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 10px; font-weight: 800; letter-spacing: .18em; color: #f2c14e; }
.la-node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.la-node i { width: 12px; height: 12px; border-radius: 50%; background: #0b1030; border: 2px solid #9fb2ff; box-shadow: 0 0 0 4px rgba(159,178,255,.12), 0 0 14px rgba(159,178,255,.6); }
.la-node.ok i { border-color: #3ccf91; box-shadow: 0 0 0 4px rgba(60,207,145,.14), 0 0 14px rgba(60,207,145,.7); }
.la-node em { font-style: normal; font-size: 11px; font-weight: 500; color: rgba(214,220,242,.68); white-space: nowrap; padding: 2px 8px; border-radius: 999px; background: rgba(8,12,34,.75); border: 1px solid rgba(255,255,255,.08); }
.login-art-text { position: relative; z-index: 2; max-width: none; }
.la-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: #f2c14e; }
.login-art-text h2 { font-size: 50px; line-height: 1.05; margin: 12px 0 12px; white-space: nowrap; background: none !important; -webkit-background-clip: border-box !important; background-clip: border-box !important; color: #fff !important; }
.login-art-text h2 em, .login-card h1 em { font-family: "Playfair Display", "Fraunces", Georgia, serif; font-style: italic; font-weight: 600; background: linear-gradient(100deg, #ffe29a, #f2c14e 50%, #d99a0b); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; opacity: .85; }
.login-art-text p.la-apps { max-width: none; white-space: nowrap; color: rgba(200,208,235,.5); letter-spacing: .14em; font-size: 12px; margin: 0 0 22px; }
.la-stats { display: inline-flex; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.03); backdrop-filter: blur(6px); }
.la-stats span { display: flex; align-items: baseline; gap: 8px; padding: 12px 20px; color: rgba(226,229,245,.7); font-size: 13px; border-right: 1px solid rgba(255,255,255,.08); }
.la-stats span:last-child { border-right: 0; }
.la-stats b { color: #fff; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.la-stats .live { align-items: center; color: #5fe0a8; font-weight: 600; }
.la-stats .live i { width: 8px; height: 8px; border-radius: 50%; background: #3ccf91; animation: livePulse 2s infinite; }
.la-tag { margin: 22px 0 0; text-align: center; font-family: "Playfair Display", Georgia, serif; font-style: italic; color: rgba(242,193,78,.75); font-size: 13.5px; letter-spacing: .04em; }
@media (max-width: 1200px) { .login-art-text h2 { font-size: 38px; white-space: normal; } .login-art-text p.la-apps { white-space: normal; } }
@media (prefers-reduced-motion: reduce) { .la-net * { animation: none !important; } }
.login-art-text h2.la-company { font-size: 54px; white-space: nowrap; margin: 12px 0 6px;
  background: linear-gradient(90deg, #fff 0%, #fff 45%, #ffe29a 75%, #f2c14e 100%) !important; -webkit-background-clip: text !important; background-clip: text !important; color: transparent !important; }
.la-motto { font-size: 21px; font-weight: 500; color: rgba(214,220,242,.72); margin: 0 0 14px; letter-spacing: -.005em; }
.la-motto em { font-family: "Playfair Display", "Fraunces", Georgia, serif; font-style: italic; font-weight: 600; background: linear-gradient(100deg, #ffe29a, #f2c14e 50%, #d99a0b); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; opacity: .85; }
.login-art-text p.la-apps { margin-bottom: 0; }
@media (max-width: 1200px) { .login-art-text h2.la-company { font-size: 40px; white-space: normal; } }

/* Sign-in fits any screen height at 100% zoom: no scrolling */
@media (min-width: 901px) {
  .login-wrap { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .login-art { height: 100%; min-height: 0; padding: clamp(24px, 5vh, 52px) 60px; gap: 0; }
  .login-art-logo { width: clamp(110px, 18vh, 170px); }
  .la-top { gap: clamp(10px, 2vh, 18px); }
  .la-net { width: min(440px, 100%, 46vh); align-self: center; }
  .la-eyebrow { font-size: clamp(9.5px, 1.3vh, 11px); }
  .login-art-text h2.la-company { font-size: clamp(36px, 6vh, 54px); margin: clamp(6px, 1.2vh, 12px) 0 clamp(2px, .6vh, 6px); }
  .la-motto { font-size: clamp(16px, 2.4vh, 21px); margin-bottom: clamp(6px, 1.4vh, 14px); }
  .login-art-text p.la-apps { font-size: clamp(10.5px, 1.4vh, 12px); }
  .login-card-wrap, .login-form-side { overflow: auto; }
}

/* Keep fields dark when the browser autofills them */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:autofill {
  -webkit-text-fill-color: #eef0fa; caret-color: #eef0fa;
  -webkit-box-shadow: 0 0 0 1000px #0f121f inset; box-shadow: 0 0 0 1000px #0f121f inset;
  transition: background-color 9999s ease-out 0s;
}
input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px #0f121f inset, 0 0 0 3px rgba(242,193,78,.15); box-shadow: 0 0 0 1000px #0f121f inset, 0 0 0 3px rgba(242,193,78,.15); }
.lg-greet { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: rgba(242,193,78,.8); }
.login-card h1 { white-space: nowrap; }
