/**
 * Apple Design System - Main Entry Point
 * CARD Wallet CRM
 * 
 * This file combines all Apple design system components
 */

/* Base Design System */

/* Additional global styles */
html {
    scroll-behavior: smooth;
}

/* Scrollbar Styling (WebKit) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--apple-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--apple-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--apple-border-light);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--apple-border) var(--apple-bg);
}

/* Focus Styles */
*:focus-visible {
    outline: 2px solid var(--apple-blue);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--apple-blue-light);
    color: var(--apple-blue);
}

/* Print Styles */
@media print {

    .sidebar,
    .mobile-header,
    .page-actions,
    .btn,
    .mobile-backdrop {
        display: none !important;
    }

    .content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .card {
        break-inside: avoid;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}/**
 * Apple Design System for CARD Wallet CRM
 * Inspired by Apple Human Interface Guidelines
 * Supports light/dark mode, responsive, and glassmorphism
 */

/* ========================================
   CSS RESET & BASE
   ======================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--apple-text);
  background: var(--apple-bg);
  overflow-x: hidden;
}

/* ========================================
   DESIGN TOKENS (CSS Variables)
   ======================================== */

:root {
  /* === Colors - Light Mode === */
  --apple-bg: #f5f5f7;
  --apple-bg-secondary: #ffffff;
  --apple-bg-tertiary: #fafafa;
  --apple-surface: #ffffff;
  --apple-surface-raised: #ffffff;
  
  /* Borders */
  --apple-border: #d2d2d7;
  --apple-border-light: #e5e5e7;
  --apple-divider: #e5e5e7;
  
  /* Text */
  --apple-text: #1d1d1f;
  --apple-text-secondary: #6e6e73;
  --apple-text-tertiary: #86868b;
  --apple-text-inverse: #ffffff;
  
  /* Brand Colors */
  --apple-blue: #007aff;
  --apple-blue-hover: #0051d5;
  --apple-blue-light: #e8f4fd;
  --apple-green: #34c759;
  --apple-green-hover: #248a3d;
  --apple-green-light: #e8f8ec;
  --apple-orange: #ff9500;
  --apple-orange-hover: #cc7700;
  --apple-orange-light: #fff4e6;
  --apple-red: #ff3b30;
  --apple-red-hover: #d70015;
  --apple-red-light: #ffebea;
  --apple-purple: #af52de;
  --apple-purple-hover: #8944ab;
  --apple-purple-light: #f5edfa;
  --apple-pink: #ff2d55;
  --apple-teal: #5ac8fa;
  --apple-indigo: #5856d6;
  --apple-yellow: #ffcc00;
  
  /* Semantic Colors */
  --apple-success: var(--apple-green);
  --apple-warning: var(--apple-orange);
  --apple-error: var(--apple-red);
  --apple-info: var(--apple-blue);
  
  /* Shadows */
  --apple-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --apple-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --apple-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --apple-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --apple-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  
  /* Border Radius */
  --apple-radius-xs: 4px;
  --apple-radius-sm: 6px;
  --apple-radius-md: 10px;
  --apple-radius-lg: 14px;
  --apple-radius-xl: 20px;
  --apple-radius-2xl: 28px;
  --apple-radius-full: 9999px;
  
  /* Spacing Scale (4px base) */
  --apple-space-1: 4px;
  --apple-space-2: 8px;
  --apple-space-3: 12px;
  --apple-space-4: 16px;
  --apple-space-5: 20px;
  --apple-space-6: 24px;
  --apple-space-8: 32px;
  --apple-space-10: 40px;
  --apple-space-12: 48px;
  --apple-space-16: 64px;
  --apple-space-20: 80px;
  
  /* Typography */
  --apple-font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --apple-font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --apple-font-mono: "SF Mono", SFMono-Regular, ui-monospace, Monaco, Consolas, monospace;
  
  /* Font Sizes */
  --apple-text-xs: 11px;
  --apple-text-sm: 13px;
  --apple-text-base: 14px;
  --apple-text-md: 16px;
  --apple-text-lg: 18px;
  --apple-text-xl: 20px;
  --apple-text-2xl: 24px;
  --apple-text-3xl: 32px;
  --apple-text-4xl: 40px;
  
  /* Font Weights */
  --apple-weight-regular: 400;
  --apple-weight-medium: 500;
  --apple-weight-semibold: 600;
  --apple-weight-bold: 700;
  
  /* Line Heights */
  --apple-leading-tight: 1.2;
  --apple-leading-snug: 1.375;
  --apple-leading-normal: 1.5;
  --apple-leading-relaxed: 1.625;
  
  /* Transitions */
  --apple-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --apple-transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --apple-transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --apple-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --apple-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --apple-ease-in: cubic-bezier(0.4, 0, 1, 1);
  
  /* Z-Index */
  --apple-z-base: 1;
  --apple-z-dropdown: 100;
  --apple-z-sticky: 200;
  --apple-z-fixed: 300;
  --apple-z-overlay: 400;
  --apple-z-modal: 500;
  --apple-z-popover: 600;
  --apple-z-tooltip: 700;
  
  /* Layout */
  --apple-sidebar-width: 240px;
  --apple-sidebar-collapsed: 64px;
  --apple-header-height: 52px;
  --apple-content-max: 1280px;
  
  /* Glassmorphism */
  --apple-glass-bg: rgba(255, 255, 255, 0.72);
  --apple-glass-border: rgba(255, 255, 255, 0.18);
  --apple-glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  --apple-backdrop-blur: blur(20px);
  --apple-backdrop-saturate: saturate(180%);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --apple-bg: #000000;
    --apple-bg-secondary: #1c1c1e;
    --apple-bg-tertiary: #2c2c2e;
    --apple-surface: #1c1c1e;
    --apple-surface-raised: #2c2c2e;
    
    --apple-border: #38383a;
    --apple-border-light: #48484a;
    --apple-divider: #38383a;
    
    --apple-text: #f5f5f7;
    --apple-text-secondary: #98989d;
    --apple-text-tertiary: #6e6e73;
    --apple-text-inverse: #1d1d1f;
    
    --apple-blue: #0a84ff;
    --apple-blue-hover: #409cff;
    --apple-blue-light: #1a3a52;
    --apple-green: #32d74b;
    --apple-green-hover: #64de75;
    --apple-green-light: #1e3a28;
    --apple-orange: #ff9f0a;
    --apple-orange-hover: #ffb340;
    --apple-orange-light: #3d2e1a;
    --apple-red: #ff453a;
    --apple-red-hover: #ff6961;
    --apple-red-light: #3d1e1c;
    --apple-purple: #bf5af2;
    --apple-purple-hover: #cf8af5;
    --apple-purple-light: #342840;
    
    --apple-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --apple-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --apple-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --apple-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
    --apple-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
    
    --apple-glass-bg: rgba(28, 28, 30, 0.72);
    --apple-glass-border: rgba(255, 255, 255, 0.1);
    --apple-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  }
}

