/* ============================================================
   KLMS — Kaizen Lifecycle Management System
   Design System: Clean Professional Light
   Print-friendly · High-contrast · Management-grade
   ============================================================ */

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

:root {
  /* ── Backgrounds ── */
  --bg-base:       #f4f6f9;
  --bg-surface:    #ffffff;
  --bg-elevated:   #f8f9fb;
  --bg-card:       #ffffff;
  --bg-hover:      #f0f3f7;

  /* ── Borders ── */
  --border:        #e2e6ed;
  --border-active: #b0bccf;

  /* ── Text ── */
  --text-primary:   #1a2332;
  --text-secondary: #4a5568;
  --text-muted:     #8896a8;

  /* ── Brand Accent ── */
  --accent:        #0d7a6b;
  --accent-mid:    #10a08d;
  --accent-light:  #e6f4f2;
  --accent-border: #b2dbd6;

  /* ── Semantic Colors ── */
  --green:         #1a7f4b;
  --green-light:   #e8f5ee;
  --green-border:  #a3d4b8;

  --blue:          #1a5fa8;
  --blue-light:    #e8f0fb;
  --blue-border:   #a3c0e8;

  --red:           #c0392b;
  --red-light:     #fdf0ee;
  --red-border:    #f0b8b1;

  --yellow:        #b45309;
  --yellow-light:  #fef9e7;
  --yellow-border: #f0d080;

  --purple:        #6b21a8;
  --purple-light:  #f5f0fc;
  --purple-border: #d4b0f0;

  --cyan:          #0e7490;
  --cyan-light:    #e6f7fb;
  --cyan-border:   #a5d8e8;

  --gray:          #5a6a7e;
  --gray-light:    #f1f3f6;
  --gray-border:   #cdd4de;

  /* ── Shadows ── */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow:     0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);

  /* ── Layout ── */
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --radius:    8px;
  --radius-sm: 5px;
  --radius-lg: 12px;

  /* ── Typography ── */
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --font-display: 'Inter', system-ui, sans-serif;
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── APP LAYOUT ─────────────────────────────────────────── */
.app-wrapper { display: flex; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: #1a2332;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-mark {
  width: 36px; height: 36px;
  background: #10a08d;
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 17px;
  border-radius: 5px;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  display: block;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 10px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 5px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
}
.nav-item:hover  { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.nav-item.active { background: #10a08d; color: #fff; }
.nav-icon        { font-size: 14px; width: 18px; text-align: center; }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 32px; height: 32px;
  background: #10a08d;
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.user-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.logout-btn {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  font-size: 16px;
  padding: 6px;
  border-radius: 5px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.logout-btn:hover { color: #fca5a5; background: rgba(255,92,92,0.15); text-decoration: none; }

/* ── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.topbar-title h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* ── STAT CARDS ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-mid);
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.stat-trend { font-size: 11px; font-weight: 600; margin-top: 4px; }
.stat-trend.up   { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* ── DATA TABLES ────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td  { border-bottom: none; }
.data-table tbody tr:hover          { background: var(--bg-hover); }
.data-table tbody tr.row-inactive   { opacity: .5; }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-green  { background: var(--green-light);  color: var(--green);  border: 1px solid var(--green-border); }
.badge-blue   { background: var(--blue-light);   color: var(--blue);   border: 1px solid var(--blue-border); }
.badge-red    { background: var(--red-light);    color: var(--red);    border: 1px solid var(--red-border); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); border: 1px solid var(--yellow-border); }
.badge-purple { background: var(--purple-light); color: var(--purple); border: 1px solid var(--purple-border); }
.badge-cyan   { background: var(--cyan-light);   color: var(--cyan);   border: 1px solid var(--cyan-border); }
.badge-gray   { background: var(--gray-light);   color: var(--gray);   border: 1px solid var(--gray-border); }
.badge-accent { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-border); }

/* ── HEALTH DOTS ────────────────────────────────────────── */
.health-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.health-dot::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-dot.green::before  { background: var(--green); }
.health-dot.yellow::before { background: var(--yellow); }
.health-dot.red::before    { background: var(--red); }
.health-dot.gray::before   { background: var(--gray); }
.health-dot.green  { color: var(--green); }
.health-dot.yellow { color: var(--yellow); }
.health-dot.red    { color: var(--red); }
.health-dot.gray   { color: var(--gray); }

/* ── PROGRESS BARS ──────────────────────────────────────── */
.progress-bar  { height: 7px; background: var(--border); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-mid); border-radius: 10px; transition: width 0.4s ease; }
.progress-fill.green  { background: var(--green); }
.progress-fill.yellow { background: var(--yellow); }
.progress-fill.red    { background: var(--red); }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-mid); border-color: var(--accent-mid); color: #fff; text-decoration: none; }

.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-active); text-decoration: none; color: var(--text-primary); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }

.btn-danger { background: var(--bg-surface); color: var(--red); border-color: var(--red-border); }
.btn-danger:hover { background: var(--red-light); color: var(--red); text-decoration: none; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 4px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

/* ── FORMS ──────────────────────────────────────────────── */
.form-group  { margin-bottom: 16px; }
.form-label  { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-hint   { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-input, .form-select, .form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-control:focus {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select { cursor: pointer; }
textarea.form-input, textarea.form-control { resize: vertical; min-height: 90px; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
.form-check input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,25,40,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15,25,40,0.45);
  backdrop-filter: blur(2px);
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-lg { max-width: 680px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.modal-close {
  background: none; border: none;
  font-size: 20px; color: var(--text-muted);
  cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── TOAST ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slide-in 0.25s ease;
  max-width: 320px;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.info    { background: var(--blue); }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── GRIDS ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ── LOGIN PAGE ─────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 24px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }

.login-logo-mark {
  width: 48px; height: 48px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 22px;
  border-radius: var(--radius);
}

.login-logo-text h2 { font-size: 18px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.login-logo-text span { font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.login-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; line-height: 1.5; }
.login-error { background: var(--red-light); border: 1px solid var(--red-border); color: var(--red); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 18px; font-weight: 500; }

/* ── KANBAN ─────────────────────────────────────────────── */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; }

.kanban-col {
  min-width: 240px; flex-shrink: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.kanban-col-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}

.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-xs);
}
.kanban-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-sm); }
.kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.kanban-card-meta  { font-size: 11px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }

/* ── CHART CONTAINERS ───────────────────────────────────── */
.chart-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}
.chart-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
canvas { max-height: 260px; }

