/* InventorySystem's copy of Gradebook's design system: same tokens (colors, radii,
   shadows, type), same top-nav-bar/card/button/table/pill/modal shapes, same
   data-theme light/dark switch. Trimmed to the generic, reusable core -- Gradebook's
   own theme.css also has ~1800 lines of domain-specific rules (timecards, student
   dashboards, notification push, account-avatar cropping) that don't apply here.
   Targets MudBlazor's own class names directly so existing MudCard/MudButton/MudTable/
   MudDialog components pick up the look without being rewritten as raw HTML. */
:root {
  --accent: #0bab9a;
  --accent-hover: #0c9686;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --surface-3: #eef1f4;
  --surface-4: #e3e8ed;
  --text: #14181d;
  --muted: #5b6572;
  --border: #dde2e8;
  --border-dark: #c4cbd4;
  --button: #f3f5f7;
  --button-text: #14181d;
  --danger: #c72a3b;
  --success: #16815a;
  --warn: #a3620a;
  --danger-soft: #fdecee;
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 29, .05), 0 1px 1px rgba(20, 24, 29, .04);
  --shadow-md: 0 6px 16px rgba(20, 24, 29, .08), 0 2px 6px rgba(20, 24, 29, .05);
  --shadow-lg: 0 20px 48px rgba(20, 24, 29, .18), 0 6px 18px rgba(20, 24, 29, .08);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1216;
  --surface: #171b21;
  --surface-2: #1d222a;
  --surface-3: #262c35;
  --surface-4: #313945;
  --text: #eef1f5;
  --muted: #9aa6b4;
  --border: #2b323c;
  --border-dark: #3a4451;
  --button: #232a33;
  --button-text: #eef1f5;
  --danger: #ff7a86;
  --success: #6fe0ab;
  --warn: #ffc061;
  --danger-soft: rgba(255, 122, 134, .16);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, .42), 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-lg: 0 28px 64px rgba(0, 0, 0, .55), 0 8px 22px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  transition: background-color .15s var(--ease), color .15s var(--ease) !important;
  -webkit-font-smoothing: antialiased;
  padding-top: 64px !important;
}
h1, h2, h3 { color: var(--text) !important; letter-spacing: -.01em !important; }

/* ---- Login screen (mirrors Gradebook's #loginScreen/.login-wrap/.login-card) ---- */
body:has(.pb-login-screen) { padding-top: 0 !important; }
.pb-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, #203b4f, #101820 55%);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.pb-login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .48);
  z-index: 0;
  pointer-events: none;
}
.pb-login-bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100vh;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: translate(-50%, -50%) scale(1.02);
  z-index: 0;
  background: #101820;
}
.pb-login-wrap {
  width: 380px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.pb-login-wrap::before {
  content: "";
  position: absolute;
  left: -24px; right: -24px; top: -22px; bottom: -24px;
  border-radius: 28px;
  background: rgba(10, 18, 24, .28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
  z-index: -1;
  pointer-events: none;
}
.pb-login-brand-logo {
  display: block;
  max-width: 320px;
  max-height: 170px;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .35));
}
.pb-login-brand-title {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-shadow: 0 10px 22px rgba(0, 0, 0, .35);
}
.pb-login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.pb-login-card h1 { text-align: center; margin: 0 0 16px; font-size: 20px; }
.pb-login-card label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 12px 0 4px;
}
.pb-login-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
}
.pb-login-card input:focus { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
.pb-login-submit {
  width: 100%;
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
.pb-login-submit:hover { background: var(--accent-hover); }
.pb-login-submit:disabled { opacity: .6; cursor: default; }

/* ---- Top nav bar (mirrors Gradebook's .gradebook-side-nav, despite the name it's a
   fixed full-width TOP bar, not a side rail) ---- */
.gradebook-side-nav {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 64px;
  z-index: 9000;
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 18px;
  gap: 6px;
}
.gradebook-side-title {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 0 0;
  margin-right: 6px;
  border-right: 1px solid var(--border) !important;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.01em;
  color: var(--text) !important;
  white-space: nowrap;
  text-decoration: none !important;
  cursor: pointer;
}
.gradebook-side-title:hover { color: var(--accent) !important; }
.gradebook-brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px;
}
.gradebook-side-links {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  scrollbar-width: none;
}
.gradebook-side-links::-webkit-scrollbar { display: none; }
.gradebook-side-links a {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 8px 14px;
  color: var(--muted) !important;
  text-decoration: none !important;
  border-radius: var(--radius-pill) !important;
  line-height: 1.25;
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background-color .12s var(--ease), color .12s var(--ease) !important;
}
.gradebook-side-links a:hover { background: var(--surface-2) !important; color: var(--text) !important; }
.gradebook-side-links a.active {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: var(--shadow-sm) !important;
}
.gradebook-side-footer { flex: 0 0 auto; margin-left: 8px; display: flex; align-items: center; gap: 6px; }

main.gb-main { padding: 20px !important; }

/* ---- Buttons: flat with soft depth, accent for primary actions ----
   Targets MudBlazor's actual button markup so existing MudButton usages everywhere
   just pick this up without touching each call site. */
.mud-button-root {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-sm) !important;
  text-transform: none !important;
  font-weight: 600 !important;
  transition: background-color .12s var(--ease), border-color .12s var(--ease), transform .08s var(--ease), box-shadow .12s var(--ease) !important;
}
.mud-button-root:active { transform: translateY(1px) !important; }
.mud-button-filled.mud-button-filled-primary,
.mud-button-filled.mud-button-filled-primary:hover {
  background-color: var(--accent) !important;
}
.mud-button-filled.mud-button-filled-primary:hover { background-color: var(--accent-hover) !important; }
.mud-button-outlined {
  border-color: var(--border-dark) !important;
}
.mud-icon-button {
  border-radius: var(--radius-sm) !important;
}

