/* MDMS Design System — dark/light themes (industrial dashboard)
 *
 * Designed and developed by SiteGuiders
 * Developer: Shahwal · shahwalrajpoot101@gmail.com
 * Website: https://siteguiders.com · v1.0.2
 */

:root,
[data-theme="light"] {
  --mdms-primary: #0B1220;
  --mdms-primary-deep: #070B14;
  --mdms-primary-soft: #1A2333;
  --mdms-accent: #F59E0B;
  --mdms-accent-hover: #D97706;
  --mdms-accent-soft: rgba(245, 158, 11, 0.14);
  --mdms-surface: #F1F5F9;
  --mdms-surface-raised: #FFFFFF;
  --mdms-surface-soft: #E8EEF5;
  --mdms-border: #D5DEE9;
  --mdms-text: #0F172A;
  --mdms-text-muted: #64748B;
  --mdms-danger: #DC2626;
  --mdms-success: #059669;
  --mdms-warning: #D97706;
  --mdms-info: #3B82F6;
  --mdms-sidebar-bg: #0B1220;
  --mdms-sidebar-text: #CBD5E1;
  --mdms-sidebar-muted: #64748B;
  --mdms-topbar-bg: rgba(255, 255, 255, 0.88);
  --mdms-table-head: #EEF2F7;
  --mdms-chart-grid: rgba(15, 23, 42, 0.08);
  --mdms-kpi-icon-bg: rgba(15, 23, 42, 0.04);
  --mdms-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
  --mdms-radius: 12px;
  --mdms-radius-sm: 8px;
  --mdms-sidebar-width: 268px;
  --mdms-sidebar-collapsed: 76px;
  --mdms-topbar-height: 64px;
  --mdms-font: "DM Sans", "IBM Plex Sans", system-ui, sans-serif;
  --mdms-font-data: "IBM Plex Sans", "DM Sans", system-ui, sans-serif;
  --mdms-transition: 180ms ease;
  color-scheme: light;

  /* Bootstrap 5 bridge — prevent dark-on-dark / light-on-light */
  --bs-body-color: #0F172A;
  --bs-body-bg: #F1F5F9;
  --bs-secondary-color: #64748B;
  --bs-tertiary-color: #64748B;
  --bs-emphasis-color: #0F172A;
  --bs-heading-color: #0F172A;
  --bs-border-color: #D5DEE9;
  --bs-link-color: #D97706;
  --bs-link-hover-color: #B45309;
  --bs-table-color: #0F172A;
  --bs-table-bg: transparent;
  --bs-table-border-color: #D5DEE9;
  --bs-table-striped-bg: rgba(15, 23, 42, 0.03);
  --bs-table-hover-bg: rgba(245, 158, 11, 0.1);
  --bs-table-hover-color: #0F172A;
}

[data-theme="dark"] {
  --mdms-primary: #F8FAFC;
  --mdms-primary-deep: #020617;
  --mdms-primary-soft: #1E293B;
  --mdms-accent: #F59E0B;
  --mdms-accent-hover: #FBBF24;
  --mdms-accent-soft: rgba(245, 158, 11, 0.16);
  --mdms-surface: #06090F;
  --mdms-surface-raised: #111827;
  --mdms-surface-soft: #0F172A;
  --mdms-border: #1F2A3A;
  --mdms-text: #F1F5F9;
  --mdms-text-muted: #94A3B8;
  --mdms-danger: #F87171;
  --mdms-success: #34D399;
  --mdms-warning: #FBBF24;
  --mdms-info: #60A5FA;
  --mdms-sidebar-bg: #080C14;
  --mdms-sidebar-text: #CBD5E1;
  --mdms-sidebar-muted: #64748B;
  --mdms-topbar-bg: rgba(8, 12, 20, 0.9);
  --mdms-table-head: #0F172A;
  --mdms-chart-grid: rgba(148, 163, 184, 0.12);
  --mdms-kpi-icon-bg: rgba(255, 255, 255, 0.04);
  --mdms-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;

  --bs-body-color: #F1F5F9;
  --bs-body-bg: #06090F;
  --bs-secondary-color: #94A3B8;
  --bs-tertiary-color: #94A3B8;
  --bs-emphasis-color: #F8FAFC;
  --bs-heading-color: #F8FAFC;
  --bs-border-color: #1F2A3A;
  --bs-link-color: #F59E0B;
  --bs-link-hover-color: #FBBF24;
  --bs-table-color: #F1F5F9;
  --bs-table-bg: transparent;
  --bs-table-border-color: #1F2A3A;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-hover-bg: rgba(245, 158, 11, 0.12);
  --bs-table-hover-color: #F8FAFC;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--mdms-font);
  color: var(--mdms-text);
  background: var(--mdms-surface);
  background-image:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(245, 158, 11, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(59, 130, 246, 0.06), transparent 45%);
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--mdms-transition), color var(--mdms-transition);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--mdms-text);
}

