/* ============================================
   CUSTOM HOME BUILDER - Styles
   Premium luxury real estate application
   ============================================ */

/* === CSS Variables === */
:root {
  --navy: #1a3a52;
  --navy-dark: #0f2435;
  --coral: #e85d3b;
  --coral-light: #ff7a5c;
  --coral-dark: #c94a2a;
  --slate: #4a6274;
  --cream: #f8f6f3;
  --gold: #c9a962;
  --gold-light: #e8c97a;
  --white: #ffffff;
  --gray-50: #fafbfc;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --bg: var(--cream);
  --bg-card: var(--white);
  --bg-sidebar: var(--white);
  --text: var(--navy);
  --text-secondary: var(--slate);
  --text-muted: var(--gray-500);
  --border: rgba(26,58,82,0.1);
  --shadow-sm: 0 1px 3px rgba(26,58,82,0.06);
  --shadow-md: 0 4px 16px rgba(26,58,82,0.08);
  --shadow-lg: 0 12px 40px rgba(26,58,82,0.12);
  --shadow-xl: 0 20px 60px rgba(26,58,82,0.18);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg: #0f1a24;
  --bg-card: #1a2b3d;
  --bg-sidebar: #162232;
  --text: #e8ecf0;
  --text-secondary: #9fb3c8;
  --text-muted: #627d98;
  --border: rgba(255,255,255,0.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.4);
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-300: #475569;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: 'DM Sans', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
::selection { background: var(--coral); color: white; }
img { max-width: 100%; display: block; }
a { color: var(--coral); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ============================================
   SPLASH SCREEN
   ============================================ */
.splash-screen {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 10000; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.splash-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.spline-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.spline-container iframe { width: 100%; height: 100%; border: none; }
.splash-content {
  position: relative; z-index: 2; text-align: center; padding: 40px; max-width: 700px;
  animation: fadeInUp 1s ease-out 0.3s both;
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.splash-logo { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 36px; }
.splash-logo-icon {
  width: 56px; height: 56px; background: linear-gradient(135deg, var(--coral), var(--coral-light));
  border-radius: 16px; display: flex; align-items: center; justify-content: center; color: white;
  box-shadow: 0 8px 24px rgba(232,93,59,0.4);
}
.splash-logo-text {
  font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700;
  color: white; text-shadow: 0 2px 12px rgba(0,0,0,0.3); letter-spacing: 1px;
}
.splash-title {
  font-family: 'Playfair Display', serif; font-size: 3.6rem; font-weight: 700;
  color: white; margin-bottom: 20px; line-height: 1.15; text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.gradient-text {
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--coral));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.splash-subtitle {
  font-size: 1.15rem; color: rgba(255,255,255,0.88); line-height: 1.75; margin-bottom: 40px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2); max-width: 560px; margin-left: auto; margin-right: auto;
}
.splash-features { display: flex; justify-content: center; gap: 20px; margin-bottom: 44px; flex-wrap: wrap; }
.splash-feature {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.12); backdrop-filter: blur(12px);
  padding: 12px 22px; border-radius: 50px; border: 1px solid rgba(255,255,255,0.18);
  color: white; font-size: 0.92rem; font-weight: 500; transition: var(--transition);
}
.splash-feature:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); }
.feature-icon { font-size: 1.2rem; }
.splash-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--coral), var(--coral-light)); color: white; border: none;
  padding: 18px 42px; font-size: 1.1rem; font-weight: 600; border-radius: 60px;
  transition: var(--transition); box-shadow: 0 8px 32px rgba(232,93,59,0.4);
  animation: pulse 2.5s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(232,93,59,0.4); }
  50% { box-shadow: 0 8px 48px rgba(232,93,59,0.6); }
}
.splash-cta:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 40px rgba(232,93,59,0.5); }
.splash-cta:active { transform: translateY(-1px) scale(0.98); }
.splash-cta svg { transition: transform 0.3s; }
.splash-cta:hover svg { transform: translateX(4px); }
.splash-hint { margin-top: 20px; font-size: 0.88rem; color: rgba(255,255,255,0.5); }
.splash-hint kbd {
  background: rgba(255,255,255,0.12); padding: 3px 10px; border-radius: 5px;
  font-family: inherit; font-size: 0.82rem; border: 1px solid rgba(255,255,255,0.15);
}

