/* =====================================================
   STATT General Contracting - Client Portal
   Main CSS — Brand: Blue, Steel Grey, White
   ===================================================== */

:root {
  /* Brand Colors */
  --blue-primary: #1E6FD9;
  --blue-bright: #2E87FF;
  --blue-dark: #1452A8;
  --blue-deeper: #0E3A7A;
  --blue-glow: rgba(30, 111, 217, 0.3);

  --steel: #8A9BB0;
  --steel-light: #B8C8D9;
  --steel-dark: #5A6E82;

  --grey-bg: #F4F6F9;
  --grey-surface: #FFFFFF;
  --grey-card: #FFFFFF;
  --grey-border: #DDE3EC;
  --grey-hover: #EEF2F7;
  --grey-muted: #C5CDD8;

  --white: #FFFFFF;
  --white-80: rgba(255,255,255,0.8);
  --white-60: rgba(255,255,255,0.6);
  --white-30: rgba(255,255,255,0.3);
  --white-10: rgba(30,111,217,0.06);

  --text-primary: #0F1923;
  --text-secondary: #4A5568;
  --text-muted: #8A9BB0;

  /* Status Colors */
  --green: #22C55E;
  --green-bg: rgba(34, 197, 94, 0.1);
  --yellow: #F59E0B;
  --yellow-bg: rgba(245, 158, 11, 0.1);
  --red: #EF4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --orange: #F97316;

  /* Spacing */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-blue: 0 0 24px rgba(30, 111, 217, 0.25);

  /* Fonts */
  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Sidebar */
  --sidebar-w: 260px;
  --header-h: 64px;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--grey-bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F4F6F9; }
::-webkit-scrollbar-thumb { background: #C5CDD8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8A9BB0; }

/* =====================================================
   UTILITIES
   ===================================================== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================
   BACKGROUND GRID
   ===================================================== */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(30,111,217,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,111,217,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(30,111,217,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-bright));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue-primary));
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.btn-full { width: 100%; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--grey-hover); border-color: var(--steel-dark); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { background: var(--white-10); color: var(--text-primary); }

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
  background: var(--grey-card);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.input-wrap { position: relative; }
.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

input, select, textarea {
  width: 100%;
  background: #F8FAFC;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}

.input-wrap input { padding-left: 40px; }
.input-wrap input:has(~ .toggle-pw) { padding-right: 40px; }

input:focus, select:focus, textarea:focus {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

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

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
}
.toggle-pw svg { width: 16px; height: 16px; }
.toggle-pw:hover { color: var(--text-secondary); }

/* =====================================================
   ERROR / SUCCESS MESSAGES
   ===================================================== */
.error-msg {
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 0.875rem;
  padding: 10px 14px;
  text-align: center;
}

.success-msg {
  background: var(--green-bg);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: var(--radius);
  color: var(--green);
  font-size: 0.875rem;
  padding: 10px 14px;
  text-align: center;
}

/* =====================================================
   STATUS BADGES
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-blue { background: rgba(30,111,217,0.15); color: var(--blue-bright); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-grey { background: var(--white-10); color: var(--text-secondary); }

/* =====================================================
   LOADING SPINNER
   ===================================================== */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--grey-border);
  border-top-color: var(--blue-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* =====================================================
   PORTAL LAYOUT (dashboard shell)
   ===================================================== */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--grey-surface);
  border-right: 1px solid var(--grey-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-logo {
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--grey-border);
}

.sidebar-logo .statt-wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--blue-primary);
  line-height: 1;
}

.sidebar-logo .statt-wordmark-sub {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-project-selector {
  padding: 16px 12px;
  border-bottom: 1px solid var(--grey-border);
}

.sidebar-project-selector label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
  padding: 0 8px;
}

.project-select-btn {
  width: 100%;
  background: var(--grey-card);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
}
.project-select-btn:hover { border-color: var(--blue-primary); }
.project-select-btn svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 8px 4px;
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--white-10); color: var(--text-primary); }
.nav-item.active {
  background: rgba(30,111,217,0.15);
  color: var(--blue-bright);
  border-left: 3px solid var(--blue-primary);
  padding-left: 9px;
}
.nav-badge {
  margin-left: auto;
  background: var(--blue-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--grey-border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); truncate: ellipsis; }
.user-role { font-size: 0.75rem; color: var(--text-muted); text-transform: capitalize; }