.text-muted,
.text-secondary,
.text-body-secondary {
  color: var(--mdms-text-muted) !important;
}

.text-body,
.text-dark,
.text-black {
  color: var(--mdms-text) !important;
}

.fw-semibold,
.fw-bold,
.fw-medium {
  color: inherit;
}

code {
  color: var(--mdms-accent);
  background: var(--mdms-accent-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

a {
  color: var(--mdms-accent);
  text-decoration: none;
}

a:hover {
  color: var(--mdms-accent-hover);
}

/* ---------- Buttons ---------- */
.btn-mdms {
  --bs-btn-bg: var(--mdms-accent);
  --bs-btn-border-color: var(--mdms-accent);
  --bs-btn-hover-bg: var(--mdms-accent-hover);
  --bs-btn-hover-border-color: var(--mdms-accent-hover);
  --bs-btn-active-bg: #B45309;
  --bs-btn-active-border-color: #B45309;
  --bs-btn-color: #0B1220;
  --bs-btn-hover-color: #0B1220;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding-inline: 1.1rem;
}

.btn-mdms-outline {
  --bs-btn-color: var(--mdms-text);
  --bs-btn-border-color: var(--mdms-border);
  --bs-btn-hover-bg: var(--mdms-surface-soft);
  --bs-btn-hover-border-color: var(--mdms-accent);
  --bs-btn-hover-color: var(--mdms-text);
  border-radius: 999px;
  font-weight: 600;
}

.btn-mdms-ghost {
  color: var(--mdms-text-muted);
  border: 0;
  background: transparent;
  border-radius: var(--mdms-radius-sm);
}

.btn-mdms-ghost:hover {
  color: var(--mdms-accent);
  background: var(--mdms-accent-soft);
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
  border-color: var(--mdms-border);
  border-radius: var(--mdms-radius-sm);
  font-family: var(--mdms-font);
  color: var(--mdms-text);
  background-color: var(--mdms-surface-raised);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--mdms-accent);
  box-shadow: 0 0 0 0.2rem var(--mdms-accent-soft);
  background-color: var(--mdms-surface-raised);
  color: var(--mdms-text);
}

/* File inputs — readable "Choose file" on dark/light themes */
.form-control[type="file"] {
  color: var(--mdms-text);
  padding: 0.4rem 0.65rem;
}

.form-control[type="file"]::file-selector-button,
.form-control[type="file"]::-webkit-file-upload-button {
  margin-right: 0.75rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius-sm);
  background: var(--mdms-accent);
  color: #0B1220;
  font-weight: 600;
  font-family: var(--mdms-font);
  cursor: pointer;
  transition: background-color var(--mdms-transition), border-color var(--mdms-transition);
}

.form-control[type="file"]:hover::file-selector-button,
.form-control[type="file"]:hover::-webkit-file-upload-button {
  background: var(--mdms-accent-hover);
  border-color: var(--mdms-accent-hover);
  color: #0B1220;
}

.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--mdms-text);
}

.form-text,
.text-muted-mdms {
  color: var(--mdms-text-muted) !important;
}

.dropdown-menu {
  background: var(--mdms-surface-raised);
  border-color: var(--mdms-border);
  box-shadow: var(--mdms-shadow);
  border-radius: var(--mdms-radius-sm);
}

.dropdown-item {
  color: var(--mdms-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--mdms-accent-soft);
  color: var(--mdms-text);
}

.dropdown-header {
  color: var(--mdms-text-muted);
}

.dropdown-divider {
  border-color: var(--mdms-border);
}

/* ---------- Auth / Install shells ---------- */
.auth-shell,
.install-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse at top left, rgba(245, 158, 11, 0.18), transparent 50%),
    linear-gradient(145deg, #020617 0%, #0B1220 45%, #111827 100%);
}

