/* ═══════════════════════════════════════════════════════════
   GASPOL — Eco-Tech Theme  |  River & Green Environment
   ═══════════════════════════════════════════════════════════ */

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

/* ── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Light Mode — River & Green Palette */
  --color-primary:      #1a7a4a;   /* Forest Green */
  --color-primary-dark: #115c36;
  --color-primary-light:#2da068;
  --color-secondary:    #1976a8;   /* Azure Blue */
  --color-accent:       #f5a623;   /* Amber Yellow */
  --color-accent-dark:  #d4891c;

  --color-open:       #f5a623;
  --color-progress:   #1976a8;
  --color-escalated:  #e8415c;
  --color-resolved:   #1a7a4a;
  --color-closed:     #6b7280;

  --color-low:      #22c55e;
  --color-medium:   #eab308;
  --color-high:     #f97316;
  --color-critical: #ef4444;

  /* Surface & Background */
  --bg-app:        #f0f7f4;
  --bg-surface:    #ffffff;
  --bg-surface-2:  #f7faf8;
  --bg-sidebar:    linear-gradient(180deg, #0f4c2a 0%, #1a7a4a 50%, #1055a8 100%);
  --bg-header:     rgba(255,255,255,0.92);
  --bg-card:       #ffffff;
  --bg-input:      #f0f7f4;

  /* Text */
  --text-primary:   #0d1f15;
  --text-secondary: #374151;
  --text-muted:     #6b7280;
  --text-inverse:   #ffffff;
  --text-sidebar:   rgba(255,255,255,0.9);

  /* Border */
  --border:         #d1e9da;
  --border-hover:   #1a7a4a;
  --border-focus:   #1a7a4a;

  /* Shadow */
  --shadow-sm:  0 1px 3px rgba(26,122,74,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 16px rgba(26,122,74,0.12), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg:  0 10px 40px rgba(26,122,74,0.15), 0 4px 16px rgba(0,0,0,0.08);
  --shadow-glow:#1a7a4a40;

  /* Gradient */
  --gradient-hero: linear-gradient(135deg, #0f4c2a 0%, #1a7a4a 40%, #1055a8 100%);
  --gradient-card: linear-gradient(135deg, #f0fff6 0%, #e8f4ff 100%);
  --gradient-accent: linear-gradient(135deg, #f5a623 0%, #e8415c 100%);

  /* Misc */
  --radius:     12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --sidebar-w:  260px;
  --header-h:   64px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── DARK MODE ─────────────────────────────────────────── */
[data-theme="dark"] {
  --color-primary:      #2ecc7b;
  --color-primary-dark: #1a7a4a;
  --color-primary-light:#50d99a;
  --color-secondary:    #42a5d9;
  --color-accent:       #fbbf24;
  --color-accent-dark:  #f59e0b;

  --bg-app:        #0a1a12;
  --bg-surface:    #0f2318;
  --bg-surface-2:  #132b1e;
  --bg-sidebar:    linear-gradient(180deg, #071510 0%, #0f2318 50%, #0a1628 100%);
  --bg-header:     rgba(10,26,18,0.95);
  --bg-card:       #132b1e;
  --bg-input:      #0f2318;

  --text-primary:   #e8f5ee;
  --text-secondary: #a7c4b0;
  --text-muted:     #6b9a78;
  --text-inverse:   #0a1a12;
  --text-sidebar:   rgba(232,245,238,0.9);

  --border:         #1c3d28;
  --border-hover:   #2ecc7b;
  --border-focus:   #2ecc7b;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.6);
  --shadow-glow:#2ecc7b40;

  --gradient-hero: linear-gradient(135deg, #071510 0%, #0f2318 40%, #0a1628 100%);
  --gradient-card: linear-gradient(135deg, #132b1e 0%, #0d1f2d 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

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

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 400px at 20% 80%, rgba(25,118,168,0.35) 0%, transparent 70%),
    radial-gradient(ellipse 600px 600px at 80% 20%, rgba(26,122,74,0.3) 0%, transparent 70%);
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: slideUp 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 72px;
  height: 72px;
  background: var(--gradient-hero);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px var(--shadow-glow);
}

.login-logo h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.login-hint {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.login-hint strong { color: var(--text-primary); }
.login-hint p { margin-bottom: 4px; }
.login-hint p:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════
   APP SHELL (SIDEBAR + MAIN)
   ═══════════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.sidebar-logo .logo-mark {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
}

.sidebar-logo .logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  line-height: 1.1;
}
.sidebar-logo .logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  line-height: 1.2;
}

.user-role-badge {
  font-size: 10.5px;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
  line-height: 1;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding: 8px 8px 6px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
  color: var(--text-sidebar);
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.15);
}

.nav-item .nav-icon { font-size: 18px; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOP HEADER ─────────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background var(--transition);
}

.header-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── PAGE CONTENT ───────────────────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
  max-width: 1280px;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), background var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

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

.card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── STAT CARDS ─────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

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

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

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--stat-color, var(--color-primary));
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  opacity: 0.12;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
  line-height: 1;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,122,74,0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  box-shadow: 0 6px 20px rgba(26,122,74,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  border-color: var(--border-hover);
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245,166,35,0.3);
}

.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(245,166,35,0.5);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #e8415c 0%, #c0384e 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(232,65,92,0.3);
}

.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(232,65,92,0.5);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--bg-surface-2);
  border-color: var(--border);
}

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 12px; }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-label span.required {
  color: #e8415c;
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(26,122,74,0.12);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* File upload area */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
  position: relative;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--color-primary);
  background: rgba(26,122,74,0.05);
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-upload-icon { font-size: 32px; margin-bottom: 8px; }

