/* Workshop Management System Custom Styling */
:root {
  --sidebar-width: 250px;
  --sidebar-bg: #ffffff;
  --sidebar-color: #596579;
  --sidebar-active-bg: #eef4ff;
  --sidebar-active-color: #245bd6;
  --primary-accent: #3974e8;
  --bg-main: #f8fafc;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: #334155;
  min-height: 100vh;
}

.brand-logo {
  object-fit: contain;
}

.navbar-brand-logo {
  width: 118px;
  height: 56px;
}

#sidebar-wrapper .sidebar-brand-logo {
  display: block;
  width: 100%;
  max-width: 160px;
  height: auto;
  max-height: 74px;
  padding: 0.35rem;
  background: #fff;
  border-radius: 0.5rem;
}

.login-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

/* Fixed, independently scrollable application sidebar */
#sidebar-wrapper {
  height: 100vh;
  height: 100dvh;
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1035;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e8edf4;
  box-shadow: 8px 0 24px rgba(20, 36, 67, 0.035);
  transition: margin-left 0.25s ease, width 0.25s ease;
}

#sidebar-wrapper .sidebar-heading {
  flex: 0 0 auto;
  min-height: 104px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #edf0f5;
  display: flex;
  align-items: center;
}

#sidebar-wrapper .sidebar-brand {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#sidebar-wrapper .sidebar-brand-logo {
  width: 100%;
  max-width: 202px;
  height: 74px;
  padding: 0.25rem;
  background: #fff;
  border-radius: 0.7rem;
}

#sidebar-wrapper .sidebar-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem 0.8rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

#sidebar-wrapper .sidebar-menu::-webkit-scrollbar { width: 6px; }
#sidebar-wrapper .sidebar-menu::-webkit-scrollbar-thumb {
  background: #d5dce7;
  border-radius: 10px;
}

#sidebar-wrapper .sidebar-section + .sidebar-section {
  margin-top: 1.15rem;
  padding-top: 0.8rem;
  border-top: 1px solid #edf0f5;
}

#sidebar-wrapper .sidebar-section-title {
  padding: 0.3rem 0.75rem 0.45rem;
  color: #8a94a5;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#sidebar-wrapper .sidebar-link {
  min-height: 42px;
  margin: 0.12rem 0;
  padding: 0.62rem 0.75rem;
  border-radius: 0.6rem;
  color: var(--sidebar-color);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.88rem;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease;
}

#sidebar-wrapper .sidebar-link i {
  width: 1.15rem;
  flex: 0 0 1.15rem;
  color: #8794a8;
  font-size: 1rem;
  text-align: center;
}

#sidebar-wrapper .sidebar-link:hover,
#sidebar-wrapper .sidebar-link.active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active-color);
}

#sidebar-wrapper .sidebar-link:hover i,
#sidebar-wrapper .sidebar-link.active i {
  color: var(--primary-accent);
}

#sidebar-wrapper .sidebar-footer {
  flex: 0 0 auto;
  padding: 0.65rem 0.8rem max(0.8rem, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #edf0f5;
}

#sidebar-wrapper .sidebar-utility {
  margin-bottom: 0.55rem;
}

#sidebar-wrapper .sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.65rem 0.55rem 0.2rem;
}

#sidebar-wrapper .sidebar-user-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9f0ff;
  color: #285bc4;
  font-size: 0.9rem;
  font-weight: 700;
}

#sidebar-wrapper .sidebar-user-copy {
  min-width: 0;
  flex: 1;
}

#sidebar-wrapper .sidebar-user-name {
  overflow: hidden;
  color: #273248;
  font-size: 0.8rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sidebar-wrapper .sidebar-user-role {
  margin-top: 0.1rem;
  color: #8b95a5;
  font-size: 0.7rem;
}

#sidebar-wrapper .sidebar-logout {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 0.55rem;
  color: #788497;
  text-decoration: none;
}