.auth-card,
.install-card {
  width: 100%;
  max-width: 440px;
  background: var(--mdms-surface-raised);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.install-card {
  max-width: 760px;
}

.auth-card-header,
.install-card-header {
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--mdms-border);
  background: linear-gradient(180deg, var(--mdms-surface-raised), var(--mdms-surface-soft));
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--mdms-text);
  letter-spacing: -0.02em;
}

.brand-mark .mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--mdms-accent), #B45309);
  color: #0B1220;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.auth-card-body,
.install-card-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.auth-footer,
.install-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
}

.install-steps {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.install-step {
  flex: 1;
  min-width: 72px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mdms-text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--mdms-border);
}

.install-step.active {
  color: var(--mdms-accent);
  border-bottom-color: var(--mdms-accent);
}

.install-step.done {
  color: var(--mdms-success);
  border-bottom-color: var(--mdms-success);
}

.req-table td,
.req-table th {
  font-size: 0.875rem;
  vertical-align: middle;
}

.badge-ok {
  background: rgba(5, 150, 105, 0.12);
  color: var(--mdms-success);
}

.badge-fail {
  background: rgba(220, 38, 38, 0.12);
  color: var(--mdms-danger);
}

/* ---------- App layout ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: var(--mdms-sidebar-width);
  background: var(--mdms-sidebar-bg);
  color: var(--mdms-sidebar-text);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--mdms-border);
  transition: width var(--mdms-transition);
}

.sidebar-brand {
  height: var(--mdms-topbar-height);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  color: #fff;
}

.sidebar-brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--mdms-accent), #B45309);
  color: #0B1220;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  display: block;
  line-height: 1.15;
}

.sidebar-brand .brand-subtitle {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--mdms-sidebar-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.12rem;
}

.sidebar-brand .brand-version {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--mdms-sidebar-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0.1rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem 1.5rem;
}

.nav-section {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mdms-sidebar-muted);
  padding: 1rem 0.85rem 0.4rem;
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--mdms-radius-sm);
  color: rgba(203, 213, 225, 0.78);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background var(--mdms-transition), color var(--mdms-transition);
  margin-bottom: 0.2rem;
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(245, 158, 11, 0.12);
  color: var(--mdms-accent);
  border-left-color: var(--mdms-accent);
  font-weight: 600;
}

.sidebar-link .bi {
  width: 1.15rem;
  font-size: 1.05rem;
  opacity: 0.95;
}

.sidebar-link .nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--mdms-accent);
  color: #0B1220;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.app-main {
  flex: 1;
  margin-left: var(--mdms-sidebar-width);
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: margin-left var(--mdms-transition);
}

.topbar {
  height: var(--mdms-topbar-height);
  background: var(--mdms-topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--mdms-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.35rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--mdms-border);
  background: var(--mdms-surface-raised);
  color: var(--mdms-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color var(--mdms-transition), color var(--mdms-transition), background var(--mdms-transition);
}

.icon-btn:hover {
  background: var(--mdms-accent-soft);
  color: var(--mdms-accent);
  border-color: rgba(245, 158, 11, 0.35);
}

.icon-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--mdms-accent);
  color: #0B1220;
  font-size: 0.62rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--mdms-surface-raised);
}

.icon-btn .badge-dot:empty {
  min-width: 8px;
  width: 8px;
  height: 8px;
  padding: 0;
}

.user-pill.dropdown-toggle::after {
  display: none;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--mdms-border);
  background: var(--mdms-surface-raised);
  color: var(--mdms-text);
  font-weight: 600;
  font-size: 0.85rem;
}

.user-pill:hover {
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--mdms-text);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mdms-accent), #B45309);
  color: #0B1220;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.user-pill-meta {
  line-height: 1.15;
  text-align: left;
}

.user-pill-meta small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--mdms-text-muted);
}

.content-area {
  padding: 1.35rem 1.6rem 1.5rem;
  flex: 1;
  min-height: 0;
}

.app-footer {
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  position: sticky;
  bottom: 0;
  z-index: 1010;
  border-top: 1px solid var(--mdms-border);
  background: color-mix(in srgb, var(--mdms-surface-raised) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -6px 18px rgba(2, 6, 23, 0.18);
  padding: 0.7rem 1.6rem;
}

.app-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  font-size: 0.78rem;
  color: var(--mdms-text-muted);
  font-weight: 500;
  line-height: 1.35;
}

.app-footer-credit {
  letter-spacing: 0.01em;
  min-width: 0;
}

.app-footer-link {
  color: var(--mdms-accent);
  font-weight: 700;
  text-decoration: none;
}

.app-footer-link:hover {
  color: var(--mdms-accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.app-footer-version {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mdms-text-muted);
  background: var(--mdms-surface-soft);
  border: 1px solid var(--mdms-border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

@media (max-width: 575.98px) {
  .app-footer {
    padding: 0.65rem 1rem;
  }

  .app-footer-inner {
    justify-content: center;
    text-align: center;
  }
}

.auth-footer a,
.install-footer a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-footer-sep {
  margin: 0 0.35rem;
  opacity: 0.55;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.page-header h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--mdms-text);
}

.page-header p {
  margin: 0.3rem 0 0;
  color: var(--mdms-text-muted);
  font-size: 0.9rem;
}

/* Cards / panels */
.panel {
  background: var(--mdms-surface-raised);
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius);
  box-shadow: var(--mdms-shadow);
}

