/* ═══════════════════════════════════════════
   IPMS v2.0 — iGov Government Style Sheet
   COMSEC IT Services
═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Merriweather:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --navy:       #003366;
  --navy-dark:  #001f4d;
  --navy-mid:   #00529b;
  --accent:     #e6f0fa;
  --gold:       #C9A84C;
  --white:      #ffffff;
  --bg:         #f5f7fa;
  --border:     #dddddd;
  --text:       #1a2640;
  --muted:      #5a6a82;
  --success:    #1a7a4a;
  --warning:    #b07d0a;
  --danger:     #c0392b;
  --sidebar-w:  260px;
  --topbar-h:   60px;
  --radius:     8px;
  --shadow:     0 2px 10px rgba(0,30,80,.08);
  --shadow-md:  0 4px 20px rgba(0,30,80,.13);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f2f5; }
::-webkit-scrollbar-thumb { background: #c4cad6; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-mid); }

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: transform .3s ease;
  box-shadow: 3px 0 20px rgba(0,0,0,.3);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.logo-seal { width: 46px; height: 46px; flex-shrink: 0; }
.logo-text-wrap { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-size: 18px; font-weight: 800; color: #FFD700; letter-spacing: 2px; font-family: 'Merriweather', Georgia, serif; }
.logo-ver { font-size: 10px; color: rgba(255,255,255,.5); letter-spacing: 1px; text-transform: uppercase; }

.sidebar-close-btn {
  color: rgba(255,255,255,.4);
  font-size: 16px;
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: relative;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--navy-mid);
  border: 2px solid var(--gold);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-meta { flex: 1; overflow: hidden; }
.user-name { display: block; font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 10.5px; color: rgba(255,255,255,.45); }
.online-dot { width: 8px; height: 8px; background: #2ecc71; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 5px #2ecc71; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px; }
.nav-label {
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255,255,255,.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 8px 4px;
  margin-top: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  color: rgba(255,255,255,.65);
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
  margin-bottom: 2px;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--navy-mid); color: #fff; box-shadow: 0 2px 10px rgba(0,82,155,.4); }
.ni { width: 17px; height: 17px; flex-shrink: 0; }
.live-pill {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 700;
  background: #e74c3c;
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: .5px;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

.sidebar-foot {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.security-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: rgba(255,255,255,.35);
  line-height: 1.4;
}
.security-chip svg { fill: #2ecc71; flex-shrink: 0; }

/* ─── MAIN WRAPPER ─── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .3s;
}

/* ─── TOPBAR ─── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 12px; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--navy); border-radius: 2px; transition: .2s; }
.breadcrumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.breadcrumb span:last-child { color: var(--navy); font-weight: 600; }
.bc-sep { color: var(--border); }
.tb-clock { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--navy);
  padding: 6px;
  border-radius: 6px;
  transition: background .15s;
}
.notif-btn:hover { background: var(--accent); }
.notif-badge {
  position: absolute;
  top: 1px; right: 1px;
  background: #e74c3c;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.tb-user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: background .15s; }
.tb-user:hover { background: var(--accent); }
.tb-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tb-uname { font-size: 13px; font-weight: 500; color: var(--navy); }
.tb-caret { font-size: 10px; color: var(--muted); }

/* ─── APP VIEW ─── */
.app-view { flex: 1; padding: 28px 28px 40px; overflow-y: auto; }

/* ─── PAGE HEADER ─── */
.page-header { margin-bottom: 24px; }
.page-header h1 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 22px;
  color: var(--navy);
  border-bottom: 3px solid var(--navy);
  padding-bottom: 10px;
  margin-bottom: 6px;
}
.page-subtitle { font-size: 13px; color: var(--muted); }

