/* =============================================
   WareLog — Clean Light Theme
   Airy · High-contrast · Indigo accent
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=Sora:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f7fc;
  --bg-2: #eef2f9;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --surface2: #f4f7fc;
  --surface3: #e9eef7;
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.18);

  --accent: #4f46e5;     /* indigo (primary)  */
  --accent-2: #7c3aed;   /* violet (secondary)*/
  --accent2: #e11d48;    /* rose (danger)     */

  --grad: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
  --grad-soft: linear-gradient(135deg, rgba(79,70,229,0.12), rgba(124,58,237,0.12));

  --text: #1e293b;       /* slate-800 */
  --muted: #64748b;      /* slate-500 */
  --low: #059669;        /* emerald-600 */
  --medium: #d97706;     /* amber-600   */
  --high: #e11d48;       /* rose-600    */
  --blue: #2563eb;       /* blue-600    */
  --purple: #7c3aed;     /* violet-600  */

  --radius: 16px;
  --radius-sm: 10px;

  --shadow-glass: 0 1px 2px rgba(15,23,42,0.04), 0 10px 28px rgba(15,23,42,0.07);
  --shadow-hover: 0 14px 36px rgba(15,23,42,0.12);
  --glow-cyan: 0 8px 24px rgba(79,70,229,0.18);
  --glow-violet: 0 8px 24px rgba(124,58,237,0.18);
}

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

html { font-size: 16px; }

body {
  font-family: 'Sora', sans-serif;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(820px 540px at 8% -8%, rgba(79,70,229,0.07), transparent 58%),
    radial-gradient(760px 600px at 102% 4%, rgba(124,58,237,0.06), transparent 56%),
    radial-gradient(900px 700px at 50% 116%, rgba(37,99,235,0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* Faint grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(15,23,42,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
}

.app-header, .page-content, .filters-bar, .tab-bar,
.profile-header, .sidebar-layout, .mobile-nav,
.login-page, .modal-overlay, .toast { position: relative; z-index: 1; }

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, .condensed {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
}

::selection { background: rgba(79,70,229,0.18); color: var(--text); }

/* ---- BUTTONS ---- */
.btn {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,0.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(99,102,241,0.38); }

.btn-danger { background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; box-shadow: 0 4px 14px rgba(225,29,72,0.26); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(225,29,72,0.38); }

.btn-outline { background: #fff; border: 1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow-cyan); }

.btn-ghost { background: transparent; color: var(--muted); padding: 6px 10px; }
.btn-ghost:hover { color: var(--accent); }

.btn-success { background: rgba(5,150,105,0.10); border: 1px solid rgba(5,150,105,0.40); color: var(--low); }
.btn-success:hover { background: rgba(5,150,105,0.16); box-shadow: 0 6px 18px rgba(5,150,105,0.20); }

.btn-sm { padding: 7px 14px; font-size: 11px; }
.btn-lg { padding: 16px 32px; font-size: 15px; }
.btn-full { width: 100%; }

/* ---- FORMS ---- */
.field-group { margin-bottom: 18px; }

.field-label {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.field-input, .field-select, .field-textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.14);
}

.field-input::placeholder,
.field-textarea::placeholder { color: var(--muted); }

.field-textarea { resize: vertical; min-height: 80px; }

.field-select { cursor: pointer; }

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  box-shadow: var(--shadow-glass);
}

.card-surface2 {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glass);
}

.panel, .worker-panel {
  box-shadow: var(--shadow-glass);
}

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }

.badge-open { background: rgba(79,70,229,0.10); color: var(--accent); border-color: rgba(79,70,229,0.22); }
.badge-open .badge-dot { background: var(--accent); }
.badge-review { background: rgba(37,99,235,0.10); color: var(--blue); border-color: rgba(37,99,235,0.22); }
.badge-review .badge-dot { background: var(--blue); }
.badge-resolved { background: rgba(5,150,105,0.10); color: var(--low); border-color: rgba(5,150,105,0.22); }
.badge-resolved .badge-dot { background: var(--low); }