/* ============================================
   AUTH SCREEN
   ============================================ */
.auth-screen {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  display: flex; align-items: center; justify-content: center; z-index: 9000;
}
.auth-container {
  display: flex; width: 100%; max-width: 880px; min-height: 560px;
  background: var(--bg-card); border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-xl); animation: fadeInUp 0.6s ease-out;
}
.auth-left-panel {
  width: 42%; background: linear-gradient(160deg, var(--navy) 0%, #0d2540 100%);
  padding: 48px 40px; display: flex; align-items: center; justify-content: center;
}
.auth-brand { text-align: center; color: white; }
.auth-brand-icon { margin-bottom: 24px; opacity: 0.9; display: inline-block; }
.auth-brand-icon svg { stroke: var(--gold); }
.auth-brand-text {
  font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700;
  margin-bottom: 12px; letter-spacing: 1px;
}
.auth-brand-description { font-size: 0.95rem; color: rgba(255,255,255,0.65); line-height: 1.6; }

.auth-right-panel { width: 58%; padding: 44px 40px; display: flex; flex-direction: column; }
.auth-tabs {
  display: flex; background: var(--gray-100); border-radius: 10px; padding: 4px;
  margin-bottom: 24px; position: relative;
}
.auth-tab {
  flex: 1; padding: 10px 20px; border: none; background: transparent; font-size: 0.92rem;
  font-weight: 600; color: var(--text-muted); border-radius: 8px; transition: var(--transition);
  cursor: pointer; position: relative; z-index: 1;
}
.auth-tab-active, .auth-tab.active {
  background: var(--bg-card); color: var(--coral); box-shadow: var(--shadow-sm);
}
.auth-tab-indicator { display: none; }
.auth-message {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
  font-size: 0.88rem; font-weight: 500;
}
.auth-message.error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.auth-message.success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
[data-theme="dark"] .auth-message.error { background: #3b1111; color: #f87171; border-color: #5c1d1d; }
[data-theme="dark"] .auth-message.success { background: #0d3320; color: #4ade80; border-color: #1a5c36; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-md);
  font-size: 0.92rem; color: var(--text); background: var(--bg-card); transition: var(--transition);
}
.form-input:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(232,93,59,0.1); }
.form-input::placeholder { color: var(--gray-400); }

.auth-forgot { text-align: right; margin-bottom: 20px; }
.forgot-link { font-size: 0.85rem; color: var(--coral); }
.forgot-link:hover { text-decoration: underline; }
.auth-button {
  width: 100%; padding: 14px; border: none; border-radius: 50px;
  background: linear-gradient(135deg, var(--coral), var(--coral-light)); color: white;
  font-size: 1rem; font-weight: 600; transition: var(--transition);
  box-shadow: 0 4px 16px rgba(232,93,59,0.3);
}
.auth-button:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(232,93,59,0.4); }
.auth-button:active { transform: translateY(0); }

.auth-divider {
  display: flex; align-items: center; margin: 24px 0; color: var(--text-muted); font-size: 0.82rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}
.auth-divider span { padding: 0 14px; }

.social-auth { display: flex; gap: 12px; }
.social-button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-md);
  background: var(--bg-card); color: var(--text); font-size: 0.9rem; font-weight: 500;
  transition: var(--transition);
}
.social-button:hover { border-color: var(--gray-300); background: var(--gray-50); }

/* ============================================
   APP HEADER
   ============================================ */