.panel-header {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--mdms-border);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--mdms-text);
}

.panel-header-start {
  justify-content: flex-start;
  gap: 0.75rem;
}

.panel-body {
  padding: 1.15rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.kpi-card {
  background: var(--mdms-surface-raised);
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--mdms-shadow);
  position: relative;
  overflow: hidden;
  transition: transform var(--mdms-transition), border-color var(--mdms-transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.35);
}

.kpi-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: var(--mdms-kpi-icon-bg);
}

.kpi-icon.amber { color: #F59E0B; background: rgba(245, 158, 11, 0.15); }
.kpi-icon.blue { color: #3B82F6; background: rgba(59, 130, 246, 0.15); }
.kpi-icon.teal { color: #14B8A6; background: rgba(20, 184, 166, 0.15); }
.kpi-icon.violet { color: #8B5CF6; background: rgba(139, 92, 246, 0.15); }

.kpi-label {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--mdms-text-muted);
  font-weight: 600;
}

.kpi-value {
  font-family: var(--mdms-font-data);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--mdms-text);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.kpi-sub {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--mdms-text-muted);
}

/* Dashboard hero */
.dash-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
}

.dash-hero h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--mdms-text);
}

.dash-hero p {
  margin: 0.4rem 0 0;
  color: var(--mdms-text-muted);
  max-width: 540px;
}

.dash-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.dash-charts {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.dash-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.activity-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.activity-item {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--mdms-surface-2, rgba(127, 127, 127, 0.08));
  border: 1px solid var(--mdms-border);
}

.activity-value {
  font-family: var(--mdms-font-data);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--mdms-text);
  letter-spacing: -0.02em;
}

.activity-label {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--mdms-text-muted);
  font-weight: 600;
}

.storage-meter {
  height: 10px;
  border-radius: 999px;
  background: var(--mdms-surface-2, rgba(127, 127, 127, 0.15));
  overflow: hidden;
  border: 1px solid var(--mdms-border);
}

.storage-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
  border-radius: inherit;
  transition: width var(--mdms-transition);
}

.status-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.status-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--mdms-surface-2, rgba(127, 127, 127, 0.12));
  overflow: hidden;
}

.status-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #94A3B8;
}