.sev-low { color: var(--low); font-weight: 700; }
.sev-med { color: var(--medium); font-weight: 700; }
.sev-high { color: var(--high); font-weight: 700; }

.flag-formal {
  background: rgba(225,29,72,0.10);
  color: var(--high);
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  border: 1px solid rgba(225,29,72,0.22);
}
.flag-mention {
  background: var(--surface3);
  color: var(--muted);
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}

/* ---- APP HEADER ---- */
.app-header {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(79,70,229,0.5), rgba(124,58,237,0.5), transparent);
}

.app-logo { display: flex; align-items: center; gap: 11px; text-decoration: none; }

.logo-icon {
  width: 34px; height: 34px;
  background: var(--grad);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}

.logo-text {
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700; font-size: 20px; letter-spacing: 1.5px;
  color: var(--text);
}
.logo-text span {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- NAV ---- */
.header-nav { display: flex; align-items: center; gap: 4px; }

.nav-item {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 15px;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.16s;
  border: 1px solid transparent; background: none;
  text-decoration: none;
}
.nav-item:hover { color: var(--text); background: rgba(15,23,42,0.05); }
.nav-item.active {
  color: var(--accent);
  background: rgba(79,70,229,0.10);
  border-color: rgba(79,70,229,0.22);
}

@media (max-width: 768px) {
  .header-nav { display: none; }
  .mobile-menu-btn { display: flex; }
}

.mobile-menu-btn {
  display: none;
  background: none; border: none;
  color: var(--text); font-size: 22px; cursor: pointer;
  padding: 6px;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-item { text-align: left; padding: 12px 16px; }

/* ---- USER CHIP ---- */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.user-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--low);
  flex-shrink: 0; box-shadow: 0 0 0 0 rgba(5,150,105,0.5);
  animation: pulse-dot 2.4s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(5,150,105,0.4); }
  70% { box-shadow: 0 0 0 7px rgba(5,150,105,0); }
  100% { box-shadow: 0 0 0 0 rgba(5,150,105,0); }
}

/* ---- SECTION TITLE ---- */
.section-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* ---- PAGE CONTENT ---- */
.page-content {
  padding: 24px 20px; max-width: 1400px; margin: 0 auto;
  animation: rise-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 768px) {
  .page-content { padding: 28px 32px; }
}

/* ---- STAT CARDS ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (min-width: 600px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(5, 1fr); } }

.stat-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glass);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
}
.stat-card.total::before { background: var(--blue); }
.stat-card.open::before { background: var(--accent); }
.stat-card.resolved::before { background: var(--low); }
.stat-card.high-sev::before { background: var(--high); }
.stat-card.flagged::before { background: var(--purple); }

.stat-value {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 36px; font-weight: 700; line-height: 1; margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.stat-card.total .stat-value { color: var(--blue); }
.stat-card.open .stat-value { color: var(--accent); }
.stat-card.resolved .stat-value { color: var(--low); }
.stat-card.high-sev .stat-value { color: var(--high); }
.stat-card.flagged .stat-value { color: var(--purple); }
.stat-label { font-size: 12px; color: var(--muted); letter-spacing: 0.2px; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; min-width: 600px; }

thead th {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--muted);
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.14s;
}
tbody tr:hover { background: rgba(79,70,229,0.05); }
tbody tr:last-child { border-bottom: none; }

tbody td { padding: 13px 14px; font-size: 13px; }

/* ---- FILTERS BAR ---- */
.filters-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-wrap: wrap;
}

@media (min-width: 768px) { .filters-bar { padding: 14px 32px; } }

.filter-search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 9px 14px;
  flex: 1; min-width: 180px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.filter-search input {
  background: none; border: none; outline: none;
  color: var(--text); font-family: 'Sora', sans-serif; font-size: 14px;
  width: 100%;
}
.filter-search input::placeholder { color: var(--muted); }

.filter-select {
  background: #fff; border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 9px 14px;
  color: var(--text); font-family: 'Sora', sans-serif; font-size: 13px;
  outline: none; cursor: pointer; -webkit-appearance: none;
  transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--accent); }

/* ---- SIDEBAR LAYOUT ---- */
.sidebar-layout { display: flex; min-height: calc(100vh - 62px); }

