:root {
  /* Primitive Color Tokens */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-cream-100: rgba(255, 255, 253, 1);
  --color-gray-50: rgba(250, 250, 250, 1);
  --color-gray-100: rgba(245, 245, 245, 1);
  --color-gray-200: rgba(229, 229, 229, 1);
  --color-gray-300: rgba(212, 212, 212, 1);
  --color-gray-400: rgba(163, 163, 163, 1);
  --color-gray-500: rgba(115, 115, 115, 1);
  --color-gray-600: rgba(82, 82, 82, 1);
  --color-gray-700: rgba(64, 64, 64, 1);
  --color-gray-800: rgba(38, 38, 38, 1);
  --color-gray-900: rgba(23, 23, 23, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-brown-600: rgba(94, 82, 64, 1);
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(38, 40, 40, 1);
  --color-slate-900: rgba(19, 52, 59, 1);
  
  /* Brand Colors - Orange */
  --color-orange-50: rgba(255, 247, 237, 1);
  --color-orange-100: rgba(255, 237, 213, 1);
  --color-orange-200: rgba(254, 215, 170, 1);
  --color-orange-300: rgba(253, 186, 116, 1);
  --color-orange-400: rgba(251, 146, 60, 1);
  --color-orange-500: rgba(219, 139, 55, 1);
  --color-orange-600: rgba(199, 122, 46, 1);
  --color-orange-700: rgba(179, 105, 37, 1);
  --color-orange-800: rgba(154, 88, 28, 1);
  --color-orange-900: rgba(124, 69, 20, 1);
  
  /* Status Colors */
  --color-red-400: rgba(255, 84, 89, 1);
  --color-red-500: rgba(239, 68, 68, 1);
  --color-red-600: rgba(220, 38, 38, 1);
  --color-green-400: rgba(74, 222, 128, 1);
  --color-green-500: rgba(34, 197, 94, 1);
  --color-green-600: rgba(22, 163, 74, 1);
  --color-blue-400: rgba(96, 165, 250, 1);
  --color-blue-500: rgba(59, 130, 246, 1);
  --color-blue-600: rgba(37, 99, 235, 1);
  --color-yellow-400: rgba(250, 204, 21, 1);
  --color-yellow-500: rgba(234, 179, 8, 1);
  --color-yellow-600: rgba(202, 138, 4, 1);

  /* RGB versions for opacity control */
  --color-orange-500-rgb: 219, 139, 55;
  --color-orange-600-rgb: 199, 122, 46;
  --color-gray-900-rgb: 23, 23, 23;
  --color-gray-600-rgb: 82, 82, 82;
  --color-gray-500-rgb: 115, 115, 115;
  --color-red-500-rgb: 239, 68, 68;
  --color-green-500-rgb: 34, 197, 94;
  --color-blue-500-rgb: 59, 130, 246;
  --color-yellow-500-rgb: 234, 179, 8;

  /* Background color tokens (Light Mode) */
  --color-bg-1: rgba(115, 115, 115, 0.06);
  --color-bg-2: rgba(219, 139, 55, 0.08);
  --color-bg-3: rgba(34, 197, 94, 0.08);
  --color-bg-4: rgba(239, 68, 68, 0.08);
  --color-bg-5: rgba(147, 51, 234, 0.08);
  --color-bg-6: rgba(249, 115, 22, 0.08);
  --color-bg-7: rgba(236, 72, 153, 0.08);
  --color-bg-8: rgba(6, 182, 212, 0.08);

  /* Semantic Color Tokens (Light Mode) */
  --color-background: #fafafa;
  --color-surface: #ffffff;
  --color-text: #171717;
  --color-text-secondary: #525252;
  --color-text-tertiary: #737373;
  --color-text-light: #a3a3a3;
  --color-text-lighter: #d4d4d4;
  
  /* Brand Primary - Orange */
  --color-primary: #db8b37;
  --color-primary-hover: #c77a2e;
  --color-primary-active: #b36925;
  --color-primary-light: rgba(219, 139, 55, 0.1);
  --color-primary-lighter: rgba(219, 139, 55, 0.05);
  
  --color-secondary: rgba(219, 139, 55, 0.1);
  --color-secondary-hover: rgba(219, 139, 55, 0.15);
  --color-secondary-active: rgba(219, 139, 55, 0.2);
  
  --color-border: #e5e5e5;
  --color-border-light: #f5f5f5;
  --color-border-dark: #d4d4d4;
  
  --color-btn-primary-text: #ffffff;
  --color-card-border: #e5e5e5;
  --color-card-border-inner: #f5f5f5;
  
  --color-error: #ef4444;
  --color-success: #22c55e;
  --color-warning: #eab308;
  --color-info: #3b82f6;
  
  --color-focus-ring: rgba(219, 139, 55, 0.3);
  --color-select-caret: rgba(23, 23, 23, 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.1;
  --status-border-opacity: 0.2;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23171717' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 34, 197, 94;
  --color-error-rgb: 239, 68, 68;
  --color-warning-rgb: 234, 179, 8;
  --color-info-rgb: 59, 130, 246;

  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --letter-spacing-tight: -0.01em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
}
h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
}
h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
}
h4 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}
h5 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
}
h6 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
}