.app-header {
  position: sticky; top: 0; z-index: 1000; background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.header-content {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 64px; max-width: 100%;
}
.header-logo { display: flex; align-items: center; gap: 10px; color: white; }
.header-logo svg { stroke: var(--gold); }
.header-logo-text {
  font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700;
  color: white; letter-spacing: 0.5px;
}
.header-nav { display: flex; gap: 6px; }
.header-nav-button {
  display: flex; align-items: center; gap: 6px; padding: 8px 18px;
  background: transparent; border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.85);
  border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 500; transition: var(--transition);
}
.header-nav-button:hover { background: rgba(255,255,255,0.08); color: white; }
.header-nav-button.import-button {
  background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 600;
}
.header-nav-button.import-button:hover { background: var(--gold-light); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-sm);
  color: white; transition: var(--transition);
}
.theme-toggle:hover { background: rgba(255,255,255,0.1); }
.sun-icon, .moon-icon { transition: var(--transition); }

.user-dropdown { position: relative; }
.user-button {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50px; color: white; transition: var(--transition);
}
.user-button:hover { background: rgba(255,255,255,0.14); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--coral);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: white;
}
.user-name { font-size: 0.88rem; font-weight: 500; }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 180px;
  background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); overflow: hidden; animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.user-menu-item {
  display: block; padding: 10px 16px; color: var(--text); font-size: 0.88rem;
  transition: var(--transition);
}
.user-menu-item:hover { background: var(--gray-100); color: var(--coral); }
.user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================
   APP LAYOUT
   ============================================ */
.app-container { display: none; flex-direction: column; min-height: 100vh; }
.app-wrapper { display: flex; flex: 1; height: calc(100vh - 64px); }

/* === Sidebar === */
.sidebar {
  width: 320px; background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
}
.sidebar-title {
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 600; color: var(--text);
}
.plans-badge {
  background: var(--coral); color: white; font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 12px; min-width: 24px; text-align: center;
}
.sidebar-search {
  padding: 12px 20px; display: flex; align-items: center; gap: 10px; position: relative;
}
.sidebar-search svg { color: var(--gray-400); flex-shrink: 0; }
.sidebar-search-input {
  flex: 1; padding: 10px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-md);
  font-size: 0.88rem; background: var(--bg); color: var(--text); transition: var(--transition);
}
.sidebar-search-input:focus { outline: none; border-color: var(--coral); }