.status-bar-fill.status-draft { background: #94A3B8; }
.status-bar-fill.status-pending_review { background: #F59E0B; }
.status-bar-fill.status-approved { background: #10B981; }
.status-bar-fill.status-changes_requested { background: #3B82F6; }
.status-bar-fill.status-rejected { background: #EF4444; }

.chart-wrap {
  position: relative;
  height: 280px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin-top: 1rem;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--mdms-text-muted);
  font-weight: 600;
}

.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Dense tables — force Bootstrap table vars so dark theme stays readable */
.table,
.table-mdms {
  --bs-table-color: var(--mdms-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--mdms-border);
  --bs-table-striped-color: var(--mdms-text);
  --bs-table-striped-bg: var(--mdms-surface-soft);
  --bs-table-active-color: var(--mdms-text);
  --bs-table-active-bg: var(--mdms-accent-soft);
  --bs-table-hover-color: var(--mdms-text);
  --bs-table-hover-bg: var(--mdms-accent-soft);
  font-family: var(--mdms-font-data);
  font-size: 0.875rem;
  margin-bottom: 0;
  color: var(--mdms-text);
}

.table > :not(caption) > * > *,
.table-mdms > :not(caption) > * > * {
  color: var(--mdms-text);
  border-color: var(--mdms-border);
  background-color: transparent;
}

.table-mdms thead th,
.table thead th {
  background: var(--mdms-table-head) !important;
  color: var(--mdms-text-muted) !important;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--mdms-border);
  white-space: nowrap;
  padding: 0.7rem 0.9rem;
}

.table-mdms tbody td,
.table tbody td {
  padding: 0.75rem 0.9rem;
  vertical-align: middle;
  border-color: var(--mdms-border);
  color: var(--mdms-text) !important;
  background: transparent;
}

.table-mdms tbody tr:hover > *,
.table tbody tr:hover > * {
  color: var(--mdms-text) !important;
  background-color: var(--mdms-accent-soft) !important;
}

.table-mdms a:not(.btn),
.table a:not(.btn) {
  color: var(--mdms-accent);
}

.table-mdms a:not(.btn):hover,
.table a:not(.btn):hover {
  color: var(--mdms-accent-hover);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill.active {
  background: rgba(5, 150, 105, 0.14);
  color: var(--mdms-success);
}

.status-pill.inactive {
  background: rgba(100, 116, 139, 0.18);
  color: var(--mdms-text-muted);
}

.status-pill.suspended {
  background: rgba(220, 38, 38, 0.14);
  color: var(--mdms-danger);
}

.status-pill.draft,
.status-pill.on_hold,
.status-pill.archived {
  background: rgba(100, 116, 139, 0.18);
  color: var(--mdms-text-muted);
}

.status-pill.pending_review,
.status-pill.changes_requested {
  background: rgba(245, 158, 11, 0.16);
  color: #F59E0B;
}

.status-pill.approved,
.status-pill.completed {
  background: rgba(5, 150, 105, 0.14);
  color: var(--mdms-success);
}

.status-pill.rejected {
  background: rgba(220, 38, 38, 0.14);
  color: var(--mdms-danger);
}

/* Settings tabs */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-bottom: 0 !important;
}

.settings-tabs .nav-link {
  color: var(--mdms-text-muted);
  font-weight: 600;
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius-sm);
  padding: 0.55rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--mdms-surface-raised);
  transition: background-color var(--mdms-transition), border-color var(--mdms-transition), color var(--mdms-transition);
}

.settings-tabs .nav-link i {
  color: var(--mdms-accent);
}

.settings-tabs .nav-link:hover {
  color: var(--mdms-text);
  border-color: color-mix(in srgb, var(--mdms-accent) 45%, var(--mdms-border));
}

.settings-tabs .nav-link.active {
  color: #0B1220;
  background: var(--mdms-accent);
  border-color: var(--mdms-accent);
}

.settings-tabs .nav-link.active i {
  color: #0B1220;
}

/* Alerts */
.alert-mdms {
  border: 0;
  border-left: 3px solid;
  border-radius: var(--mdms-radius-sm);
  font-size: 0.9rem;
}

.alert-mdms.alert-success {
  border-left-color: var(--mdms-success);
  background: rgba(5, 150, 105, 0.1);
  color: var(--mdms-success);
}

.alert-mdms.alert-danger {
  border-left-color: var(--mdms-danger);
  background: rgba(220, 38, 38, 0.1);
  color: var(--mdms-danger);
}

.alert-mdms.alert-info {
  border-left-color: var(--mdms-accent);
  background: var(--mdms-accent-soft);
  color: var(--mdms-accent-hover);
}

[data-theme="dark"] .alert-mdms.alert-info {
  color: var(--mdms-accent);
}

#mdms-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1080;
}

/* Collapsed sidebar */
body.sidebar-collapsed .sidebar {
  width: var(--mdms-sidebar-collapsed);
}

body.sidebar-collapsed .sidebar .nav-label,
body.sidebar-collapsed .sidebar .nav-section,
body.sidebar-collapsed .sidebar-brand .brand-copy,
body.sidebar-collapsed .sidebar-link .nav-badge {
  display: none;
}

body.sidebar-collapsed .app-main {
  margin-left: var(--mdms-sidebar-collapsed);
}

body.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 0.7rem;
  border-left-width: 0;
}

@media (max-width: 1199.98px) {
  .dash-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0 !important;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-charts,
  .dash-secondary {
    grid-template-columns: 1fr;
  }

  .activity-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .activity-strip {
    grid-template-columns: 1fr;
  }

  .page-header,
  .dash-hero {
    flex-direction: column;
  }
}

/* ---------- Phase 2: Project browser ---------- */
.browser-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: start;
  min-height: 420px;
}