/* ── TABS ───────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 18px;
  background: none; border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.tab-btn:hover  { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel        { display: none; }
.tab-panel.active { display: block; }

/* ── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-primary); font-weight: 600; }
.breadcrumb-sep  { color: var(--border-active); }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state-icon  { font-size: 40px; margin-bottom: 14px; opacity: 0.5; }
.empty-state-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p     { font-size: 13px; }

/* ── FILTER & SEARCH BAR ────────────────────────────────── */
.filter-bar  { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input {
  flex: 1; min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 13px; outline: none;
}
.search-input:focus { border-color: var(--accent-mid); box-shadow: 0 0 0 3px var(--accent-light); }

/* ── GANTT ──────────────────────────────────────────────── */
.gantt-wrapper { overflow-x: auto; }
.gantt-row { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.gantt-label { width: 160px; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); }
.gantt-track { flex: 1; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px; height: 22px; position: relative; }
.gantt-bar { position: absolute; height: 100%; border-radius: 4px; background: var(--accent-mid); display: flex; align-items: center; padding: 0 8px; font-size: 10px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; }

/* ── RISK ───────────────────────────────────────────────── */
.risk-matrix { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; aspect-ratio: 1; }
.risk-cell { border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; cursor: pointer; transition: opacity 0.15s; min-height: 64px; }
.risk-cell:hover { opacity: 0.8; }
.risk-low    { background: var(--green-light);  border: 1px solid var(--green-border);  color: var(--green); }
.risk-medium { background: var(--yellow-light); border: 1px solid var(--yellow-border); color: var(--yellow); }
.risk-high   { background: var(--red-light);    border: 1px solid var(--red-border);    color: var(--red); }

/* ── USER MANAGEMENT ────────────────────────────────────── */
.user-cell  { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.user-email    { font-size: 11px; color: var(--text-muted); }
.row-inactive  { opacity: .5; }

code.mono {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); background: var(--accent-light);
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--accent-border);
}

/* ── ALERTS ─────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; font-weight: 500; }
.alert-error   { background: var(--red-light);   color: var(--red);   border: 1px solid var(--red-border); }
.alert-success { background: var(--green-light);  color: var(--green); border: 1px solid var(--green-border); }
.alert-info    { background: var(--blue-light);   color: var(--blue);  border: 1px solid var(--blue-border); }

/* ── LIFECYCLE BAR ──────────────────────────────────────── */
.lifecycle-bar { display: flex; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); margin-bottom: 20px; }
.lifecycle-stage { flex: 1; padding: 8px 4px; text-align: center; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); background: var(--bg-elevated); border-right: 1px solid var(--border); transition: all 0.15s; }
.lifecycle-stage:last-child { border-right: none; }
.lifecycle-stage.active { background: var(--accent); color: #fff; }

/* ── MISC ───────────────────────────────────────────────── */
.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.muted   { color: var(--text-muted); font-size: 12px; }
.section { margin-bottom: 28px; }

.detail-kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 13px; }
.detail-kv dt { color: var(--text-muted); font-weight: 600; }
.detail-kv dd { color: var(--text-primary); }

/* ── UTILITY ────────────────────────────────────────────── */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.text-accent { color: var(--accent) !important; }
.text-muted  { color: var(--text-muted) !important; }
.text-red    { color: var(--red) !important; }
.text-green  { color: var(--green) !important; }
.text-yellow { color: var(--yellow) !important; }
.fw-bold     { font-weight: 700 !important; }
.font-mono   { font-family: var(--font-mono) !important; }
.d-flex      { display: flex !important; }
.align-center { align-items: center !important; }
.gap-1       { gap: 8px !important; }
.gap-2       { gap: 16px !important; }
.justify-between { justify-content: space-between !important; }
.w-100       { width: 100% !important; }

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-active); }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { position: fixed; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .page-body { padding: 18px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 24px; }
}

/* ── PRINT / PDF EXPORT ─────────────────────────────────── */
@media print {
  .sidebar, .topbar, .topbar-actions, .sidebar-toggle,
  .btn, .filter-bar, .modal, .modal-overlay,
  .toast-container { display: none !important; }

  .app-wrapper    { display: block; }
  .main-content   { width: 100%; overflow: visible; }
  .page-body      { padding: 0; overflow: visible; }

  body { background: #fff; color: #000; font-size: 12px; }

  .card, .chart-box, .stat-card, .kanban-col {
    border: 1px solid #ccc;
    background: #fff;
    box-shadow: none;
    break-inside: avoid;
  }

  .stat-value, .card-title, .section-title, .page-title { color: #000; }
  .data-table th { background: #f5f5f5; color: #333; }
  td, th { color: #111; border-color: #ccc; }
  .badge { border: 1px solid #ccc; background: #f5f5f5; color: #333; }
  .progress-fill { background: #555; }
  a { color: #000; text-decoration: none; }
}
