/* Grey's Anatomy Hospital */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700&family=Almarai:wght@400;700&display=swap');
:root {
  --bg: #f2f6f6;
  --surface: #ffffff;
  --surface-2: #f6f9f9;
  --line: #d5dfe0;
  --line-strong: #b6c5c7;
  --ink: #132a2e;
  --ink-2: #44605f;
  --ink-3: #7a9290;
  --rail: #0f3b40;
  --rail-ink: #bcd3d2;
  --rail-active: #174d53;
  --red: #c0392b;
  --red-soft: #fbe8e6;
  --blue: #0f8b8d;
  --blue-soft: #e1f3f3;
  --accent: #0f8b8d;
  --accent-soft: #e1f3f3;
  --green: #1f7a45;
  --green-soft: #e3f3e8;
  --amber: #9a6400;
  --amber-soft: #fff3d6;
  --radius: 10px;
  --font: 'Nunito Sans', system-ui, sans-serif;
}
[dir="rtl"] { --font: 'Almarai', 'Nunito Sans', system-ui, sans-serif; }
/* Cyberdyne Systems — Model 101 Finance portal */


* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px; line-height: 1.5;
  color: var(--ink); background: var(--bg);
  font-variant-numeric: tabular-nums;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.rail {
  background: var(--rail); color: var(--rail-ink);
  display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: #fff; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand .name { font-weight: 600; font-size: 14px; letter-spacing: .01em; line-height: 1.15; }
.brand .name span { display: block; font-weight: 400; color: var(--rail-ink); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: var(--rail-ink); padding: 9px 10px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px; font-size: 14px;
}
.nav a:hover { background: var(--rail-active); text-decoration: none; color: #fff; }
.nav a[aria-current="page"] { background: var(--rail-active); color: #fff; box-shadow: inset 3px 0 0 var(--red); }
[dir="rtl"] .nav a[aria-current="page"] { box-shadow: inset -3px 0 0 var(--red); }
.nav svg { width: 17px; height: 17px; opacity: .8; flex: none; }
.rail .spacer { flex: 1; }
.rail .foot { font-size: 12px; color: #8a949e; padding: 8px 10px; border-top: 1px solid #2f3942; overflow-wrap: anywhere; }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 32px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .crumbs { color: var(--ink-3); font-size: 13px; }
.topbar .crumbs b { color: var(--ink); font-weight: 500; }
.topbar .tools { display: flex; align-items: center; gap: 12px; }
.lang {
  display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden;
}
.lang button {
  background: none; border: 0; padding: 5px 12px; cursor: pointer; color: var(--ink-2); font-size: 13px;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.who .avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line-strong); background: var(--surface-2);
}
.who .role { color: var(--ink-3); font-size: 12px; display: block; }

.content { padding: 28px 40px 48px; max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }

/* ---- components ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 500;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #1a51b5; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn svg { width: 16px; height: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card .card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card .card-b { padding: 18px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--ink-2); font-size: 13px; margin-bottom: 6px; }
.kpi .value { font-size: 24px; font-weight: 600; }
.kpi .delta { font-size: 13px; margin-top: 4px; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }

.grid-2 { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 14px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; align-items: start; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-weight: 500; color: var(--ink-2); background: var(--surface-2); position: sticky; top: 0; }
table.data td.num, table.data th.num { text-align: end; white-space: nowrap; }
table.data code.id { white-space: nowrap; }
table.data tr:hover td { background: #fafbfc; }
.neg { color: var(--red); } .pos { color: var(--green); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.info { background: var(--blue-soft); color: var(--blue); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
.filters input { min-width: 260px; }

dl.facts { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 14px; margin: 0; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
code.id { font-family: inherit; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; }

.notice { padding: 12px 16px; border-radius: var(--radius); background: var(--amber-soft); color: #5c3c00; border: 1px solid #f0d9a0; margin-bottom: 18px; }
.notice.red { background: var(--red-soft); color: #7a0d1e; border-color: #f2c2ca; }
.notice.blue { background: var(--blue-soft); color: #143e8f; border-color: #c6d6f7; }

.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.file { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.file .ext { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.file h3 { font-size: 15px; }
.file .meta { color: var(--ink-3); font-size: 13px; }
.file .btn { align-self: flex-start; margin-top: 4px; }

.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--ink-2);
  background: var(--surface-2);
}
.dropzone input { display: block; margin: 12px auto 0; }

form .row { display: grid; grid-template-columns: 200px 1fr; gap: 10px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
form .row:last-of-type { border-bottom: 0; }
form .row label { color: var(--ink-2); }
form input[type=text], form input[type=email], form select, form textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); width: 100%; max-width: 420px; background: var(--surface);
}
.switch { display: inline-flex; align-items: center; gap: 8px; }

.chart { width: 100%; height: 200px; }

/* confidential report */
.report { position: relative; padding: 36px 40px; background: var(--surface); border: 1px solid var(--line); }
.report h2 { margin-bottom: 10px; }
.report p, .report table { position: relative; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .side { background: var(--rail); color: #fff; padding: 56px; display: flex; flex-direction: column; }
.login .side .brand { padding: 0 0 40px; }
.login .side h1 { font-size: clamp(34px, 2.4vw, 48px); font-weight: 600; max-width: 14ch; line-height: 1.15; margin-top: auto; }
.login .side p { color: var(--rail-ink); max-width: 40ch; margin-top: 16px; }
.login .side .stat { display: flex; gap: 32px; margin-top: 40px; padding-top: 24px; border-top: 1px solid #2f3942; }
.login .side .stat b { display: block; font-size: 20px; }
.login .side .stat span { color: var(--rail-ink); font-size: 13px; }
.login .panel { display: grid; place-items: center; padding: 40px; }
.login .box { width: 100%; max-width: 440px; }
.login .box h2 { font-size: 22px; margin-bottom: 6px; }
.login .box p { color: var(--ink-2); }
.login .box .btn.primary { width: 100%; justify-content: center; padding: 12px; margin-top: 20px; font-size: 15px; }
.login .box .alt { margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.login .box .legal { margin-top: 40px; font-size: 12px; color: var(--ink-3); }

/* blocked */
.blocked { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.blocked .box { max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--red); padding: 32px; }

/* print */
@media print {
  .rail, .topbar, .btn, .filters { display: none !important; }
  .shell { display: block; }
}
/* responsive */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .rail .spacer, .rail .foot { display: none; }
  .kpis, .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login .side { padding: 32px 24px; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  dl.facts, form .row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) { .kpis, .grid-3 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ultra-wide: let cards use the width */
@media (min-width: 1800px) {
  .shell { grid-template-columns: 260px 1fr; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: minmax(0,3fr) minmax(0,1fr); }
  .files { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  body { font-size: 16px; }
}

/* ---- brand imagery ---- */
.brand .logo { width: 100%; height: auto; max-height: 64px; object-fit: contain; object-position: left center; display: block; }
[dir="rtl"] .brand .logo { object-position: right center; }
.rail .brand { padding: 2px 6px 18px; }
.login .side.hero {
  background-size: cover; background-position: center bottom; position: relative; isolation: isolate;
}
.login .side.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10,16,24,.55) 0%, rgba(10,16,24,.25) 40%, rgba(10,16,24,.82) 100%);
}
.login .side.hero .logo { width: auto; height: 84px; max-width: 70%; }
.login .side.hero h1, .login .side.hero p { text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.login .side.hero p { color: #e6edf3; }
.login .side.hero .stat { border-top-color: rgba(255,255,255,.25); }
.login .side.hero .stat span { color: #cfd8e0; }
.compliance { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.compliance span {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--surface);
}
.compliance svg { width: 13px; height: 13px; color: var(--green); }
.welcome {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 18px;
  padding: 22px 26px; border-radius: var(--radius); margin-bottom: 22px; color: #fff;
  background-size: cover; background-position: center 35%; min-height: 120px; overflow: hidden;
}
.welcome::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10,16,24,.82) 0%, rgba(10,16,24,.55) 55%, rgba(10,16,24,.15) 100%); }
.welcome .photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.7); flex: none; }
.welcome .hi { font-size: 22px; font-weight: 600; }
.welcome .line { color: #e6edf3; margin-top: 2px; }
.welcome .when { color: #cfd8e0; font-size: 13px; margin-top: 6px; }
.welcome .wm { margin-inline-start: auto; height: 52px; opacity: .95; }
@media (max-width: 700px) { .welcome .wm { display: none; } }

/* ---- sidebar photo + themed header ---- */
.rail { background-size: cover; background-position: center top; position: relative; isolation: isolate; }
.rail::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rail) 84%, transparent) 0%, color-mix(in srgb, var(--rail) 62%, transparent) 45%, color-mix(in srgb, var(--rail) 90%, transparent) 100%); }
.nav a { background: rgba(255,255,255,.04); backdrop-filter: blur(2px); }
.nav a:hover { background: rgba(255,255,255,.14); }
.nav a[aria-current="page"] { background: rgba(255,255,255,.18); box-shadow: inset 3px 0 0 var(--accent); }
[dir="rtl"] .nav a[aria-current="page"] { box-shadow: inset -3px 0 0 var(--accent); }
.rail .foot { border-top-color: rgba(255,255,255,.18); color: #d6dde4; }
.rail .foot a { color: #fff !important; }
.topbar { background: linear-gradient(90deg, var(--rail) 0%, color-mix(in srgb, var(--rail) 55%, var(--accent)) 60%, var(--accent) 100%); border-bottom: 0; color: #fff; }
.topbar .crumbs, .topbar .crumbs b, .topbar .who .role { color: rgba(255,255,255,.85); }
.topbar .crumbs b { color: #fff; }
.topbar .lang { border-color: rgba(255,255,255,.45); }
.topbar .lang button { color: rgba(255,255,255,.85); }
.topbar .lang button[aria-pressed="true"] { background: #fff; color: var(--rail); }
.topbar .who .avatar { border-color: rgba(255,255,255,.8); }