.plans-list { flex: 1; overflow-y: auto; padding: 8px 12px; }
.plan-card {
  display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition); margin-bottom: 4px;
  border: 1.5px solid transparent;
}
.plan-card:hover { background: var(--gray-50); }
.plan-card.active { background: rgba(232,93,59,0.06); border-color: var(--coral); }
.plan-card-thumbnail {
  width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0;
  background: var(--gray-200);
}
.plan-card-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.plan-card-content { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.plan-card-name {
  font-weight: 600; font-size: 0.92rem; color: var(--text); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-card-specs {
  display: flex; gap: 8px; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px;
}
.plan-card-specs span::after { content: '·'; margin-left: 8px; }
.plan-card-specs span:last-child::after { display: none; }
.plan-card-footer { display: flex; justify-content: space-between; align-items: center; }
.plan-card-price { font-size: 0.82rem; font-weight: 600; color: var(--coral); }
.plan-card-date { font-size: 0.72rem; color: var(--text-muted); }

.sidebar-import-button {
  margin: 12px 16px 16px; padding: 12px; border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md); background: transparent; color: var(--text-secondary);
  font-size: 0.88rem; font-weight: 500; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sidebar-import-button:hover { border-color: var(--coral); color: var(--coral); background: rgba(232,93,59,0.04); }

/* === Main Content === */
.main-content { flex: 1; overflow-y: auto; padding: 28px 32px; background: var(--bg); }

/* === Plan Header === */
.plan-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.plan-header-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.plan-name { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; color: var(--text); }
.plan-location { font-size: 0.88rem; color: var(--text-muted); margin-top: 4px; }
.plan-header-stats { display: flex; gap: 16px; }
.stat {
  display: flex; flex-direction: column; align-items: center; padding: 10px 18px;
  background: var(--bg-card); border-radius: var(--radius-md); border: 1px solid var(--border);
  min-width: 80px;
}
.stat-value { font-size: 1.1rem; font-weight: 700; color: var(--coral); }
.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* === Tabs === */
.tabs-header { margin-bottom: 24px; }
.tab-container {
  display: flex; gap: 2px; border-bottom: 2px solid var(--gray-200);
  position: relative; overflow-x: auto;
}
.tab-button {
  padding: 12px 18px; background: none; border: none; font-size: 0.88rem; font-weight: 500;
  color: var(--text-muted); transition: var(--transition); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab-button:hover { color: var(--text); }
.tab-button.tab-active, .tab-button.active {
  color: var(--coral); border-bottom-color: var(--coral); font-weight: 600;
}
.tab-indicator { display: none; }
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================
   FLOOR PLAN VIEW
   ============================================ */
.floor-selector { display: flex; gap: 8px; margin-bottom: 16px; }
.floor-button {
  padding: 8px 20px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-secondary); font-size: 0.85rem; font-weight: 500;
  transition: var(--transition);
}
.floor-button.floor-active, .floor-button.active {
  background: var(--navy); color: white; border-color: var(--navy);
}
.floorplan-container { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: white; }
.floorplan-display { position: relative; }
.floorplan-image-wrapper { position: relative; min-height: 400px; display: flex; align-items: center; justify-content: center; }
.floorplan-image-wrapper img { max-width: 100%; height: auto; }
.annotation-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  cursor: crosshair; z-index: 10;
}
.annotation-toolbar {
  display: flex; align-items: center; gap: 6px; padding: 10px 16px;
  background: var(--bg-card); border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.toolbar-section { display: flex; align-items: center; gap: 4px; }
.toolbar-section::after {
  content: ''; width: 1px; height: 24px; background: var(--gray-200); margin: 0 8px;
}
.toolbar-section:last-child::after { display: none; }
.toolbar-button {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-secondary); transition: var(--transition);
  font-size: 0.88rem;
}
.toolbar-button:hover { border-color: var(--gray-300); background: var(--gray-50); }
.toolbar-button.active { background: var(--coral); border-color: var(--coral); color: white; }

.color-picker-wrapper { display: flex; align-items: center; gap: 6px; }
.color-picker-label { font-size: 0.78rem; color: var(--text-muted); }
.color-picker-input {
  width: 32px; height: 32px; border: 2px solid var(--gray-200); border-radius: 50%;
  cursor: pointer; padding: 0; overflow: hidden; background: none;
}
.color-picker-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-input::-webkit-color-swatch { border: none; border-radius: 50%; }

.button { padding: 8px 16px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500; border: none; transition: var(--transition); }
.button-primary { background: var(--coral); color: white; }
.button-primary:hover { background: var(--coral-dark); }
.button-secondary { background: var(--gray-100); color: var(--text); border: 1px solid var(--gray-200); }
.button-secondary:hover { background: var(--gray-200); }
.button.danger { background: #ef4444; color: white; }
.button.danger:hover { background: #dc2626; }
.button-text { font-size: 0.85rem; }
.button-spinner { display: none; }

/* ============================================
   IMAGE GALLERY
   ============================================ */
.gallery-view { }
.gallery-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.gallery-info { font-size: 0.88rem; color: var(--text-muted); }
.gallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.gallery-grid .gallery-item {
  position: relative; border-radius: var(--radius-md); overflow: hidden;
  aspect-ratio: 4/3; cursor: pointer; background: var(--gray-200);
}
.gallery-grid .gallery-item img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease;
}
.gallery-grid .gallery-item:hover img { transform: scale(1.06); }
.gallery-grid .gallery-item .gallery-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(transparent, rgba(0,0,0,0.5));
  opacity: 0; transition: opacity 0.3s;
}
.gallery-grid .gallery-item:hover .gallery-overlay { opacity: 1; }

.checkbox-group { position: absolute; top: 10px; right: 10px; z-index: 5; }
.checkbox-input { display: none; }
.checkbox-label {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid white;
  background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); color: transparent; font-size: 0.75rem;
}
.checkbox-input:checked + .checkbox-label {
  background: var(--coral); border-color: var(--coral); color: white;
}

/* ============================================
   SPECIFICATIONS VIEW
   ============================================ */
