/* ===========================================================================
   I-SYS — one theme, one file.
   ---------------------------------------------------------------------------
   Every I-SYS screen loads this. Not a document to follow — the actual
   stylesheet, so the screens cannot drift apart from it or from each other.
   Three different blues had already appeared across three screens before this
   existed.

   The colours are the logo's own, read out of the mark: deep blue #0A4E8A,
   gold #F6D157. Nothing here was invented to look nice beside them.

   Light and dark are the same tokens with different values, so a component is
   written once. Dark follows the system unless the page sets data-theme.
   =========================================================================== */

:root{
  /* --- brand ------------------------------------------------------------ */
  --blue:#0A4E8A;          /* anything you can act on */
  --blue-2:#2F72A9;        /* links, quieter actions */
  --blue-soft:#E7EFF7;     /* selected rows, focus rings, chips */
  --gold:#F6D157;          /* where to start, and nothing else */
  --gold-ink:#8A6D1F;
  --gold-soft:#FDF6E0;

  /* --- surfaces and ink ------------------------------------------------- */
  --paper:#F2F5F8;         /* the page behind everything */
  --surface:#FFFFFF;       /* cards, bars, inputs */
  --surface-2:#EDF1F5;     /* table headers, quiet fills */
  --ink:#0F1822;           /* what you read */
  --ink-2:#48566A;         /* supporting text */
  --ink-3:#7A8798;         /* labels, hints, units */
  --rule:#DDE4EC;          /* borders */
  --rule-2:#C3CEDA;        /* input borders, dividers that must be seen */

  /* --- meaning. Four, and no more: a fifth colour means nothing. -------- */
  --ok:#1C6B48;    --ok-soft:#E3F0E9;      /* done, passed, live */
  --warn:#8A6D1F;  --warn-soft:#FDF6E0;    /* needs attention, not wrong yet */
  --bad:#A8382B;   --bad-soft:#F7E6E3;     /* refused, overdue, blocked */
  --info:#0A4E8A;  --info-soft:#E7EFF7;    /* explanation, system note */

  /* --- measurements ----------------------------------------------------- */
  --r-sm:6px; --r:8px; --r-lg:12px; --r-pill:999px;
  --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px; --s-5:22px; --s-6:30px;
  --bar-h:84px;
  --shadow:0 1px 2px rgba(15,24,34,.04), 0 24px 50px -36px rgba(15,24,34,.45);
  --font:"IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --blue:#5FA3DC; --blue-2:#7FB6E4; --blue-soft:#11253A;
    --gold:#F6D157; --gold-ink:#E3BE4A; --gold-soft:#2A2312;
    --paper:#0B1118; --surface:#121A23; --surface-2:#19232E;
    --ink:#E8EEF5; --ink-2:#A7B5C5; --ink-3:#7A8798;
    --rule:#223040; --rule-2:#31445A;
    --ok:#62BC8D; --ok-soft:#11291E;
    --warn:#D9AE4A; --warn-soft:#2A2312;
    --bad:#E0776A; --bad-soft:#2D1714;
    --info:#5FA3DC; --info-soft:#11253A;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 24px 50px -36px rgba(0,0,0,.9);
  }
}
:root[data-theme="dark"]{
  --blue:#5FA3DC; --blue-2:#7FB6E4; --blue-soft:#11253A;
  --gold:#F6D157; --gold-ink:#E3BE4A; --gold-soft:#2A2312;
  --paper:#0B1118; --surface:#121A23; --surface-2:#19232E;
  --ink:#E8EEF5; --ink-2:#A7B5C5; --ink-3:#7A8798;
  --rule:#223040; --rule-2:#31445A;
  --ok:#62BC8D; --ok-soft:#11291E;
  --warn:#D9AE4A; --warn-soft:#2A2312;
  --bad:#E0776A; --bad-soft:#2D1714;
  --info:#5FA3DC; --info-soft:#11253A;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 24px 50px -36px rgba(0,0,0,.9);
}

/* --- the page ----------------------------------------------------------- */
*{box-sizing:border-box}
body.isys{margin:0;background:var(--paper);color:var(--ink);
  font:400 15px/1.6 var(--font)}
.isys code,.isys .mono{font-family:var(--mono);font-size:.92em}

/* --- the bar every screen opens with ------------------------------------ */
.isys-bar{display:flex;align-items:center;gap:var(--s-3);padding:0 var(--s-5);
  height:var(--bar-h);background:var(--surface);
  border-bottom:1px solid var(--rule)}
.isys-bar .mk{height:26px;width:auto;display:block}

/* --- the brand lockup ---------------------------------------------------
   The mark with the company's name beneath it, used in every bar on every
   screen. It is the logo artwork itself, cropped to drop the tagline — not
   the name re-set in a web font. Typesetting it again gave a different face,
   a different weight and capitals the logo does not use, so the bar carried a
   near-miss of the identity rather than the identity.                      */
.isys-brand{display:inline-flex;align-items:center;line-height:0;
  text-decoration:none;flex:none}
.isys-brand img{height:64px;width:auto;display:block}
/* the mark is deep blue; on a dark surface it needs a little lift */
:root[data-theme="dark"] .isys-brand img{filter:brightness(1.3)}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .isys-brand img{filter:brightness(1.3)}}
@media (max-width:600px){ .isys-brand img{height:52px} }
.isys-bar .sep{width:1px;height:19px;background:var(--rule-2)}
.isys-bar .module{font-size:13.5px;color:var(--ink-2);font-weight:500}
.isys-bar .right{margin-left:auto;display:flex;align-items:center;gap:var(--s-4)}
.isys-bar .who{font-size:12.5px;color:var(--ink-3)}
.isys-bar .who b{color:var(--ink-2);font-weight:500}