p {
  margin: 0 0 var(--space-16) 0;
  color: var(--color-text-secondary);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-primary-hover);
}

code,
pre {
  font-family: var(--font-family-mono);
  font-size: calc(var(--font-size-base) * 0.95);
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: var(--space-1) var(--space-4);
}

pre {
  padding: var(--space-16);
  margin: var(--space-16) 0;
  overflow: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

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

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

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

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

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

.btn--secondary:active {
  background: var(--color-secondary-active);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border-dark);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-bg-1);
  border-color: var(--color-text-light);
}

.btn--sm {
  padding: var(--space-4) var(--space-12);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

.btn--full-width {
  width: 100%;
}

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

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  resize: vertical;
}

select.form-control {
  padding: var(--space-8) var(--space-12);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-32);
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-control::placeholder {
  color: var(--color-text-light);
}

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

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

.form-group small {
  display: block;
  margin-top: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

/* Card component */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

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

.card__body {
  padding: var(--space-16);
}

.card__header,
.card__footer {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-card-border-inner);
}

/* Status indicators */
.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.status--success {
  background-color: rgba(var(--color-success-rgb), 0.1);
  color: #16a34a;
  border: 1px solid rgba(var(--color-success-rgb), 0.2);
}

.status--error {
  background-color: rgba(var(--color-error-rgb), 0.1);
  color: #dc2626;
  border: 1px solid rgba(var(--color-error-rgb), 0.2);
}

.status--warning {
  background-color: rgba(var(--color-warning-rgb), 0.1);
  color: #ca8a04;
  border: 1px solid rgba(var(--color-warning-rgb), 0.2);
}

.status--info {
  background-color: rgba(var(--color-info-rgb), 0.1);
  color: #2563eb;
  border: 1px solid rgba(var(--color-info-rgb), 0.2);
}

/* Container layout */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-16);
  padding-left: var(--space-16);
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
  }
}
@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

/* Utility classes */
.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-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}
.gap-16 {
  gap: var(--space-16);
}

.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-8 {
  margin-bottom: var(--space-8);
}
.mb-16 {
  margin-bottom: var(--space-16);
}
.mb-24 {
  margin-bottom: var(--space-24);
}
.mt-16 {
  margin-top: var(--space-16);
}
.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.p-0 {
  padding: 0;
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}
.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.px-16 {
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.block {
  display: block;
}
.hidden {
  display: none;
}

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

/* Accessibility */
.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;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #db8b37 0%, #171717 100%);
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #db8b37;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--color-text-secondary);
  font-size: 16px;
}

.developer-logo {
  max-width: 100%;
  max-height: 55px;
  object-fit: contain;
  margin: 0 auto 16px auto;
  display: block;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-weight: 400;
  cursor: pointer;
  color: var(--color-text-secondary);
}

.checkbox-label input {
  margin-right: 8px;
}

.error-message {
  color: var(--color-error);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  font-weight: 500;
}

/* App Layout */
.app-header {
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-title h2 {
  font-size: 24px;
  color: #db8b37;
  margin-bottom: 0;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.notification-container {
  position: relative;
}

.notification-bell {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.notification-dropdown {
  position: absolute;
  top: 45px;
  right: 0;
  width: 380px;
  max-height: 500px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

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

.notification-dropdown-header h3 {
  font-size: 16px;
  margin: 0;
  color: var(--color-text);
}

/* Existing CSS - KEEP AS IS */
.notification-item {
  padding: 16px;
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: background 0.2s ease;
}

.notification-item:hover {
  background: var(--color-bg-1);
}

.notification-item.unread {
  background: rgba(219, 139, 55, 0.05);
}

.notification-item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 8px;
}

.notification-item-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--color-text);
}

.notification-item-message {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.notification-item-time {
  font-size: 12px;
  color: var(--color-text-light);
}

.notification-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-light);
}

