/* ==========================================================================
   ArtEmis EstateFlow Platform — Design System CSS
   Version: 1.0.0 | Dark Real Estate & Construction Theme
   ========================================================================== */

/* ==========================================================================
   1. CSS RESET & BASE
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--dark-bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

/* ==========================================================================
   2. CSS VARIABLES — DESIGN TOKENS
   ========================================================================== */

:root {
  /* Brand Colors */
  --gold:           #C9A84C;
  --gold-dim:       rgba(201, 168, 76, 0.12);
  --gold2:          #e8c96a;
  --gold-glow:      rgba(201, 168, 76, 0.25);
  --navy:           #1E3A5F;
  --navy-light:     #254a78;
  --green:          #2dd4a0;
  --green-dim:      rgba(45, 212, 160, 0.12);
  --red:            #f05f6e;
  --red-dim:        rgba(240, 95, 110, 0.12);
  --blue:           #5b9cf6;
  --blue-dim:       rgba(91, 156, 246, 0.12);
  --orange:         #f5a623;
  --orange-dim:     rgba(245, 166, 35, 0.12);

  /* Backgrounds */
  --dark-bg:        #0a0d14;
  --surface:        #111621;
  --surface2:       #171d2c;
  --surface3:       #1c2336;
  --sidebar-bg:     #0d1220;

  /* Borders */
  --border:         #1e2840;
  --border-light:   #263354;
  --border-gold:    rgba(201, 168, 76, 0.35);

  /* Text */
  --text:           #e8eaf0;
  --text2:          #8892a4;
  --text3:          #5a6480;
  --text-muted:     #4a5470;

  /* Sidebar */
  --sidebar-width:  260px;
  --topbar-height:  64px;

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

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

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:      0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg:      0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-gold:    0 0 20px rgba(201, 168, 76, 0.2);
  --shadow-glow:    0 0 40px rgba(201, 168, 76, 0.15);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s ease;
  --transition-slow:   0.4s ease;

  /* Typography Scale */
  --text-xs:     0.75rem;
  --text-sm:     0.875rem;
  --text-base:   1rem;
  --text-lg:     1.125rem;
  --text-xl:     1.25rem;
  --text-2xl:    1.5rem;
  --text-3xl:    1.875rem;
  --text-4xl:    2.25rem;

  /* Z-index */
  --z-sidebar:   100;
  --z-topbar:    90;
  --z-modal:     200;
  --z-overlay:   199;
  --z-toast:     300;
  --z-dropdown:  150;
}

/* ==========================================================================
   3. SCROLLBAR STYLING
   ========================================================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

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

/* ==========================================================================
   4. LAYOUT — SIDEBAR + MAIN CONTENT
   ========================================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: var(--z-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.sidebar-logo img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-logo-text .brand-name {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.03em;
}

.sidebar-logo-text .brand-sub {
  font-size: var(--text-xs);
  color: var(--text2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- Module Switcher --- */
.module-switcher {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.module-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.module-badge .module-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gold);
}

.module-badge .module-label .module-icon {
  font-size: 1rem;
}

.module-switch-btn {
  font-size: var(--text-xs);
  color: var(--text2);
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.module-switch-btn:hover {
  color: var(--gold);
  border-color: var(--border-gold);
}

/* --- Navigation --- */
.sidebar-nav {
  flex: 1;
  padding: var(--space-md) 0;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-sm);
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  padding: var(--space-sm) var(--space-lg);
  margin-top: var(--space-sm);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-lg);
  color: var(--text2);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  position: relative;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text);
  background: var(--gold-dim);
  border-left-color: rgba(201, 168, 76, 0.5);
}

.nav-link.active {
  color: var(--gold);
  background: var(--gold-dim);
  border-left-color: var(--gold);
  font-weight: 600;
}

.nav-link .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav-link.active .nav-icon {
  opacity: 1;
}

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

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-sm) var(--space-md);
}

/* --- Sidebar Footer --- */
.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--surface2);
  margin-bottom: var(--space-sm);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

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

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

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

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(240, 95, 110, 0.2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.logout-btn:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* --- Main Content Area --- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Top Bar --- */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  gap: var(--space-md);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
}

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

.hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  padding: 4px 0;
  cursor: pointer;
}

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

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
}

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

