/* Compact, professional overrides for SB Admin 2 + Bootstrap 4
   Keep visual hierarchy but reduce whitespace and font sizes for dense UIs.
   Load this after sb-admin-2.min.css.
*/

:root {
  --compact-font-scale: 0.92; /* ~15px base */
}

/* Base typography */
html { font-size: 16px; }
body { font-size: calc(1rem * var(--compact-font-scale)); line-height: 1.3; }

.h1, h1 { font-size: 1.5rem; }
.h2, h2 { font-size: 1.3rem; }
.h3, h3 { font-size: 1.15rem; }
.h4, h4 { font-size: 1rem; }
.small, small { font-size: 85%; }

/* Utilities (tighter spacing) */
.mb-4 { margin-bottom: 1rem !important; }
.mt-4 { margin-top: 1rem !important; }
.p-3 { padding: 0.75rem !important; }
.px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.py-2 { padding-top: 0.35rem !important; padding-bottom: 0.35rem !important; }
.container-fluid { padding: 0.75rem 1rem; }

/* Navbar (topbar) */
.topbar { height: 3.25rem; }
.topbar .navbar-nav .nav-item .nav-link { padding: 0.25rem 0.5rem; }
.img-profile { width: 1.75rem; height: 1.75rem; }

/* Sidebar */
.sidebar { width: 13rem !important; background: linear-gradient(180deg, #2c3e50 0%, #1b2838 100%) !important; }
.sidebar.toggled { width: 6.5rem !important; }
.sidebar .sidebar-brand .sidebar-brand-text { font-size: 0.9rem; letter-spacing: 0.3px; }
.sidebar .nav-item .nav-link { padding: 0.55rem 0.85rem; font-size: 0.92rem; border-left: 3px solid transparent; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.sidebar .nav-item .nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; border-left-color: #00d1b2; }
.sidebar .nav-item .nav-link.active { background: rgba(255,255,255,0.12); color: #fff; border-left-color: #4e73df; font-weight: 600; }
.sidebar .collapse .collapse-inner { padding: 0.35rem 0.5rem; }
.sidebar .collapse .collapse-inner .collapse-item { padding: 0.35rem 0.75rem; font-size: 0.875rem; border-left: 2px solid transparent; }
.sidebar .collapse .collapse-inner .collapse-item.active { background: rgba(78,115,223,0.08); color: #4e73df; border-left-color: #4e73df; font-weight: 600; }
.sidebar .sidebar-heading { font-size: 0.72rem; font-weight: 800; color: #a8b3c7 !important; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.75rem 1rem; }
.sidebar .collapse .collapse-header { color: #6e707e; font-weight: 700; }

/* Cards */
.card { border-radius: 0.5rem; }
.card-header { padding: 0.5rem 0.75rem; }
.card-body { padding: 0.75rem; }

/* Buttons */
.btn { padding: 0.3rem 0.65rem; font-size: 0.9rem; border-radius: 0.25rem; }
.btn-lg { padding: 0.5rem 1rem; font-size: 1rem; }
.btn-sm { padding: 0.15rem 0.5rem; font-size: 0.8rem; }

/* Forms */
.form-group { margin-bottom: 0.5rem; }
.form-control, .custom-select { padding: 0.25rem 0.5rem; font-size: 0.9rem; height: calc(1.5em + 0.5rem + 2px); }
.input-group > .form-control, .input-group > .custom-select { height: calc(1.5em + 0.5rem + 2px); }
.custom-file-input ~ .custom-file-label { padding: 0.25rem 0.5rem; height: calc(1.5em + 0.5rem + 2px); }

/* Tables */
.table th, .table td { padding: 0.5rem; vertical-align: middle; }
.table thead th { border-bottom-width: 1px; }

/* DataTables tweaks (if used) */
.dataTables_wrapper .dataTables_length select { height: calc(1.5em + 0.5rem + 2px); padding: 0.25rem 0.5rem; }
.dataTables_wrapper .dataTables_filter input { height: calc(1.5em + 0.5rem + 2px); padding: 0.25rem 0.5rem; }
.dataTables_wrapper .dataTables_paginate .paginate_button { padding: 0 0.3em; }

/* Alerts and badges */
.alert { padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
.badge { padding: 0.25em 0.4em; font-size: 85%; }

/* Modals */
.modal-header, .modal-footer { padding: 0.5rem 0.75rem; }
.modal-body { padding: 0.75rem; }

/* Dashboard specific soft tweaks */
.summary-value { font-size: 1.6rem !important; }
.summary-label { font-size: 0.8rem !important; }
.summary-icon { font-size: 3rem !important; }
.chart-container { height: 240px !important; }

/* Lists */
.list-group-item { padding: 0.5rem 0.75rem; }

/* Breadcrumbs */
.breadcrumb { padding: 0.4rem 0.75rem; margin-bottom: 0.75rem; }

/* Footer */
.sticky-footer { padding: 0.5rem 0; }

/* Print adjustments (denser) */
@media print {
  body { font-size: 11px; }
  .table th, .table td { padding: 0.35rem; }
}
