/* ============================================================
   Storetec Direct — Internal Tools
   Design tokens taken from the Shelving Order Configurator so
   every app shares one visual language.
   ============================================================ */
:root {
  --navy:       rgb(2, 26, 84);
  --navy-dk:    rgb(1, 18, 60);
  --navy-md:    rgb(3, 35, 105);
  --navy-lt:    rgb(5, 48, 130);
  --navy-deep:  #092c59;          /* brand swirl colour from logo deck */

  --indigo:     #4f46e5;
  --indigo-hv:  #4338ca;
  --indigo-dim: rgba(79,70,229,.12);
  --indigo-ring:rgba(79,70,229,.25);

  --bg:         #f0f2f5;
  --surface:    #fff;
  --surface2:   #f7f8fa;
  --surface3:   #eef0f4;

  --border:     #e2e5ec;
  --border2:    #cdd1db;

  --text:       #1a2340;
  --t2:         #4a5568;
  --t3:         #8a96a8;

  --green:#16a34a; --gdim:rgba(22,163,74,.1);
  --red:  #dc2626; --rdim:rgba(220,38,38,.1);
  --amber:#d97706; --adim:rgba(217,119,6,.1);
  --blue: #2563eb; --bdim:rgba(37,99,235,.1);

  --sans:'Montserrat',Arial,sans-serif;
  --mono:'Consolas','SF Mono',monospace;

  --sh:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --sh2: 0 4px 16px rgba(0,0,0,.12);
  --sh3: 0 12px 40px rgba(0,0,0,.18);
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Branded body backgrounds
   ============================================================ */
/* The "is-app" body is the landing/admin pages — navy with the
   stylised swirl from the brand deck, rendered as inline SVG so
   it stays sharp at any screen size. */
body.is-app {
  background-color: var(--navy);
  background-image: url("/static/swirl.svg");
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: min(110vh, 1400px) auto;
}
/* Auth (login) page reuses the same backdrop. */
body.is-auth {
  background-color: var(--navy);
  background-image: url("/static/swirl.svg");
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: min(110vh, 1400px) auto;
  min-height: 100vh;
  display: flex;
}

/* ============================================================
   Landing header — simple top bar with logo left, clock + avatar right.
   Used ONLY on the public landing page. Admin uses the sidebar below.
   ============================================================ */
.hdr {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  padding: 0 32px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.hdr-brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: inherit;
}
.hdr-brand img.hdr-logo-img {
  height: 40px; display: block;
  /* No filter — show the original logo colours on the white header. */
}
/* Fallback brand stack if the image fails to load */
.hdr-logo {
  display: flex; flex-direction: column; line-height: 1;
}
.hdr-logo .logo-eyebrow {
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: lowercase; color: var(--t3);
}
.hdr-logo .logo-word {
  display: block; font-size: 18px; font-weight: 900;
  color: var(--navy); letter-spacing: -.4px; line-height: 1.05;
}
.hdr-logo .logo-word + .logo-word { margin-top: -1px; }
.hdr-pill {
  font-size: 9px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--navy);
  background: var(--indigo-dim); border: 1px solid rgba(79,70,229,.22);
  padding: 3px 9px; border-radius: 20px;
}

.hdr-right {
  display: flex; align-items: center; gap: 16px;
  padding-right: 4px;
}
.hdr-clock {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--mono);
  color: var(--t2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.hdr-clock .clk-date { color: var(--text); font-weight: 600; }
.hdr-clock .clk-sep  { color: var(--t3); }
.hdr-clock .clk-time { color: var(--text); font-weight: 600; }

/* Avatar + sign-out group on the landing header.
   Avatar shows the user's initial; clicking it reveals a tiny popover
   with their email and a Sign out button. */
.hdr-user { position: relative; display: flex; align-items: center; gap: 10px; }
.hdr-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--indigo); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; cursor: pointer;
  border: 2px solid transparent; transition: border-color .14s;
}
.hdr-avatar:hover, .hdr-user.is-open .hdr-avatar { border-color: var(--indigo-ring); }

.hdr-pop {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--sh3);
  padding: 10px;
  display: none;
  z-index: 40;
}
.hdr-user.is-open .hdr-pop { display: block; }
.pop-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.pop-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--indigo); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.pop-id { min-width: 0; }
.pop-name { font-size: 13px; font-weight: 700; color: var(--text); }
.pop-mail { font-size: 11px; color: var(--t3); margin-top: 1px; word-break: break-all; }
.pop-form { margin: 0; }
.pop-link {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  background: none; border: none;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--red);
  padding: 8px 10px; border-radius: 6px;
  cursor: pointer; text-decoration: none;
  transition: background .12s;
}
.pop-link:hover { background: var(--rdim); }

