/* ==========================================================================
   Sistem Buku Daftar Radiologi KKM V2 - macOS Native Design System
   Designed for High Legibility, Ease to Eyes & Systematic Ergonomics
   ========================================================================== */

:root {
  /* Official Clinical/Hospital Palette: macOS Aqua Teal & Slate */
  --primary: #007a78;
  --primary-hover: #006664;
  --primary-light: rgba(0, 122, 120, 0.09);
  --primary-border: rgba(0, 122, 120, 0.28);
  
  --accent: #007aff;
  --accent-light: rgba(0, 122, 255, 0.1);
  --accent-hover: #0062cc;

  /* Royal Yellow Radiology Signature Highlight */
  --rad-yellow: #f59e0b;
  --rad-yellow-hover: #d97706;
  --rad-yellow-light: rgba(245, 158, 11, 0.12);
  --rad-yellow-border: rgba(245, 158, 11, 0.3);
  
  /* Apple System Colors */
  --apple-red: #ff3b30;
  --apple-green: #34c759;
  --apple-orange: #ff9500;
  --apple-purple: #af52de;
  --apple-blue: #007aff;
  --apple-teal: #30b0c7;

  /* macOS Translucent & Clean Minimal System */
  --bg-window: #eceef2;
  --bg-main: #f5f6f8;
  --bg-sidebar: rgba(238, 240, 244, 0.82);
  --bg-card: rgba(255, 255, 255, 0.96);
  --bg-card-solid: #ffffff;
  --bg-input: #ffffff;
  --bg-subtle: rgba(0, 0, 0, 0.035);
  --bg-hover: rgba(0, 0, 0, 0.05);
  
  --text-main: #1d1d1f;
  --text-muted: #787880;
  --text-white: #ffffff;
  --text-sidebar: #48484a;
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-focus: rgba(0, 122, 120, 0.4);
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, 0.1), 0 6px 12px -3px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 24px 48px -8px rgba(0, 0, 0, 0.22), 0 12px 24px -4px rgba(0, 0, 0, 0.1);
  
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 9999px;
  
  --backdrop-blur: blur(25px) saturate(190%);
  --backdrop-blur-sm: blur(14px) saturate(170%);
  --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Professional Radiology macOS Charcoal Pro Dark Mode */
[data-theme="dark"] {
  --primary: #fbbf24; /* Royal Yellow Amber Primary in Dark Mode */
  --primary-hover: #f59e0b;
  --primary-light: rgba(251, 191, 36, 0.12);
  --primary-border: rgba(251, 191, 36, 0.3);

  --accent: #38bdf8;
  --accent-light: rgba(56, 189, 248, 0.12);
  --accent-hover: #0284c7;

  --rad-yellow: #fbbf24;
  --rad-yellow-hover: #f59e0b;
  --rad-yellow-light: rgba(251, 191, 36, 0.15);

  --apple-red: #ff453a;
  --apple-green: #30d158;
  --apple-orange: #ff9f0a;
  --apple-purple: #bf5af2;
  --apple-blue: #0a84ff;
  --apple-teal: #64d2ff;

  --bg-window: #18181a;
  --bg-main: #1c1c1e;
  --bg-sidebar: rgba(26, 26, 30, 0.85);
  --bg-card: rgba(38, 38, 42, 0.9);
  --bg-card-solid: #252528;
  --bg-input: #1a1a1c;
  --bg-subtle: rgba(255, 255, 255, 0.05);
  --bg-hover: rgba(255, 255, 255, 0.08);

  --text-main: #f5f5f7;
  --text-muted: #98989d;
  --text-white: #ffffff;
  --text-sidebar: #a1a1a6;

  --border-color: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-focus: rgba(251, 191, 36, 0.45);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px -2px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 40px -6px rgba(0, 0, 0, 0.7);
  --shadow-modal: 0 28px 56px -10px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Base Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", -system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.45;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.012em;
}