.notification-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  transition: all var(--transition-fast);
  cursor: pointer;
}

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

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: var(--radius-full);
  border: 2px solid var(--surface);
}

.notification-count {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--red);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--surface);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--surface2);
  border: 1px solid var(--border);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gold);
}

.topbar-username {
  font-size: var(--text-sm);
  color: var(--text2);
  font-weight: 500;
  display: none;
}

/* --- Page Content --- */
.page-content {
  flex: 1;
  padding: var(--space-xl);
  max-width: 1600px;
  width: 100%;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: calc(var(--z-sidebar) - 1);
  backdrop-filter: blur(2px);
}

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

/* ==========================================================================
   5. CARDS & GLASS MORPHISM
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  border-color: var(--border-light);
}

.card-glass {
  background: rgba(17, 22, 33, 0.7);
  border: 1px solid rgba(30, 40, 64, 0.8);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
}

.card-gold {
  border-color: var(--border-gold);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(201, 168, 76, 0.04) 100%);
}

.card-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(--border);
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-title .card-title-icon {
  color: var(--gold);
}

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

/* ==========================================================================
   6. KPI STAT CARDS
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  transition: background var(--transition-base);
}

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

.stat-card.stat-gold::before  { background: var(--gold); }
.stat-card.stat-green::before { background: var(--green); }
.stat-card.stat-red::before   { background: var(--red); }
.stat-card.stat-blue::before  { background: var(--blue); }

.stat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-icon.icon-gold   { background: var(--gold-dim);   color: var(--gold); }
.stat-icon.icon-green  { background: var(--green-dim);  color: var(--green); }
.stat-icon.icon-red    { background: var(--red-dim);    color: var(--red); }
.stat-icon.icon-blue   { background: var(--blue-dim);   color: var(--blue); }

.stat-trend {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-trend.up   { background: var(--green-dim);  color: var(--green); }
.stat-trend.down { background: var(--red-dim);    color: var(--red); }
.stat-trend.flat { background: var(--surface2);   color: var(--text2); }

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text2);
  font-weight: 500;
}

.stat-sublabel {
  font-size: var(--text-xs);
  color: var(--text3);
}

/* ==========================================================================
   7. TABLES
   ========================================================================== */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  min-width: 220px;
}

.table-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: var(--text-sm);
  width: 100%;
}

.table-search input::placeholder {
  color: var(--text3);
}

.table-search .search-icon {
  color: var(--text3);
  font-size: 0.9rem;
  flex-shrink: 0;
}

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

thead {
  background: var(--surface2);
}

thead th {
  padding: 12px var(--space-lg);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

thead th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

thead th.sortable:hover {
  color: var(--gold);
}

thead th.sort-asc::after  { content: ' ↑'; color: var(--gold); }
thead th.sort-desc::after { content: ' ↓'; color: var(--gold); }

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

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

tbody tr:nth-child(even) {
  background: rgba(23, 29, 44, 0.4);
}

tbody tr:hover {
  background: var(--gold-dim);
}

tbody td {
  padding: 12px var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text);
  vertical-align: middle;
}

tbody td.td-muted {
  color: var(--text2);
}

tbody td.td-mono {
  font-family: 'Courier New', monospace;
  font-size: var(--text-xs);
  color: var(--text2);
}

.table-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  font-size: var(--text-sm);
  color: var(--text2);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text2);
  background: var(--surface3);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.page-btn:hover {
  color: var(--gold);
  border-color: var(--border-gold);
}

.page-btn.active {
  background: var(--gold);
  color: var(--dark-bg);
  border-color: var(--gold);
  font-weight: 700;
}

.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ==========================================================================
   8. STATUS BADGES
   ========================================================================== */

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

/* Status Colors */
.badge-pending,
.badge-εκκρεμεί    { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(240, 95, 110, 0.25); }
.badge-success,
.badge-ολοκληρώθηκε { background: var(--green-dim);  color: var(--green);  border: 1px solid rgba(45, 212, 160, 0.25); }
.badge-warning,
.badge-αναβολή,
.badge-σε-αναμονή  { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(245, 166, 35, 0.25); }
.badge-info,
.badge-σε-εξέλιξη  { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(91, 156, 246, 0.25); }
.badge-gold        { background: var(--gold-dim);   color: var(--gold);   border: 1px solid var(--border-gold); }
.badge-danger,
.badge-σε-καθυστέρηση { background: var(--red-dim); color: var(--red);    border: 1px solid rgba(240, 95, 110, 0.25); }
.badge-draft       { background: var(--surface3);   color: var(--text2);  border: 1px solid var(--border); }
.badge-neutral     { background: var(--surface3);   color: var(--text2);  border: 1px solid var(--border); }