.file-upload-area p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.file-upload-area strong { color: var(--color-primary); }

.file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border-radius: 8px;
  margin-top: 10px;
  border: 1px solid var(--border);
}

.file-preview img {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.file-preview-info { flex: 1; min-width: 0; }
.file-preview-name { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-preview-size { font-size: 11px; color: var(--text-muted); }
.file-preview-compressed { font-size: 11px; color: var(--color-primary); font-weight: 600; }

/* ── BADGES & STATUS ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-open      { background: rgba(245,166,35,0.15);  color: #b87d10; border: 1px solid rgba(245,166,35,0.3); }
.badge-progress  { background: rgba(25,118,168,0.15);  color: #1055a8; border: 1px solid rgba(25,118,168,0.3); }
.badge-escalated { background: rgba(232,65,92,0.15);   color: #c0384e; border: 1px solid rgba(232,65,92,0.3); }
.badge-resolved  { background: rgba(26,122,74,0.15);   color: #115c36; border: 1px solid rgba(26,122,74,0.3); }
.badge-closed    { background: rgba(107,114,128,0.15); color: #4b5563; border: 1px solid rgba(107,114,128,0.3); }

[data-theme="dark"] .badge-open      { background: rgba(245,166,35,0.2);  color: #fbbf24; }
[data-theme="dark"] .badge-progress  { background: rgba(66,165,217,0.2);  color: #42a5d9; }
[data-theme="dark"] .badge-escalated { background: rgba(232,65,92,0.2);   color: #f87171; }
[data-theme="dark"] .badge-resolved  { background: rgba(46,204,123,0.2);  color: #2ecc7b; }
[data-theme="dark"] .badge-closed    { background: rgba(107,114,128,0.2); color: #9ca3af; }

.badge-low      { background: rgba(34,197,94,0.15);   color: #15803d; border: 1px solid rgba(34,197,94,0.3); }
.badge-medium   { background: rgba(234,179,8,0.15);   color: #854d0e; border: 1px solid rgba(234,179,8,0.3); }
.badge-high     { background: rgba(249,115,22,0.15);  color: #c2410c; border: 1px solid rgba(249,115,22,0.3); }
.badge-critical { background: rgba(239,68,68,0.15);   color: #b91c1c; border: 1px solid rgba(239,68,68,0.3); }

[data-theme="dark"] .badge-low      { color: #4ade80; }
[data-theme="dark"] .badge-medium   { color: #fde047; }
[data-theme="dark"] .badge-high     { color: #fb923c; }
[data-theme="dark"] .badge-critical { color: #f87171; }

/* ── TABLE ──────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead {
  background: var(--bg-surface-2);
  border-bottom: 2px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--bg-surface-2); }

td {
  padding: 12px 16px;
  color: var(--text-primary);
  vertical-align: top;
}

.td-truncate {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── MODALS ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

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

.modal-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  font-size: 18px;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--border); color: var(--text-primary); }

/* ── ALERTS ─────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(232,65,92,0.1);
  border-color: rgba(232,65,92,0.25);
  color: #c0384e;
}

.alert-success {
  background: rgba(26,122,74,0.1);
  border-color: rgba(26,122,74,0.25);
  color: #115c36;
}

.alert-info {
  background: rgba(25,118,168,0.1);
  border-color: rgba(25,118,168,0.25);
  color: #1055a8;
}

[data-theme="dark"] .alert-error   { color: #f87171; }
[data-theme="dark"] .alert-success { color: #4ade80; }
[data-theme="dark"] .alert-info    { color: #60a5fa; }

/* ── DARK MODE TOGGLE ───────────────────────────────────── */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 18px;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  transform: rotate(15deg);
}

/* ── MOBILE MENU TOGGLE ─────────────────────────────────── */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 20px;
  transition: all var(--transition);
}