.folder-tree {
  position: sticky;
  top: calc(var(--mdms-topbar-height) + 1rem);
  max-height: calc(100vh - var(--mdms-topbar-height) - 2rem);
  overflow: auto;
}

.folder-tree-header {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mdms-text-muted);
  margin-bottom: 0.5rem;
}

.folder-tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.folder-tree-list .folder-tree-list {
  padding-left: 0;
}

.folder-tree-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--mdms-radius-sm);
  color: var(--mdms-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--mdms-transition), color var(--mdms-transition);
}

.folder-tree-item:hover,
.folder-tree-item.active {
  background: var(--mdms-accent-soft);
  color: var(--mdms-accent);
}

.folder-tree-item.active {
  font-weight: 600;
}

.browser-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.view-toggle {
  display: inline-flex;
  gap: 0.25rem;
}

.folder-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius-sm);
  background: var(--mdms-surface-soft);
  color: var(--mdms-text);
  font-weight: 600;
  font-size: 0.9rem;
}

.folder-card:hover {
  border-color: var(--mdms-accent);
  background: var(--mdms-accent-soft);
  color: var(--mdms-accent);
}

.folder-card i {
  color: var(--mdms-accent);
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.file-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0.75rem;
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius-sm);
  background: var(--mdms-surface-raised);
  color: var(--mdms-text);
}

.file-grid-item:hover {
  border-color: var(--mdms-accent);
  box-shadow: var(--mdms-shadow);
  color: var(--mdms-text);
}

.file-grid-item.is-trashed {
  opacity: 0.55;
}

.file-grid-icon {
  position: relative;
  font-size: 2rem;
  color: var(--mdms-accent);
  margin-bottom: 0.5rem;
}

.file-ext {
  position: absolute;
  bottom: -0.15rem;
  right: -0.6rem;
  font-size: 0.55rem;
  font-weight: 700;
  background: #0B1220;
  color: #fff;
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
  font-family: var(--mdms-font-data);
}

.file-grid-name {
  font-size: 0.82rem;
  font-weight: 600;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-grid-meta {
  font-size: 0.72rem;
  color: var(--mdms-text-muted);
  margin-top: 0.2rem;
}

.dropzone {
  border: 2px dashed var(--mdms-border);
  border-radius: var(--mdms-radius);
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--mdms-surface-soft);
  cursor: pointer;
  transition: border-color var(--mdms-transition), background var(--mdms-transition);
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--mdms-accent);
  background: var(--mdms-accent-soft);
}

.upload-queue {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 280px;
  overflow: auto;
}

.upload-item {
  padding: 0.75rem;
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius-sm);
  background: var(--mdms-surface-raised);
}

.upload-item .progress {
  background: var(--mdms-border);
  border-radius: 999px;
  overflow: hidden;
}

.upload-item .progress-bar {
  background: var(--mdms-accent) !important;
}

/* ---------- Phase 3 ---------- */
.topbar-search {
  position: relative;
  max-width: 360px;
  width: 100%;
  margin-left: 0.5rem;
}

.topbar-search i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mdms-text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  border: 1px solid var(--mdms-border);
  background: var(--mdms-surface-raised);
  border-radius: 999px;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  font-size: 0.875rem;
  color: var(--mdms-text);
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--mdms-accent);
  box-shadow: 0 0 0 0.15rem var(--mdms-accent-soft);
}

.mdms-tabs {
  border-bottom: 1px solid var(--mdms-border);
  gap: 0.15rem;
}

.mdms-tabs .nav-link {
  border: 1px solid transparent;
  border-bottom: 0;
  color: var(--mdms-text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--mdms-radius-sm) var(--mdms-radius-sm) 0 0;
  padding: 0.55rem 0.9rem;
}

.mdms-tabs .nav-link:hover {
  color: var(--mdms-accent);
}

.mdms-tabs .nav-link.active {
  color: var(--mdms-text);
  background: var(--mdms-surface-raised);
  border-color: var(--mdms-border);
  border-bottom-color: var(--mdms-surface-raised);
  margin-bottom: -1px;
}

.preview-frame {
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius-sm);
  background: #0f1720;
  overflow: hidden;
}

.preview-frame-image {
  background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 20px 20px;
  text-align: center;
  padding: 1rem;
}