/* Badge with dot */
.badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
  flex-shrink: 0;
}

/* Status tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface3);
  color: var(--text2);
  border: 1px solid var(--border);
}

.tag-gold    { background: var(--gold-dim);  color: var(--gold);  border-color: var(--border-gold); }
.tag-green   { background: var(--green-dim); color: var(--green); }
.tag-red     { background: var(--red-dim);   color: var(--red); }
.tag-blue    { background: var(--blue-dim);  color: var(--blue); }

/* ==========================================================================
   9. FORMS
   ========================================================================== */

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

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text2);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.02em;
}

.form-label.required::after {
  content: ' *';
  color: var(--red);
}

.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  color: var(--text);
  font-size: var(--text-sm);
  font-family: 'DM Sans', sans-serif;
  transition: all var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
  background: var(--surface3);
}

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

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

.form-control[readonly] {
  opacity: 0.7;
  cursor: default;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select.form-control option {
  background: var(--surface2);
  color: var(--text);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text3);
  margin-top: 5px;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--red);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

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

.form-section-title {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gold);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Input with icon */
.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 0.9rem;
  pointer-events: none;
}

.input-icon-wrapper .form-control {
  padding-left: 38px;
}

/* ==========================================================================
   10. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1;
}

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — Gold */
.btn-primary {
  background: var(--gold);
  color: var(--dark-bg);
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold2);
  border-color: var(--gold2);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary — Border */
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-light);
}

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

/* Danger — Red */
.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(240, 95, 110, 0.3);
}

.btn-danger:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* Success — Green */
.btn-success {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(45, 212, 160, 0.3);
}

.btn-success:hover {
  background: var(--green);
  color: var(--dark-bg);
  border-color: var(--green);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text2);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text);
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

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

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
}

/* ==========================================================================
   11. MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-base);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-sm  { max-width: 420px; }
.modal-lg  { max-width: 800px; }
.modal-xl  { max-width: 1000px; }

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

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.modal-title .modal-title-icon {
  color: var(--gold);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text2);
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--red);
  border-color: rgba(240, 95, 110, 0.3);
  background: var(--red-dim);
}

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

.modal-footer {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  background: var(--surface2);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ==========================================================================
   12. ALERTS & FLASH MESSAGES
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
  animation: slideDown 0.3s ease;
}

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

.alert-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-body {
  flex: 1;
}

.alert-close {
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  color: inherit;
  flex-shrink: 0;
}

.alert-close:hover { opacity: 1; }

/* Categories */
.alert-success {
  background: var(--green-dim);
  border-color: rgba(45, 212, 160, 0.25);
  color: var(--green);
}

.alert-danger, .alert-error {
  background: var(--red-dim);
  border-color: rgba(240, 95, 110, 0.25);
  color: var(--red);
}

.alert-warning {
  background: var(--orange-dim);
  border-color: rgba(245, 166, 35, 0.25);
  color: var(--orange);
}

.alert-info {
  background: var(--blue-dim);
  border-color: rgba(91, 156, 246, 0.25);
  color: var(--blue);
}

/* Flash messages container */
.flash-messages {
  padding: 0 var(--space-xl);
  padding-top: var(--space-md);
}

/* ==========================================================================
   13. PROGRESS BARS
   ========================================================================== */

.progress-wrap {
  width: 100%;
  background: var(--surface3);
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 8px;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gold);
  transition: width 0.5s ease;
}

.progress-bar.bar-green  { background: var(--green); }
.progress-bar.bar-red    { background: var(--red); }
.progress-bar.bar-blue   { background: var(--blue); }

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

.progress-labeled .progress-wrap { flex: 1; }
.progress-labeled .progress-pct {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  min-width: 36px;
  text-align: right;
}

