/* =========================================================================
   Sistem Permohonan VTM — Fresh Theme
   Light, clinical-but-warm palette built around the specimen-tracking
   subject matter. Signature device: color-coded "tube-cap" status dots
   used consistently across badges, tables, and the activity feed.
   ========================================================================= */

:root {
  /* Color */
  --bg: #F6F8F7;
  --surface: #FFFFFF;
  --surface-2: #FBFCFB;
  --ink: #16211F;
  --muted: #6B7A78;
  --line: #E4E9E7;
  --primary: #146B5C;
  --primary-dark: #0E4F44;
  --primary-tint: #E6F1EE;
  --accent: #E7A33E;
  --accent-tint: #FBF1DE;
  --danger: #C4453A;
  --danger-tint: #FBEAE8;
  --success: #3F9142;
  --success-tint: #EAF5EA;
  --info: #3E7CB1;
  --info-tint: #E9F1F8;

  /* Type */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Shape */
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(22, 33, 31, 0.06);
  --shadow-md: 0 8px 24px rgba(22, 33, 31, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display-num {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  color: var(--ink);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.mono { font-family: var(--font-mono); }

/* Focus visibility (accessibility floor) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

/* ---------------------------------------------------------------------- */
/* App shell: sidebar + topbar                                            */
/* ---------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand .mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-family: var(--font-display); font-weight: 700; font-size: 15px;
}

.sidebar-brand .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
}
.sidebar-brand .name small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }

.sidebar-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.sidebar-nav .group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 14px 10px 6px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 2px 0;
  border-radius: 9px;
  color: var(--ink);
  font-size: 14px; font-weight: 500;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: var(--surface-2); }
.sidebar-nav a.active {
  background: var(--primary-tint);
  color: var(--primary-dark);
  border-left-color: var(--primary);
}
.sidebar-nav a .icon { width: 18px; text-align: center; opacity: 0.85; }
.sidebar-nav .badge-count {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 7px;
}

.sidebar-foot { padding: 14px 22px; border-top: 1px solid var(--line); }
.sidebar-foot a { color: var(--muted); font-size: 13px; font-weight: 500; }
.sidebar-foot a:hover { color: var(--danger); }

.main { flex: 1; min-width: 0; }

.topbar {
  height: 68px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 19px; margin: 0; }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; }
.topbar .user-chip .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-tint); color: #8A5A12;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.topbar .user-chip .role-tag {
  font-size: 11px; color: var(--muted); text-transform: capitalize;
}

.content { padding: 26px 28px 60px; }

/* ---------------------------------------------------------------------- */
/* Cards                                                                   */
/* ---------------------------------------------------------------------- */
.card2 {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card2-pad { padding: 20px 22px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .stat-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card .stat-label {
  font-size: 12.5px; color: var(--muted); font-weight: 500;
  display: flex; align-items: center; gap: 7px;
}
.stat-card .stat-num {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 600; margin-top: 6px; line-height: 1;
}
.stat-card .stat-trend {
  margin-top: 10px; font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-trend.flat { color: var(--muted); }
.stat-card .stat-icon-strip {
  position: absolute; top: 0; right: 0; bottom: 0; width: 4px;
}

/* ---------------------------------------------------------------------- */
/* Signature device: tube-cap status dot                                  */
/* ---------------------------------------------------------------------- */
.cap-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 7px; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6) inset;
}
.cap-new     { background: var(--info); }
.cap-process { background: var(--accent); }
.cap-ready   { background: #A85EC9; }
.cap-done    { background: var(--success); }
.cap-reject  { background: var(--danger); }

.status-pill {
  display: inline-flex; align-items: center;
  font-size: 12.5px; font-weight: 600;
  padding: 4px 11px 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ---------------------------------------------------------------------- */
/* Buttons + forms                                                        */
/* ---------------------------------------------------------------------- */
.btn2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.05s ease, background 0.15s ease;
}
.btn2:active { transform: scale(0.98); }
.btn2-primary { background: var(--primary); color: #fff; }
.btn2-primary:hover { background: var(--primary-dark); color: #fff; }
.btn2-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn2-ghost:hover { background: var(--surface-2); }
.btn2-block { width: 100%; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--font-body); font-size: 14.5px;
  padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

.alert2 {
  padding: 11px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  margin-bottom: 16px; border: 1px solid transparent;
}
.alert2-danger { background: var(--danger-tint); color: #8A2E26; border-color: #F0CFCB; }
.alert2-success { background: var(--success-tint); color: #276A2A; border-color: #C9E5CA; }

/* ---------------------------------------------------------------------- */
/* Activity feed                                                          */
/* ---------------------------------------------------------------------- */
.feed { position: relative; padding-left: 4px; }
.feed-item { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.feed-item:not(:last-child)::after {
  content: ''; position: absolute; left: 13px; top: 32px; bottom: -4px; width: 1px;
  background: var(--line);
}
.feed-item .feed-dot {
  width: 27px; height: 27px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line); z-index: 1;
}
.feed-item .feed-body { flex: 1; }
.feed-item .feed-title { font-size: 13.5px; font-weight: 600; }
.feed-item .feed-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------------------- */
/* Login page                                                             */
/* ---------------------------------------------------------------------- */
.login-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface);
}
@media (max-width: 900px) { .login-shell { grid-template-columns: 1fr; } .login-brand { display: none; } }

.login-brand {
  background: radial-gradient(circle at 30% 20%, var(--primary-dark), #0A3A32 70%);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px;
  color: #EAF6F2;
}
.login-brand .ring {
  position: absolute; border: 1px dashed rgba(234,246,242,0.18); border-radius: 50%;
  animation: pulse-ring 7s ease-in-out infinite;
}
.login-brand .ring.r1 { width: 340px; height: 340px; right: -90px; top: 30%; }
.login-brand .ring.r2 { width: 520px; height: 520px; right: -180px; top: 20%; animation-delay: -2.3s; }
.login-brand .ring.r3 { width: 220px; height: 220px; right: -30px; top: 44%; animation-delay: -4.6s; }
@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.06); opacity: 1; }
}
.login-brand .brand-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-brand .brand-top .mark {
  width: 40px; height: 40px; border-radius: 11px; background: rgba(234,246,242,0.12);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700;
}
.login-brand .headline {
  font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1.15;
  max-width: 380px; position: relative; z-index: 1;
}
.login-brand .subline { color: rgba(234,246,242,0.75); font-size: 14.5px; margin-top: 14px; max-width: 360px; position: relative; z-index: 1; }
.login-brand .foot-note { font-size: 12.5px; color: rgba(234,246,242,0.55); position: relative; z-index: 1; }

.login-form-side { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 24px; margin: 0 0 6px; }
.login-card .lede { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.login-switch { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--muted); }

/* Utility */
.text-muted2 { color: var(--muted); }
.d-flex-between { display: flex; align-items: center; justify-content: space-between; }