/* Force light/dark mode classes */
.light-mode {
  color-scheme: light;
}

.dark-mode {
  color-scheme: dark;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--apple-font-display);
  font-weight: var(--apple-weight-semibold);
  line-height: var(--apple-leading-tight);
  color: var(--apple-text);
  margin-bottom: var(--apple-space-4);
}

h1 { font-size: var(--apple-text-4xl); }
h2 { font-size: var(--apple-text-3xl); }
h3 { font-size: var(--apple-text-2xl); }
h4 { font-size: var(--apple-text-xl); }
h5 { font-size: var(--apple-text-lg); }
h6 { font-size: var(--apple-text-md); }

p {
  margin-bottom: var(--apple-space-4);
  line-height: var(--apple-leading-normal);
}

.text-xs { font-size: var(--apple-text-xs); }
.text-sm { font-size: var(--apple-text-sm); }
.text-base { font-size: var(--apple-text-base); }
.text-md { font-size: var(--apple-text-md); }
.text-lg { font-size: var(--apple-text-lg); }
.text-xl { font-size: var(--apple-text-xl); }

.font-regular { font-weight: var(--apple-weight-regular); }
.font-medium { font-weight: var(--apple-weight-medium); }
.font-semibold { font-weight: var(--apple-weight-semibold); }
.font-bold { font-weight: var(--apple-weight-bold); }

.text-secondary { color: var(--apple-text-secondary); }
.text-tertiary { color: var(--apple-text-tertiary); }

.mono {
  font-family: var(--apple-font-mono);
  font-variant-numeric: tabular-nums;
}

/* ========================================
   LINKS
   ======================================== */

a {
  color: var(--apple-blue);
  text-decoration: none;
  transition: color var(--apple-transition-fast);
}

a:hover {
  color: var(--apple-blue-hover);
  text-decoration: underline;
}

a:active {
  opacity: 0.7;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Spacing utilities */
.mt-1 { margin-top: var(--apple-space-1); }
.mt-2 { margin-top: var(--apple-space-2); }
.mt-4 { margin-top: var(--apple-space-4); }
.mt-6 { margin-top: var(--apple-space-6); }

.mb-1 { margin-bottom: var(--apple-space-1); }
.mb-2 { margin-bottom: var(--apple-space-2); }
.mb-4 { margin-bottom: var(--apple-space-4); }
.mb-6 { margin-bottom: var(--apple-space-6); }

.p-4 { padding: var(--apple-space-4); }
.p-6 { padding: var(--apple-space-6); }
.p-8 { padding: var(--apple-space-8); }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--apple-space-2); }
.gap-4 { gap: var(--apple-space-4); }
.gap-6 { gap: var(--apple-space-6); }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive grid */
@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}
/**
 * Apple-style UI Components for CARD Wallet CRM
 * Buttons, Cards, Forms, Badges, Modals, Navigation
 */

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--apple-space-2);
    padding: var(--apple-space-2) var(--apple-space-4);
    font-family: var(--apple-font-text);
    font-size: var(--apple-text-base);
    font-weight: var(--apple-weight-medium);
    line-height: 1.5;
    border-radius: var(--apple-radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--apple-transition-fast);
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

/* Primary Button */
.btn-primary {
    background: var(--apple-blue);
    color: var(--apple-text-inverse);
    box-shadow: var(--apple-shadow-sm);
}

.btn-primary:hover {
    background: var(--apple-blue-hover);
    box-shadow: var(--apple-shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--apple-shadow-xs);
}

/* Secondary Button */
.btn-secondary {
    background: var(--apple-surface);
    color: var(--apple-text);
    border: 1px solid var(--apple-border);
    box-shadow: var(--apple-shadow-xs);
}

.btn-secondary:hover {
    background: var(--apple-bg-tertiary);
    border-color: var(--apple-border-light);
    box-shadow: var(--apple-shadow-sm);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--apple-blue);
    border: 1px solid var(--apple-blue);
}

.btn-outline:hover {
    background: var(--apple-blue-light);
    border-color: var(--apple-blue-hover);
}

/* Danger Button */
.btn-danger {
    background: var(--apple-red);
    color: var(--apple-text-inverse);
}

.btn-danger:hover {
    background: var(--apple-red-hover);
}

/* Success Button */
.btn-success {
    background: var(--apple-green);
    color: var(--apple-text-inverse);
}

.btn-success:hover {
    background: var(--apple-green-hover);
}

/* Warning Button */
.btn-warning {
    background: var(--apple-orange);
    color: var(--apple-text-inverse);
}

.btn-warning:hover {
    background: var(--apple-orange-hover);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--apple-text);
    border: none;
}

.btn-ghost:hover {
    background: var(--apple-bg-tertiary);
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: var(--apple-text-sm);
    border-radius: var(--apple-radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: var(--apple-text-md);
    border-radius: var(--apple-radius-lg);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Icon Button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--apple-radius-md);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* Disabled State */
.btn:disabled,
.btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: var(--apple-surface);
    border-radius: var(--apple-radius-lg);
    box-shadow: var(--apple-shadow-sm);
    padding: var(--apple-space-6);
    transition: all var(--apple-transition-base);
    border: 1px solid transparent;
}

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

.card-header {
    margin-bottom: var(--apple-space-4);
    padding-bottom: var(--apple-space-4);
    border-bottom: 1px solid var(--apple-divider);
}

.card-title {
    font-size: var(--apple-text-lg);
    font-weight: var(--apple-weight-semibold);
    margin: 0;
    color: var(--apple-text);
}

.card-subtitle {
    font-size: var(--apple-text-sm);
    color: var(--apple-text-secondary);
    margin-top: var(--apple-space-1);
}

.card-body {
    margin-bottom: var(--apple-space-4);
}

.card-footer {
    margin-top: var(--apple-space-4);
    padding-top: var(--apple-space-4);
    border-top: 1px solid var(--apple-divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Glass Card (Glassmorphism) */
.card-glass {
    background: var(--apple-glass-bg);
    backdrop-filter: var(--apple backdrop-blur);
    -webkit-backdrop-filter: var(--apple-backdrop-blur);
    border: 1px solid var(--apple-glass-border);
    box-shadow: var(--apple-glass-shadow);
}

/* Elevated Card */
.card-elevated {
    box-shadow: var(--apple-shadow-lg);
}

/* Interactive Card */
.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-4px);
    box-shadow: var(--apple-shadow-lg);
}

.card-interactive:active {
    transform: translateY(-2px);
    box-shadow: var(--apple-shadow-md);
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
    margin-bottom: var(--apple-space-4);
}