/* ── SIDEBAR OVERLAY (MOBILE) ───────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
  backdrop-filter: blur(2px);
}

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
  display: block;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p { font-size: 13px; }

/* ── LOADING ────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(var(--bg-app), 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 16px;
}

/* ── TIKET DETAIL CARD ──────────────────────────────────── */
.tiket-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.tiket-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }

.tiket-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tiket-card-body { padding: 16px 20px; }

.tiket-card-footer {
  padding: 12px 20px;
  background: var(--bg-surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tiket-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.tiket-info-item label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.tiket-info-item span {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
}

.tiket-id { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.tiket-kategori { font-weight: 700; color: var(--text-primary); font-size: 15px; }

.tiket-foto {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition);
}
.tiket-foto:hover { transform: scale(1.01); }

/* ── ESCALATION ALERT BOX ───────────────────────────────── */
.escalation-box {
  background: rgba(232,65,92,0.07);
  border: 1px solid rgba(232,65,92,0.2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 12px;
}

.escalation-box label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #c0384e;
  display: block;
  margin-bottom: 4px;
}

[data-theme="dark"] .escalation-box label { color: #f87171; }

.escalation-box p { font-size: 13px; color: var(--text-primary); }

/* ── FILTER BAR ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.filter-bar .form-control { width: auto; min-width: 160px; }
.filter-bar input[type="search"] { flex: 1; min-width: 200px; max-width: 320px; }

/* ── PAGE SECTION TITLE ─────────────────────────────────── */
.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── GRID LAYOUTS ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── PROGRESS BAR ───────────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--color-primary);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* ── DYNAMIC COLUMN TAG ─────────────────────────────────── */
.column-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(26,122,74,0.1);
  color: var(--color-primary);
  border: 1px solid rgba(26,122,74,0.2);
}

/* ── TOAST NOTIFICATION ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  animation: slideInRight 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.toast.toast-success { border-left: 4px solid var(--color-primary); }
.toast.toast-error   { border-left: 4px solid #e8415c; }
.toast.toast-info    { border-left: 4px solid var(--color-secondary); }
.toast.fade-out      { animation: fadeOut 0.3s ease forwards; }

/* ── IMAGE LIGHTBOX ─────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ── LOG KERJA LIST ─────────────────────────────────────── */
.log-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--bg-card);
  transition: all var(--transition);
  display: grid;
  gap: 6px;
}

.log-item:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }

.log-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.log-item-project {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.log-item-dur {
  font-size: 12px;
  background: rgba(26,122,74,0.1);
  color: var(--color-primary);
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 600;
}

.log-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.log-item-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.log-extra-item {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.log-extra-item strong { color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-surface-2) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── HERO BANNER ─────────────────────────────────────────── */
.dashboard-hero {
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.dashboard-hero::after {
  content: '';
  position: absolute;
  right: 60px;
  bottom: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.dashboard-hero h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}

.dashboard-hero p { font-size: 14px; opacity: 0.8; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay.visible { display: block; }

  .menu-toggle { display: flex; }

  .main-content { margin-left: 0; }

  .page-content { padding: 16px; }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .tiket-info-grid { grid-template-columns: 1fr; }

  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-control { width: 100%; }

  .modal { padding: 24px 20px; }

  .top-header { padding: 0 16px; }
  .header-title { font-size: 15px; }

  .section-title { font-size: 18px; }

  .tiket-card-header { flex-direction: column; align-items: flex-start; }
  .tiket-card-footer { flex-direction: column; }
  .tiket-card-footer .btn { width: 100%; justify-content: center; }

  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { min-width: auto; max-width: 100%; }

  .dashboard-hero { padding: 20px; }
  .dashboard-hero h2 { font-size: 19px; }

  .login-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ── UTILITY CLASSES ────────────────────────────────────── */
.hidden { display: none !important; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); font-size: 13px; }
.text-small  { font-size: 12px; }
.font-bold   { font-weight: 700; }
.w-full      { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── SIDEBAR NAV LOGOUT ─────────────────────────────────── */
.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  color: rgba(255,100,100,0.85);
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.btn-logout:hover {
  background: rgba(232,65,92,0.15);
  color: #ff6b6b;
}

/* ── CHART BAR SIMPLE ───────────────────────────────────── */
.chart-bar-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.chart-bar-label {
  width: 100px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-track {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

.chart-bar-value {
  width: 30px;
  text-align: right;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
}