/* ✅ NEW CLASSES - ADD THESE */
.unread-badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--color-accent, #2196F3);
  border-radius: 50%;
  flex-shrink: 0;
}

.notification-list {
  max-height: 400px;
  overflow-y: auto;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 2px solid var(--color-border-light, #eee);
}

.notification-header h4 {
  margin: 0;
  font-size: 16px;
  color: var(--color-text);
}

.user-role-badge {
  background: linear-gradient(135deg, #db8b37 0%, #171717 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  color: var(--color-text);
  transition: color var(--duration-fast) var(--ease-standard);
}

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

.app-layout {
  display: flex;
  min-height: calc(100vh - 68px);
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: #171717;
  color: white;
  padding: 24px 0;
  transition: all 0.3s ease;
  overflow-y: auto;
  max-height: calc(100vh - 68px);
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-menu > li {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  font-size: 14px;
}

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

.nav-link.active {
  background: linear-gradient(135deg, #db8b37 0%, #171717 100%);
  color: white;
  border-left: 4px solid #db8b37;
}

.nav-link svg {
  flex-shrink: 0;
}

.nav-link-expandable {
  justify-content: space-between;
}

.expand-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
  margin-left: auto;
}

.nav-link-expandable.expanded .expand-arrow {
  transform: rotate(180deg);
}

.nav-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-submenu.expanded {
  max-height: 2000px;
}

.nav-submenu li {
  position: relative;
}

.nav-submenu .nav-link {
  padding-left: 56px;
  font-size: 13px;
}

.nav-submenu .nav-submenu .nav-link {
  padding-left: 72px;
}

.nav-submenu .nav-submenu .nav-submenu .nav-link {
  padding-left: 88px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 32px;
  background: #fafafa;
  overflow-y: auto;
}

.page-content {
  display: none;
}

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

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
}

.breadcrumb {
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin-top: 8px;
}

.breadcrumb a {
  color: #db8b37;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Stats Summary Card - WHITE WITH BORDER */
.stats-summary-card {
  background: white;
  color: var(--color-text);
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.stats-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.total-count {
  font-size: 48px;
  font-weight: 700;
  color: #db8b37;
}

.status-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.status-item {
  background: #fafafa;
  padding: 16px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  border: 1px solid var(--color-border-light);
}

.status-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.status-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.status-item-count {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.status-item-percentage {
  font-size: 14px;
  color: var(--color-text-tertiary);
}

/* Controls Section */
.controls-section {
  background: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.control-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--color-text-secondary);
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range-inputs span {
  color: var(--color-text-tertiary);
  font-size: 13px;
}

.date-presets {
  display: flex;
  gap: 8px;
}

/* Display Content */
.display-content {
  min-height: 300px;
}

/* Cards View */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: rgba(219, 139, 55, 0.3);
}

.project-card-header {
  background: linear-gradient(135deg, #db8b37 0%, #171717 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-card-title {
  font-size: 20px;
  font-weight: 600;
}

.project-type-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.project-card-body {
  padding: 20px;
}

.project-logo {
  max-width: 200px;
  max-height: 100px;
  margin-bottom: 12px;
  object-fit: contain;
}

.project-total-units {
  font-size: 32px;
  font-weight: 700;
  color: #db8b37;
  margin-bottom: 16px;
}

.project-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.project-status-box {
  padding: 12px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  border: 1px solid var(--color-border-light);
  background: #fafafa;
}

.project-status-label {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-bottom: 4px;
}

.project-status-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

/* Chart View */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

.chart-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.chart-card h3 {
  margin-bottom: 16px;
  font-size: 18px;
  color: var(--color-text);
  font-weight: 600;
}

.chart-container {
  height: 300px;
  position: relative;
}

/* Progress View */
.progress-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.progress-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.progress-card h3 {
  margin-bottom: 16px;
  font-size: 18px;
  color: var(--color-text);
  font-weight: 600;
}

.progress-item {
  margin-bottom: 16px;
}

.progress-item:last-child {
  margin-bottom: 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--color-text);
}

.progress-bar-container {
  height: 24px;
  background: #f0f0f0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.progress-bar-fill {
  height: 100%;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
}

/* Table View */
.table-container {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.data-table th {
  background: #fafafa;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: 0.025em;
}

.data-table th:hover {
  background: #f0f0f0;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table td {
  color: var(--color-text-secondary);
}

.data-table td strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Projects Management */
.projects-content {
  background: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.project-list-item {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  background: white;
}

.project-list-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: rgba(219, 139, 55, 0.4);
}

.project-info h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--color-text);
  font-weight: 600;
}

.project-info p {
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin: 0;
}

.project-actions {
  display: flex;
  gap: 8px;
}

/* Building & Floor Grid */
.building-grid,
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.building-card,
.floor-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.3s ease;
}

.building-card:hover,
.floor-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(219, 139, 55, 0.4);
}

.building-card h4,
.floor-card h4 {
  color: var(--color-text);
  margin-bottom: 8px;
  font-weight: 600;
}

.building-card p,
.floor-card p {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin-bottom: 4px;
}

.floor-plan-thumbnail {
  width: 100%;
  height: 150px;
  background: #f5f5f5;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  object-fit: cover;
  border: 1px solid var(--color-border-light);
}

/* Unit Canvas */
.unit-canvas-container {
  position: relative;
  margin: 20px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f9f9f9;
}
.unit-canvas-container.drag-mode {
  border: 3px solid #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.unit-canvas-container img {
  display: block;
  width: 100%;
  height: auto;
}

.unit-marker {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    /* Use margin instead for centering */
    margin-left: -17.5px;  /* ← ADD THIS (half of width) */
    margin-top: -17.5px;   /* ← ADD THIS (half of height) */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    border: 2px solid white;
    user-select: none;
}

.unit-marker:hover {
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  scale: 1.15;
}

.unit-marker.dragging {
  cursor: move;
  z-index: 100;
  opacity: 0.8;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  scale: 1.2;

}

.unit-canvas-container.drag-mode .unit-marker {
  cursor: move !important;
}

.unit-canvas-container.drag-mode {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Unit Tooltip */
.unit-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  z-index: 10000;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.unit-tooltip.visible {
  opacity: 1;
}

/* Requests Page */
.request-filters {
  background: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.request-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  border-left: 4px solid;
}

.request-card.pending {
  border-left-color: #eab308;
}

.request-card.approved {
  border-left-color: #22c55e;
}

.request-card.denied {
  border-left-color: #ef4444;
}

.request-card.completed {
  border-left-color: #3b82f6;
}

.request-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
}

.request-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text);
}