.form-label {
    display: block;
    font-size: var(--apple-text-sm);
    font-weight: var(--apple-weight-medium);
    color: var(--apple-text-secondary);
    margin-bottom: var(--apple-space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--apple-space-3) var(--apple-space-4);
    font-family: var(--apple-font-text);
    font-size: var(--apple-text-base);
    color: var(--apple-text);
    background: var(--apple-surface);
    border: 1px solid var(--apple-border);
    border-radius: var(--apple-radius-md);
    transition: all var(--apple-transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px var(--apple-blue-light);
}

.form-input::placeholder {
    color: var(--apple-text-tertiary);
}

/* Input Sizes */
.form-input-sm {
    padding: 6px 12px;
    font-size: var(--apple-text-sm);
}

.form-input-lg {
    padding: 14px 16px;
    font-size: var(--apple-text-md);
    border-radius: var(--apple-radius-lg);
}

/* Input States */
.form-input.error,
.form-input:invalid {
    border-color: var(--apple-red);
}

.form-input.error:focus {
    box-shadow: 0 0 0 4px var(--apple-red-light);
}

.form-input.success {
    border-color: var(--apple-green);
}

.form-help {
    font-size: var(--apple-text-xs);
    color: var(--apple-text-tertiary);
    margin-top: var(--apple-space-1);
}

.form-error {
    font-size: var(--apple-text-xs);
    color: var(--apple-red);
    margin-top: var(--apple-space-1);
}

/* Floating Labels */
.form-floating {
    position: relative;
}

.form-floating .form-label {
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: var(--apple-text-base);
    color: var(--apple-text-tertiary);
    pointer-events: none;
    transition: all var(--apple-transition-fast);
}

.form-floating .form-input:focus~.form-label,
.form-floating .form-input:not(:placeholder-shown)~.form-label {
    top: -8px;
    left: 12px;
    font-size: var(--apple-text-xs);
    background: var(--apple-surface);
    padding: 0 4px;
    color: var(--apple-blue);
}

/* Checkbox & Radio (iOS style) */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--apple-space-2);
    cursor: pointer;
}

.form-checkbox,
.form-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--apple-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--apple-transition-fast);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    position: relative;
}

.form-radio {
    border-radius: 50%;
}

.form-checkbox:checked,
.form-radio:checked {
    background: var(--apple-blue);
    border-color: var(--apple-blue);
}

.form-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-radio:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Toggle Switch (iOS style) */
.form-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
}

.form-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.form-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--apple-border);
    transition: 0.3s;
    border-radius: 31px;
}

.form-switch-slider:before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-switch input:checked+.form-switch-slider {
    background-color: var(--apple-green);
}

.form-switch input:checked+.form-switch-slider:before {
    transform: translateX(20px);
}

/* ========================================
   BADGES & CHIPS
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: var(--apple-text-xs);
    font-weight: var(--apple-weight-medium);
    border-radius: var(--apple-radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: var(--apple-blue-light);
    color: var(--apple-blue);
}

.badge-success {
    background: var(--apple-green-light);
    color: var(--apple-green);
}

.badge-warning {
    background: var(--apple-orange-light);
    color: var(--apple-orange);
}

.badge-error {
    background: var(--apple-red-light);
    color: var(--apple-red);
}

.badge-secondary {
    background: var(--apple-bg-tertiary);
    color: var(--apple-text-secondary);
    border: 1px solid var(--apple-border);
}

/* Status Badges */
.status-waiting {
    background: var(--apple-orange-light);
    color: var(--apple-orange);
}

.status-in_work {
    background: var(--apple-green-light);
    color: var(--apple-green);
}

.status-processing {
    background: var(--apple-purple-light);
    color: var(--apple-purple);
}

.status-await_refund {
    background: var(--apple-orange-light);
    color: var(--apple-orange);
}

.status-archived {
    background: var(--apple-bg-tertiary);
    color: var(--apple-text-tertiary);
    border: 1px solid var(--apple-border);
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    padding: var(--apple-space-4);
    border-radius: var(--apple-radius-md);
    margin-bottom: var(--apple-space-4);
    border-left: 4px solid;
    display: flex;
    align-items: start;
    gap: var(--apple-space-3);
}

.alert-info {
    background: var(--apple-blue-light);
    border-color: var(--apple-blue);
    color: var(--apple-text);
}

.alert-success {
    background: var(--apple-green-light);
    border-color: var(--apple-green);
    color: var(--apple-text);
}

.alert-warning {
    background: var(--apple-orange-light);
    border-color: var(--apple-orange);
    color: var(--apple-text);
}

.alert-error {
    background: var(--apple-red-light);
    border-color: var(--apple-red);
    color: var(--apple-text);
}

/* ========================================
   MODALS
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--apple-z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--apple-space-4);
    animation: fadeIn var(--apple-transition-base);
}

.modal {
    background: var(--apple-surface);
    border-radius: var(--apple-radius-xl);
    box-shadow: var(--apple-shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp var(--apple-transition-base);
}

.modal-header {
    padding: var(--apple-space-6);
    border-bottom: 1px solid var(--apple-divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--apple-text-xl);
    font-weight: var(--apple-weight-semibold);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--apple-bg-tertiary);
    color: var(--apple-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--apple-transition-fast);
}

.modal-close:hover {
    background: var(--apple-border-light);
}

.modal-body {
    padding: var(--apple-space-6);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--apple-space-6);
    border-top: 1px solid var(--apple-divider);
    display: flex;
    gap: var(--apple-space-3);
    justify-content: flex-end;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   TABLES
   ======================================== */

.table-container {
    overflow-x: auto;
    border-radius: var(--apple-radius-lg);
    background: var(--apple-surface);
    box-shadow: var(--apple-shadow-sm);
    margin-bottom: var(--apple-space-6);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: var(--apple-bg-tertiary);
}

thead th {
    padding: var(--apple-space-3) var(--apple-space-4);
    text-align: left;
    font-size: var(--apple-text-sm);
    font-weight: var(--apple-weight-semibold);
    color: var(--apple-text-secondary);
    border-bottom: 1px solid var(--apple-divider);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--apple-divider);
    transition: background var(--apple-transition-fast);
}

tbody tr:hover {
    background: var(--apple-bg-tertiary);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: var(--apple-space-3) var(--apple-space-4);
    font-size: var(--apple-text-base);
    color: var(--apple-text);
}

