/* =====================================================================
   POCAD Technician Portal — Unified Design System
   File:    /tech/assets/tech-ui.css
   Version: 1.0  ·  July 24, 2026
   Accent:  Tech-blue (#2e9cf5)
   ---------------------------------------------------------------------
   PRESENTATION LAYER ONLY. This file introduces NO behavior and NO
   business logic. It is inert until a page opts in by (a) linking it
   and (b) using its classes. Existing pages are unaffected until then.

   Font pairing (load once in each page <head>):
     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link href="https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap" rel="stylesheet">
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. DESIGN TOKENS
   Single source of truth. Every color/spacing value below is derived
   from the login page so the whole portal reads as one product.
--------------------------------------------------------------------- */
:root {
  /* Surfaces (dark) */
  --t-bg0:        #02040a;   /* page base            */
  --t-bg1:        #04080f;   /* raised base          */
  --t-bg2:        #071420;   /* panel                */
  --t-bg3:        #0a1c2e;   /* elevated panel       */

  /* Brand accent — TECH BLUE */
  --t-accent:       #2e9cf5;
  --t-accent-2:     #1f7ed0; /* gradient end / hover */
  --t-accent-soft:  rgba(46,156,245,.12);
  --t-accent-line:  rgba(46,156,245,.28);
  --t-accent-glow:  rgba(46,156,245,.16);

  /* Secondary brand tones (kept for continuity across the platform) */
  --t-teal:       #3c8699;
  --t-teal-soft:  rgba(60,134,153,.12);
  --t-orange:     #ff3000;   /* reserved: destructive / high-alert    */
  --t-orange-soft:rgba(255,48,0,.12);

  /* Text (ink on dark) */
  --t-ink:        #e8f0f7;
  --t-ink-muted:  rgba(232,240,247,.62);
  --t-ink-faint:  rgba(232,240,247,.34);
  --t-ink-strong: #ffffff;

  /* Lines */
  --t-border:     rgba(148,163,184,.14);
  --t-border-hi:  rgba(148,163,184,.26);

  /* Panels / inputs */
  --t-card:       linear-gradient(160deg, rgba(12,26,46,.72), rgba(4,8,15,.9));
  --t-panel:      rgba(4,8,15,.86);
  --t-input-bg:   rgba(2,6,23,.72);
  --t-input-focus-bg: rgba(2,6,23,.9);

  /* Status */
  --t-ok:         #34d399;  --t-ok-soft:   rgba(52,211,153,.13);  --t-ok-line:   rgba(52,211,153,.3);
  --t-warn:       #fbbf24;  --t-warn-soft: rgba(251,191,36,.13);  --t-warn-line: rgba(251,191,36,.3);
  --t-bad:        #f87171;  --t-bad-soft:  rgba(248,113,113,.14); --t-bad-line:  rgba(248,113,113,.3);

  /* Radii */
  --t-r-xs: 8px;
  --t-r-sm: 12px;
  --t-r-md: 14px;   /* default control radius */
  --t-r-lg: 18px;   /* default card radius    */
  --t-r-xl: 26px;   /* hero / auth card       */
  --t-r-pill: 100px;

  /* Spacing scale */
  --t-s1: 4px;  --t-s2: 8px;  --t-s3: 12px; --t-s4: 16px;
  --t-s5: 20px; --t-s6: 24px; --t-s7: 32px; --t-s8: 44px;

  /* Type */
  --t-font-head: 'Syne', system-ui, sans-serif;
  --t-font-body: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Elevation */
  --t-shadow-sm: 0 6px 18px rgba(0,0,0,.28);
  --t-shadow-md: 0 16px 44px rgba(0,0,0,.4);
  --t-shadow-accent: 0 12px 28px rgba(46,156,245,.22);

  /* Native chrome heights */
  --t-header-h: 60px;
  --t-bottomnav-h: 64px;

  /* Motion */
  --t-ease: cubic-bezier(.22,1,.36,1);
}

/* ---------------------------------------------------------------------
   2. RESET + BASE
   Scoped soft-reset. Pages opt in by adding class="t-ui" on <body>.
   This avoids clobbering pages that haven't migrated yet.
--------------------------------------------------------------------- */
.t-ui *, .t-ui *::before, .t-ui *::after { box-sizing: border-box; }

