:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--bg-page);
  background-image: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.04) 0px, transparent 50%),
                    radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.04) 0px, transparent 50%);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- NAVIGATION --- */
.nav {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 9px;
  color: #fff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-item {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.nav-btn:hover {
  background: var(--primary-hover);
}

.nav-logout {
  color: #f87171;
}

.nav-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #e2e8f0;
}

.user-role-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.04em;
}

.user-role-tag.admin {
  background: #f59e0b;
  color: #78350f;
}

.user-role-tag.user {
  background: #3b82f6;
  color: #ffffff;
}

/* --- CONTAINER & LAYOUT --- */
.container {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 20px;
  min-height: calc(100vh - 180px);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.narrow {
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

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

.page-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

/* --- HERO SECTION --- */
.hero-section {
  text-align: center;
  padding: 56px 20px 48px;
  max-width: 760px;
  margin: 0 auto;
}

.badge-hero {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--primary-border);
  margin-bottom: 16px;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  background: linear-gradient(135deg, #0f172a 20%, #4338ca 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 28px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* --- FEATURES GRID --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 36px 0 24px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 30px;
  margin-bottom: 12px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.demo-banner {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid var(--primary-border);
  margin-top: 24px;
}

.demo-banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.demo-banner-content h4 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #1e1b4b;
}

.demo-banner-content p {
  margin: 0;
  color: #4338ca;
  font-size: 14px;
}

/* --- STATS GRID --- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-decoration: none;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  border-top: 4px solid var(--primary);
  display: block;
}

.stat:hover, .stat.active {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.stat.active {
  background: #f8fafc;
  outline: 2px solid var(--primary);
}

.stat-pending { border-top-color: #f59e0b; }
.stat-in-progress { border-top-color: #3b82f6; }
.stat-resolved { border-top-color: #10b981; }
.stat-rejected { border-top-color: #ef4444; }

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* --- FORMS & INPUTS --- */
label {
  display: block;
  margin: 16px 0 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

textarea {
  resize: vertical;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--primary);
  color: #ffffff;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.btn.secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn.secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-sm:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-clear {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f1f5f9;
}

.btn-clear:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* --- DEMO ACCOUNT HELPER --- */
.demo-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 18px 0;
}

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

.demo-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 10px;
}

.demo-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.demo-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-demo {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-demo:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.role-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.role-pill.admin { background: #fef3c7; color: #b45309; }
.role-pill.user { background: #e0e7ff; color: #4338ca; }

.form-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 20px;
}

.form-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* --- TABLES --- */
.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

th, td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(248, 250, 252, 0.8);
}

.subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.category-tag {
  display: inline-block;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

/* --- BADGES --- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge.in-progress {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.badge.resolved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge.rejected {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* --- ALERTS --- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert.success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.alert.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* --- DETAIL & REMARK BOXES --- */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.meta-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.meta-val {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.detail-block h4 {
  margin: 16px 0 8px;
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.description-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.6;
}

.remark-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.6;
}

.remark-box.active {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.remark-box.pending {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: var(--text-muted);
}

.remark-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: #dcfce7;
  color: #15803d;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}

/* --- EMPTY STATE --- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.empty-state p {
  color: var(--text-muted);
  margin: 0 auto 20px;
  max-width: 440px;
  font-size: 14px;
}

/* --- FOOTER --- */
.footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 24px 20px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-meta {
  font-size: 12px;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 12px;
}

@media (max-width: 640px) {
  .hero-title { font-size: 30px; }
  .nav-inner { flex-direction: column; gap: 12px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .card { padding: 18px; }
}