.sidebar {
  width: 220px;
  background: rgba(255,255,255,0.6);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 900px) { .sidebar { display: block; } }

.sidebar-label {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--muted);
  padding: 0 20px; margin-bottom: 8px; margin-top: 16px;
}

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; font-size: 14px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  transition: all 0.15s; border: none; background: none;
  width: 100%; text-align: left; border-left: 3px solid transparent;
}
.sidebar-item:hover { background: rgba(15,23,42,0.04); color: var(--text); }
.sidebar-item.active { background: rgba(79,70,229,0.08); color: var(--accent); border-left-color: var(--accent); }
.sidebar-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-count {
  margin-left: auto;
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 9px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.sidebar-count.alert { background: rgba(225,29,72,0.12); border-color: rgba(225,29,72,0.4); color: var(--high); }

.main-content { flex: 1; overflow: auto; }

/* ---- TABS ---- */
.tab-bar {
  display: flex; gap: 4px;
  padding: 14px 20px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
@media (min-width: 768px) { .tab-bar { padding: 14px 32px 0; } }

.tab {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--muted);
  padding: 9px 18px; border-radius: 9px 9px 0 0;
  cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s; margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); background: rgba(79,70,229,0.06); }

/* ---- TILE GRIDS ---- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 600px) { .tile-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .tile-grid { grid-template-columns: repeat(4, 1fr); } }

.tile {
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.16s;
  user-select: none;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.tile:hover { border-color: var(--accent); background: rgba(79,70,229,0.04); transform: translateY(-2px); box-shadow: var(--glow-cyan); }
.tile.selected { border-color: var(--accent); background: rgba(79,70,229,0.10); box-shadow: var(--glow-cyan); }
.tile.selected-red { border-color: var(--accent2); background: rgba(225,29,72,0.10); box-shadow: 0 8px 22px rgba(225,29,72,0.18); }

.tile-emoji { font-size: 28px; margin-bottom: 8px; display: block; }
.tile-label {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px; font-weight: 600; line-height: 1.3;
}

/* ---- INCIDENT TILE GRID ---- */
.incident-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px) { .incident-tile-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .incident-tile-grid { grid-template-columns: repeat(6, 1fr); } }

/* ---- WORKER GRID ---- */
.worker-card-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
}
@media (min-width: 600px) { .worker-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .worker-card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .worker-card-grid { grid-template-columns: repeat(4, 1fr); } }

.worker-card {
  background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  cursor: pointer; transition: all 0.18s;
  box-shadow: var(--shadow-glass);
  position: relative; overflow: hidden;
}
.worker-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.wc-avatar {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--grad-soft); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
}
.wc-name { font-weight: 700; font-size: 15px; margin-bottom: 3px; }
.wc-role { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.wc-stats { display: flex; gap: 8px; }
.wc-stat { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 9px; text-align: center; }
.wc-stat-val { font-family: 'Chakra Petch', sans-serif; font-size: 20px; font-weight: 700; }
.wc-stat-val.red { color: var(--high); }
.wc-stat-val.orange { color: var(--accent); }
.wc-stat-label { font-size: 10px; color: var(--muted); margin-top: 2px; }
.wc-status { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--low); }

/* ---- TWO COL ---- */
.two-col { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }

.two-col-sidebar { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 900px) { .two-col-sidebar { grid-template-columns: 280px 1fr; } }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #fff; border: 1px solid var(--border-strong);
  border-radius: 14px; padding: 14px 20px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 16px 44px rgba(15,23,42,0.16);
  z-index: 9999; transform: translateY(80px); opacity: 0;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(5,150,105,0.5); }
.toast.error { border-color: rgba(225,29,72,0.5); }

/* ---- LOADING ---- */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 20px; color: var(--muted); font-size: 14px;
  gap: 12px;
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- EMPTY STATE ---- */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; text-align: center;
  color: var(--muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.55; }
.empty-state-title { font-family: 'Chakra Petch', sans-serif; font-size: 20px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.empty-state-sub { font-size: 13px; }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.35); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000; display: none;
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px; padding: 28px;
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(15,23,42,0.28);
  animation: modal-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes modal-pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 22px; font-weight: 700; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
}