/* ==========================================================================
   14. SECTION HEADERS & PAGE LAYOUT HELPERS
   ========================================================================== */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.page-header-left h1 {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.page-header-left p {
  color: var(--text2);
  font-size: var(--text-sm);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 20px;
  background: var(--gold);
  border-radius: 2px;
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }

/* Flex helpers */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-start   { display: flex; align-items: center; }
.gap-sm       { gap: var(--space-sm); }
.gap-md       { gap: var(--space-md); }
.gap-lg       { gap: var(--space-lg); }

/* Spacing utilities */
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }

/* ==========================================================================
   15. EMPTY STATES
   ========================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  color: var(--text3);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text2);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  font-size: var(--text-sm);
  color: var(--text3);
  max-width: 320px;
  line-height: 1.7;
}

/* ==========================================================================
   16. DETAIL / DESCRIPTION LISTS
   ========================================================================== */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.detail-value.value-gold   { color: var(--gold); font-weight: 700; }
.detail-value.value-green  { color: var(--green); }
.detail-value.value-red    { color: var(--red); }

/* ==========================================================================
   17. NOTIFICATIONS DROPDOWN
   ========================================================================== */

.notifications-dropdown {
  position: absolute;
  top: calc(var(--topbar-height) - 4px);
  right: var(--space-xl);
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  display: none;
  overflow: hidden;
}

.notifications-dropdown.open {
  display: block;
  animation: fadeInDown 0.2s ease;
}

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

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

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

.notif-mark-all {
  font-size: var(--text-xs);
  color: var(--gold);
  cursor: pointer;
}

.notif-list {
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}

.notif-item:hover {
  background: var(--surface2);
}

.notif-item.unread {
  background: rgba(201, 168, 76, 0.04);
  border-left: 3px solid var(--gold);
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--gold);
  flex-shrink: 0;
  margin-top: 6px;
}

.notif-body {
  flex: 1;
}

.notif-text {
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.5;
}

.notif-time {
  font-size: var(--text-xs);
  color: var(--text3);
  margin-top: 2px;
}

/* ==========================================================================
   18. MOBILE BOTTOM NAV
   ========================================================================== */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: calc(var(--z-sidebar) + 1);
  padding: var(--space-sm) 0;
  padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-sm) var(--space-md);
  color: var(--text3);
  font-size: 0.65rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
  letter-spacing: 0.04em;
}

.mobile-nav-item .mobile-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: var(--gold);
}

/* ==========================================================================
   19. LOGIN PAGE
   ========================================================================== */

.login-page {
  min-height: 100vh;
  background: var(--dark-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(30, 58, 95, 0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 168, 76, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(30, 58, 95, 0.2) 0%, transparent 60%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-2xl);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.login-logo img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.login-title {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-title h1 {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.login-title .login-subtitle {
  font-size: var(--text-sm);
  color: var(--text2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.login-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin-bottom: var(--space-xl);
}

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

.login-submit {
  width: 100%;
  padding: 13px;
  margin-top: var(--space-md);
  font-size: var(--text-base);
  letter-spacing: 0.04em;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text3);
}

.login-footer a {
  color: var(--text2);
}

/* ==========================================================================
   20. MODULE SELECTOR PAGE
   ========================================================================== */

.module-selector-page {
  min-height: 100vh;
  background: var(--dark-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.module-selector-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.module-selector-header h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.module-selector-header p {
  color: var(--text2);
  font-size: var(--text-base);
}

.module-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  max-width: 800px;
  width: 100%;
}

.module-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  text-decoration: none;
  transition: all var(--transition-base);
  display: block;
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold-dim);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.module-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  color: var(--text);
}

.module-card:hover::before {
  opacity: 1;
}

.module-card-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  display: block;
  position: relative;
  z-index: 1;
}

.module-card-title {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-sm);
  position: relative;
  z-index: 1;
}

.module-card-sub {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gold);
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}

.module-card-desc {
  font-size: var(--text-sm);
  color: var(--text2);
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.module-card-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 1.1rem;
  margin-top: var(--space-lg);
  transition: all var(--transition-base);
  position: relative;
  z-index: 1;
}

.module-card:hover .module-card-arrow {
  background: var(--gold);
  color: var(--dark-bg);
  transform: scale(1.1);
}

/* ==========================================================================
   21. UTILITY CLASSES
   ========================================================================== */