/* ============================================================
   Stage — content area below the landing header
   ============================================================ */
.stage {
  min-height: calc(100vh - 64px);
  padding: 40px 32px 56px;
}

/* ============================================================
   App shell — used by admin pages.
   Same layout as the shelving / pricing apps: navy sidebar on the
   left, scrollable main panel on the right with a sticky topbar.
   ============================================================ */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--navy);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.main { flex: 1; overflow-y: auto; }

/* Sidebar logo block — matches shelving exactly */
.logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.25);
}
.logo img.logo-img {
  width: 100%; max-width: 200px;
  display: block; margin-bottom: 10px;
  filter: brightness(0) invert(1);   /* makes the dark logo white */
  opacity: .95;
}
.logo-eyebrow {
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: lowercase; color: rgba(255,255,255,.45);
}
.logo-word {
  display: block; font-size: 22px; font-weight: 900;
  color: #fff; letter-spacing: -.6px; line-height: 1.05;
}
.logo-tag {
  font-size: 9px; font-style: italic;
  color: rgba(255,255,255,.32); margin-top: 1px;
}
.logo-pill {
  display: inline-block; margin-top: 10px;
  font-size: 9px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #fff;
  background: rgba(255,255,255,.15);
  padding: 2px 8px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.25);
}

/* "Back to apps" button shown directly under the app pill —
   appears on every internal app for consistent navigation back.
   Forced to display:block via the wrapper and full-width sizing so
   it consistently sits below the inline-block pill. */
.logo .back-to-apps,
.back-to-apps {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85) !important;
  font-family: var(--sans);
  transition: all .14s;
  text-decoration: none !important;
  width: 100%;
}
.logo .back-to-apps:hover,
.back-to-apps:hover {
  background: rgba(255,255,255,.14);
  color: #fff !important;
  border-color: rgba(255,255,255,.5);
}
.back-to-apps svg { flex-shrink: 0; opacity: .8; }

/* Sidebar nav */
.nav { flex: 1; padding: 8px 0 4px; }
.nav-sec {
  font-size: 9px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255,255,255,.26);
  padding: 14px 18px 4px;
}
.nav-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px 8px 18px;
  cursor: pointer;
  color: rgba(255,255,255,.58);
  font-size: 13px; font-weight: 500;
  transition: all .14s;
  border: none; background: none;
  width: 100%; text-align: left;
  border-left: 3px solid transparent;
  font-family: var(--sans);
  text-decoration: none;
}
.nav-btn:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.88); }
.nav-btn.on   { background: rgba(79,70,229,.18); color: #fff; border-left-color: var(--indigo); }
.nav-btn svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .65; }
.nav-btn.on svg { opacity: 1; }

/* Sidebar footer — sign-out button (kept for legacy uses; admin moved
   "Back to apps" to under the pill). */
.sb-foot {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,.25);
  display: flex; flex-direction: column; gap: 5px;
}
.sb-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 10px; border-radius: 5px;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.25);
  background: none;
  color: rgba(255,255,255,.5);
  font-family: var(--sans);
  transition: all .14s;
  width: 100%;
  text-decoration: none;
}
.sb-btn:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.8); }

/* Persistent signed-in-user row at the very bottom of every app sidebar.
   Same shape across the auth admin, shelving, and pricing apps. */
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.15);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--indigo); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0; letter-spacing: .02em;
}
.user-meta { min-width: 0; flex: 1; }
.u-name {
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,.92);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.u-mail {
  font-size: 10px; color: rgba(255,255,255,.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
/* Older two-line variant — kept so legacy templates still render */
.u-role { font-size: 10px; color: rgba(255,255,255,.3); }

.user-signout-form { margin: 0; flex-shrink: 0; }
.user-signout {
  background: none; border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  transition: all .14s;
}
.user-signout:hover {
  background: var(--rdim); color: #fff;
  border-color: var(--red);
}

/* Topbar (inside .main) — matches shelving exactly */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.tb-l .tb-sec {
  display: block; font-size: 9.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--t3);
}
.tb-l .tb-ttl {
  display: block; font-size: 18px; font-weight: 800;
  color: var(--text); line-height: 1.2; margin-top: 1px;
}
.tb-r { display: flex; align-items: center; gap: 8px; }
.body { padding: 24px 28px; }

/* ============================================================
   Landing — hero + app tile grid
   ============================================================ */
.landing-hero {
  text-align: center;
  color: #fff;
  margin: 24px auto 36px;
  max-width: 760px;
}
.landing-hero h1 {
  font-size: 30px; font-weight: 800;
  letter-spacing: -.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.landing-hero p {
  margin-top: 8px;
  font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,.78);
  letter-spacing: .01em;
}
.landing-hero .hi-name { color: #fff; font-weight: 700; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}
.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--sh);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
  overflow: hidden;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh2);
  border-color: var(--indigo);
}
.tile::before {
  content: ""; position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--indigo);
  opacity: 0; transition: opacity .15s;
}
.tile:hover::before { opacity: 1; }
.tile-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; letter-spacing: .04em;
  margin-bottom: 14px;
}
.tile-name {
  font-size: 15px; font-weight: 800; color: var(--text);
  letter-spacing: -.1px;
}
.tile-desc {
  font-size: 12px; color: var(--t3); margin-top: 4px;
  line-height: 1.45;
}
.tile-cta {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--indigo);
}