/* Mobile Table */
@media (max-width: 768px) {
    .table-responsive {
        display: block;
    }

    .table-responsive thead {
        display: none;
    }

    .table-responsive tr {
        display: block;
        margin-bottom: var(--apple-space-4);
        border: 1px solid var(--apple-divider);
        border-radius: var(--apple-radius-md);
    }

    .table-responsive td {
        display: flex;
        justify-content: space-between;
        padding: var(--apple-space-3);
        border-bottom: 1px solid var(--apple-divider);
    }

    .table-responsive td:last-child {
        border-bottom: none;
    }

    .table-responsive td::before {
        content: attr(data-label);
        font-weight: var(--apple-weight-semibold);
        color: var(--apple-text-secondary);
    }
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--apple-border-light);
    border-top-color: var(--apple-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}/**
 * Apple-style Layout & Navigation for CARD Wallet CRM
 * Responsive sidebar, header, mobile navigation
 */

/* ========================================
   MAIN LAYOUT
   ======================================== */

.layout {
    display: flex;
    min-height: 100vh;
    background: var(--apple-bg);
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    width: var(--apple-sidebar-width);
    height: 100vh;
    background: var(--apple-surface);
    border-right: 1px solid var(--apple-divider);
    position: fixed;
    left: 0;
    top: 0;
    z-index: var(--apple-z-sticky);
    display: flex;
    flex-direction: column;
    transition: transform var(--apple-transition-base);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: var(--apple-space-6) var(--apple-space-4);
    border-bottom: 1px solid var(--apple-divider);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--apple-space-3);
    text-decoration: none;
    color: var(--apple-text);
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--apple-radius-md);
    background: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-purple) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--apple-weight-bold);
    font-size: 18px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: var(--apple-text-md);
    font-weight: var(--apple-weight-semibold);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: var(--apple-text-xs);
    color: var(--apple-text-secondary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--apple-space-2) 0;
}

.nav-section {
    padding: var(--apple-space-4) 0;
}

.nav-section-title {
    padding: var(--apple-space-2) var(--apple-space-4);
    font-size: var(--apple-text-xs);
    font-weight: var(--apple-weight-semibold);
    color: var(--apple-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--apple-space-3);
    padding: var(--apple-space-2) var(--apple-space-4);
    margin: 0 var(--apple-space-2);
    color: var(--apple-text);
    text-decoration: none;
    border-radius: var(--apple-radius-md);
    font-size: var(--apple-text-sm);
    font-weight: var(--apple-weight-regular);
    transition: all var(--apple-transition-fast);
    position: relative;
}

.nav-link:hover {
    background: var(--apple-bg-tertiary);
    color: var(--apple-text);
    text-decoration: none;
}

.nav-link.active {
    background: var(--apple-blue-light);
    color: var(--apple-blue);
    font-weight: var(--apple-weight-medium);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--apple-blue);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: var(--apple-weight-semibold);
    background: var(--apple-red);
    color: white;
    border-radius: var(--apple-radius-full);
    min-width: 18px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--apple-space-4);
    border-top: 1px solid var(--apple-divider);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--apple-space-3);
    padding: var(--apple-space-2);
    border-radius: var(--apple-radius-md);
    cursor: pointer;
    transition: background var(--apple-transition-fast);
}

.sidebar-user:hover {
    background: var(--apple-bg-tertiary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--apple-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--apple-weight-semibold);
    font-size: var(--apple-text-sm);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: var(--apple-text-sm);
    font-weight: var(--apple-weight-medium);
    color: var(--apple-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: var(--apple-text-xs);
    color: var(--apple-text-secondary);
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.content {
    flex: 1;
    margin-left: var(--apple-sidebar-width);
    min-height: 100vh;
    padding: var(--apple-space-6) var(--apple-space-8);
    background: var(--apple-bg);
    transition: margin-left var(--apple-transition-base);
}

.content-header {
    margin-bottom: var(--apple-space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--apple-space-4);
}

.page-title {
    font-size: var(--apple-text-3xl);
    font-weight: var(--apple-weight-semibold);
    color: var(--apple-text);
    margin: 0;
}

.page-subtitle {
    font-size: var(--apple-text-base);
    color: var(--apple-text-secondary);
    margin-top: var(--apple-space-1);
}

.page-actions {
    display: flex;
    gap: var(--apple-space-2);
    align-items: center;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--apple-space-2);
    margin-bottom: var(--apple-space-4);
    font-size: var(--apple-text-sm);
}

.breadcrumb-item {
    color: var(--apple-text-secondary);
    text-decoration: none;
}

.breadcrumb-item:hover {
    color: var(--apple-blue);
}

.breadcrumb-separator {
    color: var(--apple-text-tertiary);
}

.breadcrumb-item.active {
    color: var(--apple-text);
    font-weight: var(--apple-weight-medium);
}

/* ========================================
   MOBILE HEADER/NAV
   ======================================== */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--apple-header-height);
    background: var(--apple-surface);
    border-bottom: 1px solid var(--apple-divider);
    z-index: var(--apple-z-fixed);
    padding: 0 var(--apple-space-4);
    align-items: center;
    justify-content: space-between;
}

.mobile-header-title {
    font-size: var(--apple-text-md);
    font-weight: var(--apple-weight-semibold);
    color: var(--apple-text);
    margin: 0;
}

.mobile-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--apple-radius-md);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--apple-transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--apple-bg-tertiary);
}

/* Hamburger Icon */
.hamburger {
    width: 24px;
    height: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    height: 2px;
    background: var(--apple-text);
    border-radius: 2px;
    transition: all var(--apple-transition-fast);
}

.mobile-menu-btn.active .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Backdrop */
.mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--apple-z-overlay);
    opacity: 0;
    transition: opacity var(--apple-transition-base);
}

.mobile-backdrop.active {
    opacity: 1;
}

/* ========================================
   RESPONSIVE (Mobile)
   ======================================== */

@media (max-width: 768px) {

    /* Show mobile header */
    .mobile-header {
        display: flex;
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: var(--apple-shadow-xl);
    }

    /* Show backdrop when sidebar is active */
    .mobile-backdrop {
        display: block;
    }

    /* Adjust content */
    .content {
        margin-left: 0;
        padding: calc(var(--apple-header-height) + var(--apple-space-4)) var(--apple-space-4) var(--apple-space-4);
    }

    .page-title {
        font-size: var(--apple-text-2xl);
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
        justify-content: stretch;
    }

    .page-actions .btn {
        flex: 1;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .content {
        padding: var(--apple-space-6);
    }
}

/* ========================================
   UTILITIES
   ======================================== */

/* Section Container */
.section {
    margin-bottom: var(--apple-space-8);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--apple-space-4);
}

.section-title {
    font-size: var(--apple-text-xl);
    font-weight: var(--apple-weight-semibold);
    color: var(--apple-text);
    margin: 0;
}

.section-actions {
    display: flex;
    gap: var(--apple-space-2);
}

/* Divider */
.divider {
    height: 1px;
    background: var(--apple-divider);
    margin: var(--apple-space-6) 0;
    border: none;
}

