/* Plaza Management ERP - Design System */
@font-face {
  font-family: 'Peyda';
  src: url('../font/Peyda-Thin.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Peyda';
  src: url('../font/peyda-extralight.ttf') format('truetype');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Peyda';
  src: url('../font/peyda-light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Peyda';
  src: url('../font/Peyda-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Peyda';
  src: url('../font/Peyda-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Peyda';
  src: url('../font/Peyda-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Peyda';
  src: url('../font/Peyda-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Peyda';
  src: url('../font/Peyda-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Peyda';
  src: url('../font/Peyda-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colors */
  --color-primary: #1e3a5f;
  --color-primary-dark: #152a45;
  --color-primary-light: #2d4f7c;
  --color-accent-blue: #3b82f6;
  --color-accent-teal: #14b8a6;
  --color-accent-green: #22c55e;
  --color-accent-orange: #f97316;
  --color-accent-purple: #8b5cf6;
  --color-accent-red: #ef4444;
  --color-accent-yellow: #eab308;

  --color-bg: #f4f6f9;
  --color-bg-card: #ffffff;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-sidebar-text: #cbd5e1;
  --color-sidebar-active: #ffffff;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);

  /* Typography */
  --font-family: 'Peyda', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --transition: 0.25s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* RTL Support */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .sidebar-nav .nav-item svg {
  margin-right: 0;
  margin-left: var(--space-md);
}

[dir="rtl"] .search-box svg {
  left: auto;
  right: 12px;
}

[dir="rtl"] .search-box input {
  padding-left: var(--space-md);
  padding-right: 40px;
}

[dir="rtl"] .table th,
[dir="rtl"] .table td {
  text-align: right;
}

[dir="rtl"] .detail-panel {
  border-left: none;
  border-right: 1px solid var(--color-border);
}

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

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin var(--transition);
}

.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-collapsed);
}

[dir="rtl"] .main-wrapper {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

[dir="rtl"].sidebar-collapsed .main-wrapper,
[dir="rtl"] .sidebar-collapsed .main-wrapper {
  margin-right: var(--sidebar-collapsed);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-primary);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition), width var(--transition);
  overflow: hidden;
}

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
}

.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: var(--header-height);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-teal));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo svg {
  width: 22px;
  height: 22px;
  color: white;
}

.sidebar-brand {
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand h1 {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.sidebar-brand span {
  font-size: var(--font-size-xs);
  color: var(--color-sidebar-text);
}

.sidebar-collapsed .sidebar-brand {
  opacity: 0;
  width: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-sm);
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-section-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.35);
  padding: var(--space-md) var(--space-md) var(--space-sm);
}

.sidebar-collapsed .nav-section-label {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-sidebar-text);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
}

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

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-sidebar-active);
}

.nav-item.nav-item-navigating {
  background: rgba(59, 130, 246, 0.22);
  color: white;
  transform: translateX(4px) scale(0.98);
}

[dir="rtl"] .nav-item.nav-item-navigating {
  transform: translateX(-4px) scale(0.98);
}

.sidebar-collapsed .nav-item span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-sidebar-text);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-toggle-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.sidebar-collapsed .sidebar-toggle-btn svg {
  transform: rotate(180deg);
}

[dir="rtl"] .sidebar-toggle-btn svg {
  transform: rotate(180deg);
}

[dir="rtl"] .sidebar-collapsed .sidebar-toggle-btn svg {
  transform: rotate(0deg);
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

/* Top Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  height: var(--header-height);
  padding: 0 var(--space-lg);
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

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

.mobile-menu-btn:hover {
  background: var(--color-border-light);
}

.page-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
}

.page-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.search-box {
  position: relative;
  width: 280px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
}

.search-box input {
  width: 100%;
  padding: 9px var(--space-md) 9px 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input:focus {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.search-box input::placeholder {
  color: var(--color-text-muted);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  padding: 5px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.lang-btn.active {
  background: var(--color-primary);
  color: white;
}

.lang-btn:hover:not(.active) {
  color: var(--color-text);
}

/* Notification */
.notification-wrapper {
  position: relative;
}

.notification-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  position: relative;
}

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