.empty-tiles {
  background: var(--surface);
  border: 1px dashed var(--border2);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  color: var(--t2);
}
.empty-tiles strong { color: var(--text); display: block; margin-bottom: 6px; font-size: 14px; }

/* ============================================================
   Auth (login) page
   ============================================================ */
.auth-stage {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
  width: 100%;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 400px;
  padding: 32px;
  box-shadow: var(--sh3);
}
.auth-logo {
  display: flex; flex-direction: column;
  line-height: 1; margin-bottom: 20px;
}
.auth-logo img.auth-logo-img {
  width: 100%; max-width: 240px;
  display: block; margin: 0 auto 4px;
  /* No filter here — show the logo in its original brand colours
     against the white auth card. */
}
.auth-logo .logo-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: lowercase; color: var(--t3);
}
.auth-logo .logo-word {
  font-size: 22px; font-weight: 900;
  color: var(--navy); letter-spacing: -.5px; line-height: 1.05;
}
.auth-logo .logo-word + .logo-word { margin-top: -1px; }
.auth-logo .logo-tag {
  font-size: 10px; font-style: italic; color: var(--t3); margin-top: 4px;
}
.auth-pill {
  display: inline-block;
  font-size: 9px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--navy);
  background: var(--indigo-dim); border: 1px solid rgba(79,70,229,.22);
  padding: 3px 9px; border-radius: 20px;
  margin-top: 10px;
}
.auth-card h1 {
  font-size: 18px; font-weight: 800; color: var(--text);
  margin: 22px 0 4px;
}
.auth-card .auth-sub { font-size: 12px; color: var(--t3); margin-bottom: 18px; }

/* ============================================================
   Forms — same conventions as shelving
   ============================================================ */
.f { margin-bottom: 13px; }
.f label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--t2); margin-bottom: 4px;
}
.f input, .f select, .f textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--text); font-size: 13px;
  font-family: var(--sans); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.f input:focus, .f select:focus, .f textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-ring);
}
.f input::placeholder { color: var(--t3); }
.f textarea { resize: vertical; min-height: 80px; }
.fg { display: grid; gap: 11px; }
.fg.c2 { grid-template-columns: 1fr 1fr; }