.request-meta {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.request-status-badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.request-status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.request-status-badge.approved {
  background: #d1fae5;
  color: #065f46;
}

.request-status-badge.denied {
  background: #fee2e2;
  color: #991b1b;
}

.request-status-badge.completed {
  background: #dbeafe;
  color: #1e40af;
}

.request-body {
  margin-bottom: 16px;
}

.request-detail-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.request-detail-label {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.request-detail-row > span:last-child {
  color: var(--color-text);
}

.request-comment {
  background: #fafafa;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-size: 14px;
  border-left: 3px solid #db8b37;
  border: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
}

.request-comment strong {
  color: var(--color-text);
}

.request-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* History Page */
.history-filters {
  background: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-buttons {
  display: flex;
  gap: 8px;
}

.export-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.history-log {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.history-entry {
  padding: 20px;
  border-bottom: 1px solid var(--color-border-light);
  transition: all 0.3s ease;
}

.history-entry:hover {
  background: #fafafa;
}

.history-entry:last-child {
  border-bottom: none;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.history-timestamp {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.history-action {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
  color: white;
}

.history-details {
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 8px;
}

.history-path {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

/* Settings Page */
.settings-section {
  background: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.settings-section h2 {
  font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
  color: var(--color-text);
  font-weight: 700;
}

.settings-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  transition: all 0.2s ease;
}

.status-list-item:hover {
  border-color: rgba(219, 139, 55, 0.4);
  box-shadow: var(--shadow-sm);
}

.status-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-color-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-border);
}

.status-name {
  font-weight: 500;
  color: var(--color-text);
}

.status-default-badge {
  background: #d1fae5;
  color: #065f46;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
}

.credential-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.credential-card {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
}

.credential-card h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--color-text);
  font-weight: 600;
}

.data-management-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.data-stats {
  padding: 20px;
  background: #fafafa;
  border-radius: var(--radius-md);
  margin-top: 20px;
  border: 1px solid var(--color-border-light);
}

.data-stats p {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.data-stats strong {
  color: var(--color-text);
}

.data-stats h3 {
  color: var(--color-text);
  margin-bottom: 12px;
  font-weight: 600;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

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

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

.modal-header h2 {
  font-size: 20px;
  color: var(--color-text);
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text-light);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f5f5f5;
  color: var(--color-text);
}

.modal-body {
  padding: 24px;
}

.modal-body p {
  color: var(--color-text-secondary);
}

.modal-body strong {
  color: var(--color-text);
}

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

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-text);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  max-width: 400px;
  font-weight: 500;
}

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

.toast.success {
  background: #22c55e;
}

.toast.error {
  background: #ef4444;
}

.toast.warning {
  background: #eab308;
  color: #171717;
}

/* File Upload Enhancements */
input[type="file"].form-control {
  padding: 8px;
  cursor: pointer;
}

input[type="file"].form-control::-webkit-file-upload-button {
  background: linear-gradient(135deg, #db8b37 0%, #171717 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-right: 12px;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

input[type="file"].form-control::-webkit-file-upload-button:hover {
  opacity: 0.9;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    bottom: 0;
    z-index: 99;
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-content {
    padding: 16px;
  }
  
  .controls-section {
    grid-template-columns: 1fr;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-row {
    grid-template-columns: 1fr;
  }
  
  .credential-forms {
    grid-template-columns: 1fr;
  }
  
  .header-right {
    gap: 8px;
  }
  
  .user-role-badge {
    padding: 6px 12px;
    font-size: 11px;
  }

  .notification-dropdown {
    width: 320px;
    right: -20px;
  }

  .stats-summary-card {
    padding: 20px;
  }

  .total-count {
    font-size: 36px;
  }

  .status-breakdown {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .logo-title h2 {
    font-size: 18px;
  }
  
  .page-header h1 {
    font-size: 22px;
  }
  
  .total-count {
    font-size: 32px;
  }
  
  .export-buttons {
    flex-direction: column;
  }
  
  .export-buttons .btn {
    width: 100%;
  }

  .project-status-grid {
    grid-template-columns: 1fr;
  }

  .request-detail-row {
    grid-template-columns: 1fr;
  }

  .stats-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .modal {
    width: 95%;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* Clean scrollbars for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a3a3a3;
}

/* Print styles */
@media print {
  .app-header,
  .sidebar,
  .controls-section,
  .btn,
  .modal-overlay,
  .notification-container,
  .user-role-badge {
    display: none !important;
  }

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

  .project-card,
  .chart-card,
  .progress-card,
  .data-table,
  .stats-summary-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  body {
    background: white !important;
  }

  .page-content {
    display: block !important;
  }
}

/* Additional refinements for clean white design */
.project-list-item,
.building-card,
.floor-card,
.status-list-item {
  transition: all 0.2s ease;
}

/* Ensure all cards have consistent styling */
.card,
.project-card,
.building-card,
.floor-card,
.chart-card,
.progress-card,
.request-card,
.history-log,
.settings-section,
.controls-section,
.stats-summary-card,
.projects-content,
.request-filters,
.history-filters {
  background: white;
  border: 1px solid var(--color-border);
}

/* Subtle hover effects */
.card:hover,
.project-card:hover,
.chart-card:hover,
.progress-card:hover {
  border-color: rgba(219, 139, 55, 0.3);
}

/* Clean section dividers */
hr {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: 20px 0;
}

/* Consistent spacing for all content sections */
.page-content > div:not(:last-child) {
  margin-bottom: 24px;
}

/* Better focus states */
.form-control:focus,
.btn:focus-visible {
  border-color: #db8b37;
  box-shadow: 0 0 0 3px rgba(219, 139, 55, 0.1);
}

/* Improved text readability */
.text-muted {
  color: var(--color-text-tertiary);
}

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

/* Better link styling */
a:not(.btn):not(.nav-link) {
  color: #db8b37;
  font-weight: 500;
}

a:not(.btn):not(.nav-link):hover {
  color: #c77a2e;
  text-decoration: underline;
}

/* Improved badge styling */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.badge-primary {
  background: rgba(219, 139, 55, 0.1);
  color: #db8b37;
}

.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.badge-warning {
  background: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

/* Empty states */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--color-text-tertiary);
}

.empty-state h3 {
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--color-text-tertiary);
  margin-bottom: 20px;
}

/* Loading states */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(219, 139, 55, 0.3);
  border-radius: 50%;
  border-top-color: #db8b37;
  animation: spin 1s ease-in-out infinite;
}

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

/* Improved alert/info boxes */
.alert {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: 16px;
}

.alert-info {
  background: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.2);
  color: #1e40af;
}

.alert-success {
  background: rgba(34, 197, 94, 0.05);
  border-color: rgba(34, 197, 94, 0.2);
  color: #15803d;
}

.alert-warning {
  background: rgba(234, 179, 8, 0.05);
  border-color: rgba(234, 179, 8, 0.2);
  color: #a16207;
}

.alert-error {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--color-border-light);
  margin: 24px 0;
}

/* Section headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

.section-header .actions {
  display: flex;
  gap: 8px;
}

/* Improved table styling */
.data-table thead th {
  position: sticky;
  top: 0;
  background: #fafafa;
  z-index: 10;
}

/* Better form styling */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-light);
}