/* --- type --------------------------------------------------------------- */
.isys h1{margin:0 0 var(--s-1);font-size:25px;font-weight:600;letter-spacing:-.01em}
.isys h2{margin:0 0 var(--s-2);font-size:19px;font-weight:600}
.isys h3{margin:0;font-size:14.5px;font-weight:600}
.isys .lead{color:var(--ink-3);font-size:13.5px}
.isys .hint{font-size:11.5px;color:var(--ink-3)}
.isys .label{font-size:11px;font-weight:600;letter-spacing:.06em;
  text-transform:uppercase;color:var(--ink-2)}

/* --- cards -------------------------------------------------------------- */
.isys .card{background:var(--surface);border:1px solid var(--rule);
  border-radius:var(--r-lg)}
.isys .card > h3{padding:var(--s-3) var(--s-4);
  border-bottom:1px solid var(--rule)}
.isys .card > .body{padding:var(--s-4)}
.isys .card.lead{border-top:3px solid var(--gold)}
.isys .card.alert{border-color:var(--bad)}

/* --- controls ----------------------------------------------------------- */
.isys input,.isys select,.isys textarea{width:100%;padding:10px 12px;
  border:1px solid var(--rule-2);border-radius:var(--r);background:var(--surface);
  color:var(--ink);font:inherit;font-size:14px}
.isys input:focus,.isys select:focus,.isys textarea:focus{outline:none;
  border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-soft)}
.isys input:disabled,.isys select:disabled{background:var(--surface-2);
  color:var(--ink-3)}

.isys .btn{font:inherit;font-size:14px;font-weight:500;padding:9px 18px;
  border-radius:var(--r);border:1px solid var(--rule-2);cursor:pointer;
  background:var(--surface);color:var(--ink-2)}
.isys .btn:hover{border-color:var(--blue);color:var(--blue)}
.isys .btn.primary{background:var(--blue);border-color:var(--blue);color:#fff;
  font-weight:600}
.isys .btn.primary:hover{filter:brightness(1.08)}
.isys .btn.danger:hover{border-color:var(--bad);color:var(--bad)}
.isys .btn:disabled{opacity:.55;cursor:default}
.isys .btn:disabled:hover{border-color:var(--rule-2);color:var(--ink-2)}

/* --- badges. The meaning is the colour; there are four. ----------------- */
.isys .tag{display:inline-block;font-size:10.5px;font-weight:600;
  letter-spacing:.05em;text-transform:uppercase;padding:2px 9px;
  border-radius:var(--r-pill)}
.isys .tag.ok{background:var(--ok-soft);color:var(--ok)}
.isys .tag.warn{background:var(--warn-soft);color:var(--warn)}
.isys .tag.bad{background:var(--bad-soft);color:var(--bad)}
.isys .tag.info{background:var(--info-soft);color:var(--info)}
.isys .tag.quiet{background:var(--surface-2);color:var(--ink-3)}
.isys .tag.env{background:var(--gold-soft);color:var(--gold-ink);
  border:1px solid var(--gold);letter-spacing:.09em;padding:3px 10px}

/* --- tables ------------------------------------------------------------- */
.isys table{width:100%;border-collapse:collapse;font-size:13.5px}
.isys thead th{text-align:start;font-size:10.5px;font-weight:600;
  letter-spacing:.05em;text-transform:uppercase;color:var(--ink-3);
  background:var(--surface-2);padding:9px var(--s-3);
  border-bottom:1px solid var(--rule)}
.isys tbody td{padding:10px var(--s-3);border-bottom:1px solid var(--rule);
  vertical-align:top}
.isys tbody tr:last-child td{border-bottom:0}
.isys tbody tr:hover{background:var(--surface-2)}

/* --- notes -------------------------------------------------------------- */
.isys .note{border-radius:var(--r);padding:var(--s-3) var(--s-4);
  font-size:13px;border:1px solid}
.isys .note.info{background:var(--info-soft);border-color:var(--rule);
  color:var(--ink-2)}
.isys .note.warn{background:var(--warn-soft);border-color:var(--gold);
  color:var(--warn)}
.isys .note.bad{background:var(--bad-soft);border-color:var(--bad);
  color:var(--bad)}

/* --- the save bar. Nothing is written until it is pressed. -------------- */
.isys-save{position:fixed;left:0;right:0;bottom:0;z-index:300;display:flex;
  align-items:center;gap:var(--s-4);padding:11px var(--s-5);
  background:var(--surface);border-top:1px solid var(--rule);
  box-shadow:0 -6px 24px -18px rgba(15,24,34,.6)}

/* --- layout ------------------------------------------------------------- */
.isys main{max-width:1180px;margin:0 auto;padding:var(--s-6) var(--s-5) 44px}
.isys .grid-2{display:grid;grid-template-columns:1fr 1fr;gap:var(--s-4)}
.isys .grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--s-4)}
@media (max-width:1000px){.isys .grid-4{grid-template-columns:repeat(2,1fr)}}
@media (max-width:640px){
  .isys .grid-2,.isys .grid-4{grid-template-columns:1fr}
  .isys-bar .who{display:none}
}