.t-ui {
  margin: 0;
  font-family: var(--t-font-body);
  color: var(--t-ink);
  background-color: var(--t-bg0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Safe-area padding helpers for notch / home indicator */
.t-safe-top    { padding-top: env(safe-area-inset-top); }
.t-safe-bottom { padding-bottom: env(safe-area-inset-bottom); }
.t-safe-x      { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* Ambient background (optional): <div class="t-bg"></div> as first child */
.t-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 900px 600px at -5% 8%,   rgba(60,134,153,.14) 0%, transparent 55%),
    radial-gradient(ellipse 700px 520px at 105% 92%, rgba(255,48,0,.06)   0%, transparent 50%),
    radial-gradient(ellipse 620px 420px at 50% -8%,  rgba(46,156,245,.08) 0%, transparent 45%);
}
.t-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(60,134,153,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60,134,153,.05) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 0%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 0%, transparent 100%);
}

/* ---------------------------------------------------------------------
   3. TYPOGRAPHY
--------------------------------------------------------------------- */
.t-ui h1, .t-ui h2, .t-ui h3, .t-ui .t-head { font-family: var(--t-font-head); font-weight: 700; letter-spacing: -.4px; color: var(--t-ink); line-height: 1.08; }
.t-ui h1 { font-size: clamp(28px, 4.5vw, 40px); font-weight: 800; }
.t-ui h2 { font-size: clamp(22px, 3vw, 28px); }
.t-ui h3 { font-size: 18px; }

.t-kicker {
  font-size: 10px; font-weight: 700; letter-spacing: 2.4px;
  text-transform: uppercase; color: var(--t-accent);
}
.t-muted  { color: var(--t-ink-muted); }
.t-faint  { color: var(--t-ink-faint); }
.t-accent-text { color: var(--t-accent); }

/* ---------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
--------------------------------------------------------------------- */
.t-container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--t-s5); }
.t-container-narrow { max-width: 480px; }
.t-stack > * + * { margin-top: var(--t-s4); }
.t-row  { display: flex; gap: var(--t-s3); flex-wrap: wrap; }
.t-row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--t-s3); }
.t-grid { display: grid; gap: var(--t-s4); }
.t-grid-2 { grid-template-columns: repeat(2, 1fr); }
.t-grid-3 { grid-template-columns: repeat(3, 1fr); }
.t-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------------------------------------------------------------------
   5. CARDS
--------------------------------------------------------------------- */
.t-card {
  position: relative;
  background: var(--t-card);
  border: 1px solid var(--t-border);
  border-radius: var(--t-r-lg);
  padding: var(--t-s6);
  box-shadow: var(--t-shadow-sm);
  backdrop-filter: blur(10px);
}
.t-card-flush { padding: 0; overflow: hidden; }
.t-card-hero { border-radius: var(--t-r-xl); padding: var(--t-s7); box-shadow: var(--t-shadow-md); }
.t-card-accent { border-color: var(--t-accent-line); }
.t-card-accent::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--t-accent), transparent);
  border-radius: var(--t-r-lg) var(--t-r-lg) 0 0;
}
.t-card-title { font-family: var(--t-font-head); font-weight: 700; font-size: 16px; margin-bottom: var(--t-s2); }

/* ---------------------------------------------------------------------
   6. BUTTONS  (one radius: --t-r-md; consistent everywhere)
--------------------------------------------------------------------- */
.t-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--t-s2);
  border: 1px solid transparent; border-radius: var(--t-r-md);
  padding: 13px 18px; min-height: 44px;  /* comfortable tap target */
  font-family: var(--t-font-body); font-size: 13px; font-weight: 700;
  letter-spacing: .6px; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--t-ease), box-shadow .2s var(--t-ease), filter .2s var(--t-ease), background .2s var(--t-ease), border-color .2s var(--t-ease);
  white-space: nowrap; user-select: none;
}
.t-btn:active { transform: translateY(1px) scale(.99); }

.t-btn-primary {
  background: linear-gradient(135deg, var(--t-accent) 0%, var(--t-accent-2) 100%);
  color: #fff; box-shadow: var(--t-shadow-accent);
}
.t-btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 16px 32px rgba(46,156,245,.3); }

