/* ============================================================
   DGPro — Core Styles v1.0.0-beta.3
   Classes match base.php exactly.
   ============================================================ */

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 13px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); font-size: 13px; color: var(--color-text);
       background: var(--color-bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
ul { list-style: none; }
h1, h2, h3, h4 { color: var(--color-text-dark); font-weight: 600; line-height: 1.3; }

/* ══════════════════════════════════════════════════════════
   APP SHELL — exact class names used in base.php
   ══════════════════════════════════════════════════════════ */

.dgr-app {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 218px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 300;
  transition: transform 0.25s ease;
}

/* Brand / logo block */
.sidebar-brand {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
}
.brand-version {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  font-weight: 500;
  letter-spacing: .04em;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 8px 0 16px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,.72);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
  border-left-color: rgba(255,255,255,.25);
}
.nav-item.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-left-color: rgba(255,255,255,.9);
  font-weight: 600;
}
.nav-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.nav-label { flex: 1; }

/* Sidebar footer — user chip */
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.user-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role {
  font-size: 10.5px;
  color: rgba(255,255,255,.45);
  text-transform: capitalize;
}
.logout-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}
.logout-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
  text-decoration: none;
}

/* Mobile toggle button */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-dark);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 6px;
  border-radius: 4px;
  margin-right: 4px;
  transition: background 0.15s;
}
.sidebar-toggle:hover { background: var(--color-bg); }

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 199;
}
.sidebar-overlay.active { display: block; }

