/* =====================================================================
   ALVIZ MEDICAL STORE  --  shared styles
   Navy and teal taken from the shop logo.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --navy:        #001232;
  --navy-soft:   #0a2350;
  --teal:        #018AA7;
  --teal-dark:   #016A81;
  --teal-wash:   #E6F4F7;

  --ink:         #12181f;
  --ink-soft:    #4a5560;
  --ink-faint:   #8b96a2;

  --paper:       #ffffff;
  --shell:       #f2f5f8;
  --line:        #dbe2ea;

  --ok:          #0f7a3d;
  --warn:        #9a6700;
  --bad:         #b3261e;
  --bad-wash:    #fdeceb;

  --radius:      8px;
  --radius-lg:   14px;
  --shadow:      0 1px 2px rgba(0,18,50,.08), 0 4px 16px rgba(0,18,50,.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--shell);
  -webkit-font-smoothing: antialiased;
}

/* numbers line up in columns and never shift width while typing */
.num, input[inputmode="decimal"], input[type="number"], .mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- app
   shell */
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: .04em; font-size: 14px;
  text-transform: uppercase;
}
.topbar .brand img { height: 30px; width: 30px; }
.topbar nav { display: flex; gap: 4px; margin-left: 10px; }
.topbar nav a {
  color: #c9d5e4; text-decoration: none; padding: 7px 13px;
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
}
.topbar nav a:hover { background: var(--navy-soft); color: #fff; }
.topbar nav a.on { background: var(--teal); color: #fff; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: #9fb0c6; }
.topbar .who b { color: #fff; font-weight: 500; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 20px 18px 60px; }
.wrap.narrow { max-width: 720px; }

/* ------------------------------------------------------------- panels */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 18px; }
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.panel-head h2 {
  margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .02em;
}
.panel-body { padding: 18px; }

/* ------------------------------------------------------------- forms */
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-bottom: 5px; }

input[type=text], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-wash);
}
input[readonly] { background: #f6f8fa; color: var(--ink-soft); }

.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 5px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  font: inherit; font-weight: 500;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #f6f8fa; }
.btn:focus-visible { outline: 3px solid var(--teal-wash); outline-offset: 1px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }

.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-soft); }

.btn-danger { color: var(--bad); border-color: #f0c4c1; background: #fff; }
.btn-danger:hover { background: var(--bad-wash); }

.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ notices */
.notice {
  padding: 11px 14px; border-radius: var(--radius);
  font-size: 14px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.notice-bad  { background: var(--bad-wash); border-color: #f3c9c6; color: #86211b; }
.notice-ok   { background: #e8f6ed; border-color: #bfe3cd; color: #0c5c2f; }
.notice-warn { background: #fdf5e2; border-color: #f0dcae; color: #7a5200; }

/* ------------------------------------------------------------- tables */
table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint);
  padding: 9px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.grid td { padding: 10px; border-bottom: 1px solid #eef2f6; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid .r { text-align: right; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.pill-void { background: var(--bad-wash); color: #86211b; }
.pill-ok   { background: #e8f6ed; color: #0c5c2f; }

/* --------------------------------------------------------- login page */
.login-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 50% -10%, #06305c 0%, var(--navy) 60%);
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--paper);
  border-radius: 18px;
  padding: 30px 28px 26px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.login-card .mark { text-align: center; margin-bottom: 18px; }
.login-card .mark img { width: 86px; height: 86px; }
.login-card h1 {
  margin: 0 0 3px; text-align: center;
  font-size: 17px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--navy);
}
.login-card .sub {
  text-align: center; font-size: 13px; color: var(--ink-faint);
  margin: 0 0 22px;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.check input { width: 16px; height: 16px; accent-color: var(--teal); }

/* -------------------------------------------------------- offline bar */
.offline-bar {
  display: none;
  background: var(--warn); color: #fff;
  text-align: center; padding: 7px; font-size: 14px; font-weight: 500;
}
body.is-offline .offline-bar { display: block; }

@media (max-width: 640px) {
  .row { flex-direction: column; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar .who { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --------------------------------------------------- show password */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 62px; }

.pw-eye {
  position: absolute;
  top: 50%; right: 6px;
  transform: translateY(-50%);
  padding: 5px 10px;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--teal-dark);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.pw-eye:hover { background: var(--teal-wash); }
.pw-eye:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