.t-btn-secondary {
  background: rgba(255,255,255,.02); border-color: var(--t-accent-line); color: var(--t-accent);
}
.t-btn-secondary:hover { background: var(--t-accent-soft); border-color: rgba(46,156,245,.45); color: #fff; transform: translateY(-1px); }

.t-btn-ghost { background: transparent; border-color: var(--t-border-hi); color: var(--t-ink-muted); }
.t-btn-ghost:hover { color: var(--t-ink); border-color: var(--t-ink-faint); }

/* Reserved for destructive / high-alert only */
.t-btn-danger { background: linear-gradient(135deg, var(--t-orange), #c62600); color:#fff; box-shadow: 0 12px 28px rgba(255,48,0,.22); }
.t-btn-danger:hover { transform: translateY(-1px); filter: brightness(1.05); }

.t-btn-sm { min-height: 36px; padding: 8px 14px; font-size: 12px; }
.t-btn-lg { min-height: 52px; padding: 16px 22px; font-size: 14px; }
.t-btn-block { width: 100%; }
.t-btn:disabled, .t-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------------------------------------------------------------------
   7. FORMS
--------------------------------------------------------------------- */
.t-field { display: flex; flex-direction: column; gap: 7px; }
.t-label { font-size: 12px; font-weight: 600; color: #d8e3ec; letter-spacing: .2px; }
.t-hint  { font-size: 11.5px; color: var(--t-ink-faint); }

.t-input, .t-select, .t-textarea {
  width: 100%; min-height: 44px;
  padding: 13px 15px; border-radius: var(--t-r-md);
  border: 1px solid rgba(148,163,184,.2);
  background: var(--t-input-bg); color: #fff;
  font-family: inherit; font-size: 14px;
  transition: border-color .2s var(--t-ease), box-shadow .2s var(--t-ease), background .2s var(--t-ease);
}
.t-textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.t-input::placeholder, .t-textarea::placeholder { color: rgba(232,240,247,.34); }
.t-input:focus, .t-select:focus, .t-textarea:focus {
  outline: none; border-color: rgba(46,156,245,.75);
  box-shadow: 0 0 0 4px var(--t-accent-soft); background: var(--t-input-focus-bg);
}
.t-input:disabled, .t-input[readonly] { opacity: .7; cursor: not-allowed; }

/* File / upload dropzone */
.t-dropzone {
  border: 1.5px dashed rgba(46,156,245,.35); border-radius: var(--t-r-md);
  padding: var(--t-s5); text-align: center; color: var(--t-ink-muted);
  background: rgba(46,156,245,.03); transition: border-color .2s var(--t-ease), background .2s var(--t-ease);
}
.t-dropzone:hover { border-color: rgba(46,156,245,.6); background: rgba(46,156,245,.06); }

/* ---------------------------------------------------------------------
   8. BADGES / PILLS / STATUS  (one status system, not two)
--------------------------------------------------------------------- */
.t-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--t-r-pill); padding: 5px 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  background: var(--t-accent-soft); border: 1px solid var(--t-accent-line); color: var(--t-accent);
}
.t-badge-dot::before { content:''; width:6px; height:6px; border-radius:50%; background: currentColor; }
.t-badge-live::before { animation: t-pulse 2s ease-in-out infinite; }

.t-status { display:inline-flex; align-items:center; gap:6px; border-radius: var(--t-r-pill); padding: 4px 11px; font-size: 11.5px; font-weight: 700; border:1px solid; }
.t-status-ok   { background: var(--t-ok-soft);   color: #6ee7b7; border-color: var(--t-ok-line); }
.t-status-warn { background: var(--t-warn-soft); color: #fcd34d; border-color: var(--t-warn-line); }
.t-status-bad  { background: var(--t-bad-soft);  color: #fca5a5; border-color: var(--t-bad-line); }
.t-status-neutral { background: rgba(148,163,184,.08); color: var(--t-ink-muted); border-color: var(--t-border); }
.t-status::before { content:''; width:7px; height:7px; border-radius:50%; background: currentColor; }

/* ---------------------------------------------------------------------
   9. ALERTS  (inline feedback — replaces bare server flashes)
--------------------------------------------------------------------- */
.t-alert { border-radius: var(--t-r-md); padding: 12px 15px; font-size: 13px; line-height: 1.5; border: 1px solid; }
.t-alert-ok   { background: var(--t-ok-soft);   border-color: var(--t-ok-line);   color: #bbf7d0; }
.t-alert-warn { background: var(--t-warn-soft); border-color: var(--t-warn-line); color: #fde68a; }
.t-alert-bad  { background: rgba(127,29,29,.32); border-color: rgba(239,68,68,.45); color: #fecaca; }
.t-alert-info { background: var(--t-accent-soft); border-color: var(--t-accent-line); color: #bfdbfe; }

/* ---------------------------------------------------------------------
   10. TABLES  (responsive; no forced min-width)
--------------------------------------------------------------------- */
.t-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--t-r-md); }
.t-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t-table th, .t-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--t-border); }
.t-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--t-ink-faint); font-weight: 700; }
.t-table td { color: var(--t-ink-muted); }
.t-table tbody tr:hover { background: rgba(46,156,245,.04); }

/* ---------------------------------------------------------------------
   11. EMPTY / LOADING / SKELETON STATES  (were missing entirely)
--------------------------------------------------------------------- */
.t-empty { text-align: center; padding: var(--t-s7) var(--t-s5); color: var(--t-ink-muted); }
.t-empty-icon { font-size: 30px; opacity: .5; margin-bottom: var(--t-s3); }
.t-empty-title { font-family: var(--t-font-head); font-weight: 700; font-size: 16px; color: var(--t-ink); margin-bottom: 6px; }
.t-empty-text { font-size: 13px; max-width: 320px; margin: 0 auto; }

.t-spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--t-accent-soft); border-top-color: var(--t-accent); animation: t-spin .7s linear infinite; }
.t-skeleton { position: relative; overflow: hidden; background: rgba(148,163,184,.08); border-radius: var(--t-r-sm); }
.t-skeleton::after { content:''; position:absolute; inset:0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: t-shimmer 1.4s infinite; }

/* ---------------------------------------------------------------------
   12. NATIVE CHROME — top bar + bottom tab bar
--------------------------------------------------------------------- */
.t-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: var(--t-s3);
  height: var(--t-header-h); padding: 0 var(--t-s4);
  padding-top: env(safe-area-inset-top);
  background: rgba(2,4,10,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--t-border);
}
.t-topbar-title { font-family: var(--t-font-head); font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.t-topbar-brand { display: flex; align-items: center; gap: 10px; }
.t-topbar-logo { height: 26px; width: auto; display: block; }

/* Native-style bottom tab bar */
.t-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--t-bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(2,4,10,.9); backdrop-filter: blur(16px);
  border-top: 1px solid var(--t-border);
}
.t-bottomnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--t-ink-faint); font-size: 10.5px; font-weight: 600;
  transition: color .2s var(--t-ease); position: relative; min-width: 44px;
}
.t-bottomnav-item svg, .t-bottomnav-item .t-ico { width: 22px; height: 22px; }
.t-bottomnav-item.active { color: var(--t-accent); }
.t-bottomnav-item.active::before { content:''; position:absolute; top:0; width:28px; height:3px; border-radius:0 0 3px 3px; background: var(--t-accent); }