/* ── Main wrapper ─────────────────────────────────────────── */
/* base.php uses .main-wrap not .main-wrapper */
.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
  flex-shrink: 0;
}
.topbar-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* base.php uses .topbar-actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Flash messages (base.php uses .flash, .flash-{type}) ── */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  border-left: 4px solid;
  margin: 0;
  position: relative;
}
.flash-success { background: var(--color-success-bg); border-color: var(--color-success); color: #065f46; }
.flash-error   { background: var(--color-danger-bg);  border-color: var(--color-danger);  color: #991b1b; }
.flash-warning { background: var(--color-warning-bg); border-color: var(--color-warning); color: #92400e; }
.flash-info    { background: var(--color-info-bg);    border-color: var(--color-info);    color: #1e40af; }
.flash-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.flash-body { flex: 1; line-height: 1.5; }
.flash-close {
  background: none; border: none; cursor: pointer;
  opacity: .5; font-size: 14px; padding: 0; line-height: 1;
  flex-shrink: 0; margin-top: 1px;
}
.flash-close:hover { opacity: 1; }

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 20px 24px;
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-primary   { background: var(--color-primary);       color: #fff;                      border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff; }
.btn-secondary { background: var(--color-surface);       color: var(--color-text-dark);    border-color: var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-bg); color: var(--color-text-dark); }
.btn-ghost     { background: transparent;                color: var(--color-text-muted);   border-color: var(--color-border); }
.btn-ghost:hover { background: var(--color-bg);          color: var(--color-text-dark);    border-color: var(--color-border-strong); }
.btn-danger    { background: var(--color-danger);        color: #fff;                      border-color: var(--color-danger); }
.btn-danger:hover { background: #c9374a; color: #fff; }
.btn-success   { background: var(--color-success);       color: #fff;                      border-color: var(--color-success); }
.btn-warning   { background: var(--color-warning);       color: #fff;                      border-color: var(--color-warning); }
.btn-info      { background: var(--color-info);          color: #fff;                      border-color: var(--color-info); }
.btn-white     { background: #fff;                       color: var(--color-text-dark);    border-color: var(--color-border-strong); }
.btn-white:hover { background: var(--color-bg); }

.btn-sm  { padding: 4px 10px;  font-size: 11.5px; border-radius: 4px; }
.btn-xs  { padding: 2px 7px;   font-size: 11px;   border-radius: 3px; }
.btn-lg  { padding: 9px 20px;  font-size: 14px;   border-radius: 6px; }
.btn-full { width: 100%; justify-content: center; }

/* ══════════════════════════════════════════════════════════
   FORM ELEMENTS — consistent throughout
   ══════════════════════════════════════════════════════════ */

/* All text-like inputs + textarea + select */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]),
select,
textarea {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--color-border);
  border-radius: 5px;
  background: var(--color-surface);
  color: var(--color-text-dark);
  font-size: 13px;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

input::placeholder, textarea::placeholder {
  color: var(--color-text-subtle);
}

/* Select: custom dropdown arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888c8e' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 28px;
  cursor: pointer;
}
select[multiple] { background-image: none; padding-right: 10px; cursor: auto; }

/* Focus ring */
input:not([type=checkbox]):not([type=radio]):not([type=file]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: .7;
}

/* Readonly */
input[readonly], textarea[readonly] {
  background: var(--color-bg);
  cursor: default;
}

/* Color input */
input[type=color] {
  height: 36px;
  width: 100%;
  padding: 2px 3px;
  border-radius: 5px;
  cursor: pointer;
}

/* File input */
input[type=file] {
  display: block;
  width: 100%;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
  border: none;
  background: none;
  cursor: pointer;
}

/* Checkboxes & Radios — custom */
input[type=checkbox],
input[type=radio] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--color-border-strong);
  background: var(--color-surface);
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
input[type=radio] { border-radius: 50%; }

input[type=checkbox]:hover,
input[type=radio]:hover { border-color: var(--color-primary); }

input[type=checkbox]:checked,
input[type=radio]:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

input[type=checkbox]:checked::after {
  content: '';
  display: block;
  width: 8px; height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0, -1px);
}
input[type=radio]:checked::after {
  content: '';
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #fff;
}

input[type=checkbox]:focus,
input[type=radio]:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}

input[type=checkbox]:indeterminate {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
input[type=checkbox]:indeterminate::after {
  content: '';
  display: block;
  width: 7px; height: 2px;
  background: #fff;
  border-radius: 1px;
}

input[type=checkbox]:disabled,
input[type=radio]:disabled { opacity: .5; cursor: not-allowed; }

/* Field group */
.field-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field-group > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-label);
}
.field-hint { font-size: 11.5px; color: var(--color-text-muted); line-height: 1.4; }

/* ══════════════════════════════════════════════════════════
   PANELS
   ══════════════════════════════════════════════════════════ */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 7px;
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.panel-header h1,
.panel-header h2,
.panel-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0;
}
.inside { padding: 16px; }

/* ══════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 400px;
}
.table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}
.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-dark);
  vertical-align: middle;
}
.table tbody tr:hover td { background: var(--color-row-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.ref-link {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ══════════════════════════════════════════════════════════
   STATUS BADGES
   ══════════════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
}
.status-pending   { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-info      { background: #dbeafe; color: #1e40af; }

.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  background: var(--color-primary);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════
   ALERTS (also .alert for older views)
   ══════════════════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 5px;
  border: 1px solid;
  font-size: 13px;
  margin-bottom: 12px;
}
.alert-success { background: var(--color-success-bg); color: #065f46; border-color: var(--color-success-border); }
.alert-error, .alert-danger { background: var(--color-danger-bg); color: #991b1b; border-color: var(--color-danger-border); }
.alert-warning  { background: var(--color-warning-bg); color: #92400e; border-color: var(--color-warning-border); }
.alert-info     { background: var(--color-info-bg);    color: #1e40af; border-color: var(--color-info-border); }

/* ══════════════════════════════════════════════════════════
   STATS / DASHBOARD
   ══════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 7px;
  padding: 16px;
}
.stat-number { font-size: 32px; font-weight: 800; color: var(--color-text-dark); line-height: 1; }
.stat-label  { font-size: 11.5px; color: var(--color-text-muted); margin-top: 4px; font-weight: 500; }
.stat-pending  .stat-number { color: var(--color-warning); }
.stat-confirmed .stat-number { color: var(--color-primary); }
.stat-cancelled .stat-number { color: var(--color-danger); }

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
  font-size: 13.5px;
}
.empty-state a { color: var(--color-primary); }

/* ══════════════════════════════════════════════════════════
   BULK BAR
   ══════════════════════════════════════════════════════════ */
.bulk-bar {
  display: none;
  padding: 9px 14px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bulk-bar.visible { display: flex; }
.bulk-count { font-size: 13px; font-weight: 600; color: #1e40af; min-width: 80px; }

/* ══════════════════════════════════════════════════════════
   LOGIN
   ══════════════════════════════════════════════════════════ */
.login-body {
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-wrap { width: 100%; max-width: 420px; padding: 0 16px; }
.login-card {
  background: var(--color-surface);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
  overflow: hidden;
}
.login-brand {
  padding: 26px 30px 20px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.login-form { padding: 22px 30px 18px; }
.login-footer {
  text-align: center;
  padding: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

/* ══════════════════════════════════════════════════════════
   SETTINGS TABS
   ══════════════════════════════════════════════════════════ */
.settings-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
  flex-wrap: nowrap;
}
.settings-tab {
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-muted);
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.settings-tab:hover { color: var(--color-text-dark); text-decoration: none; }
.settings-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   MODAL + TOAST
   ══════════════════════════════════════════════════════════ */
body.dgp-modal-open { overflow: hidden; }

.dgp-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
.dgp-modal.dgp-modal-visible { opacity: 1; pointer-events: auto; }
.dgp-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.48);
  cursor: pointer;
}
.dgp-modal-panel {
  position: relative;
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  transform: translateY(8px) scale(.98);
  transition: transform .18s ease;
}
.dgp-modal-visible .dgp-modal-panel { transform: translateY(0) scale(1); }
.dgp-modal-header { padding: 18px 22px 0; }
.dgp-modal-title  { margin: 0; font-size: 16px; font-weight: 700; color: var(--color-text-dark); }
.dgp-modal-body   { padding: 12px 22px 20px; }
.dgp-modal-msg    { font-size: 14px; line-height: 1.6; color: var(--color-text); margin: 8px 0 18px; }
.dgp-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dgp-toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 1100;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 7px;
  box-shadow: 0 4px 18px rgba(0,0,0,.15);
  font-size: 13px; font-weight: 500; max-width: 360px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}
.dgp-toast.dgp-toast-visible { opacity: 1; transform: translateY(0); }
.dgp-toast-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.dgp-toast-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.dgp-toast-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.dgp-toast-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.dgp-toast-icon    { font-size: 14px; flex-shrink: 0; }
.dgp-toast-msg     { flex: 1; }
.dgp-toast-close {
  background: none; border: none; cursor: pointer;
  opacity: .5; font-size: 13px; padding: 0; line-height: 1; flex-shrink: 0;
}
.dgp-toast-close:hover { opacity: 1; }

/* Email check hint */
.email-check-hint { display: block; font-size: 12px; margin-top: 3px; }

/* Scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ══════════════════════════════════════════════════════════
   WIZARD / PORTAL
   ══════════════════════════════════════════════════════════ */
.wizard-steps {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 24px; padding: 0;
}
.wizard-sep { flex: 1; height: 2px; background: var(--color-border); min-width: 20px; }
.wizard-step { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wizard-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-border); color: var(--color-text-muted);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.wizard-step.active .wizard-step-num {
  background: var(--color-primary); color: #fff;
}
.wizard-step.done .wizard-step-num {
  background: var(--color-success); color: #fff;
}
.wizard-step-label { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }
.wizard-step.active .wizard-step-label { color: var(--color-primary); font-weight: 600; }
.wizard-step.done   .wizard-step-label { color: var(--color-success); }

.portal-page-title { font-size: 20px; font-weight: 800; color: var(--color-text-dark); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 200;
    transition: transform 0.25s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  .sidebar-toggle { display: block; }
  .main-content { padding: 14px 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 12px; height: 50px; }
  .topbar-title { font-size: 14px; }
}

/* ══════════════════════════════════════════════════════════
   SETTINGS TABS — class used in views/settings/index.php
   ══════════════════════════════════════════════════════════ */
.settings-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
  flex-shrink: 0;
  scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar { display: none; }

.tab-link {
  display: inline-block;
  padding: 9px 15px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-link:hover { color: var(--color-text-dark); text-decoration: none; }
.tab-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   STAT CARDS — additional
   ══════════════════════════════════════════════════════════ */
.stat-link {
  display: inline-block;
  font-size: 11.5px;
  color: var(--color-primary);
  margin-top: 6px;
  text-decoration: none;
}
.stat-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════
   STICKY ACTIONS BAR
   ══════════════════════════════════════════════════════════ */
.sticky-actions {
  position: sticky;
  top: 54px;
  z-index: 90;
  background: var(--color-bg);
  padding: 10px 0;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════
   MISC UTILITIES
   ══════════════════════════════════════════════════════════ */
.text-muted   { color: var(--color-text-muted) !important; }
.text-sm      { font-size: 12px !important; }
.text-xs      { font-size: 11px !important; }
.font-mono    { font-family: var(--font-mono) !important; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-none       { display: none !important; }
.d-flex       { display: flex !important; }
.gap-8        { gap: 8px !important; }
.mt-0         { margin-top: 0 !important; }
.mb-0         { margin-bottom: 0 !important; }
.w-full       { width: 100% !important; }

/* ══════════════════════════════════════════════════════════
   SETTINGS TABS — enhanced visual (hover + active)
   ══════════════════════════════════════════════════════════ */
.settings-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 20px;
  flex-shrink: 0;
  scrollbar-width: none;
  background: var(--color-surface);
  border-radius: 7px 7px 0 0;
  padding: 0 4px;
}
.settings-tabs::-webkit-scrollbar { display: none; }

.tab-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  border-radius: 5px 5px 0 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  position: relative;
}
.tab-link:hover {
  color: var(--color-text-dark);
  background: var(--color-bg);
  text-decoration: none;
}
.tab-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-pale);
}

/* ══════════════════════════════════════════════════════════
   LIST TOOLBAR — structured search + filter bar
   ══════════════════════════════════════════════════════════ */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.list-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.list-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
/* Constrained-width inputs in toolbar — not full width */
.list-toolbar input[type=text],
.list-toolbar input[type=search],
.list-toolbar select {
  width: auto;
  min-width: 140px;
  max-width: 220px;
}

@media (max-width: 768px) {
  .list-toolbar { flex-direction: column; align-items: stretch; }
  .list-toolbar-left, .list-toolbar-right { width: 100%; }
  .list-toolbar input[type=text],
  .list-toolbar input[type=search],
  .list-toolbar select { max-width: 100%; min-width: 0; width: 100%; }
}

/* ══════════════════════════════════════════════════════════
   BULK ACTION BAR — consistent across all list views
   ══════════════════════════════════════════════════════════ */
.bulk-bar {
  display: none;            /* hidden until rows selected */
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  flex-wrap: wrap;
  animation: bulkSlide 0.15s ease;
}
.bulk-bar.visible { display: flex; }

@keyframes bulkSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bulk-count {
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
  white-space: nowrap;
  min-width: 90px;
}

/* Inline select — sized to content, not full width */
.bulk-bar select {
  width: auto;
  min-width: 150px;
  max-width: 220px;
  padding: 5px 26px 5px 9px;
  font-size: 12.5px;
}

/* FullCalendar — taller default height */
.fc { min-height: 80vh; }
.fc .fc-view-harness { min-height: 80vh; }