/* ---- Cards/panels: soft elevation, rounded, gentle border ---- */
.mud-paper {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-sm) !important;
  border: 1px solid var(--border) !important;
}
.mud-card { border-radius: var(--radius-md) !important; }

/* ---- Forms ---- */
.mud-input-outlined .mud-input-outlined-border {
  border-radius: var(--radius-sm) !important;
  border-color: var(--border-dark) !important;
}
.mud-input-outlined.mud-shrink .mud-input-outlined-border,
.mud-input-outlined:hover:not(.mud-disabled) .mud-input-outlined-border {
  border-color: var(--accent) !important;
}

/* ---- Status pills (MudChip) ---- */
.mud-chip {
  border-radius: var(--radius-pill) !important;
  font-weight: 700 !important;
  font-size: 11px !important;
}

/* ---- Dense tables with soft dividers ---- */
.mud-table-container {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
}
.mud-table-root thead .mud-table-cell {
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.mud-table-root tbody tr:nth-child(even) .mud-table-cell { background: var(--surface-2) !important; }
.mud-table-root tbody tr:hover .mud-table-cell { background: color-mix(in srgb, var(--accent) 8%, var(--surface)) !important; }

/* ---- Dialogs: same rounded/shadow language as the rest of the app ---- */
.mud-dialog {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
}
.mud-dialog-title { font-weight: 700 !important; }

@media (max-width: 900px) {
  .gradebook-side-links a { padding: 7px 11px; }
  main.gb-main { padding: 10px !important; }
}

/* ---- Android app download promo (Android visitors only, see android-app-promo.js) ---- */
.android-app-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9500;
}
/* Push page content below the banner rather than letting it float over the top of
   whatever's already there. Three cases, each needing a different total offset: login
   screen alone (0, already set elsewhere), login screen + banner (banner's own height),
   and the authenticated nav bar + banner (nav bar's 64px stacked under the banner too,
   both the body's scroll offset and the fixed nav bar's own position need it). More
   `:has()` clauses = higher specificity, so these safely override the single-condition
   rules elsewhere regardless of source order. */
body:has(.android-app-banner):has(.pb-login-screen) { padding-top: 42px !important; }
body:has(.android-app-banner):has(.gradebook-side-nav) { padding-top: 106px !important; }
body:has(.android-app-banner) .gradebook-side-nav { top: 42px; }
.android-app-banner span { flex: 1 1 auto; }
.android-app-banner-download {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, .18);
  color: #fff !important;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  text-decoration: none !important;
  white-space: nowrap;
}
.android-app-banner-download:hover { background: rgba(255, 255, 255, .3); }
.android-app-banner-dismiss {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: #fff;
  opacity: .8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
}
.android-app-banner-dismiss:hover { opacity: 1; }