.divider-vertical {
    width: 1px;
    height: auto;
    background: var(--apple-divider);
    margin: 0 var(--apple-space-4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--apple-space-12) var(--apple-space-6);
}

.empty-state-icon {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: var(--apple-space-4);
}

.empty-state-title {
    font-size: var(--apple-text-xl);
    font-weight: var(--apple-weight-semibold);
    color: var(--apple-text);
    margin-bottom: var(--apple-space-2);
}

.empty-state-description {
    font-size: var(--apple-text-base);
    color: var(--apple-text-secondary);
    margin-bottom: var(--apple-space-6);
}/**
 * Apple Wallet-style Bank Cards for CARD Wallet CRM
 * Visual card design with flip animations и gradients
 */

/* ========================================
   CARD GRID
   ======================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--apple-space-6);
    margin-bottom: var(--apple-space-8);
}

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

/* ========================================
   BANK CARD
   ======================================== */

.bank-card {
    width: 100%;
    aspect-ratio: 1.586 / 1;
    /* Credit card ratio */
    border-radius: var(--apple-radius-xl);
    padding: var(--apple-space-6);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--apple-transition-base);
    box-shadow: var(--apple-shadow-lg);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bank-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--apple-shadow-xl);
}

.bank-card:active {
    transform: translateY(-4px) scale(1.01);
}

/* Card Gradients by Bank */
.bank-card.bank-privat {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.bank-card.bank-mono {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bank-card.bank-generic {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Card Variants */
.bank-card.variant-gold {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
}

.bank-card.variant-platinum {
    background: linear-gradient(135deg, #606c88 0%, #3f4c6b 100%);
}

.bank-card.variant-black {
    background: linear-gradient(135deg, #232526 0%, #414345 100%);
}

/* Card Background Pattern */
.bank-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Custom Background Image */
.bank-card.has-bg {
    background-size: cover;
    background-position: center;
}

.bank-card.has-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
}

/* ========================================
   CARD ELEMENTS
   ======================================== */

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.card-bank-logo {
    font-size: var(--apple-text-sm);
    font-weight: var(--apple-weight-bold);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.card-brand {
    width: 48px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--apple-weight-bold);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    padding: 4px 8px;
}

/* Visa/Mastercard logos */
.card-brand.visa {
    background: white;
    color: #1434cb;
}

.card-brand.mastercard {
    background: transparent;
    position: relative;
    width: 48px;
}

.card-brand.mastercard::before,
.card-brand.mastercard::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.card-brand.mastercard::before {
    background: #eb001b;
    left: 4px;
}

.card-brand.mastercard::after {
    background: #f79e1b;
    right: 4px;
    mix-blend-mode: multiply;
}

/* Card Chip */
.card-chip {
    width: 44px;
    height: 34px;
    background: linear-gradient(135deg, #d4af37 0%, #f9d976 50%, #d4af37 100%);
    border-radius: 6px;
    margin: var(--apple-space-4) 0;
    position: relative;
    z-index: 1;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-chip::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: repeating-linear-gradient(90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px);
    border-radius: 4px;
}

/* Card Number */
.card-number {
    font-family: var(--apple-font-mono);
    font-size: var(--apple-text-xl);
    font-weight: var(--apple-weight-medium);
    letter-spacing: 2px;
    margin: var(--apple-space-4) 0;
    position: relative;
    z-index: 1;
}

/* Card Footer */
.card-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 1;
}

.card-holder {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.card-value {
    font-size: var(--apple-text-sm);
    font-weight: var(--apple-weight-medium);
}

.card-expiry {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
}

/* ========================================
   CARD STATUS INDICATORS
   ======================================== */

.card-status-badge {
    position: absolute;
    top: var(--apple-space-4);
    right: var(--apple-space-4);
    padding: 4px 10px;
    border-radius: var(--apple-radius-full);
    font-size: 11px;
    font-weight: var(--apple-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    z-index: 2;
}

.card-status-badge.status-active {
    background: rgba(52, 199, 89, 0.9);
}

.card-status-badge.status-blocked {
    background: rgba(255, 59, 48, 0.9);
}

.card-status-badge.status-awaiting {
    background: rgba(255, 149, 0, 0.9);
}

/* ========================================
   CARD BALANCE OVERLAY
   ======================================== */

.card-balance-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--apple-space-4) var(--apple-space-6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.card-balance-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 2px;
}

.card-balance-amount {
    font-family: var(--apple-font-mono);
    font-size: var(--apple-text-lg);
    font-weight: var(--apple-weight-semibold);
}

/* ========================================
   CARD FLIP ANIMATION
   ======================================== */

.card-flip-container {
    perspective: 1000px;
    width: 100%;
    aspect-ratio: 1.586 / 1;
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip-container.flipped .card-flip-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--apple-radius-xl);
    box-shadow: var(--apple-shadow-lg);
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
    display: flex;
    flex-direction: column;
    padding: var(--apple-space-6);
}

.card-magnetic-strip {
    width: 100%;
    height: 48px;
    background: linear-gradient(90deg, #2c2c2c 0%, #1a1a1a 100%);
    margin: var(--apple-space-4) 0 var(--apple-space-6);
}

.card-cvv-box {
    background: white;
    color: #000;
    padding: var(--apple-space-3);
    border-radius: 4px;
    text-align: right;
    font-family: var(--apple-font-mono);
    font-size: var(--apple-text-sm);
    margin-bottom: var(--apple-space-4);
}

.card-back-info {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    margin-top: auto;
}

/* ========================================
   MINI CARD (List View)
   ======================================== */

.bank-card-mini {
    display: flex;
    align-items: center;
    gap: var(--apple-space-4);
    padding: var(--apple-space-4);
    background: var(--apple-surface);
    border: 1px solid var(--apple-divider);
    border-radius: var(--apple-radius-lg);
    transition: all var(--apple-transition-fast);
    cursor: pointer;
}

.bank-card-mini:hover {
    border-color: var(--apple-blue);
    box-shadow: var(--apple-shadow-sm);
    transform: translateY(-2px);
}

.card-mini-icon {
    width: 56px;
    height: 36px;
    border-radius: var(--apple-radius-sm);
    background: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-purple) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: var(--apple-weight-bold);
    flex-shrink: 0;
}

.card-mini-icon.privat {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.card-mini-icon.mono {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.card-mini-info {
    flex: 1;
    min-width: 0;
}

.card-mini-number {
    font-family: var(--apple-font-mono);
    font-size: var(--apple-text-sm);
    color: var(--apple-text);
    margin-bottom: 2px;
}

.card-mini-meta {
    font-size: var(--apple-text-xs);
    color: var(--apple-text-secondary);
}

.card-mini-balance {
    font-family: var(--apple-font-mono);
    font-size: var(--apple-text-md);
    font-weight: var(--apple-weight-semibold);
    color: var(--apple-text);
    text-align: right;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 480px) {
    .bank-card {
        padding: var(--apple-space-4);
    }

    .card-number {
        font-size: var(--apple-text-md);
        letter-spacing: 1px;
    }

    .card-balance-amount {
        font-size: var(--apple-text-base);
    }
}/**
 * Mobile & Responsive Enhancements
 * Additional styles for better mobile experience
 */

/* ========================================
   RESPONSIVE GRID IMPROVEMENTS
   ======================================== */

@media (max-width: 768px) {

    .grid.grid-cols-2,
    .grid.grid-cols-3,
    .grid.grid-cols-4 {
        grid-template-columns: 1fr;
        gap: var(--apple-space-4);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {

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

/* ========================================
   BETTER MOBILE FORMS
   ======================================== */

@media (max-width: 768px) {

    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px !important;
        /* Prevent zoom on iOS */
    }

    .btn {
        min-height: 44px;
        /* Touch-friendly */
    }
}

/* ========================================
   COMPACT CARD LISTS (Mobile)
   ======================================== */

.compact-list {
    display: flex;
    flex-direction: column;
    gap: var(--apple-space-2);
}

.compact-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--apple-space-3);
    background: var(--apple-surface);
    border: 1px solid var(--apple-divider);
    border-radius: var(--apple-radius-md);
    transition: all var(--apple-transition-fast);
}

.compact-list-item:hover {
    border-color: var(--apple-blue);
    transform: translateX(4px);
}

/* ========================================
   STAT CARDS
   ======================================== */

.stat-card {
    background: var(--apple-surface);
    border-radius: var(--apple-radius-lg);
    padding: var(--apple-space-4);
    text-align: center;
    border: 1px solid var(--apple-divider);
    transition: all var(--apple-transition-fast);
}

.stat-card:hover {
    border-color: var(--apple-blue);
    box-shadow: var(--apple-shadow-md);
    transform: translateY(-2px);
}

.stat-card-value {
    font-size: var(--apple-text-3xl);
    font-weight: var(--apple-weight-bold);
    color: var(--apple-text);
    margin: var(--apple-space-2) 0;
}

.stat-card-label {
    font-size: var(--apple-text-sm);
    color: var(--apple-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-icon {
    font-size: 32px;
    margin-bottom: var(--apple-space-2);
}

/* ========================================
   QUICK ACTIONS PANEL
   ======================================== */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--apple-space-3);
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--apple-space-2);
    padding: var(--apple-space-4);
    background: var(--apple-surface);
    border: 1px solid var(--apple-divider);
    border-radius: var(--apple-radius-lg);
    text-decoration: none;
    color: var(--apple-text);
    transition: all var(--apple-transition-fast);
    cursor: pointer;
}

.quick-action:hover {
    border-color: var(--apple-blue);
    background: var(--apple-blue-light);
    transform: translateY(-4px);
    box-shadow: var(--apple-shadow-md);
    text-decoration: none;
}

.quick-action-icon {
    font-size: 28px;
}

.quick-action-label {
    font-size: var(--apple-text-sm);
    font-weight: var(--apple-weight-medium);
    text-align: center;
}

/* ========================================
   TIMELINE (for activity feeds)
   ======================================== */

.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--apple-divider);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--apple-space-6);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--apple-blue);
    border: 2px solid var(--apple-surface);
    box-shadow: 0 0 0 2px var(--apple-blue-light);
}

.timeline-content {
    background: var(--apple-surface);
    padding: var(--apple-space-4);
    border-radius: var(--apple-radius-md);
    border: 1px solid var(--apple-divider);
}

.timeline-time {
    font-size: var(--apple-text-xs);
    color: var(--apple-text-tertiary);
    margin-top: var(--apple-space-2);
}

/* ========================================
   PROGRESS INDICATORS
   ======================================== */

.progress-bar {
    height: 8px;
    background: var(--apple-bg-tertiary);
    border-radius: var(--apple-radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--apple-blue), var(--apple-purple));
    border-radius: var(--apple-radius-full);
    transition: width 0.3s ease;
}