.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 22px; cursor: pointer; padding: 4px;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--high); }

/* ---- FORM GRID ---- */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 600px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---- SEVERITY BUTTONS ---- */
.sev-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.sev-btn {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 14px 10px; text-align: center; cursor: pointer;
  background: var(--surface-solid); transition: all 0.15s;
}
.sev-btn .sev-dot { width: 10px; height: 10px; border-radius: 50%; margin: 0 auto 8px; }
.sev-btn.low .sev-dot { background: var(--low); }
.sev-btn.medium .sev-dot { background: var(--medium); }
.sev-btn.high .sev-dot { background: var(--high); }
.sev-btn.low:hover, .sev-btn.low.selected { border-color: var(--low); background: rgba(5,150,105,0.08); }
.sev-btn.medium:hover, .sev-btn.medium.selected { border-color: var(--medium); background: rgba(217,119,6,0.08); }
.sev-btn.high:hover, .sev-btn.high.selected { border-color: var(--high); background: rgba(225,29,72,0.08); }
.sev-label { font-family: 'Chakra Petch', sans-serif; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.sev-desc { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---- PHOTO ZONE ---- */
.photo-zone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--surface2);
}
.photo-zone:hover { border-color: var(--accent); background: rgba(79,70,229,0.04); }
.photo-zone-icon { font-size: 36px; margin-bottom: 10px; }
.photo-zone-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.photo-zone-sub { font-size: 12px; color: var(--muted); }

.photo-preview-img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border); max-height: 280px;
  object-fit: cover; display: none;
}

/* ---- STEP INDICATOR ---- */
.step-bar { display: flex; align-items: center; gap: 6px; }
.step-pip { width: 30px; height: 5px; border-radius: 3px; background: var(--surface3); transition: all 0.3s; }
.step-pip.active { background: var(--grad); }
.step-pip.done { background: var(--low); }
.step-text { font-family: 'Chakra Petch', sans-serif; font-size: 12px; color: var(--muted); letter-spacing: 1px; margin-left: 6px; }

/* ---- WORKER SEARCH PANEL ---- */
.worker-panel { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.worker-panel-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-family: 'Chakra Petch', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.worker-search-box { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.worker-search-box input { background: none; border: none; outline: none; color: var(--text); font-family: 'Sora', sans-serif; font-size: 14px; width: 100%; }
.worker-list { max-height: 300px; overflow-y: auto; }
.worker-list-item { padding: 11px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.12s; }
.worker-list-item:hover { background: rgba(79,70,229,0.05); }
.worker-list-item.selected { background: rgba(79,70,229,0.08); border-left: 3px solid var(--accent); }
.worker-list-item:last-child { border-bottom: none; }
.wli-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface3); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.wli-name { font-weight: 600; font-size: 14px; }
.wli-role { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ---- FLAG TOGGLE ---- */
.flag-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flag-btn { background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all 0.15s; }
.flag-btn:hover { border-color: var(--accent); }
.flag-btn.selected { border-color: var(--accent); background: rgba(79,70,229,0.08); box-shadow: var(--glow-cyan); }
.flag-btn-icon { font-size: 20px; }
.flag-btn-title { font-weight: 600; font-size: 13px; }
.flag-btn-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---- TYPE CHOICE ---- */
.type-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .type-choice { grid-template-columns: 1fr; } }

.type-card {
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 32px 20px; text-align: center;
  cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden;
  box-shadow: var(--shadow-glass);
}
.type-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px 4px 0 0; }
.type-card.worker::before { background: var(--grad); }
.type-card.incident::before { background: linear-gradient(90deg, #f43f5e, #e11d48); }
.type-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.type-card.selected-worker { border-color: var(--accent); background: rgba(79,70,229,0.06); box-shadow: var(--glow-cyan); }
.type-card.selected-incident { border-color: var(--accent2); background: rgba(225,29,72,0.06); box-shadow: 0 8px 22px rgba(225,29,72,0.18); }

.type-emoji { font-size: 48px; margin-bottom: 14px; display: block; }
.type-title { font-family: 'Chakra Petch', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.type-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---- SCREEN (report flow steps) ---- */
.report-screen { display: none; }
.report-screen.active { display: block; animation: rise-in 0.4s cubic-bezier(0.22,1,0.36,1) both; }

/* ---- PROFILE HEADER ---- */
.profile-header {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 24px 20px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.6); flex-wrap: wrap;
}
@media (min-width: 768px) { .profile-header { padding: 28px 32px; } }

.profile-avatar {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--grad-soft); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; flex-shrink: 0;
}
.profile-info .pi-name { font-family: 'Chakra Petch', sans-serif; font-size: 26px; font-weight: 700; }
.profile-info .pi-role { font-size: 14px; color: var(--muted); margin-top: 2px; }
.profile-info .pi-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }

.profile-stats { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; }
.ps-item { text-align: center; }
.ps-val { font-family: 'Chakra Petch', sans-serif; font-size: 28px; font-weight: 700; }
.ps-val.red { color: var(--high); }
.ps-val.orange { color: var(--accent); }
.ps-val.blue { color: var(--blue); }
.ps-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---- BREADCRUMB ---- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--accent); cursor: pointer; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--border-strong); }

/* ---- TIMELINE ---- */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 18px; position: relative; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--border-strong); }
.tl-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.tl-dot.green { border-color: var(--low); background: rgba(5,150,105,0.10); }
.tl-dot.orange { border-color: var(--accent); background: rgba(79,70,229,0.10); }
.tl-action { font-size: 13px; font-weight: 600; }
.tl-time { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---- DETAIL ROW ---- */
.detail-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; gap: 12px; }
.detail-row:last-child { border-bottom: none; }
.detail-key { color: var(--muted); min-width: 120px; flex-shrink: 0; }
.detail-val { text-align: right; font-weight: 500; }

/* ---- LOGIN ---- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(700px 500px at 25% 30%, rgba(79,70,229,0.10), transparent 60%),
    radial-gradient(700px 520px at 80% 75%, rgba(124,58,237,0.10), transparent 60%);
}
.login-card {
  background: #fff;
  border: 1px solid var(--border); border-radius: 22px;
  padding: 44px 34px; width: 100%; max-width: 420px;
  box-shadow: 0 30px 70px rgba(15,23,42,0.16);
  animation: modal-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.role-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 24px; }
.role-tab { padding: 11px; border-radius: 10px; text-align: center; font-family: 'Chakra Petch', sans-serif; font-size: 14px; font-weight: 600; letter-spacing: 0.5px; cursor: pointer; border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface2); transition: all 0.15s; }
.role-tab.active { border-color: var(--accent); color: var(--accent); background: rgba(79,70,229,0.08); }

/* ---- QUICK ACTION CARDS ---- */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
@media (max-width: 480px) { .quick-actions { grid-template-columns: 1fr; } }

.quick-card {
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 16px; cursor: pointer; transition: all 0.18s; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-glass);
}
.quick-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.qc-icon { width: 50px; height: 50px; border-radius: 13px; background: var(--grad-soft); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.qc-title { font-family: 'Chakra Petch', sans-serif; font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.qc-sub { font-size: 12px; color: var(--muted); }

/* ---- CONFIRM SCREEN ---- */
.confirm-screen { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px; }
.confirm-icon { width: 84px; height: 84px; border-radius: 50%; background: rgba(5,150,105,0.12); border: 2px solid var(--low); display: flex; align-items: center; justify-content: center; font-size: 40px; margin-bottom: 24px; }
.confirm-title { font-family: 'Chakra Petch', sans-serif; font-size: 32px; font-weight: 700; margin-bottom: 10px; }
.confirm-sub { font-size: 14px; color: var(--muted); max-width: 400px; line-height: 1.6; margin-bottom: 24px; }
.confirm-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 32px; }
.confirm-tag { background: var(--surface2); border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 15px; font-size: 13px; font-weight: 600; }

/* ---- UTILITY ---- */
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-high { color: var(--high); }
.text-low { color: var(--low); }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.16); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(15,23,42,0.28); background-clip: content-box; }