.btn-logout {
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-logout svg { width: 14px; height: 14px; }
.btn-logout:hover { background: var(--red-bg); border-color: rgba(239,68,68,0.3); color: var(--red); }

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

/* Top header */
.top-header {
  height: var(--header-h);
  background: var(--grey-surface);
  border-bottom: 1px solid var(--grey-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Page content */
.page-content {
  padding: 32px;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* =====================================================
   STAT CARDS (Dashboard)
   ===================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--grey-card);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--grey-muted); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue-primary), var(--blue-bright));
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover::before { opacity: 1; }

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: rgba(30,111,217,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon svg { width: 20px; height: 20px; color: var(--blue-bright); }

/* =====================================================
   PROGRESS BAR
   ===================================================== */
.progress-bar-wrap {
  background: var(--grey-surface);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-primary), var(--blue-bright));
  border-radius: 100px;
  transition: width 0.5s ease;
}

/* =====================================================
   TABLES
   ===================================================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--grey-surface);
  border-bottom: 1px solid var(--grey-border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--grey-border);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--grey-hover); }

/* =====================================================
   PHOTO GALLERY
   ===================================================== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.photo-card {
  background: var(--grey-card);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.photo-card:hover { border-color: var(--blue-primary); transform: translateY(-2px); box-shadow: var(--shadow-blue); }

.photo-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--grey-surface);
}

.photo-info {
  padding: 12px;
}

.photo-category {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 4px;
}

.photo-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.photo-date { font-size: 0.75rem; color: var(--text-muted); }

/* =====================================================
   TIMELINE / MILESTONES
   ===================================================== */
.timeline {
  position: relative;
  padding-left: 32px;
}

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

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--grey-border);
  background: var(--grey-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.timeline-dot.completed {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
}
.timeline-dot.in-progress {
  background: var(--grey-card);
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.timeline-dot.delayed {
  border-color: var(--yellow);
}
.timeline-dot svg { width: 10px; height: 10px; color: white; }

.timeline-content {
  background: var(--grey-card);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 16px;
}

.timeline-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

/* =====================================================
   ACTIVITY FEED
   ===================================================== */
.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--grey-border);
}
.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(30,111,217,0.1);
  border: 1px solid rgba(30,111,217,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-icon svg { width: 14px; height: 14px; color: var(--blue-bright); }

.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 0.875rem; color: var(--text-primary); line-height: 1.4; }
.activity-text strong { color: var(--blue-bright); }
.activity-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* =====================================================
   MESSAGES
   ===================================================== */
.messages-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: calc(100vh - var(--header-h) - 64px);
  background: var(--grey-card);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.messages-list {
  border-right: 1px solid var(--grey-border);
  overflow-y: auto;
  background: var(--grey-surface);
}

.messages-list-header {
  padding: 16px;
  border-bottom: 1px solid var(--grey-border);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.message-preview {
  padding: 14px 16px;
  border-bottom: 1px solid var(--grey-border);
  cursor: pointer;
  transition: background 0.15s;
}
.message-preview:hover { background: var(--grey-hover); }
.message-preview.active { background: rgba(30,111,217,0.1); border-left: 3px solid var(--blue-primary); }
.message-preview.unread .msg-preview-text { color: var(--text-primary); font-weight: 500; }
.msg-preview-from { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.msg-preview-text { font-size: 0.8rem; color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-preview-time { font-size: 0.72rem; color: var(--text-muted); float: right; }

.message-thread {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.thread-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--grey-border);
}

.thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-bubble {
  max-width: 65%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
}
.msg-bubble.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-primary));
  color: white;
  border-bottom-right-radius: 4px;
}
.msg-bubble.received {
  align-self: flex-start;
  background: var(--grey-surface);
  border: 1px solid var(--grey-border);
  border-bottom-left-radius: 4px;
}
.msg-bubble p { font-size: 0.9rem; line-height: 1.5; }
.msg-bubble time { font-size: 0.72rem; opacity: 0.7; margin-top: 4px; display: block; }

.thread-composer {
  padding: 16px 24px;
  border-top: 1px solid var(--grey-border);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.thread-composer textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 14px;
}

/* =====================================================
   MODAL / LIGHTBOX
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s;
}

.modal {
  background: var(--grey-card);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.2s;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius);
  display: flex;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--white-10); color: var(--text-primary); }
.modal-close svg { width: 20px; height: 20px; }

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

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

/* =====================================================
   NOTIFICATION BELL
   ===================================================== */
.notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius);
  transition: all 0.2s;
  display: flex;
}
.notif-btn svg { width: 22px; height: 22px; }
.notif-btn:hover { background: var(--white-10); color: var(--text-primary); }
.notif-count {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--red);
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  gap: 12px;
}
.empty-state svg { width: 48px; height: 48px; color: var(--text-muted); opacity: 0.5; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); }
.empty-state p { font-size: 0.875rem; color: var(--text-muted); max-width: 300px; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .messages-layout { grid-template-columns: 1fr; }
  .messages-list { display: none; }
  .messages-layout.show-list .messages-list { display: block; }
  .messages-layout.show-list .message-thread { display: none; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-content { padding: 20px 16px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}