/* Give page content room above a fixed bottom nav */
.t-has-bottomnav { padding-bottom: calc(var(--t-bottomnav-h) + env(safe-area-inset-bottom) + var(--t-s5)); }

/* ---------------------------------------------------------------------
   13. UTILITIES
--------------------------------------------------------------------- */
.t-divider { height: 1px; background: var(--t-border); border: 0; margin: var(--t-s5) 0; }
.t-text-center { text-align: center; }
.t-mt-0{margin-top:0}.t-mt-2{margin-top:var(--t-s2)}.t-mt-4{margin-top:var(--t-s4)}.t-mt-6{margin-top:var(--t-s6)}
.t-hide { display: none !important; }
.t-sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ---------------------------------------------------------------------
   14. ANIMATIONS
--------------------------------------------------------------------- */
@keyframes t-pulse   { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.8)} }
@keyframes t-spin    { to { transform: rotate(360deg); } }
@keyframes t-shimmer { 100% { transform: translateX(100%); } }
@keyframes t-fadeUp  { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
.t-animate-in { animation: t-fadeUp .6s var(--t-ease) both; }

@media (prefers-reduced-motion: reduce) {
  .t-ui *, .t-animate-in { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------------
   15. RESPONSIVE
--------------------------------------------------------------------- */
@media (max-width: 900px) {
  .t-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .t-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .t-container { padding: 0 var(--t-s4); }
  .t-grid-2, .t-grid-3, .t-grid-4 { grid-template-columns: 1fr; }
  .t-card { padding: var(--t-s5); }
  .t-card-hero { padding: var(--t-s6); }
  .t-btn-responsive { width: 100%; }
}