.progress-fill.success {
    background: var(--apple-green);
}

.progress-fill.warning {
    background: var(--apple-orange);
}

.progress-fill.danger {
    background: var(--apple-red);
}

/* ========================================
   INFO PANELS
   ======================================== */

.info-panel {
    background: var(--apple-bg-tertiary);
    border-left: 4px solid var(--apple-blue);
    padding: var(--apple-space-4);
    border-radius: var(--apple-radius-md);
    margin-bottom: var(--apple-space-4);
}

.info-panel.warning {
    border-left-color: var(--apple-orange);
    background: var(--apple-orange-light);
}

.info-panel.success {
    border-left-color: var(--apple-green);
    background: var(--apple-green-light);
}

.info-panel.error {
    border-left-color: var(--apple-red);
    background: var(--apple-red-light);
}

/* ========================================
   TABS
   ======================================== */

.tabs {
    display: flex;
    gap: var(--apple-space-1);
    border-bottom: 1px solid var(--apple-divider);
    margin-bottom: var(--apple-space-6);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: var(--apple-space-3) var(--apple-space-4);
    font-size: var(--apple-text-sm);
    font-weight: var(--apple-weight-medium);
    color: var(--apple-text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--apple-transition-fast);
    white-space: nowrap;
}

.tab:hover {
    color: var(--apple-text);
    background: var(--apple-bg-tertiary);
    border-radius: var(--apple-radius-sm) var(--apple-radius-sm) 0 0;
}

.tab.active {
    color: var(--apple-blue);
    border-bottom-color: var(--apple-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   FILTERS PANEL
   ======================================== */

.filters {
    background: var(--apple-surface);
    padding: var(--apple-space-4);
    border-radius: var(--apple-radius-lg);
    border: 1px solid var(--apple-divider);
    margin-bottom: var(--apple-space-6);
}

.filter-row {
    display: flex;
    gap: var(--apple-space-3);
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--apple-space-2);
    margin-top: var(--apple-space-6);
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 var(--apple-space-3);
    border-radius: var(--apple-radius-md);
    border: 1px solid var(--apple-divider);
    background: var(--apple-surface);
    color: var(--apple-text);
    font-size: var(--apple-text-sm);
    cursor: pointer;
    transition: all var(--apple-transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--apple-blue);
    background: var(--apple-blue-light);
}

.pagination-btn.active {
    background: var(--apple-blue);
    color: white;
    border-color: var(--apple-blue);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   DROPDOWN MENU
   ======================================== */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--apple-space-2);
    min-width: 200px;
    background: var(--apple-surface);
    border: 1px solid var(--apple-divider);
    border-radius: var(--apple-radius-lg);
    box-shadow: var(--apple-shadow-lg);
    padding: var(--apple-space-2);
    display: none;
    z-index: var(--apple-z-dropdown);
}