.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--color-accent-red);
  border-radius: 50%;
  border: 2px solid white;
}

[dir="rtl"] .notification-badge {
  right: auto;
  left: 6px;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-height: 420px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
  z-index: 200;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

[dir="rtl"] .notification-dropdown {
  right: auto;
  left: 0;
  transform-origin: top left;
}

.notification-dropdown.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.notification-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-accent-blue);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.notification-dropdown-body {
  max-height: 300px;
  overflow-y: auto;
}

.notification-dropdown-body::-webkit-scrollbar {
  width: 6px;
}

.notification-dropdown-body::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 6px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: background var(--transition);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: rgba(59, 130, 246, 0.04);
}

.notification-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-item-icon svg {
  width: 16px;
  height: 16px;
}

.notification-item-icon.warning {
  background: rgba(234, 179, 8, 0.14);
  color: var(--color-accent-yellow);
}

.notification-item-icon.danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-accent-red);
}

.notification-item-icon.info {
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-accent-blue);
}

.notification-item-content {
  flex: 1;
  min-width: 0;
}

.notification-item p {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 2px;
}

.notification-item .notification-message {
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.notification-item span {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 6px;
}

.notification-dropdown-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg);
  text-align: center;
}

.notification-dropdown-footer button {
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-accent-blue);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.notification-dropdown-footer button:hover {
  background: rgba(59, 130, 246, 0.14);
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}

.user-profile:hover {
  background: var(--color-border-light);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-purple), var(--color-accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.user-info {
  line-height: 1.3;
}

.user-info .name {
  font-size: var(--font-size-sm);
  font-weight: 600;
}

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

/* Page Content */
.page-content {
  flex: 1;
  padding: var(--space-lg);
  will-change: opacity, transform;
}

.page-header-meta {
  will-change: opacity, transform;
}

/* Page navigation progress */
.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 10001;
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
  opacity: 0;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  pointer-events: none;
}

body.page-transitioning .page-progress {
  opacity: 1;
  width: 62%;
}

body.page-loading .page-progress {
  opacity: 1;
  width: 100%;
}

/* Page exit animation */
.page-content.is-exiting {
  animation: pageContentOut 0.36s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

.page-header-meta.is-exiting {
  animation: pageHeaderOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageContentOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(0.985);
    filter: blur(3px);
  }
}

@keyframes pageHeaderOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Page enter animation */
.page-content.is-entering > * {
  opacity: 0;
  animation: pageBlockIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--enter-i, 0) * 70ms + 90ms);
}

