/* ============================================================
   SpectroNova™ Design Management System — Master Stylesheet
   ============================================================ */

:root {
  --or:       #E8671A;
  --or-dark:  #B84E10;
  --or-mid:   #F5A96A;
  --or-light: #FDF0E8;
  --or-pale:  #FEF7F2;
  --white:    #FFFFFF;
  --gray-1:   #F4F5F7;
  --gray-2:   #E8E8E8;
  --gray-3:   #D0D0D0;
  --gray-4:   #999999;
  --gray-5:   #666666;
  --gray-6:   #444444;
  --gray-7:   #222222;
  --dark:       #1A1B2E;
  --sidebar-bg: #1A1B2E;
  --sidebar-bg2:#14152A;
  --green:  #1A7A2E;
  --blue:   #1A56A0;
  --red:    #C0392B;
  --amber:  #E8A817;
  --success-green:  #1A7A2E;
  --warning-amber:  #E8A817;
  --error-red:      #C0392B;
  --info-blue:      #1A56A0;
  --accent-orange:  #E8671A;
  --sidebar-w: 230px;
  --header-h:  52px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: Calibri, 'Segoe UI', Arial, sans-serif;
  background: var(--gray-1);
  color: var(--gray-7);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--sidebar-bg); height: 100vh;
  position: fixed; top: 0; left: 0;
  display: flex; flex-direction: column; z-index: 100; overflow-y: auto;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: var(--sidebar-bg2);
  text-decoration: none; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo-icon {
  width: 30px; height: 30px; background: var(--or);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff;
}
.sidebar-logo-text { color: #fff; font-size: 14px; font-weight: 600; line-height: 1.2; }
.sidebar-logo-text small { display: block; font-size: 10px; font-weight: 400; color: rgba(255,255,255,0.5); letter-spacing: 0.5px; }
.sidebar-section {
  padding: 16px 0 4px 18px; font-size: 10px; font-weight: 700;
  letter-spacing: 1.2px; color: rgba(255,255,255,0.35); text-transform: uppercase;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; color: rgba(255,255,255,0.65);
  text-decoration: none; font-size: 13px;
  border-left: 3px solid transparent; transition: all 0.15s;
}
.sidebar-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-item.active {
  background: rgba(232,103,26,0.12); color: var(--or);
  border-left-color: var(--or); font-weight: 600;
}
.sidebar-item .si-icon { width: 18px; text-align: center; font-size: 14px; }
.sidebar-bottom {
  margin-top: auto; padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-bottom a { display: block; color: rgba(255,255,255,0.5); font-size: 12px; text-decoration: none; padding: 4px 0; }
.sidebar-bottom a:hover { color: var(--or-mid); }

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

/* ---- Topbar ---- */
.topbar {
  height: var(--header-h); background: var(--white);
  border-bottom: 1px solid var(--gray-2); padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.breadcrumb { font-size: 11px; color: var(--gray-5); }
.breadcrumb span { color: var(--or-mid); font-weight: 600; }
.page-title { font-size: 16px; font-weight: 700; color: var(--gray-7); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray-6); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--or);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

/* ---- Content ---- */
.content { padding: 20px 24px 32px; flex: 1; overflow-y: auto; }

/* ---- Stat Cards ---- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  border-radius: 10px; padding: 18px 16px; text-align: center;
  position: relative; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.10); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.stat-card.c-dark   { background: #1F2937; }
.stat-card.c-dark::before   { background: linear-gradient(90deg, #F59E0B, #D97706); }
.stat-card.c-orange { background: #FFF7ED; }
.stat-card.c-orange::before { background: linear-gradient(90deg, #F59E0B, #D97706); }
.stat-card.c-green  { background: #ECFDF5; }
.stat-card.c-green::before  { background: linear-gradient(90deg, #10B981, #059669); }
.stat-card.c-blue   { background: #EFF6FF; }
.stat-card.c-blue::before   { background: linear-gradient(90deg, #3B82F6, #2563EB); }
.stat-card.c-purple { background: #F5F3FF; }
.stat-card.c-purple::before { background: linear-gradient(90deg, #8B5CF6, #7C3AED); }
.stat-card.c-red    { background: #FEF2F2; }
.stat-card.c-red::before    { background: linear-gradient(90deg, #EF4444, #DC2626); }
.stat-card.c-teal   { background: #F0FDFA; }
.stat-card.c-teal::before   { background: linear-gradient(90deg, #14B8A6, #0D9488); }
.stat-card.c-dark .stat-label   { color: rgba(255,255,255,0.7); }
.stat-card.c-orange .stat-label { color: #92400E; }
.stat-card.c-green .stat-label  { color: #065F46; }
.stat-card.c-blue .stat-label   { color: #1E3A5F; }
.stat-card.c-purple .stat-label { color: #5B21B6; }
.stat-card.c-red .stat-label    { color: #991B1B; }
.stat-card.c-teal .stat-label   { color: #134E4A; }
.stat-card.c-dark .stat-value   { color: #FCD34D; }
.stat-card.c-orange .stat-value { color: #B45309; }
.stat-card.c-green .stat-value  { color: #047857; }
.stat-card.c-blue .stat-value   { color: #1D4ED8; }
.stat-card.c-purple .stat-value { color: #6D28D9; }
.stat-card.c-red .stat-value    { color: #DC2626; }
.stat-card.c-teal .stat-value   { color: #0F766E; }
.stat-icon { font-size: 18px; margin-bottom: 6px; display: block; }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-sub { font-size: 11px; margin-top: 4px; font-weight: 600; }

/* ---- Cards ---- */
.card { background: var(--white); border-radius: 8px; border: 1px solid var(--gray-2); margin-bottom: 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--gray-2);
}
.card-header h2 { font-size: 15px; font-weight: 700; color: var(--gray-7); }
.card-body { padding: 18px; }

/* ---- Data Tables ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: var(--gray-7); color: #fff; padding: 10px 14px;
  text-align: left; font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-2); color: var(--gray-7); }
.data-table tbody tr:hover { background: var(--or-pale); }
.data-table tbody tr { cursor: pointer; }

/* ---- Tags ---- */
.tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }
.tag-green  { background: #D1FAE5; color: #065F46; }
.tag-or     { background: #FDE8D0; color: #7C2D12; }
.tag-blue   { background: #DBEAFE; color: #1E3A5F; }
.tag-red    { background: #FEE2E2; color: #7F1D1D; }
.tag-gray   { background: #E5E7EB; color: #374151; }
.tag-amber  { background: #FEF3C7; color: #78350F; }
.tag-orange { background: #FED7AA; color: #7C2D12; }
.tag-purple { background: #EDE9FE; color: #5B21B6; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 6px; font-family: inherit;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-md { padding: 8px 18px; font-size: 13px; }
.btn-primary { background: var(--or); color: #fff; }
.btn-primary:hover { background: var(--or-dark); }
.btn-secondary { background: var(--white); color: var(--gray-7); border: 1px solid var(--gray-2); }
.btn-secondary:hover { border-color: var(--gray-4); }
.btn-ghost { background: transparent; color: var(--or); }
.btn-ghost:hover { background: var(--or-light); }

/* ---- Hero Card ---- */
.hero-card {
  background: linear-gradient(135deg, #E8671A 0%, #F5A96A 100%);
  border-radius: 12px; padding: 32px 36px; color: #fff;
  margin-bottom: 24px; position: relative; overflow: hidden;
}
.hero-card::after {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.hero-card p { font-size: 14px; color: rgba(255,255,255,0.7); max-width: 600px; }

/* ---- Screen Grid ---- */
.screen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.screen-card {
  background: var(--white); border: 1px solid var(--gray-2);
  border-radius: 10px; padding: 20px; text-decoration: none;
  color: var(--gray-7); transition: all 0.2s;
  display: flex; flex-direction: column; gap: 8px;
}
.screen-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); transform: translateY(-2px); border-color: var(--or-mid); }
.screen-card .sc-icon {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--or-light); color: var(--or);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.screen-card .sc-num { font-size: 11px; font-weight: 700; color: var(--or); text-transform: uppercase; letter-spacing: 0.6px; }
.screen-card h3 { font-size: 15px; font-weight: 700; }
.screen-card p { font-size: 12px; color: var(--gray-5); line-height: 1.5; }
.screen-section-heading {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--gray-4); margin-top: 12px; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--gray-2);
}

/* ---- Info Bar ---- */
.info-bar {
  background: var(--or-light); border-left: 4px solid var(--or);
  padding: 12px 16px; border-radius: 0 6px 6px 0;
  font-size: 13px; color: var(--gray-7); margin-bottom: 16px;
}

/* ---- Progress Bars ---- */
.progress-bar-bg {
  background: var(--gray-2); border-radius: 6px; height: 10px;
  overflow: hidden; width: 100%;
}
.progress-bar-fill {
  height: 100%; border-radius: 6px; transition: width 0.4s ease;
}
.progress-bar-fill.fill-green  { background: linear-gradient(90deg, #10B981, #059669); }
.progress-bar-fill.fill-orange { background: linear-gradient(90deg, #F59E0B, #D97706); }
.progress-bar-fill.fill-blue   { background: linear-gradient(90deg, #3B82F6, #2563EB); }
.progress-bar-fill.fill-red    { background: linear-gradient(90deg, #EF4444, #DC2626); }

/* ---- Building Matrix ---- */
.matrix-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.matrix-table th {
  background: var(--gray-7); color: #fff; padding: 8px 10px;
  text-align: center; font-weight: 600; font-size: 11px; text-transform: uppercase;
}
.matrix-table td {
  padding: 8px 10px; border: 1px solid var(--gray-2); text-align: center;
  font-weight: 600; font-size: 11px;
}
.matrix-table td.m-green  { background: #D1FAE5; color: #065F46; }
.matrix-table td.m-amber  { background: #FEF3C7; color: #78350F; }
.matrix-table td.m-blue   { background: #DBEAFE; color: #1E3A5F; }
.matrix-table td.m-red    { background: #FEE2E2; color: #7F1D1D; }
.matrix-table td.m-gray   { background: #F3F4F6; color: #6B7280; }
.matrix-table td.m-orange { background: #FED7AA; color: #7C2D12; }
.matrix-table td.row-label { text-align: left; font-weight: 700; background: var(--or-pale); color: var(--gray-7); }

/* ---- Filter Bar ---- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar select, .filter-bar input {
  padding: 7px 12px; border: 1px solid var(--gray-2); border-radius: 6px;
  font-size: 13px; font-family: inherit; color: var(--gray-7); background: #fff;
}
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--or); box-shadow: 0 0 0 2px var(--or-light); }

/* ---- Donut/Pie Charts (CSS-only) ---- */
.donut-chart {
  width: 120px; height: 120px; border-radius: 50%; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.donut-center {
  width: 70px; height: 70px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: var(--gray-7); position: absolute;
}

/* ---- Utilities ---- */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.mt-16  { margin-top: 16px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-700 { font-weight: 700; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.color-or   { color: var(--or-dark); }
.color-gray { color: var(--gray-5); }
.w-full { width: 100%; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .screen-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .screen-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
}