.dropdown.active .dropdown-menu {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--apple-space-2);
    padding: var(--apple-space-2) var(--apple-space-3);
    border-radius: var(--apple-radius-sm);
    color: var(--apple-text);
    text-decoration: none;
    font-size: var(--apple-text-sm);
    transition: background var(--apple-transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--apple-bg-tertiary);
    text-decoration: none;
}

.dropdown-divider {
    height: 1px;
    background: var(--apple-divider);
    margin: var(--apple-space-2) 0;
}

/* ========================================
   UTILITIES
   ======================================== */

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .show-mobile {
        display: none !important;
    }
}/**
 * Dark Mode Support
 * Simple toggle for light/dark themes
 */

/* Dark mode colors override */
[data-theme="dark"] {
    --apple-bg: #000000;
    --apple-bg-secondary: #1c1c1e;
    --apple-bg-tertiary: #2c2c2e;
    --apple-surface: #1c1c1e;
    --apple-text: #f5f5f7;
    --apple-text-secondary: #98989d;
    --apple-text-tertiary: #6e6e73;
    --apple-divider: #38383a;
    --apple-border: #38383a;
    --apple-border-light: #38383a;

    /* Adjust shadows for dark mode */
    --apple-shadow-sm: 0 1px 3px rgba(255, 255, 255, 0.05);
    --apple-shadow-md: 0 4px 12px rgba(255, 255, 255, 0.08);
    --apple-shadow-lg: 0 8px 24px rgba(255, 255, 255, 0.12);
    --apple-shadow-xl: 0 16px 48px rgba(255, 255, 255, 0.16);
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--apple-surface);
    border: 1px solid var(--apple-divider);
    box-shadow: var(--apple-shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all var(--apple-transition-base);
    z-index: var(--apple-z-fixed);
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--apple-shadow-xl);
}

.dark-mode-toggle:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .dark-mode-toggle {
        bottom: 80px;
        /* Above mobile nav if any */
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Hide toggle content based on theme */
[data-theme="light"] .dark-mode-toggle .moon-icon,
[data-theme="dark"] .dark-mode-toggle .sun-icon {
    display: none;
}/**
 * Legacy CSS Compatibility Layer
 * Maps old class names to new Apple design system classes
 */

/* Old page container classes */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--apple-space-6);
}

.page-header {
    font-size: var(--apple-text-3xl);
    font-weight: var(--apple-weight-bold);
    margin-bottom: var(--apple-space-4);
    color: var(--apple-text);
}

.page-subtitle {
    font-size: var(--apple-text-base);
    color: var(--apple-text-secondary);
    margin-bottom: var(--apple-space-6);
}

/* Old section styles */
.section-header {
    font-size: var(--apple-text-xl);
    font-weight: var(--apple-weight-semibold);
    margin-bottom: var(--apple-space-4);
    color: var(--apple-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-gap-sm {
    height: var(--apple-space-4);
}

.section-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--apple-space-6);
}

/* Old table styles */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--apple-surface);
    border-radius: var(--apple-radius-lg);
    overflow: hidden;
}

thead {
    background: var(--apple-bg-tertiary);
}

thead th {
    padding: var(--apple-space-3) var(--apple-space-4);
    text-align: left;
    font-weight: var(--apple-weight-semibold);
    font-size: var(--apple-text-sm);
    color: var(--apple-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--apple-divider);
}

tbody tr {
    border-bottom: 1px solid var(--apple-divider);
    transition: background var(--apple-transition-fast);
}

tbody tr:hover {
    background: var(--apple-bg-tertiary);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: var(--apple-space-3) var(--apple-space-4);
    font-size: var(--apple-text-sm);
    color: var(--apple-text);
}

/* Old form styles compatibility */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: var(--apple-space-2) var(--apple-space-3);
    border: 1px solid var(--apple-border);
    border-radius: var(--apple-radius-md);
    font-size: var(--apple-text-base);
    background: var(--apple-surface);
    color: var(--apple-text);
    transition: all var(--apple-transition-fast);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px var(--apple-blue-light);
}

/* Old label styles */
label {
    display: block;
    font-size: var(--apple-text-sm);
    font-weight: var(--apple-weight-medium);
    color: var(--apple-text);
    margin-bottom: var(--apple-space-1);
}

/* Old utilities */
.muted {
    color: var(--apple-text-secondary);
}

.num {
    font-family: var(--apple-font-mono);
    text-align: right;
}

.mono,
.td-mono {
    font-family: var(--apple-font-mono);
}

/* Old pill/tag styles */
.pill,
.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--apple-radius-full);
    font-size: var(--apple-text-xs);
    font-weight: var(--apple-weight-medium);
    background: var(--apple-bg-tertiary);
    color: var(--apple-text);
}

.pill.danger,
.tag.danger {
    background: var(--apple-red-light);
    color: var(--apple-red);
}

.pill.warn,
.tag.warn {
    background: var(--apple-orange-light);
    color: var(--apple-orange);
}

.pill.success,
.tag.success {
    background: var(--apple-green-light);
    color: var(--apple-green);
}

/* Old section row/list */
.section-list {
    display: flex;
    flex-direction: column;
    gap: var(--apple-space-2);
}

.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--apple-space-3);
    background: var(--apple-surface);
    border: 1px solid var(--apple-divider);
    border-radius: var(--apple-radius-md);
}

.section-row .left {
    flex: 1;
}

.section-row .right {
    text-align: right;
}

/* Form row compatibility */
.form-row {
    display: flex;
    gap: var(--apple-space-3);
    align-items: center;
    flex-wrap: wrap;
}

/* Old card compatibility */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--apple-space-6);
}

.tile {
    background: var(--apple-surface);
    border: 1px solid var(--apple-divider);
    border-radius: var(--apple-radius-lg);
    padding: var(--apple-space-4);
    transition: all var(--apple-transition-base);
}

.tile:hover {
    box-shadow: var(--apple-shadow-md);
    transform: translateY(-2px);
}

/* Ensure old button styles work */
.btn-xs {
    padding: 4px 8px;
    font-size: var(--apple-text-xs);
    min-height: auto;
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--apple-text-sm);
    min-height: auto;
}

/* Old status badges */
.status-waiting,
.status-in_work,
.status-processing,
.status-await,
.status-archived {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--apple-radius-full);
    font-size: var(--apple-text-xs);
    font-weight: var(--apple-weight-medium);
}

.status-waiting {
    background: var(--apple-bg-tertiary);
    color: var(--apple-text-secondary);
}

.status-in_work {
    background: var(--apple-green-light);
    color: var(--apple-green);
}