/* Improved checkbox and radio styling */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #db8b37;
}

/* Better disabled state */
.btn:disabled,
.form-control:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f5f5f5;
}

/* Improved code blocks */
code {
  background: rgba(219, 139, 55, 0.1);
  color: #db8b37;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* Better list styling */
ul:not(.nav-menu):not(.nav-submenu),
ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

ul:not(.nav-menu):not(.nav-submenu) li,
ol li {
  margin-bottom: 8px;
  color: var(--color-text-secondary);
}

/* Improved blockquote */
blockquote {
  border-left: 4px solid #db8b37;
  padding-left: 16px;
  margin: 16px 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Better image styling */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Improved selection */
::selection {
  background: rgba(219, 139, 55, 0.2);
  color: var(--color-text);
}

/* Better placeholder styling */
::placeholder {
  color: var(--color-text-light);
  opacity: 1;
}

/* Smooth transitions for theme changes */
* {
  transition-property: background-color, border-color, color;
  transition-duration: 0.15s;
  transition-timing-function: ease-in-out;
}

/* Override transitions for specific elements */
.btn,
.nav-link,
.unit-marker,
.project-card,
.building-card,
.floor-card {
  transition: all 0.2s ease;
}

/* Ensure proper text contrast everywhere */
.project-card-body,
.building-card,
.floor-card,
.chart-card,
.progress-card,
.settings-section,
.modal-body,
.request-card,
.history-entry {
  color: var(--color-text-secondary);
}

.project-card-body h3,
.project-card-body h4,
.building-card h4,
.floor-card h4,
.chart-card h3,
.progress-card h3,
.settings-section h3,
.modal-body h3,
.request-title,
.history-details {
  color: var(--color-text);
}

/* Final polish */
body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Ensure orange brand color is used consistently */
.text-primary {
  color: #db8b37 !important;
}

.bg-primary {
  background-color: #db8b37 !important;
}

.border-primary {
  border-color: #db8b37 !important;
}
/* ============================================================================
   DYNAMIC UNIT MARKERS (Rounded Rectangle, Auto-width)
   ============================================================================ */

.unit-marker-dynamic {
    position: absolute;
    padding: 4px 17.5px;  /* 17.5px left/right padding as requested */
    border-radius: 12px;  /* Rounded edges */
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-align: center;
    cursor: pointer;
    transform: translate(-50%, -50%);  /* Center on position */
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    z-index: 10;
    user-select: none;
    min-height: 24px;
    line-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unit-marker-dynamic:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    z-index: 100;
}

.unit-marker-dynamic.dragging {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 6px 12px rgba(0,0,0,0.5);
    z-index: 1000;
    cursor: grabbing;
}

/* Legacy position indicator (dashed border) */
.unit-marker-dynamic[style*="dashed"] {
    animation: pulse-legacy 2s infinite;
}

@keyframes pulse-legacy {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ============================================================================
   UNIT MARKERS CONTAINER (for responsive positioning)
   ============================================================================ */

#unitMarkersContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#unitMarkersContainer .unit-marker,
#unitMarkersContainer .unit-marker-dynamic {
    pointer-events: auto;
}

/* ============================================================================
   ENHANCED TOOLTIP (Multi-line support)
   ============================================================================ */

.unit-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    z-index: 10000;
    pointer-events: none;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.unit-tooltip.visible {
    opacity: 1;
}

.unit-tooltip strong {
    color: #fff;
    font-size: 14px;
}

/* ============================================================================
   DASHBOARD FILTERS
   ============================================================================ */

.dashboard-filters {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.dashboard-filters h3 {
    margin-bottom: 16px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.dashboard-filters .filter-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.dashboard-filters .form-group {
    flex: 1;
    min-width: 150px;
}

/* ============================================================================
   TYPE BREAKDOWN SECTION
   ============================================================================ */

#typeBreakdown {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 16px;
}

#typeBreakdown .status-item {
    min-width: 0;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

#typeBreakdown .status-item:nth-child(1) { border-left-color: #007bff; }
#typeBreakdown .status-item:nth-child(2) { border-left-color: #28a745; }
#typeBreakdown .status-item:nth-child(3) { border-left-color: #ffc107; }
#typeBreakdown .status-item:nth-child(4) { border-left-color: #dc3545; }
#typeBreakdown .status-item:nth-child(5) { border-left-color: #6c757d; }
#typeBreakdown .status-item:nth-child(6) { border-left-color: #17a2b8; }

#typeBreakdown .status-item-header {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}

#typeBreakdown .status-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
}

#typeBreakdown .status-item-count {
    font-size: 22px;
    font-weight: 700;
    color: #212529;
}

#typeBreakdown .status-item-percentage {
    font-size: 13px;
    color: #adb5bd;
}