/* ============================================================
   Buttons — identical to shelving app
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13px; font-weight: 600;
  font-family: var(--sans);
  cursor: pointer; border: none;
  transition: all .14s;
  white-space: nowrap; text-decoration: none;
}
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-p  { background: var(--indigo); color: #fff; }
.btn-p:hover { background: var(--indigo-hv); }
.btn-s  { background: var(--surface); color: var(--text); border: 1px solid var(--border2); }
.btn-s:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-g  { background: none; color: var(--t2); border: 1px solid var(--border); }
.btn-g:hover { border-color: var(--border2); color: var(--text); }
.btn-d  { background: var(--rdim); color: var(--red); border: 1px solid transparent; }
.btn-d:hover { border-color: var(--red); }
.btn-n  { background: var(--navy); color: #fff; }
.btn-n:hover { background: var(--navy-md); }
.btn.sm { padding: 6px 11px; font-size: 12px; }

/* ============================================================
   Cards / tables / badges — admin pages
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: var(--sh);
}
.card-hdr {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.card-ttl  { font-size: 14px; font-weight: 700; color: var(--text); }
.card-sub  { font-size: 11px; color: var(--t3); margin-top: 2px; }

.alert {
  padding: 10px 13px; border-radius: 6px;
  margin-bottom: 14px; font-size: 13px;
  display: flex; gap: 8px; align-items: flex-start;
}
.ai  { background: var(--bdim); border: 1px solid rgba(37,99,235,.2);   color: #1e40af; }
.aw  { background: var(--adim); border: 1px solid rgba(217,119,6,.2);   color: #92400e; }
.ae  { background: var(--rdim); border: 1px solid rgba(220,38,38,.2);   color: #991b1b; }
.aok { background: var(--gdim); border: 1px solid rgba(22,163,74,.2);   color: #166534; }

.tbl { overflow-x: auto; border-radius: 7px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); }
thead tr { background: var(--surface2); border-bottom: 1px solid var(--border); }
th {
  text-align: left; padding: 10px 14px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--t3); white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }
.mono { font-family: var(--mono); font-size: 12px; }

.bdg { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.bi { background: var(--indigo-dim); color: var(--indigo); }
.bg { background: var(--gdim); color: var(--green); }
.br { background: var(--rdim); color: var(--red); }
.ba { background: var(--adim); color: var(--amber); }
.bb { background: var(--bdim); color: var(--blue); }
.bn { background: rgba(27,42,74,.1); color: var(--navy); }

/* ============================================================
   Admin pages — content sits inside the .body of .main, so the
   shell is provided by .app/.sidebar/.topbar above. These rules
   just tune typography for admin content blocks.
   ============================================================ */
.admin-h1 {
  font-size: 18px; font-weight: 800; color: var(--text);
  margin-bottom: 4px;
}
.admin-sub { font-size: 12px; color: var(--t3); margin-bottom: 18px; }

/* Stat row used on admin overview */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-bottom: 18px; }
.stat  { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.stat.dk { background: var(--navy); border-color: transparent; }
.st-lbl { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--t3); }
.stat.dk .st-lbl { color: rgba(255,255,255,.4); }
.st-val { font-size: 24px; font-weight: 800; color: var(--text); margin: 4px 0 2px; line-height: 1; font-family: var(--mono); }
.stat.dk .st-val { color: #fff; }
.st-sub { font-size: 11px; color: var(--t3); }

/* Permission picker — grouped by app */
.perm-group  { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.perm-group-h { background: var(--surface2); padding: 8px 12px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t2); border-bottom: 1px solid var(--border); }
.perm-list   { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.perm-item   { display: flex; gap: 10px; padding: 9px 12px; align-items: flex-start; border-top: 1px solid var(--border); }
.perm-item:nth-child(1), .perm-item:nth-child(2) { border-top: none; }
.perm-item input[type="checkbox"] { margin-top: 2px; accent-color: var(--indigo); }
.perm-key  { font-family: var(--mono); font-size: 11px; color: var(--text); font-weight: 600; }
.perm-desc { font-size: 11px; color: var(--t3); margin-top: 2px; }

/* Flash messages */
.flash {
  background: var(--gdim);
  border: 1px solid rgba(22,163,74,.25);
  color: #166534;
  padding: 9px 13px; border-radius: 6px;
  font-size: 13px; margin-bottom: 14px;
}

/* Helpers */
.row-actions { display: flex; gap: 6px; }
.spacer { flex: 1; }
.mt2 { margin-top: 8px; } .mt3 { margin-top: 12px; } .mt4 { margin-top: 16px; }
.mb2 { margin-bottom: 8px; } .mb3 { margin-bottom: 12px; }
.muted { color: var(--t3); }
.hidden { display: none !important; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .hdr { padding: 0 16px; height: 60px; }
  .hdr-clock .clk-date { display: none; }
  .hdr-pill { display: none; }
  .stage { padding: 24px 16px 40px; }

  /* On narrow screens the admin sidebar collapses to a top strip. */
  .app { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: 100%; max-height: none; }
  .logo { padding: 16px 18px 12px; }
  .logo img.logo-img { width: 130px; }
  .nav { padding: 4px 0; display: flex; flex-wrap: wrap; }
  .nav-sec { width: 100%; padding: 8px 18px 2px; }
  .nav-btn { width: auto; flex: 1 1 auto; border-left: none; border-bottom: 3px solid transparent; }
  .nav-btn.on { border-left-color: transparent; border-bottom-color: var(--indigo); }
  .sb-foot, .user-row { display: none; }   /* keep mobile nav lean */
  .body { padding: 18px 16px; }
  .topbar { padding: 0 16px; }

  .perm-list { grid-template-columns: 1fr; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