.specifications-form { max-width: 820px; margin: 0 auto; }
.specs-section { margin-bottom: 36px; }
.specs-section-title {
  font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 600;
  color: var(--text); margin-bottom: 18px; padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
}
.specs-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
}
.specs-grid .form-group { margin-bottom: 0; }
.specs-grid .full-width { grid-column: 1 / -1; }

.form-range {
  width: 100%; height: 6px; border-radius: 3px; -webkit-appearance: none; appearance: none;
  background: var(--gray-200); outline: none; margin-top: 8px;
}
.form-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--coral); cursor: pointer; box-shadow: 0 2px 6px rgba(232,93,59,0.3);
}
.range-output { font-size: 0.85rem; font-weight: 600; color: var(--coral); margin-top: 4px; }

.form-textarea {
  width: 100%; min-height: 120px; padding: 12px 16px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md); font-size: 0.92rem; color: var(--text);
  background: var(--bg-card); resize: vertical; transition: var(--transition); font-family: inherit;
}
.form-textarea:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(232,93,59,0.1); }

select.form-input {
  -webkit-appearance: none; appearance: none;
  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='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}

.checkbox-group-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.checkbox-group-inline label {
  padding: 8px 16px; border: 1.5px solid var(--gray-200); border-radius: 50px;
  font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: var(--transition);
  color: var(--text-secondary);
}
.checkbox-group-inline input:checked + label,
.checkbox-group-inline label.selected {
  background: var(--coral); border-color: var(--coral); color: white;
}

.specs-actions { text-align: center; margin-top: 32px; }

/* ============================================
   IMPORT MODAL
   ============================================ */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 5000;
}
.modal { background: var(--bg-card); border-radius: var(--radius-xl); width: 100%; max-width: 580px;
  box-shadow: var(--shadow-xl); animation: slideUp 0.3s ease; max-height: 90vh; overflow-y: auto; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal-header {
  display: flex; justify-content: space-between; align-items: center; padding: 24px 28px 0;
}
.modal-header h2 { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--gray-100); color: var(--text-muted); font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); transform: rotate(90deg); }

.modal-content { padding: 24px 28px; }
.input-with-button { display: flex; gap: 8px; margin-bottom: 20px; }
.input-with-button .form-input { flex: 1; }
.input-with-button .button { flex-shrink: 0; }

.import-loading { display: none; }
.loading-steps { display: flex; flex-direction: column; gap: 14px; }
.loading-step {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 0.88rem; color: var(--text-muted);
  transition: var(--transition);
}
.loading-step.active { color: var(--coral); background: rgba(232,93,59,0.06); font-weight: 500; }
.loading-step.complete { color: #16a34a; }
.step-status { width: 20px; text-align: center; }
.loading-spinner {
  width: 18px; height: 18px; border: 2px solid var(--gray-200);
  border-top-color: var(--coral); border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.import-preview { display: none; margin-top: 20px; }
.import-section { margin-bottom: 16px; }
.import-section h3 { font-size: 0.92rem; font-weight: 600; margin-bottom: 8px; }
.preview-items { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-item { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-secondary); }
.preview-count { font-weight: 700; color: var(--coral); }
.preview-label { color: var(--text-muted); }

.import-error { display: none; color: #dc2626; font-size: 0.88rem; padding: 12px; background: #fef2f2; border-radius: var(--radius-sm); margin-top: 12px; }

.modal-footer { padding: 16px 28px 24px; display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.92); z-index: 8000;
  display: flex; align-items: center; justify-content: center;
}
.lightbox { position: relative; max-width: 90vw; max-height: 90vh; }
.lightbox-content { display: flex; align-items: center; justify-content: center; }
.lightbox-content img {
  max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: var(--radius-md);
  animation: zoomIn 0.3s ease;
}
@keyframes zoomIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.lightbox-close {
  position: absolute; top: -40px; right: 0; width: 36px; height: 36px;
  border-radius: 50%; border: none; background: rgba(255,255,255,0.15);
  color: white; font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.15); color: white; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); transform: translateY(-50%) scale(1.1); }