@media (max-width: 1200px) {
    #typeBreakdown {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    #typeBreakdown {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================================
   PDF EXPORT MODAL (Larger modal)
   ============================================================================ */

.modal-lg {
    max-width: 800px !important;
    width: 95%;
}

.floor-checkbox-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
}

.floor-checkbox-group {
    margin-bottom: 16px;
}

.floor-checkbox-group-header {
    font-weight: 600;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--color-bg-1);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.floor-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 6px 16px;
    cursor: pointer;
}

.floor-checkbox-item:hover {
    background: var(--color-bg-1);
    border-radius: var(--radius-sm);
}

.floor-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.floor-checkbox-item span {
    flex: 1;
}

.floor-checkbox-item .unit-count {
    color: var(--text-light);
    font-size: 12px;
}

/* ============================================================================
   UNIT TYPE MANAGEMENT (Settings)
   ============================================================================ */

#unitTypesList .status-list-item {
    border-left: 4px solid #6c757d;
}

#unitTypesList .status-color-box {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

/* ============================================================================
   POSITION INDICATOR IN UNITS TABLE
   ============================================================================ */

.position-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.position-badge.responsive {
    background: #d4edda;
    color: #155724;
}

.position-badge.legacy {
    background: #fff3cd;
    color: #856404;
}

