/* ApplauseSuite modern EHR-inspired theme */
:root {
  --navy-900: #0b2b5c;
  --navy-800: #113873;
  --navy-700: #1a4a94;
  --navy-600: #1f5fff;
  --sidebar-width: 230px;
  --sky-100: #e9f0ff;
  --gray-50: #f6f8fb;
  --gray-100: #eef2f6;
  --gray-300: #d7dce3;
  --gray-500: #94a3b8;
  --text-900: #0f172a;
  --text-700: #1f2937;
  --success-100: #e1f6eb;
}

body {
  background: var(--gray-50);
  color: var(--text-900);
  letter-spacing: 0.01em;
  line-height: 1.42;
}

/* Keep action menus above fixed shells and adjacent cards/panels. */
.dropdown-menu {
  z-index: 2200;
}

.dropdown-menu.show {
  z-index: 2200;
}

.app-shell {
  background: linear-gradient(180deg, #f8faff 0%, #eef2f7 100%);
}

/* Topbar */
.topbar {
  background: linear-gradient(90deg, var(--navy-900) 0%, var(--navy-700) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1030;
  padding: 8px 0;
}
.topbar .nav-link,
.topbar .btn,
.topbar .navbar-text {
  color: #fff;
}
.topbar-nav .nav-link {
  color: rgba(255,255,255,0.9);
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
}
.topbar-nav .nav-link:hover {
  background: rgba(255,255,255,0.12);
}
.topbar-nav .nav-link.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.topbar-inner {
  padding-left: calc(var(--sidebar-width) + 12px);
  padding-right: 12px;
}
.topbar-nav-scroller {
  overflow-x: auto;
  overflow-y: hidden;
}
.topbar .btn-outline-light {
  border-color: rgba(255,255,255,0.4);
}
.topbar .badge-soft {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 60%, #0f1f40 100%);
  color: #e5eaf3;
  border-right: 1px solid rgba(255,255,255,0.06);
  box-shadow: 6px 0 24px rgba(0,0,0,0.1);
}
.sidebar .nav-link {
  color: #d9e2ff;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 500;
}
.sidebar .nav-link:hover {
  background: rgba(255,255,255,0.08);
}
.sidebar .nav-link.active {
  background: rgba(31,95,255,0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.sidebar .badge-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #fff;
}
.sidebar .nav-section-title {
  color: #9fb2d9;
  font-size: 12px;
  letter-spacing: 0.08em;
}

/* Cards + panels */
.card {
  border: 1px solid #e4e8f0;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
  border-radius: 14px;
  margin-bottom: 12px;
}
.card-header {
  background: #f7f9fc;
  border-bottom: 1px solid #e4e8f0;
  padding: 10px 14px;
}

/* Tables */
.table {
  border-spacing: 0;
  border-collapse: collapse;
  font-size: 12.5px;
}
.table th {
  background: #f0f4fb;
  color: var(--text-700);
  font-weight: 600;
  border-bottom: 1px solid #d8dee9;
  white-space: nowrap;
  padding: 8px 10px;
}
.table td {
  vertical-align: middle;
  border-color: #e5e7eb;
  padding: 8px 10px;
}
.table tbody tr:nth-child(even) {
  background: #f9fbff;
}
.table tbody tr:hover {
  background: #eef4ff;
}
.table-responsive {
  border: 1px solid #e4e8f0;
  border-radius: 12px;
  padding: 4px;
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
}

/* Forms */
.form-control, .form-select {
  border-radius: 10px;
  border-color: #d7dce3;
  box-shadow: none;
  font-size: 12.5px;
  padding: 8px 10px;
  height: 38px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 2px rgba(31,95,255,0.2);
}
.btn-primary {
  background: var(--navy-700);
  border-color: var(--navy-700);
  border-radius: 10px;
}
.btn-outline-secondary {
  border-radius: 10px;
}

/* Pills / filter bar */
.filter-bar, form.filter {
  background: #fff;
  border: 1px solid #e4e8f0;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}
.filter-bar .btn, form.filter .btn {
  border-radius: 8px;
}

/* Searchable dropdown */
.searchable-select .searchable-dropdown {
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.12);
  border: 1px solid #e4e8f0;
  background: #fff;
}
.searchable-select .list-group-item {
  border: 0;
  padding: 10px 12px;
}
.searchable-select .list-group-item:hover {
  background: #eef4ff;
}

/* Utility */
.shadow-slim { box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.text-muted-soft { color: var(--gray-500); }

main.container-fluid, main.container {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

main.app-main {
  min-width: 0;
}

/* Compact spacing for forms and grids */
.row.g-3 > [class*="col"], .row.g-4 > [class*="col"] { padding-top: 8px; padding-bottom: 8px; }
.row.g-3 { row-gap: 12px; }
.row.g-4 { row-gap: 12px; }

@media (max-width: 991px) {
  .sidebar { width: 82vw; }
  .topbar .container-fluid { padding-inline: 12px; }
  main.container-fluid, main.container { padding-inline: 12px !important; }
  .topbar { left: 0; width: 100%; padding-left: 12px; padding-right: 12px; }
  .topbar-inner { padding-left: 12px; padding-right: 12px; }
  .app-shell { padding-top: 48px; }
}
@media (max-width: 768px) {
  main.container, main.container-fluid { padding-inline: 10px !important; }
  .table-responsive { border-left: 0; border-right: 0; border-radius: 0; padding: 0; }
  .card { border-radius: 10px; }
}

@media (min-width: 992px) {
  .app-shell { padding-top: 0px; }
  .topbar { left: 0; width: 100%; padding-left: calc(var(--sidebar-width) + 12px); padding-right: 16px; }
  .topbar-inner { padding-left: 0; padding-right: 0; }
  main.app-main { padding-top: calc(56px + 1.5rem) !important; }
  body.sidebar-collapsed .topbar { left: 0; width: 100%; }
  body.sidebar-collapsed .app-shell { margin-left: 0; padding-top: 0px; }
}