/* ─── KPI CARDS ─── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::before { content:''; position:absolute; top:0; left:0; width:4px; height:100%; background: var(--navy); }
.kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1; }
.kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.kpi-trend { font-size: 11px; font-weight: 600; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-card.accent::before { background: var(--gold); }
.kpi-card.success::before { background: var(--success); }
.kpi-card.danger::before { background: var(--danger); }

/* ─── CARDS / PANELS ─── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 14px; font-weight: 700; color: var(--navy); font-family: 'Merriweather',Georgia,serif; }
.card-body { padding: 18px; }
.card-actions { display: flex; gap: 8px; }

/* ─── GRID LAYOUTS ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }

/* ─── TABLES ─── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--navy);
  color: #fff;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .4px;
  white-space: nowrap;
}
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr:nth-child(even) { background: #f9fafc; }
tbody tr:hover { background: var(--accent); }
.tbl-empty { text-align: center; color: var(--muted); padding: 30px !important; font-style: italic; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-mid); box-shadow: 0 3px 10px rgba(0,51,102,.3); }
.btn-secondary { background: var(--accent); color: var(--navy); border: 1px solid var(--border); }
.btn-secondary:hover { background: #d0e4f7; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: 6px; }

/* ─── BADGES / STATUS ─── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-navy { background: var(--navy); color: #fff; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--navy-mid);
  box-shadow: 0 0 0 3px rgba(0,82,155,.12);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ─── TABS ─── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 2px; }
.tab-btn {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── PROGRESS BARS ─── */
.progress-bar { background: #e8ecf1; border-radius: 20px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 20px; background: var(--navy); transition: width .6s ease; }
.progress-fill.gold { background: var(--gold); }
.progress-fill.success { background: var(--success); }
.progress-fill.danger { background: var(--danger); }

/* ─── MODAL ─── */
.modal-wrap {
  position: fixed; inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(3px);
  animation: fadeIn .2s ease;
}
.modal-wrap[hidden] { display: none; }
.modal-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp .25s ease;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; color: var(--navy); font-family: 'Merriweather',Georgia,serif; }
.modal-head button { font-size: 16px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.modal-head button:hover { background: #fee2e2; color: var(--danger); }
.modal-content { padding: 20px; overflow-y: auto; flex: 1; }
.modal-actions { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }

/* ─── TOAST ─── */
.toast-zone { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy-dark);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 360px;
  animation: toastIn .3s ease;
}
.toast.success { border-left: 4px solid #2ecc71; }
.toast.error { border-left: 4px solid #e74c3c; }
.toast.info { border-left: 4px solid var(--navy-mid); }
@keyframes toastIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

/* ─── SENTIMENT METER ─── */
.sentiment-meter { display: flex; height: 10px; border-radius: 20px; overflow: hidden; margin: 8px 0; }
.sm-positive { background: var(--success); }
.sm-neutral { background: var(--warning); }
.sm-negative { background: var(--danger); }

/* ─── KANBAN ─── */
.kanban { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.kanban-col { background: #f5f7fa; border-radius: var(--radius); padding: 12px; min-height: 300px; }
.kanban-col-head {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px 13px;
  margin-bottom: 8px;
  cursor: grab;
  transition: box-shadow .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.kanban-card:hover { box-shadow: var(--shadow); }
.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.kanban-card-meta { font-size: 11px; color: var(--muted); }

/* ─── CHART PLACEHOLDER ─── */
.chart-box {
  background: var(--accent);
  border: 1px dashed var(--navy-mid);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--navy-mid);
  font-size: 13px;
  font-weight: 500;
  min-height: 220px;
  position: relative;
  overflow: hidden;
}

/* ─── MAP PLACEHOLDER ─── */
.map-box {
  background: linear-gradient(135deg, #e8f4fd 0%, #cce4f6 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 320px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-box-label { color: var(--navy); font-size: 14px; font-weight: 600; z-index: 2; }

/* ─── STAT ROW ─── */
.stat-row { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-item { text-align: center; flex: 1; min-width: 80px; }
.stat-num { font-size: 22px; font-weight: 800; color: var(--navy); }
.stat-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ─── TIMELINE ─── */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before { content:''; position:absolute; left:13px; top:0; bottom:0; width:2px; background:var(--border); }
.tl-item { position: relative; padding-left: 36px; margin-bottom: 18px; }
.tl-dot { position:absolute; left:6px; top:4px; width:16px; height:16px; border-radius:50%; background:var(--navy); border:3px solid var(--white); box-shadow:0 0 0 2px var(--navy); }
.tl-dot.gold { background: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.tl-dot.success { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.tl-title { font-size: 13px; font-weight: 600; color: var(--text); }
.tl-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ─── OVERLAY ─── */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 150;
}
.overlay.show { display: block; }

/* ─── SECTION DIVIDER ─── */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* ─── MISC UTILITIES ─── */
.text-navy { color: var(--navy); }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-gold { color: var(--gold); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close-btn { display: block; }
  .main-wrapper { margin-left: 0; }
  .hamburger { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .app-view { padding: 16px; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { gap: 12px; }
}