/* ============================================================================
   DRAG MODE STYLING
   ============================================================================ */

.unit-canvas-container.drag-mode {
    cursor: grab;
    border: 3px dashed var(--primary);
    border-radius: var(--radius-md);
}

.unit-canvas-container.drag-mode .unit-marker,
.unit-canvas-container.drag-mode .unit-marker-dynamic {
    cursor: grab;
}

.unit-canvas-container.drag-mode .unit-marker:active,
.unit-canvas-container.drag-mode .unit-marker-dynamic:active {
    cursor: grabbing;
}

/* ============================================================================
   PDF PREVIEW STYLES (for print)
   ============================================================================ */

@media print {
    .no-print {
        display: none !important;
    }
    
    .page {
        page-break-after: always;
        border: none !important;
        margin: 0 !important;
        padding: 15mm !important;
    }
    
    .page:last-child {
        page-break-after: auto;
    }
    
    .unit-marker-preview {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

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

@media (max-width: 768px) {
    .dashboard-filters .filter-row {
        flex-direction: column;
    }
    
    .dashboard-filters .form-group {
        width: 100%;
    }
    
    .modal-lg {
        max-width: 100%;
        margin: 10px;
    }
    
    /* Smaller markers on mobile */
    .unit-marker-dynamic {
        font-size: 9px;
        padding: 3px 12px;
        min-height: 20px;
    }
}

/* ============================================================================
   CHARTS GRID UPDATE (for type chart)
   ============================================================================ */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chart-card h3 {
    margin-bottom: 16px;
    font-size: 16px;
    color: var(--text);
}

.chart-container {
    position: relative;
    height: 250px;
}

/* ============================================================================
   LOADING STATE FOR PDF GENERATION
   ============================================================================ */

.pdf-generating {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.pdf-generating-content {
    text-align: center;
    padding: 40px;
}

.pdf-generating-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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