/* ===== Spark Vault: unified header / sidebar / main layout =====
   Paste/replace this entire block into assets/custom.css (keep other styles below/above) */

/* reset / base */
:root{ --sidebar-width:220px; --sidebar-offset:64px; --header-height:64px; }

/* Header (fixed) */
.header-bar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1100;
  box-sizing: border-box;
}
.header-bar .brand-left{ display:flex; align-items:center; gap:10px; }
.header-bar .brand-left img{ height:36px; }
.header-bar .header-right{ margin-left:auto; display:flex; gap:12px; align-items:center; }

/* Sidebar (fixed under header) */
.sidebar {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  left: 12px;
  width: var(--sidebar-width);
  min-height: calc(100vh - var(--header-height) - 16px);
  background: transparent;
  z-index: 1000;
  box-sizing: border-box;
  padding: 0;
}

/* Sidebar inner card to match dashboard look */
.sidebar .card-sidebar {
  background:#fff;
  border-radius:10px;
  padding:16px;
  box-shadow: 0 6px 18px rgba(15,23,42,0.04);
  border: 1px solid #f0f2f5;
}

/* Sidebar nav items */
.sidebar .nav { margin:0; padding:0; }
.sidebar .nav .nav-link {
  color:#007bff;
  padding:8px 6px;
  display:block;
  border-radius:6px;
}
.sidebar .nav .nav-link:hover { background: rgba(0,123,255,0.06); color:#0056b3; }

/* Logout button spacing */
.sidebar .logout-btn { margin-top:14px; }

/* Main content area — push right of sidebar and below header */
.main {
  margin-left: calc(var(--sidebar-width) + 48px); /* space for sidebar + gap */
  padding: calc(var(--header-height) + 24px) 28px 36px 28px;
  min-height: calc(100vh - var(--header-height));
  background: #f5f7fb;
  box-sizing: border-box;
}

/* Support old container.with-sidebar pages */
.container.with-sidebar, .main .container-fluid, .container.with-sidebar .card {
  margin-left: 0;
  padding-left: 0;
  padding-right: 0;
}

/* Make the report card look clean */
.container.with-sidebar .card, .report-card, .card {
  background:#fff;
  border-radius:10px;
  box-shadow:0 6px 18px rgba(15,23,42,0.04);
  border: 1px solid #f1f3f5;
  padding:14px;
}

/* Avoid sidebar covering the nav tabs */
.nav-tabs { position:relative; z-index:30; }

/* Tables styling */
.table.table-hover tbody tr td{ vertical-align: middle; }
.table.table-hover tbody tr:nth-child(odd){ background: #ffffff; }
.table.table-hover tbody tr:nth-child(even){ background: #fbfbfb; }

/* Mobile responsiveness: collapse sidebar on small screens */
@media (max-width: 991px) {
  .main { margin-left: 18px; padding-left: 18px; padding-right:18px; }
  .sidebar { position: relative; width: 100%; top: 0; margin-bottom: 12px; }
  .sidebar .card-sidebar { border-radius:8px; }
}

/* Force highest specificity fallback if other rules conflict */
html body .main { margin-left: calc(var(--sidebar-width) + 48px) !important; padding-top: calc(var(--header-height) + 24px) !important; }


/* === Dashboard GUI patch (v2) === */

/* Dashboard: white rounded boxes + black border + shadow (applied inside .main area) */
.main .card, .main .widget, .main .card-stat, .main .kpi, .main .card .card-body, .main .widget .card-body {
  background: #ffffff !important;
  border: 0.5px solid rgba(191,191,191,0.85) !important; /* strong black border as requested */
  border-radius: 12px !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08) !important;
}

/* ensure KPI small label is muted but legible */
.main .kpi .card-body .text-muted.small, .main .card-stat .stat-label {
  color: #666 !important;
  font-size: 0.95rem;
}

/* KPI number style */
.main .kpi .card-body .h2, .main .stat-value {
  font-weight: 600;
  color: #111;
}

/* small layout tweaks for spacing */
.main .card .card-body, .main .widget .card-body {
  padding: 18px;
}

/* Charts card inner padding */
.main .card .card-body canvas {
  display: block;
  width: 100% !important;
}

/* make recent table card stand out */
.main .table-wrapper, .main .card .table {
  background: transparent;
}

/* Responsive tweaks: keep border radius on small screens too */
@media (max-width: 767px){
  .main .card, .main .widget { border-radius:10px; }
}


/* ===== Auto-patched styles injected by assistant ===== */


/* === PATCH: Dashboard card visuals (white rounded boxes, black border, shadow) === */

/* General card style override to match provided mockup */
.card, .widget, .card-stat, .kpi, .table-wrapper, .table-responsive > .table {
  background: #ffffff !important;
  border-radius: 14px !important;
  border: 0.5px solid #c8c8c8 !important; /* black-ish border */
  box-shadow: 0 6px 18px rgba(20,20,20,0.06) !important;
  padding: 18px !important;
}

/* KPI small cards (top boxes) */
.card-stat, .kpi {
  padding: 20px 22px !important;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* KPI label & value */
.card-stat .stat-label, .kpi .text-muted.small, .kpi .stat-label { color:#6b6f76; font-size:0.9rem; margin-bottom:6px; }
.card-stat .stat-value, .kpi .h2 { font-size:2.1rem; font-weight:600; color:#111; line-height:1; }

/* Make donut/line card paddings a bit smaller so charts fit */
.widget canvas, .card .table-responsive { width:100% !important; height: 220px !important; max-height: 220px !important; display:block; }

/* Recent table wrapper adjustments */
.table-wrapper { padding: 18px !important; }
.table-wrapper table th, .table-wrapper table td { vertical-align: middle !important; }
.table-wrapper table thead th { font-weight:700; color:#222; }

/* Left sidebar small card */
.card-sidebar, .brand-small { background:transparent; border:none; box-shadow:none; padding:0; }
.brand-small img { height:34px; }

/* Smaller rounded for inside elements (donut chart container) */
.widget > .card-body, .card > .card-body { padding: 0; background:transparent; border:none; box-shadow:none; }

/* Ensure charts area keeps inner white card look */
.widget canvas { padding: 18px; background:transparent; border-radius:10px; }

/* Responsiveness: adjust KPI boxes stacking */
@media (max-width: 991px){
  .card-stat, .kpi { min-height:70px; font-size:14px; padding:12px; }
}

/* Ensure table-responsive inner container inherits rounded corners */
.table-responsive { border-radius: 12px; overflow: hidden; border: none; box-shadow:none; }

/* small tweak to make the floating legend look consistent */
.chart-legend { font-size:0.85rem; }

/* End patch */