[data-theme="light"] .preview-frame-image {
  background: repeating-conic-gradient(#e8ecf1 0% 25%, #f7f9fb 0% 50%) 50% / 20px 20px;
}

.preview-frame-image img {
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.preview-frame-pdf iframe {
  width: 100%;
  height: 560px;
  border: 0;
  background: #fff;
}

.preview-text,
.preview-office {
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius-sm);
  background: var(--mdms-surface-raised);
  padding: 1rem;
  max-height: 520px;
  overflow: auto;
  font-family: var(--mdms-font-data);
  font-size: 0.85rem;
  white-space: pre-wrap;
  color: var(--mdms-text);
}

.preview-office {
  white-space: normal;
}

.preview-docx {
  font-family: var(--mdms-font);
  line-height: 1.55;
}

.preview-pptx-slide {
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius-sm);
  background: var(--mdms-surface);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.preview-pptx-slide:last-child {
  margin-bottom: 0;
}

.preview-pptx-slide-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mdms-text-muted);
  margin-bottom: 0.5rem;
}

.preview-pptx-slide p {
  margin-bottom: 0.35rem;
}

.preview-pptx-slide p:last-child {
  margin-bottom: 0;
}

.preview-empty {
  border: 1px dashed var(--mdms-border);
  border-radius: var(--mdms-radius);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--mdms-text-muted);
  background: var(--mdms-surface-soft);
}

.rounded-mdms {
  border-radius: var(--mdms-radius) !important;
}

.bg-surface-soft {
  background: var(--mdms-surface-soft);
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-item {
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius-sm);
  padding: 0.9rem 1rem;
  background: var(--mdms-surface-raised);
}

.comment-reply {
  margin-left: 1rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-left: 3px solid var(--mdms-accent);
  background: var(--mdms-accent-soft);
  border-radius: 0 var(--mdms-radius-sm) var(--mdms-radius-sm) 0;
}

.mdms-notif-menu {
  width: 360px;
  max-width: calc(100vw - 1.5rem);
  background: var(--mdms-surface-raised);
  border: 1px solid var(--mdms-border);
}

.mdms-notif-list {
  max-height: 360px;
  overflow: auto;
}

.mdms-notif-item {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--mdms-border);
  color: inherit;
  font-size: 0.85rem;
}

.mdms-notif-item:hover {
  background: var(--mdms-accent-soft);
  color: inherit;
}

.mdms-notif-item.unread {
  background: rgba(245, 158, 11, 0.08);
}

.mdms-notif-page .list-group-item.unread {
  border-left: 3px solid var(--mdms-accent);
  background: rgba(245, 158, 11, 0.06);
}

.list-group-item {
  background: var(--mdms-surface-raised);
  border-color: var(--mdms-border);
  color: var(--mdms-text);
}

.card {
  background: var(--mdms-surface-raised);
  border-color: var(--mdms-border);
  color: var(--mdms-text);
}

.card-header,
.card-footer {
  background: var(--mdms-surface-soft);
  border-color: var(--mdms-border);
  color: var(--mdms-text);
}

.form-check-label,
.form-text {
  color: var(--mdms-text-muted);
}

/* High-contrast checkboxes & switches (visible when unchecked on dark theme) */
.form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.18rem;
  background-color: var(--mdms-surface-soft);
  border: 2px solid var(--mdms-text-muted);
  cursor: pointer;
  box-shadow: none;
  transition: background-color var(--mdms-transition), border-color var(--mdms-transition), box-shadow var(--mdms-transition);
}

.form-check-input:hover {
  border-color: var(--mdms-accent);
}

.form-check-input:focus {
  border-color: var(--mdms-accent);
  box-shadow: 0 0 0 0.2rem var(--mdms-accent-soft);
}

.form-check-input:checked {
  background-color: var(--mdms-accent);
  border-color: var(--mdms-accent);
}

.form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%230B1220' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input[type="checkbox"]:indeterminate {
  background-color: var(--mdms-accent);
  border-color: var(--mdms-accent);
}

.form-switch .form-check-input {
  width: 2.6rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  background-color: #334155;
  border: 2px solid #94A3B8;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23F8FAFC'/%3e%3c/svg%3e");
  background-position: left center;
  border-radius: 2rem;
}

[data-theme="light"] .form-switch .form-check-input {
  background-color: #CBD5E1;
  border-color: #64748B;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23FFFFFF'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23F8FAFC'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:checked {
  background-color: var(--mdms-accent);
  border-color: var(--mdms-accent);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%230B1220'/%3e%3c/svg%3e");
  background-position: right center;
}

