:root {
  --sidebar-width: 260px;
  /*--sidebar-bg: #0f172a;*/
  --sidebar-bg: #312151;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #3b82f6;
  --sidebar-hover: #1e293b;
  --topbar-height: 60px;
  --primary: #3b82f6;
  --primary: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --body-bg: #f1f5f9;
  --card-bg: #ffffff;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }

body { background: var(--body-bg); font-family: 'Inter', 'Segoe UI', sans-serif; margin: 0; }

/* ── SIDEBAR ────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .3s ease;
    overflow-y: auto;
}
.sidebar-brand {
    padding: 20px 20px 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #312151 0%, #312151 50%, #595999 100%);
}
.sidebar-nav { list-style: none; padding: 12px 0; margin: 0; flex: 1; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: var(--sidebar-text);
  text-decoration: none; font-size: .875rem; font-weight: 500;
  border-radius: 0; transition: all .2s;
  border-left: 3px solid transparent;
}
.sidebar-nav li a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav li a.active {
  background: rgba(59,130,246,.15); color: var(--sidebar-active);
  border-left-color: var(--sidebar-active);
}
.sidebar-nav li a i { width: 18px; text-align: center; }
.nav-section {
  padding: 12px 20px 4px; font-size: .65rem; font-weight: 700;
  color: #475569; letter-spacing: .08em; text-transform: uppercase;
}
.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid #1e293b;
}
.user-info { display: flex; align-items: center; color: var(--sidebar-text); }

/* ── MAIN CONTENT ───────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin .3s ease;
}
.topbar {
  height: var(--topbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.page-content { padding: 24px; }

/* ── CARDS ──────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0 !important;
  padding: 16px 20px;
  font-weight: 600;
}

/* ── STAT CARDS ─────────────── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.stat-icon {
  width: 56px; height: 56px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { color: var(--text-muted); font-size: .8rem; font-weight: 500; margin-top: 2px; }

/* ── PRIORITY BADGES ────────── */
.badge-critical { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-high     { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.badge-medium   { background: #fefce8; color: #ca8a04; border: 1px solid #fef08a; }
.badge-low      { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.badge-info     { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* ── STATUS BADGES ──────────── */
.badge-new         { background: #eff6ff; color: #1d4ed8; }
.badge-assigned    { background: #faf5ff; color: #7c3aed; }
.badge-inprogress  { background: #fff7ed; color: #c2410c; }
.badge-pending     { background: #fefce8; color: #92400e; }
.badge-resolved    { background: #f0fdf4; color: #15803d; }
.badge-closed      { background: #f1f5f9; color: #475569; }
.badge-cancelled   { background: #fef2f2; color: #991b1b; }

/* ── TABLES ─────────────────── */
.table { font-size: .875rem; }
.table thead th {
  background: #f8fafc; color: #475569;
  font-weight: 600; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 2px solid var(--border);
  padding: 12px 16px;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table-hover tbody tr:hover { background: #f8fafc; }
.sla-breached { color: #dc2626; font-weight: 600; }
.sla-warning  { color: #d97706; }

/* ── FORMS ──────────────────── */
.form-label { font-weight: 500; font-size: .875rem; color: #374151; }
.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: 8px; font-size: .875rem;
  padding: 8px 12px;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ── PAGE HEADER ────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; color: #0f172a; }
.page-header .breadcrumb { font-size: .8rem; margin: 0; }

/* ── TIMELINE ───────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 9px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot {
  position: absolute; left: -23px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-content {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; font-size: .8rem;
}

/* ── CATALOG CARDS ──────────── */
.catalog-card {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; cursor: pointer; transition: all .2s;
  background: var(--card-bg); text-decoration: none; color: inherit;
  display: block; height: 100%;
}
.catalog-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(59,130,246,.15);
  transform: translateY(-2px); color: inherit;
}
.catalog-icon {
  width: 48px; height: 48px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem; margin-bottom: 12px;
}

/* ── PAGINATION ─────────────── */
.pagination .page-link { border-radius: 8px; margin: 0 2px; font-size: .875rem; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ── LOGIN PAGE ─────────────── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #312151 0%, #312151 50%, #595999 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: rgba(255,255,255,.03); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 20px;
  padding: 48px 40px; width: 100%; max-width: 440px;
  box-shadow: 0 25px 50px rgba(0,0,0,.4);
}

/* ── RESPONSIVE ─────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}