#sidebar-wrapper .sidebar-logout:hover {
  background: #fff0f0;
  color: #c63d4b;
}

/* Main Content Area */
#page-content-wrapper {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease, width 0.25s ease;
}

.main-navbar {
  min-height: 72px;
  padding: 0.55rem 1.25rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e8edf4;
  box-shadow: 0 2px 8px rgba(27, 43, 69, 0.025);
  backdrop-filter: blur(12px);
}
.topbar-inner { gap: 1rem; }
.topbar-menu-toggle {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border: 1px solid #e5eaf1;
  border-radius: 0.7rem;
  background: #fff;
  color: #526078;
  font-size: 1.25rem;
}
.topbar-menu-toggle:hover { background: #f4f7fb; }
.topbar-search {
  width: min(440px, 48%);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.75rem;
  border: 1px solid #e5eaf1;
  border-radius: 999px;
  background: #fbfcfe;
  color: #8792a3;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.topbar-search:focus-within {
  border-color: #9bb8f5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(57, 116, 232, 0.1);
}
.topbar-search > i { font-size: 0.9rem; }
.topbar-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #344157;
  font-size: 0.82rem;
}
.topbar-search input::placeholder { color: #9aa4b3; }
.topbar-search kbd {
  flex: 0 0 auto;
  padding: 0.18rem 0.35rem;
  border: 1px solid #e8edf4;
  border-radius: 0.35rem;
  background: #fff;
  color: #8c96a6;
  font-family: inherit;
  font-size: 0.62rem;
  box-shadow: 0 1px 1px rgba(27,43,69,0.04);
}
.topbar-account-dropdown { margin-left: auto; }
.topbar-account {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.65rem 0.3rem 0.35rem;
  border: 1px solid #e4e9f0;
  border-radius: 0.75rem;
  background: #fff;
  color: #303b4e;
  text-align: left;
}
.topbar-account::after { display: none; }
.topbar-account:hover, .topbar-account.show { border-color: #d2dbea; background: #fbfcfe; }
.topbar-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid #d8e5ff;
  border-radius: 50%;
  background: #eef4ff;
  color: #3472e7;
  font-size: 1rem;
}
.topbar-account-copy { min-width: 0; display: flex; flex-direction: column; }
.topbar-account-name {
  max-width: 190px;
  overflow: hidden;
  color: #303b4e;
  font-size: 0.8rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-account-role { margin-top: 0.08rem; color: #8994a5; font-size: 0.68rem; }
.topbar-chevron { margin-left: 0.2rem; color: #8792a3; font-size: 0.68rem; }
.topbar-account-menu {
  min-width: 210px;
  margin-top: 0.5rem !important;
  padding: 0.45rem;
  border: 1px solid #e8edf4;
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(22, 37, 63, 0.12);
}
.topbar-account-menu .dropdown-item { padding: 0.58rem 0.65rem; border-radius: 0.45rem; color: #4f5d72; font-size: 0.82rem; }
.topbar-account-menu .dropdown-item:hover { background: #f3f6fb; }
.topbar-account-menu .dropdown-divider { margin: 0.35rem 0; }

@media (max-width: 767.98px) {
  .main-navbar { min-height: 64px; padding: 0.45rem 0.65rem; }
  .topbar-inner { gap: 0.5rem; }
  .topbar-search { width: auto; height: 40px; flex: 1 1 auto; gap: 0.45rem; padding: 0 0.65rem; }
  .topbar-search input { font-size: 0.75rem; }
  .topbar-search kbd { display: none; }
  .topbar-account { min-height: 40px; padding: 0.2rem; border: 0; background: transparent; }
  .topbar-account:hover, .topbar-account.show { border: 0; background: #f2f5fa; }
  .topbar-avatar { width: 34px; height: 34px; }
  .topbar-account-copy, .topbar-chevron { display: none; }
}
@media (max-width: 380px) {
  .topbar-search input::placeholder { color: transparent; }
}

/* Shared modern table treatment for list, detail, and admin-facing tables */
.card:has(.table-responsive) {
  overflow: hidden;
  border: 1px solid #e7ecf3 !important;
  border-radius: 0.85rem !important;
  box-shadow: 0 3px 12px rgba(27, 43, 69, 0.035) !important;
}
.table-responsive {
  border-radius: inherit;
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}
.table-responsive::-webkit-scrollbar { height: 7px; }
.table-responsive::-webkit-scrollbar-thumb { border-radius: 8px; background: #cbd5e1; }
.table:not(.dashboard-table) {
  --bs-table-hover-bg: #f7f9fd;
  margin-bottom: 0;
  color: #4c596d;
  font-size: 0.84rem;
}
.table:not(.dashboard-table) > thead > tr > th {
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid #e8edf3;
  background-color: #f8fafc !important;
  color: #768296;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  vertical-align: middle;
  white-space: nowrap;
}
.table:not(.dashboard-table) > tbody > tr > td,
.table:not(.dashboard-table) > tfoot > tr > td,
.table:not(.dashboard-table) > tfoot > tr > th {
  padding: 0.78rem 0.85rem;
  border-color: #edf0f5;
  vertical-align: middle;
}
.table:not(.dashboard-table) > tbody > tr:last-child > td { border-bottom-color: transparent; }
.table-hover > tbody > tr { transition: background-color 0.14s ease; }
.table-hover > tbody > tr:hover > * { color: #334157; }
.table-bordered:not(.dashboard-table) > :not(caption) > * > * { border-color: #e8edf3; }
.pagination { gap: 0.25rem; margin-top: 1rem; }
.pagination .page-link {
  min-width: 2.25rem;
  min-height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid #e5eaf1;
  border-radius: 0.55rem !important;
  background: #fff;
  color: #667388;
  font-size: 0.8rem;
  box-shadow: none;
}
.pagination .page-link:hover { border-color: #cddaf5; background: #f4f7fd; color: #2867d8; }
.pagination .page-item.active .page-link { border-color: #3974e8; background: #3974e8; color: #fff; }
.pagination .page-item.disabled .page-link { background: #f8fafc; color: #b3bdca; }
@media (max-width: 767.98px) {
  .table:not(.dashboard-table) { font-size: 0.78rem; }
  .table:not(.dashboard-table) > thead > tr > th { padding: 0.68rem 0.7rem; font-size: 0.65rem; }
  .table:not(.dashboard-table) > tbody > tr > td,
  .table:not(.dashboard-table) > tfoot > tr > td,
  .table:not(.dashboard-table) > tfoot > tr > th { padding: 0.68rem 0.7rem; }
}

/* Consistent form controls and responsive inline item tables */
.card:has(form) {
  border: 1px solid #e7ecf3 !important;
  border-radius: 0.85rem !important;
  box-shadow: 0 3px 12px rgba(27, 43, 69, 0.035) !important;
}
.card:has(form) > .card-header {
  padding: 1rem 1.2rem;
  border-bottom-color: #edf0f5;
  background: #fff;
}
.form-label {
  margin-bottom: 0.42rem;
  color: #3b475b;
  font-size: 0.83rem;
  font-weight: 600;
}
.form-control, .form-select {
  min-height: 43px;
  border-color: #dfe5ed;
  border-radius: 0.6rem;
  color: #354157;
  font-size: 0.86rem;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.form-control { min-height: 100px; }
.form-control::placeholder { color: #a0a9b7; }
.form-control:focus, .form-select:focus {
  border-color: #8eaff1;
  box-shadow: 0 0 0 3px rgba(57, 116, 232, 0.11);
}
.form-control:disabled, .form-select:disabled { background-color: #f5f7fa; color: #7f8b9d; }
.form-control-sm, .form-select-sm { min-height: 36px; border-radius: 0.48rem; font-size: 0.78rem; }
.input-group > .form-control, .input-group > .form-select,
.input-group > .input-group-text { min-height: 43px; }
.input-group > .input-group-text {
  border-color: #dfe5ed;
  border-radius: 0.6rem 0 0 0.6rem;
}
.form-text, .text-muted.small { line-height: 1.5; }
.form-check-input { border-color: #cbd4e0; }
.form-check-input:checked { border-color: #3974e8; background-color: #3974e8; }
.formset-table-wrap {
  max-width: 100%;
  overflow-x: auto !important;
  border: 1px solid #e7ecf3;
  border-radius: 0.7rem;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
form .table-responsive > table.table-bordered,
form .formset-table-wrap > table {
  min-width: 940px;
  margin-bottom: 0;
}
form .table-responsive > table.table-bordered > thead > tr > th,
form .formset-table-wrap > table > thead > tr > th {
  padding: 0.68rem 0.72rem;
}
form .table-responsive > table.table-bordered > tbody > tr > td,
form .formset-table-wrap > table > tbody > tr > td {
  padding: 0.55rem 0.6rem;
}
form .table-responsive > table.table-bordered input,
form .table-responsive > table.table-bordered select,
form .formset-table-wrap > table input,
form .formset-table-wrap > table select { min-width: 92px; }
form .table-responsive > table.table-bordered .item-desc,
form .formset-table-wrap > table .item-desc { min-width: 170px; }
.btn { border-radius: 0.58rem; }
form .btn { font-weight: 600; }
.invalid-feedback, .text-danger.small { font-size: 0.76rem; }
@media (max-width: 767.98px) {
  .form-control, .form-select { min-height: 42px; font-size: 0.84rem; }
  form .table-responsive > table.table-bordered,
  form .formset-table-wrap > table { min-width: 900px; }
  .card:has(form) > .card-body { padding: 1rem; }
}

/* Desktop sidebar collapse; mobile continues to use the slide-in navigation. */
.sidebar-mini-mark { display: none; }
.sidebar-tooltip {
  position: fixed;
  z-index: 2000;
  display: none;
  max-width: 220px;
  padding: 0.48rem 0.68rem;
  transform: translateY(-50%);
  border: 1px solid #e5eaf1;
  border-radius: 0.55rem;
  background: #202b3d;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(22, 37, 63, 0.18);
  pointer-events: none;
}
.sidebar-tooltip.visible { display: block; }
@media (min-width: 992px) {
  body.sidebar-collapsed { --sidebar-width: 78px; }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-heading { min-height: 78px; padding: 0.7rem; justify-content: center; }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-brand-logo { display: none; }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-mini-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 0.75rem;
    background: #eaf1ff;
    color: #245bd6;
    font-size: 1.45rem;
    font-weight: 800;
    font-style: italic;
  }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-menu { padding: 0.7rem 0.55rem; }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-section-title { display: none; }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-section + .sidebar-section { margin-top: 0.45rem; padding-top: 0.45rem; }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-link {
    min-height: 46px;
    justify-content: center;
    gap: 0;
    padding: 0.55rem;
  }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-link > span { display: none; }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-link i { width: auto; flex: 0 0 auto; font-size: 1.12rem; }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-footer { padding: 0.55rem 0.45rem max(0.65rem, env(safe-area-inset-bottom)); }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-user-card { justify-content: center; padding: 0.55rem 0 0.1rem; }
  body.sidebar-collapsed #sidebar-wrapper .sidebar-user-copy,
  body.sidebar-collapsed #sidebar-wrapper .sidebar-logout { display: none; }
}

.main-container {
  padding: 1.75rem 1.5rem;
  flex: 1;
  min-width: 0;
}

/* Keep wide data tables readable on smaller screens without stretching the page. */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive > .table {
  min-width: 680px;
}

.table-responsive > .table thead th {
  white-space: nowrap;
  vertical-align: middle;
}

/* Cards & Components */
.card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-stat {
  border-left: 4px solid var(--primary-accent);
}

.card-stat.border-success { border-left-color: #10b981 !important; }
.card-stat.border-warning { border-left-color: #f59e0b !important; }
.card-stat.border-info { border-left-color: #06b6d4 !important; }
.card-stat.border-danger { border-left-color: #ef4444 !important; }

/* Status Badges & Utilities */
.badge-status {
  padding: 0.35em 0.75em;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 9999px;
}

.fs-7 { font-size: 0.85rem; }
.fs-8 { font-size: 0.75rem; }
.fw-extrabold { font-weight: 800; }

.hover-primary:hover {
  color: var(--primary-accent) !important;
}

/* Print Styles */
@media print {
  #sidebar-wrapper, .main-navbar, .no-print, footer, .btn, .alert {
    display: none !important;
  }
  #page-content-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
  }
  .main-container {
    padding: 0 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
  .print-header {
    border-bottom: 2px solid #000 !important;
    margin-bottom: 1.5rem !important;
  }
}

/* Mobile Responsiveness */
/* Hide browser spinner arrows on numeric fields while retaining number input behavior. */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

@media (max-width: 991.98px) {
  #sidebar-wrapper {
    margin-left: calc(-1 * var(--sidebar-width));
  }
  #sidebar-wrapper.show {
    margin-left: 0;
  }
  #page-content-wrapper {
    margin-left: 0;
    width: 100%;
  }
}

/* Dashboard overview */
.dashboard-page { max-width: 1680px; margin: 0 auto; }
.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.4rem;
}
.dashboard-eyebrow {
  margin-bottom: 0.35rem;
  color: #7d899b;
  font-size: 0.76rem;
  font-weight: 600;
}
.dashboard-header h1 {
  margin: 0;
  color: #202b3d;
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}
.dashboard-header p { margin: 0.35rem 0 0; color: #8490a1; font-size: 0.9rem; }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.dashboard-actions .btn { border-radius: 0.65rem; padding: 0.58rem 0.85rem; font-size: 0.84rem; font-weight: 600; }
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}
.dashboard-metric {
  min-width: 0;
  min-height: 145px;
  padding: 1.1rem 1.15rem;
  border: 1px solid #e8edf4;
  border-radius: 0.9rem;
  background: #fff;
  color: #263247;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(27, 43, 69, 0.025);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
a.dashboard-metric:hover { color: #263247; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(27, 43, 69, 0.08); }
.dashboard-metric.metric-highlight {
  border-color: #2464e7;
  background: linear-gradient(140deg, #2869eb 0%, #1455d4 100%);
  color: #fff;
}
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; color: #778398; font-size: 0.82rem; font-weight: 600; }
.metric-highlight .metric-top { color: rgba(255,255,255,0.82); }
.metric-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #e8edf5; border-radius: 50%; color: #3974e8; font-size: 1rem; }
.metric-highlight .metric-icon { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.14); color: #fff; }
.metric-value { margin-top: 0.45rem; color: #202b3d; font-size: clamp(1.7rem, 2.5vw, 2.15rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.2; }
.metric-highlight .metric-value { color: #fff; }
.metric-value.metric-currency { font-size: clamp(1.35rem, 2vw, 1.85rem); }
.metric-foot { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.55rem; color: #8a95a5; font-size: 0.73rem; }
.metric-highlight .metric-foot { color: rgba(255,255,255,0.8); }
.metric-foot i { font-size: 0.68rem; }
.dashboard-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid #e8edf4;
  border-radius: 0.9rem;
  background: #fff;
}
.quick-stat { display: flex; align-items: center; gap: 0.7rem; min-width: 0; padding: 0.35rem 0.5rem; color: inherit; text-decoration: none; }
.quick-stat + .quick-stat { border-left: 1px solid #edf0f5; padding-left: 1rem; }
.quick-stat-icon { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border-radius: 0.65rem; background: #f5f7fb; font-size: 1rem; }
.quick-stat small, .quick-stat strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-stat small { color: #8490a1; font-size: 0.72rem; }
.quick-stat strong { margin-top: 0.1rem; color: #273247; font-size: 0.92rem; font-weight: 700; }
.quick-stat:hover strong { color: #2869df; }
.dashboard-panels { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 1rem; margin-bottom: 1rem; }
.dashboard-table-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-panel { min-width: 0; overflow: hidden; border: 1px solid #e8edf4; border-radius: 0.9rem; background: #fff; box-shadow: 0 2px 8px rgba(27, 43, 69, 0.025); }
.panel-heading { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.15rem 0.8rem; }
.panel-heading h2 { margin: 0; color: #273247; font-size: 0.98rem; font-weight: 700; }
.panel-heading p { margin: 0.25rem 0 0; color: #8a95a5; font-size: 0.74rem; }
.panel-link { flex: 0 0 auto; color: #3974e8; font-size: 0.76rem; font-weight: 650; text-decoration: none; }
.panel-link:hover { color: #174ebc; }
.chart-wrap { position: relative; width: 100%; padding: 0 1.1rem 1rem; }
.chart-wrap-tall { height: 300px; }
.chart-wrap-donut { height: 300px; max-width: 420px; margin: 0 auto; padding: 0.25rem 1.2rem 1rem; }
.dashboard-table-wrap { padding: 0 0.65rem 0.55rem; }
.dashboard-table { min-width: 520px !important; font-size: 0.8rem; }
.dashboard-table thead th { padding: 0.65rem 0.55rem; border-bottom: 1px solid #edf0f5; color: #8a95a5; font-size: 0.67rem; font-weight: 650; letter-spacing: 0.035em; text-transform: uppercase; white-space: nowrap; }
.dashboard-table tbody td { padding: 0.72rem 0.55rem; border-color: #f0f2f6; color: #566276; white-space: nowrap; }
.dashboard-table tbody tr:last-child td { border-bottom: 0; }
.dashboard-table td small { display: block; margin-top: 0.16rem; color: #909bad; font-size: 0.69rem; }
.dashboard-table td strong { color: #354157; font-weight: 600; }
.record-link { color: #2867db; font-weight: 650; text-decoration: none; }
.record-link:hover { text-decoration: underline; }
.status-pill { display: inline-flex; align-items: center; padding: 0.27rem 0.55rem; border-radius: 999px; font-size: 0.67rem; font-weight: 650; }
.status-success { background: #e8f7ef; color: #268654; }
.status-info { background: #e9f3ff; color: #2867c6; }
.status-warning { background: #fff5dc; color: #a8750b; }
.status-danger { background: #fff0f0; color: #bc4a54; }
.status-neutral { background: #f0f2f6; color: #697589; }
.empty-state { height: 110px; color: #929cad !important; text-align: center; vertical-align: middle; }

@media (max-width: 1199.98px) {
  .dashboard-metrics, .dashboard-quick-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-panels { grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr); }
}
@media (max-width: 767.98px) {
  .main-container { padding: 1rem 0.8rem; }
  .dashboard-header { align-items: flex-start; flex-direction: column; gap: 0.9rem; }
  .dashboard-actions { width: 100%; }
  .dashboard-actions .btn { flex: 1; }
  .dashboard-metrics { gap: 0.65rem; }
  .dashboard-metric { min-height: 132px; padding: 0.9rem; }
  .metric-top { font-size: 0.73rem; }
  .metric-icon { width: 31px; height: 31px; }
  .metric-foot { font-size: 0.67rem; }
  .dashboard-quick-stats { gap: 0.35rem; padding: 0.55rem; }
  .quick-stat { gap: 0.45rem; padding: 0.45rem 0.3rem; }
  .quick-stat + .quick-stat { padding-left: 0.4rem; }
  .quick-stat-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .quick-stat small { font-size: 0.64rem; }
  .quick-stat strong { font-size: 0.78rem; }
  .dashboard-panels, .dashboard-table-row { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .chart-wrap-tall, .chart-wrap-donut { height: 260px; }
}