.page-header-meta.is-entering {
  animation: pageHeaderIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.page-content.is-pre-enter > * {
  opacity: 0;
  transform: translateY(22px);
}

.page-header-meta.is-pre-enter {
  opacity: 0;
  transform: translateY(14px);
}

@keyframes pageBlockIn {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  70% {
    transform: translateY(-2px) scale(1.002);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pageHeaderIn {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-content.is-exiting,
  .page-content.is-entering > *,
  .page-header-meta.is-exiting,
  .page-header-meta.is-entering,
  .nav-item.nav-item-navigating {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
  }

  .page-progress {
    display: none;
  }
}

/* Cards */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.card-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.kpi-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 24px;
  height: 24px;
}

.kpi-icon.blue { background: rgba(59, 130, 246, 0.12); color: var(--color-accent-blue); }
.kpi-icon.teal { background: rgba(20, 184, 166, 0.12); color: var(--color-accent-teal); }
.kpi-icon.green { background: rgba(34, 197, 94, 0.12); color: var(--color-accent-green); }
.kpi-icon.orange { background: rgba(249, 115, 22, 0.12); color: var(--color-accent-orange); }
.kpi-icon.purple { background: rgba(139, 92, 246, 0.12); color: var(--color-accent-purple); }
.kpi-icon.red { background: rgba(239, 68, 68, 0.12); color: var(--color-accent-red); }
.kpi-icon.yellow { background: rgba(234, 179, 8, 0.12); color: var(--color-accent-yellow); }

.kpi-content {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.kpi-change {
  font-size: var(--font-size-xs);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-change.positive { color: var(--color-accent-green); }
.kpi-change.negative { color: var(--color-accent-red); }

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-lg);
}

.grid-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

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

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

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

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

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

.btn-accent:hover {
  background: #2563eb;
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-size-xs);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-group {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.badge-warning { background: rgba(234, 179, 8, 0.12); color: #ca8a04; }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.badge-info { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.badge-purple { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.badge-neutral { background: rgba(100, 116, 139, 0.12); color: #475569; }
.badge-teal { background: rgba(20, 184, 166, 0.12); color: #0d9488; }

.badge-priority-high { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.badge-priority-medium { background: rgba(249, 115, 22, 0.12); color: #ea580c; }
.badge-priority-low { background: rgba(34, 197, 94, 0.12); color: #16a34a; }

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table th {
  text-align: left;
  padding: 12px var(--space-md);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table td {
  padding: 14px var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.table tbody tr {
  transition: background var(--transition);
}

.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.03);
}

.table tbody tr.selected {
  background: rgba(59, 130, 246, 0.08);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--color-text);
}

.tab-btn.active {
  color: var(--color-accent-blue);
  border-bottom-color: var(--color-accent-blue);
  font-weight: 600;
}

.tab-panel {
  display: none;
}

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

/* Filters */
.filters-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.filter-group label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* Custom Dropdown */
.custom-dropdown {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.custom-dropdown-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.custom-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  min-width: 168px;
  padding: 10px 12px 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[dir="rtl"] .custom-dropdown-trigger {
  padding: 10px 14px 10px 12px;
}

.custom-dropdown-label {
  flex: 1;
  min-width: 0;
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-dropdown-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-text-secondary);
  flex-shrink: 0;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, color 0.2s ease;
}

.custom-dropdown-chevron svg {
  width: 14px;
  height: 14px;
}

.custom-dropdown-trigger:hover {
  border-color: rgba(59, 130, 246, 0.35);
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.custom-dropdown-trigger:hover .custom-dropdown-chevron {
  background: rgba(59, 130, 246, 0.14);
  color: var(--color-accent-blue);
}

.custom-dropdown.open .custom-dropdown-trigger {
  border-color: var(--color-accent-blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), var(--shadow-md);
  transform: scale(1.01);
}

.custom-dropdown.open .custom-dropdown-chevron {
  transform: rotate(180deg);
  background: rgba(59, 130, 246, 0.16);
  color: var(--color-accent-blue);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  z-index: 6000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px) scale(0.94);
  transform-origin: top center;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.custom-dropdown-menu.is-portaled {
  position: fixed;
  top: auto;
  left: auto;
  width: auto;
}

.custom-dropdown.open-up .custom-dropdown-menu,
.custom-dropdown-menu.is-portaled.open-up {
  transform-origin: bottom center;
  transform: translateY(10px) scale(0.94);
}

.custom-dropdown.open .custom-dropdown-menu,
.custom-dropdown-menu.is-portaled.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: dropdownMenuExpand 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.custom-dropdown.open.open-up .custom-dropdown-menu,
.custom-dropdown-menu.is-portaled.is-open.open-up {
  animation: dropdownMenuExpandUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes dropdownMenuExpand {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.94);
  }
  70% {
    transform: translateY(2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropdownMenuExpandUp {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  70% {
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.custom-dropdown-menu-inner {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-lg);
  box-shadow:
    0 22px 45px rgba(15, 23, 42, 0.14),
    0 8px 16px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}

.custom-dropdown-menu-inner::-webkit-scrollbar {
  width: 5px;
}

.custom-dropdown-menu-inner::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 6px;
}

.custom-dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.custom-dropdown.open .custom-dropdown-option,
.custom-dropdown-menu.is-open .custom-dropdown-option {
  animation: dropdownOptionReveal 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--option-i) * 40ms + 50ms);
}

@keyframes dropdownOptionReveal {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.custom-dropdown-option-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-dropdown-option-check {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-accent-blue);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.custom-dropdown-option-check svg {
  width: 11px;
  height: 11px;
}

.custom-dropdown-option:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-accent-blue);
  transform: translateX(2px);
}

[dir="rtl"] .custom-dropdown-option:hover {
  transform: translateX(-2px);
}

.custom-dropdown-option.selected {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-accent-blue);
  font-weight: 600;
}

.custom-dropdown-option.selected .custom-dropdown-option-check {
  opacity: 1;
  transform: scale(1);
}

.custom-dropdown-option:active {
  transform: scale(0.98);
}

.custom-dropdown-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Filter bar pill dropdowns */
.filters-bar .filter-group {
  padding: 6px 10px 6px 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform 0.2s ease;
}

.filters-bar .filter-group:hover {
  border-color: rgba(59, 130, 246, 0.25);
  box-shadow: var(--shadow-md);
}

.filters-bar .filter-group:has(.custom-dropdown.open) {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow-md);
}

.filters-bar .filter-group .custom-dropdown-trigger {
  min-width: 140px;
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: var(--radius-full);
  transform: none;
}

.filters-bar .filter-group .custom-dropdown-trigger:hover,
.filters-bar .filter-group .custom-dropdown.open .custom-dropdown-trigger {
  border: none;
  box-shadow: none;
  transform: none;
}

.filters-bar .filter-group .custom-dropdown-chevron {
  width: 24px;
  height: 24px;
}

.filters-bar .filter-group .custom-dropdown.open .custom-dropdown-trigger {
  box-shadow: none;
}

/* Modal & form dropdowns */
.form-group .custom-dropdown {
  width: 100%;
}

.form-group .custom-dropdown-trigger {
  width: 100%;
  min-width: 0;
}

.modal-body .custom-dropdown {
  width: 100%;
}

/* Legacy native select classes (hidden when enhanced) */
.filter-select,
select.form-control {
  appearance: none;
  -webkit-appearance: none;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

.pagination-info {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.pagination-controls {
  display: flex;
  gap: 4px;
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
}

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

.page-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

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

/* Chart Placeholders */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-chart {
  width: 180px;
  height: 180px;
  position: relative;
}

.donut-chart svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center .value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
}

.donut-center .label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 200px;
  padding: var(--space-md) 0;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.bar {
  width: 100%;
  max-width: 48px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--color-accent-blue);
  transition: height 0.8s ease;
  animation: barGrow 0.8s ease forwards;
}

@keyframes barGrow {
  from { transform: scaleY(0); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}

.bar-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-align: center;
}

.line-chart-placeholder {
  width: 100%;
  height: 200px;
}

.line-chart-placeholder svg {
  width: 100%;
  height: 100%;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
  transition: all var(--transition);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

.quick-action-btn:hover {
  border-color: var(--color-accent-blue);
  background: rgba(59, 130, 246, 0.04);
  color: var(--color-accent-blue);
}

.quick-action-btn svg {
  width: 18px;
  height: 18px;
  color: var(--color-accent-blue);
}

/* Alerts Panel */
.alert-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-icon.warning { background: rgba(234, 179, 8, 0.12); color: var(--color-accent-yellow); }
.alert-icon.danger { background: rgba(239, 68, 68, 0.12); color: var(--color-accent-red); }
.alert-icon.info { background: rgba(59, 130, 246, 0.12); color: var(--color-accent-blue); }

.alert-content h4 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: 2px;
}

.alert-content p {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.alert-time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Floor Grid / Unit Map */
.status-legend {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.legend-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.legend-badge .dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.dot-occupied { background: var(--color-accent-green); }
.dot-available { background: var(--color-accent-blue); }
.dot-reserved { background: var(--color-accent-purple); }
.dot-maintenance { background: var(--color-accent-orange); }
.dot-vacant { background: var(--color-text-muted); }

.floor-section {
  margin-bottom: var(--space-xl);
}

.floor-section-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--space-sm);
}

.unit-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}

.unit-cell:hover {
  transform: scale(1.05);
}

.unit-cell.selected {
  border-color: var(--color-text);
  box-shadow: var(--shadow-md);
}

.unit-cell.occupied { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.unit-cell.available { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.unit-cell.reserved { background: rgba(139, 92, 246, 0.15); color: #7c3aed; }
.unit-cell.maintenance { background: rgba(249, 115, 22, 0.15); color: #ea580c; }
.unit-cell.vacant { background: rgba(148, 163, 184, 0.15); color: #64748b; }

/* Detail Panel */
.page-with-panel {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-lg);
}

.detail-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
  max-height: calc(100vh - var(--header-height) - var(--space-lg) * 2);
  overflow-y: auto;
}

.detail-panel.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

.detail-field {
  margin-bottom: var(--space-md);
}

.detail-field label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-field .value {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

.detail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.detail-panel-header h3 {
  font-size: var(--font-size-md);
  font-weight: 600;
}

/* Timeline */
.timeline {
  margin-top: var(--space-lg);
}

.timeline-item {
  display: flex;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

[dir="rtl"] .timeline-item::before {
  left: auto;
  right: 11px;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent-blue);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.timeline-dot svg {
  width: 12px;
  height: 12px;
  color: white;
}

.timeline-content h5 {
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.timeline-content p {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.timeline-content .time {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Summary Cards (Billing) */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.summary-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.summary-card .label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.summary-card .amount {
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.summary-card.total .amount { color: var(--color-accent-blue); }
.summary-card.paid .amount { color: var(--color-accent-green); }
.summary-card.pending .amount { color: var(--color-accent-orange); }
.summary-card.overdue .amount { color: var(--color-accent-red); }

/* Invoice Summary Panel */
.invoice-summary-panel {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.invoice-summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  font-size: var(--font-size-sm);
}

.invoice-summary-row.total {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-sm);
  padding-top: var(--space-md);
  font-weight: 700;
  font-size: var(--font-size-md);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: var(--space-lg);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h2 {
  font-size: var(--font-size-lg);
  font-weight: 700;
}

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

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

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
}

[dir="rtl"] .modal-footer {
  justify-content: flex-start;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* Reports */
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.analytics-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.analytics-card {
  text-align: center;
  padding: var(--space-lg);
}

.analytics-card .metric-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: 4px;
}

.analytics-card .metric-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.analytics-card .metric-change {
  font-size: var(--font-size-xs);
  margin-top: var(--space-sm);
}

/* Placeholder Page */
.placeholder-content {
  text-align: center;
  padding: var(--space-2xl);
}

.placeholder-content svg {
  width: 64px;
  height: 64px;
  color: var(--color-text-muted);
  margin: 0 auto var(--space-lg);
}

.placeholder-content h2 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

.placeholder-content p {
  color: var(--color-text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 999;
}

.sidebar-overlay.open {
  display: block;
}

/* Utility */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gap-sm { gap: var(--space-sm); }
.hidden { display: none !important; }

/* Category KPI - 4 col on category pages */
.category-kpi {
  grid-template-columns: repeat(4, 1fr);
}

/* Staff Grid */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.staff-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition);
}

.staff-card:hover {
  box-shadow: var(--shadow-md);
}

.staff-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: var(--font-size-sm);
  flex-shrink: 0;
}

.staff-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.staff-card-info strong {
  font-size: var(--font-size-sm);
}

.staff-card-info span {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

/* Shift Cards */
.staff-shift-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.shift-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.shift-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.shift-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shift-info strong {
  font-size: var(--font-size-sm);
}

.shift-info span {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

/* Settings Layout */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.settings-nav {
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
}

.settings-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px var(--space-md);
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

[dir="rtl"] .settings-nav-btn {
  text-align: right;
}

.settings-nav-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.settings-nav-btn.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-accent-blue);
  font-weight: 600;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.toggle-row:last-of-type {
  border-bottom: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle-switch.on .toggle-slider,
.toggle-switch input:checked + .toggle-slider {
  background: var(--color-accent-blue);
}

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

[dir="rtl"] .toggle-switch.on .toggle-slider::before,
[dir="rtl"] .toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(-20px);
}

/* Parking grid cells */
.parking-cell {
  font-size: var(--font-size-xs);
}

.parking-grid {
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
}

/* Toast notification */
.app-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  padding: 14px 20px;
  background: var(--color-text);
  color: white;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 360px;
}

[dir="rtl"] .app-toast {
  right: auto;
  left: 24px;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-toast.success {
  background: #16a34a;
}