/* Vector Icon Utility */
.icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-xs { width: 12px; height: 12px; }
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 22px; height: 22px; }

/* Layout Grid */
.app-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-window);
}

/* ==========================================================================
   macOS Window Chrome & Controls (Traffic Lights)
   ========================================================================== */
.macos-window-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.35rem 0.5rem 0.75rem;
  user-select: none;
}

.macos-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.macos-dot-close {
  background-color: #ff5f56;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
}

.macos-dot-minimize {
  background-color: #ffbd2e;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
}

.macos-dot-zoom {
  background-color: #27c93f;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
}

.macos-dot:hover {
  filter: brightness(0.92);
  transform: scale(1.06);
}

/* ==========================================================================
   macOS Native Sidebar (Translucent Vibrancy & Clean Typography)
   ========================================================================== */
.sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.75rem 1rem;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.25s ease, opacity 0.2s ease;
  white-space: nowrap;
  overflow-x: hidden;
  z-index: 20;
}

.app-container.sidebar-collapsed .sidebar {
  width: 0px;
  padding: 0;
  opacity: 0;
  border-right: none;
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar-brand-text h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.sidebar-brand-text p {
  font-size: 0.68rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.4px;
}

[data-theme="dark"] .sidebar-brand-text h2 {
  color: var(--text-white);
}

[data-theme="dark"] .sidebar-brand-text p {
  color: var(--rad-yellow);
}

/* Sidebar Section Titles (macOS HIG System Sidebar Groups) */
.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.65rem 0.65rem 0.25rem;
  user-select: none;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.48rem 0.75rem;
  color: var(--text-sidebar);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.83rem;
  transition: var(--transition);
}

.nav-item a:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}

.nav-item.active a {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 122, 120, 0.3);
}

[data-theme="dark"] .nav-item.active a {
  background-color: var(--rad-yellow);
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.35);
}

/* Sidebar Footer (Facility & Live Network Pill) */
.sidebar-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* ==========================================================================
   macOS Unified Titlebar & Toolbar
   ========================================================================== */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 100vh;
  background-color: var(--bg-main);
}

.top-navbar {
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  flex-shrink: 0;
  background-color: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 15;
}

.page-title {
  display: flex;
  align-items: center;
}

.page-title h1 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.015em;
  line-height: 1;
  margin: 0;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* macOS Network Live Status Pill */
.macos-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 3px 10px;
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.28);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: #15803d;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  user-select: none;
}

[data-theme="dark"] .macos-live-badge {
  background: rgba(48, 209, 88, 0.15);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
}

.macos-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: macosPulse 2s infinite;
}

@keyframes macosPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* macOS Toolbar Pill Button */
.macos-toolbar-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.macos-toolbar-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

/* ==========================================================================
   macOS Inset Grouped Cards & Content Area
   ========================================================================== */
.content-body {
  padding: 1.15rem 1.4rem;
  flex-grow: 1;
}

.card {
  background-color: var(--bg-card);
  backdrop-filter: var(--backdrop-blur-sm);
  -webkit-backdrop-filter: var(--backdrop-blur-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-header-clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1.1rem;
  min-height: 42px;
  box-sizing: border-box;
}

.card-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  line-height: 1;
}

.card-title-text svg,
.card-title-text .icon {
  color: var(--primary);
  flex-shrink: 0;
}

/* macOS Icon Squircle for Section Headers */
.macos-icon-squircle {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}

[data-theme="dark"] .macos-icon-squircle {
  background: rgba(251, 191, 36, 0.15);
  color: var(--rad-yellow);
}

/* ==========================================================================
   macOS Segmented Controls & Section Tabs
   ========================================================================== */
.segmented-control,
.filter-tab-group {
  display: inline-flex;
  align-items: center;
  background: rgba(118, 118, 128, 0.12);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 2px;
  user-select: none;
}