.status-processing {
    background: var(--apple-orange-light);
    color: var(--apple-orange);
}

.status-await {
    background: var(--apple-yellow-light);
    color: var(--apple-yellow);
}

.status-archived {
    background: var(--apple-bg-tertiary);
    color: var(--apple-text-tertiary);
    opacity: 0.6;
}

/* Responsive table fixes */
@media (max-width: 768px) {
    .page-container {
        padding: var(--apple-space-4);
    }

    .section-split {
        grid-template-columns: 1fr;
    }

    .tiles-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: var(--apple-text-xs);
    }

    thead th,
    tbody td {
        padding: var(--apple-space-2) var(--apple-space-2);
    }
}/**
 * MAC CSS Variables Compatibility
 * Aliases --mac-* variables to --apple-* for legacy pages
 */

:root {
    /* Colors */
    --mac-blue: var(--apple-blue);
    --mac-blue-light: var(--apple-blue-light);
    --mac-green: var(--apple-green);
    --mac-green-light: var(--apple-green-light);
    --mac-orange: var(--apple-orange);
    --mac-orange-light: var(--apple-orange-light);
    --mac-red: var(--apple-red);
    --mac-red-light: var(--apple-red-light);
    --mac-yellow: var(--apple-yellow);
    --mac-yellow-light: var(--apple-yellow-light);
    --mac-purple: var(--apple-purple);
    --mac-purple-light: var(--apple-purple-light);

    /* Backgrounds */
    --mac-bg: var(--apple-bg);
    --mac-bg-secondary: var(--apple-bg-secondary);
    --mac-bg-tertiary: var(--apple-bg-tertiary);
    --mac-surface: var(--apple-surface);

    /* Text */
    --mac-text: var(--apple-text);
    --mac-text-secondary: var(--apple-text-secondary);
    --mac-text-tertiary: var(--apple-text-tertiary);

    /* Borders */
    --mac-border: var(--apple-border);
    --mac-border-light: var(--apple-border-light);
    --mac-divider: var(--apple-divider);

    /* Spacing */
    --mac-space-xs: var(--apple-space-1);
    --mac-space-sm: var(--apple-space-2);
    --mac-space-md: var(--apple-space-4);
    --mac-space-lg: var(--apple-space-6);
    --mac-space-xl: var(--apple-space-8);

    /* Font sizes */
    --mac-font-size-xs: var(--apple-text-xs);
    --mac-font-size-sm: var(--apple-text-sm);
    --mac-font-size-base: var(--apple-text-base);
    --mac-font-size-lg: var(--apple-text-lg);
    --mac-font-size-xl: var(--apple-text-xl);

    /* Font weights */
    --mac-font-weight-normal: var(--apple-weight-regular);
    --mac-font-weight-medium: var(--apple-weight-medium);
    --mac-font-weight-semibold: var(--apple-weight-semibold);
    --mac-font-weight-bold: var(--apple-weight-bold);

    /* Font family */
    --mac-font-mono: var(--apple-font-mono);

    /* Border radius */
    --mac-radius-sm: var(--apple-radius-sm);
    --mac-radius-md: var(--apple-radius-md);
    --mac-radius-lg: var(--apple-radius-lg);
    --mac-radius-full: var(--apple-radius-full);

    /* Shadows */
    --mac-shadow-sm: var(--apple-shadow-sm);
    --mac-shadow-md: var(--apple-shadow-md);
    --mac-shadow-lg: var(--apple-shadow-lg);

    /* Transitions */
    --mac-transition-fast: var(--apple-transition-fast);
    --mac-transition-base: var(--apple-transition-base);
}

/* Fix table overflows */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--apple-radius-lg);
}

.table-wrap table {
    min-width: 100%;
}

/* Form grid improvements */
.form-grid {
    display: grid;
    gap: var(--apple-space-3);
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
}

/* iOS toggle switch */
.ios-toggle {
    position: relative;
    appearance: none;
    width: 51px;
    height: 31px;
    background: var(--apple-bg-tertiary);
    border-radius: var(--apple-radius-full);
    cursor: pointer;
    transition: background var(--apple-transition-base);
    border: none;
    outline: none;
}

.ios-toggle::before {
    content: '';
    position: absolute;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform var(--apple-transition-base);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ios-toggle:checked {
    background: var(--apple-green);
}

.ios-toggle:checked::before {
    transform: translateX(20px);
}

/* Toggle wrapper */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: var(--apple-space-2);
}

/* Dropdown menu fixes */
.dropdown-menu {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--apple-text);
    padding: var(--apple-space-2);
    border-radius: var(--apple-radius-md);
    transition: background var(--apple-transition-fast);
}

.dropdown-toggle:hover {
    background: var(--apple-bg-tertiary);
}

.dropdown-menu-content {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--apple-surface);
    border: 1px solid var(--apple-divider);
    border-radius: var(--apple-radius-lg);
    box-shadow: var(--apple-shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--apple-transition-fast);
    z-index: 1000;
    overflow: hidden;
}

.dropdown-menu.open .dropdown-menu-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-content a,
.dropdown-menu-content button {
    display: block;
    width: 100%;
    padding: var(--apple-space-2) var(--apple-space-4);
    text-align: left;
    background: none;
    border: none;
    color: var(--apple-text);
    font-size: var(--apple-text-sm);
    cursor: pointer;
    transition: background var(--apple-transition-fast);
    text-decoration: none;
}

.dropdown-menu-content a:hover,
.dropdown-menu-content button:hover {
    background: var(--apple-bg-tertiary);
}

/* Modal improvements */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: var(--apple-space-4);
}

.modal.show {
    display: flex;
}

.modal-body {
    background: var(--apple-surface);
    border-radius: var(--apple-radius-xl);
    box-shadow: var(--apple-shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: var(--apple-space-4) var(--apple-space-6);
    border-bottom: 1px solid var(--apple-divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--apple-text-xl);
    font-weight: var(--apple-weight-semibold);
    color: var(--apple-text);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--apple-text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--apple-radius-md);
    transition: all var(--apple-transition-fast);
}

.modal-close:hover {
    background: var(--apple-bg-tertiary);
    color: var(--apple-text);
}

.modal-footer {
    padding: var(--apple-space-4) var(--apple-space-6);
    border-top: 1px solid var(--apple-divider);
    display: flex;
    gap: var(--apple-space-3);
    justify-content: flex-end;
}

/* Ensure responsiveness for legacy tables */
@media (max-width: 768px) {
    .table-wrap {
        margin: 0 calc(var(--apple-space-4) * -1);
        border-radius: 0;
    }

    .modal-body {
        border-radius: 0;
        max-height: 100vh;
        padding: 0;
    }

    .modal {
        padding: 0;
    }
}