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

:root {
  --primary: #0A2540;
  --primary-light: #1A3A5C;
  --accent: #E8320A;
  --accent-hover: #FF4D2A;
  --success: #00C48C;
  --warning: #FFB020;
  --danger: #FF4D4F;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --text: #1A2B40;
  --muted: #6B7A99;
  --border: #E2E8F0;
  --shadow: 0 2px 12px rgba(10,37,64,0.08);
  --shadow-lg: 0 8px 32px rgba(10,37,64,0.14);
  --radius: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,h2,h3,h4 { font-family: 'Rajdhani', sans-serif; letter-spacing: 0.02em; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; }

/* ---- NAVBAR ---- */
.navbar {
  background: var(--primary);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
}
.navbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px; height: 64px;
  display: flex; align-items: center; gap: 24px;
}
.navbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon { font-size: 26px; color: var(--accent); display: inline-block; animation: spin 10s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-name { display: block; font-family: 'Rajdhani', sans-serif; font-size: 20px; font-weight: 700; color: #fff; letter-spacing: 0.1em; line-height: 1; }
.brand-tagline { display: block; font-size: 10px; color: rgba(255,255,255,0.45); letter-spacing: 0.12em; text-transform: uppercase; }
.navbar-links { display: flex; gap: 4px; flex: 1; }
.nav-link { padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.7); transition: all 0.15s; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.1); }
.nav-link.highlight { background: var(--accent); color: #fff; }
.nav-link.highlight:hover { background: var(--accent-hover); }
.navbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-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: 15px; }
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1; }
.user-role { font-size: 10px; color: rgba(255,255,255,0.45); text-transform: capitalize; margin-top: 2px; }
.hamburger { display: none; background: none; border: none; color: #fff; font-size: 22px; padding: 4px; }

/* ---- LAYOUT ---- */
.page-body { flex: 1; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 32px 24px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: 32px; font-weight: 700; color: var(--primary); margin-bottom: 4px; line-height: 1; }
.page-header p { color: var(--muted); font-size: 14px; }
.app-footer { background: var(--primary); color: rgba(255,255,255,0.35); text-align: center; padding: 14px; font-size: 12px; letter-spacing: 0.04em; }

/* ---- CARD ---- */
.card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--border); }

/* ---- BUTTONS ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 600; border: none; cursor: pointer; transition: all 0.18s; font-family: 'DM Sans', sans-serif; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); background: #F8FAFC; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-danger { background: var(--danger); color: #fff; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); background: #FAFBFC; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 15px; transition: border-color 0.15s; }
.form-control:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(10,37,64,0.08); }
textarea.form-control { resize: vertical; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.col-span-2 { grid-column: span 2; }
.error-msg { color: var(--danger); font-size: 13px; background: #fff0f0; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border-left: 3px solid var(--danger); }
.success-msg { color: #15803D; font-size: 13px; background: #f0fff4; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; border-left: 3px solid var(--success); }

/* ---- BADGES ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.badge-new { background: #EFF6FF; color: #2563EB; }
.badge-assigned { background: #FFF7ED; color: #EA580C; }
.badge-inprogress { background: #F0FFF4; color: #16A34A; }
.badge-onhold { background: #FFFBEB; color: #D97706; }
.badge-resolved { background: #F0FFF4; color: #15803D; }
.badge-closed { background: #F1F5F9; color: #64748B; }
.badge-low { background: #F0FFF4; color: #15803D; }
.badge-medium { background: #FFF7ED; color: #EA580C; }
.badge-high { background: #FEF2F2; color: #DC2626; }
.badge-critical { background: #1A0A0A; color: #FF6B6B; }

/* ---- TABLE ---- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 10px 16px; background: #F8FAFC; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable:hover td { background: #F8FAFC; cursor: pointer; }

/* ---- STATS ---- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-row-6 { grid-template-columns: repeat(6, 1fr); }
.stat-card { padding: 20px; text-align: center; }
.stat-count { font-family: 'Rajdhani', sans-serif; font-size: 38px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* ---- FILTER BAR ---- */
.filter-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-right: 4px; }
.filter-btn { padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; background: transparent; border: 1.5px solid var(--border); color: var(--muted); cursor: pointer; transition: all 0.15s; text-decoration: none; display: inline-block; }
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- TICKET NO ---- */
.ticket-no { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 13px; color: var(--primary); background: #EFF6FF; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }

/* ---- EMPTY STATE ---- */
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); }

/* ---- PAGINATION ---- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; border-top: 1px solid var(--border); }

/* ---- AUTH ---- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-left { background: var(--primary); display: flex; flex-direction: column; justify-content: center; padding: 60px; position: relative; overflow: hidden; }
.auth-left::before { content: ''; position: absolute; top: -80px; right: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(232,50,10,0.12); }
.auth-brand-icon { font-size: 48px; color: var(--accent); display: block; margin-bottom: 12px; }
.auth-brand h1 { font-family: 'Rajdhani', sans-serif; font-size: 44px; font-weight: 700; color: #fff; letter-spacing: 0.1em; line-height: 1; margin-bottom: 6px; }
.auth-brand p { color: rgba(255,255,255,0.5); font-size: 14px; }
.auth-features { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; }
.feature-item { color: rgba(255,255,255,0.75); font-size: 15px; }
.auth-right { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { background: #fff; border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.auth-card h2 { font-family: 'Rajdhani', sans-serif; font-size: 32px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.auth-card .subtitle { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* ---- TICKET DETAIL ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.card-section { padding: 24px; margin-bottom: 16px; }
.card-title { font-family: 'Rajdhani', sans-serif; font-size: 17px; font-weight: 700; color: var(--primary); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.info-row { display: flex; padding: 9px 0; border-bottom: 1px solid #F1F5F9; font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-label { width: 140px; color: var(--muted); flex-shrink: 0; font-weight: 500; }
.info-val { font-weight: 500; }
.notes-box { background: #F8FAFC; border-left: 3px solid var(--primary); padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.notes-resolved { border-left-color: var(--success); }
.problem-text { line-height: 1.7; white-space: pre-wrap; }

/* ---- TIMELINE ---- */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F1F5F9; }
.tl-item:last-child { border-bottom: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 5px; }
.tl-meta { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 13px; }
.tl-name { font-weight: 600; }
.tl-time { color: var(--muted); }
.tl-comment { margin-top: 6px; font-size: 13px; color: var(--muted); background: #F8FAFC; padding: 6px 10px; border-radius: 6px; }

/* ---- MISC ---- */
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.fw-600 { font-weight: 600; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between { justify-content: space-between; }
.problem-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--muted); max-width: 280px; }
.role-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; text-transform: capitalize; }
.mini-avatar { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.status-dot-active { color: var(--success); font-weight: 600; font-size: 13px; }
.status-dot-inactive { color: var(--muted); font-weight: 600; font-size: 13px; }
.form-section { padding: 28px 32px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.form-actions { padding: 20px 32px; background: #F8FAFC; display: flex; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--border); }
.section-title { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 20px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) { .detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .stat-row-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
  .navbar-links { display: none; position: fixed; top: 64px; left: 0; right: 0; background: var(--primary-light); flex-direction: column; padding: 16px; gap: 4px; }
  .navbar-links.open { display: flex; }
  .hamburger { display: block; }
  .user-info { display: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .form-section { padding: 20px 16px; }
  .form-actions { flex-direction: column; }
  .wrap { padding: 20px 16px; }
  .page-header { flex-direction: column; }
}
@media (max-width: 480px) { .stat-row, .stat-row-6 { grid-template-columns: repeat(2, 1fr); } }