.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }
.lightbox-caption {
  position: absolute; bottom: -36px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,0.7); font-size: 0.88rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast-container .toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--gray-400); font-size: 0.88rem; min-width: 280px;
  animation: slideInRight 0.4s ease;
}
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
.toast-container .toast.success { border-left-color: #16a34a; }
.toast-container .toast.error { border-left-color: #dc2626; }
.toast-container .toast.info { border-left-color: #2563eb; }
.toast-container .toast.removing { animation: slideOutRight 0.3s ease forwards; }
@keyframes slideOutRight { to { opacity: 0; transform: translateX(60px); } }

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 24px; text-align: center;
}
.empty-state-icon { font-size: 3rem; opacity: 0.4; margin-bottom: 16px; }
.empty-state-title {
  font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 600;
  color: var(--text); margin-bottom: 8px;
}
.empty-state-description { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 24px; max-width: 400px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .sidebar { width: 280px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .specs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .auth-container { flex-direction: column; max-width: 440px; }
  .auth-left-panel { display: none; }
  .auth-right-panel { width: 100%; }
  .header-nav { display: none; }
  .sidebar { display: none; }
  .app-wrapper { flex-direction: column; }
  .main-content { padding: 20px 16px; }
  .splash-title { font-size: 2.4rem; }
  .splash-subtitle { font-size: 1rem; }
  .splash-features { flex-direction: column; gap: 10px; align-items: center; }
  .plan-header-stats { flex-wrap: wrap; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; }
}
@media (max-width: 480px) {
  .splash-title { font-size: 2rem; }
  .splash-logo-text { font-size: 1.3rem; }
  .gallery-grid { grid-template-columns: 1fr; }
  .plan-name { font-size: 1.4rem; }
  .tab-button { padding: 10px 12px; font-size: 0.82rem; }
  .modal { margin: 12px; max-width: calc(100% - 24px); }
}

/* ================================================================ */
/* PROJECT ADMIN STYLES                                             */
/* ================================================================ */

/* Admin Sub-Navigation */
.admin-subnav {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.admin-subnav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-subnav-btn:hover { background: rgba(99,102,241,0.08); color: var(--text-primary); }
.admin-subnav-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

/* Summary Cards */
.admin-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.summary-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.summary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.summary-card-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.summary-card-header svg { opacity: 0.5; }
.summary-card-value {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.summary-card-value.on-budget { color: #10b981; }
.summary-card-value.over-budget { color: #ef4444; }
.summary-card-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.summary-card-total { border-left: 3px solid var(--primary); }
.summary-card-spent { border-left: 3px solid #f59e0b; }
.summary-card-variance { border-left: 3px solid #10b981; }
.summary-card-progress { border-left: 3px solid #8b5cf6; }

.progress-bar-small {
  height: 6px;
  background: rgba(139,92,246,0.15);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* Admin Section */
.admin-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.admin-section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.admin-section-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 12px;
}

/* Project Info Grid */
.project-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.project-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  background: rgba(99,102,241,0.04);
  border-radius: 8px;
}
.info-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.info-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Phase Budget Chart */
.phase-chart-container { display: flex; flex-direction: column; gap: 10px; }
.phase-chart-row {
  display: grid;
  grid-template-columns: 200px 1fr 90px;
  align-items: center;
  gap: 12px;
}
.phase-chart-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phase-chart-bar-wrapper {
  height: 22px;
  background: rgba(99,102,241,0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.phase-chart-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
  position: relative;
}
.phase-chart-bar.estimated { background: linear-gradient(90deg, rgba(99,102,241,0.7), rgba(99,102,241,0.4)); }
.phase-chart-bar.actual {
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(90deg, #10b981, #34d399);
  z-index: 1;
}
.phase-chart-amount {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Budget Table */
.budget-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.budget-toolbar .admin-section-title { margin-bottom: 0; }
.budget-toolbar-actions { display: flex; gap: 8px; align-items: center; }
.budget-search {
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  width: 200px;
}
.budget-filter {
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
}
.budget-table-wrapper { overflow-x: auto; }
.budget-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.budget-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
  border-bottom: 2px solid var(--glass-border);
  position: sticky;
  top: 0;
  background: var(--glass-bg);
}
.budget-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(99,102,241,0.06);
  color: var(--text-primary);
  vertical-align: top;
}
.budget-table tbody tr:hover { background: rgba(99,102,241,0.04); }
.budget-table .col-number { text-align: right; font-variant-numeric: tabular-nums; }
.budget-table .col-phase { min-width: 180px; }
.budget-table .col-notes { max-width: 250px; font-size: 0.78rem; color: var(--text-secondary); }
.budget-table .col-status { width: 90px; }
.budget-table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--glass-border);
  background: rgba(99,102,241,0.04);
}
.budget-table .subtotal-row { background: rgba(99,102,241,0.06); }
.budget-table .subtotal-row td { font-weight: 600; font-style: italic; }

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-badge.not-started { background: rgba(107,114,128,0.15); color: #6b7280; }
.status-badge.in-progress { background: rgba(245,158,11,0.15); color: #d97706; }
.status-badge.completed { background: rgba(16,185,129,0.15); color: #059669; }
.status-badge.over-budget { background: rgba(239,68,68,0.15); color: #dc2626; }

/* Workflow Timeline */
.workflow-timeline { display: flex; flex-direction: column; gap: 0; }
.workflow-phase {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  position: relative;
}
.workflow-phase:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 48px;
  bottom: 0;
  width: 2px;
  background: var(--glass-border);
}
.workflow-phase.phase-completed:not(:last-child)::before { background: #10b981; }
.workflow-phase.phase-in-progress:not(:last-child)::before {
  background: linear-gradient(to bottom, #f59e0b 50%, var(--glass-border) 50%);
}

.workflow-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--glass-border);
  background: var(--bg-primary);
  z-index: 1;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
}
.workflow-icon:hover { transform: scale(1.1); }
.phase-completed .workflow-icon { background: #10b981; border-color: #10b981; color: #fff; }
.phase-in-progress .workflow-icon { background: #f59e0b; border-color: #f59e0b; color: #fff; animation: pulse-ring 2s infinite; }
.phase-not-started .workflow-icon { background: var(--bg-primary); border-color: var(--glass-border); color: var(--text-secondary); }

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}

.workflow-details { flex: 1; min-width: 0; }
.workflow-phase-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.workflow-phase-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.workflow-phase-cost {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
}
.workflow-status-toggle {
  display: flex;
  gap: 4px;
}
.workflow-status-btn {
  padding: 5px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.workflow-status-btn:hover { border-color: var(--primary); color: var(--primary); }
.workflow-status-btn.active-status { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Invoice Summary */
.invoice-summary-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.invoice-stat {
  flex: 1;
  min-width: 140px;
  padding: 14px 18px;
  background: rgba(99,102,241,0.04);
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}
.invoice-stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.invoice-stat-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.button-sm { padding: 8px 14px; font-size: 0.82rem; }

/* Contacts Grid */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.contact-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.contact-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.contact-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
}
.contact-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.contact-role {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.contact-info-row svg { flex-shrink: 0; opacity: 0.5; }
.contact-info-row a { color: var(--primary); text-decoration: none; }
.contact-info-row a:hover { text-decoration: underline; }

/* Admin View responsive */
@media (max-width: 768px) {
  .admin-subnav { gap: 2px; }
  .admin-subnav-btn { padding: 8px 10px; font-size: 0.78rem; }
  .admin-subnav-btn svg { display: none; }
  .admin-summary-cards { grid-template-columns: repeat(2, 1fr); }
  .phase-chart-row { grid-template-columns: 120px 1fr 70px; }
  .phase-chart-label { font-size: 0.72rem; }
  .budget-toolbar { flex-direction: column; align-items: stretch; }
  .budget-toolbar-actions { flex-wrap: wrap; }
  .budget-search { width: 100%; }
  .workflow-phase { grid-template-columns: 36px 1fr; gap: 10px; }
  .workflow-status-toggle { display: none; }
}
@media (max-width: 480px) {
  .admin-summary-cards { grid-template-columns: 1fr; }
  .contacts-grid { grid-template-columns: 1fr; }
}

/* === Utility === */
.hidden { display: none !important; }