.segmented-control-item,
.filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 4px 13px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: transparent;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.segmented-control-item:hover,
.filter-tab:hover {
  color: var(--text-main);
}

.segmented-control-item.active,
.filter-tab.active {
  background: var(--bg-card-solid) !important;
  color: var(--text-main) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .segmented-control-item.active,
[data-theme="dark"] .filter-tab.active {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* macOS Quick Section Navigation Bar (for Registration & Multi-Tab Screens) */
.macos-section-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.macos-section-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.macos-section-tab:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.macos-section-tab.active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 122, 120, 0.28);
}

[data-theme="dark"] .macos-section-tab.active {
  color: #0f172a;
  background: var(--rad-yellow);
  border-color: var(--rad-yellow);
  box-shadow: 0 2px 6px rgba(251, 191, 36, 0.35);
}

/* Modality Quick Pills */
.modality-pills-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}

.modality-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 4px 11px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.modality-pill:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .modality-pill:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.modality-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 122, 120, 0.3);
}

[data-theme="dark"] .modality-pill.active {
  background: var(--rad-yellow);
  color: #0f172a;
  border-color: var(--rad-yellow);
  box-shadow: 0 2px 6px rgba(251, 191, 36, 0.35);
}

/* ==========================================================================
   macOS Form Controls & Input Ergonomics
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

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

.form-control {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.form-control:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .form-control:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.form-control:focus {
  background-color: var(--bg-card-solid);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--border-focus);
}

[data-theme="dark"] .form-control:focus {
  background-color: var(--bg-card-solid);
  border-color: var(--rad-yellow);
  box-shadow: 0 0 0 3px var(--border-focus);
}

/* Custom Select Dropdown with macOS Chevron */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 11px;
  padding-right: 2rem;
}

/* ==========================================================================
   macOS Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.52rem 1.05rem;
  font-weight: 600;
  font-size: 0.83rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 122, 120, 0.3);
}

[data-theme="dark"] .btn-primary {
  background-color: var(--rad-yellow);
  color: #0f172a;
  border-color: var(--rad-yellow);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(251, 191, 36, 0.35);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

[data-theme="dark"] .btn-primary:hover {
  background-color: var(--rad-yellow-hover);
  border-color: var(--rad-yellow-hover);
}

.btn-accent {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

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

.btn-secondary {
  background-color: #64748b;
  color: white;
}

.btn-secondary:hover {
  background-color: #475569;
}

.btn-outline {
  background-color: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-hover);
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

/* ==========================================================================
   macOS Table Views (Finder / Mail Style)
   ========================================================================== */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table th {
  background-color: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table tr:hover {
  background-color: var(--primary-light);
}

/* ==========================================================================
   macOS KPI Cards & Analytics Widgets
   ========================================================================== */
.kpi-card {
  background-color: var(--bg-card);
  backdrop-filter: var(--backdrop-blur-sm);
  -webkit-backdrop-filter: var(--backdrop-blur-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.kpi-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 0.25rem;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   macOS Frosted Glass Modals
   ========================================================================== */
.macos-modal-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: var(--backdrop-blur-sm);
  -webkit-backdrop-filter: var(--backdrop-blur-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.25rem;
}

.macos-modal-dialog,
.modal-dialog {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 3.5rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: macosModalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes macosModalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.macos-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .macos-modal-header {
  background: rgba(0, 0, 0, 0.2);
}

.macos-modal-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.macos-modal-body {
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.macos-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 0.85rem 1.4rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .macos-modal-footer {
  background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   macOS Notification Banners (Toasts)
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 0.85rem 1.15rem;
  background-color: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: macosToastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes macosToastSlide {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Print Rules */
@media print {
  .sidebar, .top-navbar, .btn, .no-print, .macos-section-nav, .operator-bar {
    display: none !important;
  }
  .main-wrapper {
    max-height: none !important;
    overflow: visible !important;
    background: #ffffff !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}