.form-switch .form-check-input:checked:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%230B1220'/%3e%3c/svg%3e");
}

.form-check-label {
  cursor: pointer;
  color: var(--mdms-text);
  user-select: none;
}

/* Integration / settings cards */
.mdms-integration-card {
  background: var(--mdms-surface-soft);
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius);
  padding: 1rem 1.15rem;
  transition: border-color var(--mdms-transition), box-shadow var(--mdms-transition);
}

.mdms-integration-card:hover {
  border-color: color-mix(in srgb, var(--mdms-accent) 45%, var(--mdms-border));
}

.mdms-integration-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--mdms-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mdms-accent-soft);
  color: var(--mdms-accent);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.mdms-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--mdms-surface-raised);
  border: 1px solid var(--mdms-border);
}

.mdms-switch-wrap .form-check-label {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0;
  color: var(--mdms-text);
}

.mdms-switch-wrap .form-check {
  display: flex;
  align-items: center;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.mdms-switch-wrap .form-check-input {
  float: none;
  margin-left: 0;
}

.input-group-text .bi {
  color: var(--mdms-accent);
}

.form-label .bi {
  color: var(--mdms-accent);
  margin-right: 0.25rem;
}

.input-group-text {
  background: var(--mdms-surface-soft);
  border-color: var(--mdms-border);
  color: var(--mdms-text);
}

.nav-tabs .nav-link {
  color: var(--mdms-text-muted);
}

.nav-tabs .nav-link.active {
  color: var(--mdms-text);
  background: var(--mdms-surface-raised);
  border-color: var(--mdms-border);
}

.close,
.btn-close {
  filter: var(--mdms-btn-close-filter, none);
}

[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.breadcrumb {
  --bs-breadcrumb-divider-color: var(--mdms-text-muted);
}

.breadcrumb-item,
.breadcrumb-item a {
  color: var(--mdms-text-muted);
}

.breadcrumb-item.active {
  color: var(--mdms-text);
}

.modal-content {
  background: var(--mdms-surface-raised);
  border-color: var(--mdms-border);
  color: var(--mdms-text);
  border-radius: var(--mdms-radius);
}

.modal-header,
.modal-footer {
  border-color: var(--mdms-border);
}

.pagination .page-link {
  background: var(--mdms-surface-raised);
  border-color: var(--mdms-border);
  color: var(--mdms-text);
}

.pagination .page-item.active .page-link {
  background: var(--mdms-accent);
  border-color: var(--mdms-accent);
  color: #0B1220;
}

@media (max-width: 991.98px) {
  .browser-layout {
    grid-template-columns: 1fr;
  }

  .folder-tree {
    position: static;
    max-height: 220px;
  }
}

/* Settings polish — toggles, uploads, integrations */
.settings-panel {
  max-width: 920px;
}

.mdms-setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--mdms-radius);
  border: 1px solid var(--mdms-border);
  background: var(--mdms-surface-soft);
  transition: border-color var(--mdms-transition), background-color var(--mdms-transition);
}

.mdms-setting-toggle.compact {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--mdms-surface-raised);
}

.mdms-setting-toggle.is-on {
  border-color: color-mix(in srgb, var(--mdms-accent) 55%, var(--mdms-border));
  background: var(--mdms-accent-soft);
}

.mdms-setting-toggle-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--mdms-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mdms-accent-soft);
  color: var(--mdms-accent);
  flex-shrink: 0;
}

.mdms-upload-card {
  border: 1px solid var(--mdms-border);
  border-radius: var(--mdms-radius);
  background: var(--mdms-surface-soft);
  padding: 1rem;
  height: 100%;
}

.mdms-inline-hint {
  background: var(--mdms-accent-soft);
  border: 1px solid color-mix(in srgb, var(--mdms-accent) 35%, var(--mdms-border));
  color: var(--mdms-text);
  border-radius: var(--mdms-radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.mdms-inline-hint a {
  color: var(--mdms-accent);
  font-weight: 600;
}

.mdms-integration-card.is-enabled {
  border-color: color-mix(in srgb, var(--mdms-accent) 50%, var(--mdms-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--mdms-accent) 18%, transparent);
}

.form-switch .form-check-input {
  width: 2.85rem;
  height: 1.5rem;
}

.mdms-setting-toggle .form-switch .form-check-input {
  width: 3rem;
  height: 1.55rem;
}