.text-gold   { color: var(--gold) !important; }
.text-green  { color: var(--green) !important; }
.text-red    { color: var(--red) !important; }
.text-blue   { color: var(--blue) !important; }
.text-muted  { color: var(--text2) !important; }
.text-dim    { color: var(--text3) !important; }
.text-white  { color: var(--text) !important; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.font-display { font-family: 'Playfair Display', serif; }
.font-mono    { font-family: 'Courier New', monospace; }

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

.d-none  { display: none !important; }
.d-flex  { display: flex !important; }
.d-block { display: block !important; }
.d-grid  { display: grid !important; }

.w-full  { width: 100%; }

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

/* Currency / number display */
.currency {
  font-family: 'DM Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.currency-large {
  font-family: 'Playfair Display', serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gold);
}

/* Property code */
.prop-code {
  font-family: 'Courier New', monospace;
  font-size: var(--text-xs);
  color: var(--gold);
  background: var(--gold-dim);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-gold);
}

/* ==========================================================================
   22. RESPONSIVE — 1200px
   ========================================================================== */

@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .page-content {
    padding: var(--space-lg);
  }
}

/* ==========================================================================
   23. RESPONSIVE — 768px (Mobile)
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --topbar-height: 56px;
  }

  /* Sidebar: hidden by default on mobile */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger-btn {
    display: flex;
  }

  .topbar {
    padding: 0 var(--space-md);
  }

  .page-content {
    padding: var(--space-md);
    padding-bottom: calc(var(--space-md) + 70px); /* room for bottom nav */
  }

  .flash-messages {
    padding: 0 var(--space-md);
    padding-top: var(--space-sm);
  }

  .mobile-bottom-nav {
    display: block;
  }

  /* Stacked grids */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }

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

  .page-header {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .module-cards {
    grid-template-columns: 1fr;
  }

  .modal {
    max-height: 85vh;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-search {
    min-width: unset;
  }

  .topbar-username {
    display: none;
  }
}

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

  .page-title {
    font-size: var(--text-base);
  }

  .login-card {
    padding: var(--space-xl) var(--space-lg);
  }
}

/* ==========================================================================
   24. PRINT STYLES
   ========================================================================== */

@media print {
  .sidebar,
  .topbar,
  .mobile-bottom-nav,
  .btn,
  .modal-overlay,
  .notification-btn,
  .hamburger-btn,
  .no-print {
    display: none !important;
  }

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

  .page-content {
    padding: 0 !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .card, .table-wrapper {
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }

  thead th, tbody td {
    color: black !important;
  }

  table {
    font-size: 11px;
  }

  .badge {
    border: 1px solid #ccc !important;
    color: black !important;
    background: none !important;
  }

  h1, h2, h3, h4, h5, h6 {
    color: black !important;
  }
}

/* ==========================================================================
   25. ADDITIONAL COMPONENT STYLES
   ========================================================================== */

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Toast notification */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + var(--space-md));
  right: var(--space-xl);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  min-width: 300px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  pointer-events: all;
  animation: slideInRight 0.3s ease;
}

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

.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error   { border-left: 3px solid var(--red); }
.toast.toast-warning { border-left: 3px solid var(--orange); }
.toast.toast-info    { border-left: 3px solid var(--blue); }

/* Action row */
.action-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* List group */
.list-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transition: background var(--transition-fast);
}

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

.list-item:hover {
  background: var(--surface2);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text2);
  margin-bottom: var(--space-md);
}

.breadcrumb .bc-sep {
  color: var(--text3);
}

.breadcrumb .bc-current {
  color: var(--text);
  font-weight: 600;
}

/* Inline edit */
.inline-edit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-sm);
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.photo-thumb:hover {
  border-color: var(--gold);
  transform: scale(1.03);
}

/* Chart container */
.chart-container {
  position: relative;
  width: 100%;
}

/* Horizontal rule */
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

/* Gold accent line */
.accent-line {
  width: 40px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin: var(--space-sm) 0;
}

/* JnS Bros attribution */
.pplx-attribution {
  font-size: var(--text-xs);
  color: var(--text3);
  text-align: center;
  padding: var(--space-sm) 0;
}

.pplx-attribution a {
  color: var(--text3);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.pplx-attribution a:hover {
  color: var(--gold);
}
