/* P2P Estimating Platform - Dark Glassmorphic Theme */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f0f5;
  --text-secondary: #8b8b9e;
  --text-muted: #5a5a6e;
  --accent: #c8a951;
  --accent-hover: #d4b85e;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --sidebar-width: 240px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-voice { background: rgba(200, 169, 81, 0.15); color: var(--accent); border-radius: 50%; width: 40px; height: 40px; padding: 0; justify-content: center; }
.btn-voice:hover { background: rgba(200, 169, 81, 0.3); }
.btn-voice.active { background: var(--danger); color: white; animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.search-input {
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  width: 250px;
}

/* Auth Screen */
#auth-screen {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(200, 169, 81, 0.1) 0%, var(--bg-primary) 50%);
}
.auth-container { width: 100%; max-width: 420px; padding: 20px; }
.auth-logo { text-align: center; margin-bottom: 30px; }
.auth-logo i { font-size: 48px; color: var(--accent); margin-bottom: 12px; }
.auth-logo h1 { font-size: 28px; font-weight: 700; }
.auth-logo p { color: var(--text-secondary); margin-top: 6px; }
.auth-card { padding: 30px; background: rgba(255,255,255,0.05); border: 1px solid rgba(201,169,78,0.2); border-radius: 16px; backdrop-filter: blur(20px); }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.auth-tab { flex: 1; padding: 10px; background: none; border: none; color: var(--text-secondary); font-size: 14px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit; }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-form { display: none; }
.auth-form.active { display: block; }

/* Screen Management */
.screen { display: none; }
.screen.active { display: flex; align-items: center; justify-content: center; }
#auth-screen.active { display: flex; }
#dashboard-screen.active { display: flex; width: 100%; min-height: 100vh; }
#admin-screen.active { display: block; width: 100%; min-height: 100vh; padding: 30px; padding-left: 190px; overflow-y: auto; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}
.sidebar-header { text-align: center; padding: 10px 0 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 16px; }
.sidebar-logo { width: 48px; height: 48px; border-radius: 12px; object-fit: contain; margin-bottom: 8px; background: rgba(255,255,255,0.05); padding: 4px; }
.sidebar-business-name { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.sidebar-nav { list-style: none; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 8px; cursor: pointer; color: var(--text-secondary); font-size: 14px; transition: all 0.2s; margin-bottom: 4px; }
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.nav-item.active { background: rgba(200, 169, 81, 0.12); color: var(--accent); }
.nav-item i { width: 20px; text-align: center; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--border-color); }

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px 32px;
  min-height: 100vh;
}
.view { display: none; }
.view.active { display: block; }
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.view-header h2 { font-size: 24px; font-weight: 600; }
.view-actions { display: flex; gap: 12px; align-items: center; }

/* Kanban Board */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: calc(100vh - 120px);
}
.kanban-column {
  min-width: 280px;
  max-width: 300px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.column-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.column-header h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.column-count { background: rgba(200, 169, 81, 0.2); color: var(--accent); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.column-cards { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 100px; }

/* Kanban Cards */
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.kanban-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.kanban-card.dragging { opacity: 0.5; }
.card-title { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.card-badge.gc { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.card-badge.due { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.card-badge.amount { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.card-badge.overdue { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* Chat */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 100px); }
.chat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chat-controls { display: flex; gap: 8px; align-items: center; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; background: rgba(0,0,0,0.2); border-radius: var(--radius-lg); margin-bottom: 16px; }
.chat-message { margin-bottom: 16px; display: flex; }
.chat-message.user { justify-content: flex-end; }
.chat-message .message-content { max-width: 70%; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.chat-message.assistant .message-content { background: rgba(255,255,255,0.04); border: 1px solid var(--border-color); }
.chat-message.user .message-content { background: rgba(200, 169, 81, 0.15); border: 1px solid rgba(200, 169, 81, 0.3); }
.chat-message .message-content ul { margin: 8px 0; padding-left: 20px; }
.chat-message .message-content li { margin-bottom: 4px; }
.chat-input-area { display: flex; gap: 8px; }
.chat-input-area textarea { flex: 1; padding: 12px 16px; background: rgba(255,255,255,0.04); border: 1px solid var(--border-color); border-radius: 12px; color: var(--text-primary); font-size: 14px; resize: none; font-family: inherit; }
.chat-input-area textarea:focus { outline: none; border-color: var(--accent); }
.select-sm { padding: 6px 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary); font-size: 12px; }

/* Email */
.email-container { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.email-compose, .email-history { padding: 24px; }

/* Calendar */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.calendar-day { padding: 10px; min-height: 80px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 12px; }
.calendar-day.today { border-color: var(--accent); }
.calendar-day .day-number { font-weight: 600; margin-bottom: 4px; }
.calendar-event { font-size: 10px; background: rgba(200, 169, 81, 0.15); padding: 2px 4px; border-radius: 3px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Settings */
.settings-container { max-width: 700px; }
.settings-section { padding: 24px; margin-bottom: 20px; }
.settings-section h3 { font-size: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.settings-note { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.logo-upload { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.logo-upload img { width: 80px; height: 80px; border-radius: 12px; object-fit: contain; background: rgba(255,255,255,0.05); padding: 4px; border: 1px solid var(--border-color); }
.integration-status { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.integration-status i { font-size: 8px; margin-right: 6px; }

/* Voice Overlay */
.voice-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.voice-overlay.hidden { display: none; }
.voice-container { padding: 40px; text-align: center; min-width: 300px; }
.voice-avatar { width: 100px; height: 100px; border-radius: 50%; background: rgba(200, 169, 81, 0.15); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; position: relative; }
.voice-avatar i { font-size: 36px; color: var(--accent); }
.voice-pulse { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--accent); animation: voice-pulse 2s infinite; }
@keyframes voice-pulse { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.3); opacity: 0; } }
.voice-transcript { font-size: 14px; color: var(--text-secondary); margin: 12px 0; min-height: 40px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 500; }
.modal.hidden { display: none; }
.modal-content { padding: 24px; width: 90%; max-width: 550px; max-height: 85vh; overflow-y: auto; }
.modal-lg { max-width: 800px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

/* Markup Images - constrain to fit within popup */
.markup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.markup-grid a { display: block; }
.markup-grid img { width: 100%; max-height: 300px; object-fit: contain; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.3); cursor: pointer; transition: transform 0.2s; }
.markup-grid img:hover { transform: scale(1.02); border-color: rgba(255,215,0,0.3); }

/* Delete button on kanban cards */
.kanban-card { position: relative; }
.card-delete-btn { position: absolute; top: 8px; right: 8px; background: rgba(139,26,26,0.8); border: none; color: #fff; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.kanban-card:hover .card-delete-btn { opacity: 1; }
.card-delete-btn:hover { background: #c0392b; }

/* Data Table */
.data-table { width: 100%; }
.data-table table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.data-table th { color: var(--text-secondary); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table tr:hover { background: rgba(255,255,255,0.02); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Upload Hero Banner */
.upload-hero {
  background: linear-gradient(135deg, rgba(201,169,78,0.15), rgba(201,169,78,0.05));
  border: 2px solid rgba(201,169,78,0.4);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  margin-bottom: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.upload-hero:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(201,169,78,0.25), rgba(201,169,78,0.1));
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(201,169,78,0.2);
}
.upload-hero h3 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.upload-hero p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}
.upload-hero .upload-btn {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(135deg, #c9a94e, #a8893e);
  color: #000;
  font-weight: 700;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
}


/* Orphaned mobile styles removed - moved to proper @media query */
}

/* Landing Screen */
#landing-screen.landing-hidden {
  display: none;
}
#landing-screen.landing-visible {
  display: block;
}

/* Billing view styles */
.topup-card-app:hover {
  border-color: rgba(201,169,78,0.4) !important;
  background: rgba(201,169,78,0.05) !important;
  transform: translateY(-2px);
}
.billing-plan-card:hover {
  border-color: rgba(201,169,78,0.4) !important;
  background: rgba(201,169,78,0.05) !important;
  transform: translateY(-2px);
}
.billing-plan-card.current {
  border-color: rgba(74,222,128,0.3) !important;
  background: rgba(74,222,128,0.05) !important;
}
#view-billing {
  padding: 30px;
}
#view-billing h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #fff;
}
#view-billing h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #c9a94e;
}

/* HIGH CONTRAST AUTH FORM FIX */
#auth-screen {
  background: linear-gradient(180deg, #0d1117 0%, #0a0a0f 100%) !important;
}
.auth-card {
  background: rgba(20, 20, 30, 0.95) !important;
  border: 1px solid rgba(201, 169, 78, 0.4) !important;
  border-radius: 16px !important;
  padding: 40px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(201,169,78,0.1) !important;
}
.auth-logo h1 {
  color: #ffffff !important;
  font-size: 28px !important;
}
.auth-logo p {
  color: #9ca3af !important;
}
.auth-tabs {
  border-bottom: 1px solid rgba(201,169,78,0.3) !important;
}
.auth-tab {
  color: #9ca3af !important;
  font-size: 15px !important;
}
.auth-tab.active {
  color: #c8a951 !important;
  border-bottom-color: #c8a951 !important;
}
.auth-form .form-group label {
  color: #d1d5db !important;
  font-size: 14px !important;
}
.auth-form .form-group input {
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  color: #ffffff !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
}
.auth-form .form-group input:focus {
  border-color: #c8a951 !important;
  box-shadow: 0 0 0 2px rgba(201,169,78,0.2) !important;
}
.auth-form .btn-primary {
  background: linear-gradient(135deg, #c8a951, #d4b85e) !important;
  color: #000000 !important;
  font-weight: 700 !important;
  padding: 14px !important;
  font-size: 16px !important;
  border-radius: 10px !important;
  margin-top: 8px !important;
}

/* === FIX: Kanban board horizontal scroll === */
.main-content {
  overflow-x: hidden;
  max-width: calc(100vw - var(--sidebar-width));
}
.kanban-board {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding-bottom: 12px;
}
.kanban-board::-webkit-scrollbar {
  height: 8px;
}
.kanban-board::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}
.kanban-board::-webkit-scrollbar-thumb {
  background: rgba(200,169,81,0.4);
  border-radius: 4px;
}
.kanban-board::-webkit-scrollbar-thumb:hover {
  background: rgba(200,169,81,0.6);
}
.kanban-column {
  scroll-snap-align: start;
}

/* === FIX: Billing plans 2x2 grid === */
#billing-plans-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px !important;
}
#billing-topup-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px !important;
}

/* === FIX: Settings/Profile view === */
#view-profile.active {
  display: block !important;
}
.settings-container {
  max-width: 700px;
}
.logo-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
}
.logo-upload img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: contain;
  border: 2px solid rgba(200,169,81,0.3);
}




/* ============================================================
   DASHBOARD UX OVERHAUL - Liquid Glass + Mobile Fixes
   ============================================================ */

/* Logo Placeholder */
.logo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(201,169,78,0.2), rgba(201,169,78,0.05));
    border: 1px solid rgba(201,169,78,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c9a94e;
    font-size: 20px;
}
.logo-upload .logo-placeholder {
    width: 80px;
    height: 80px;
    font-size: 32px;
}

/* Liquid Glass - Enhanced glass-card */
.glass-card,
.settings-section,
.kanban-column,
.billing-section,
.topup-card-app,
.billing-plan-card {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.05) !important;
    transition: all 0.3s ease !important;
}
.glass-card:hover,
.settings-section:hover {
    border-color: rgba(201,169,78,0.2) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

/* Liquid Glass on modal content */
.modal-content {
    background: rgba(15, 15, 25, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

/* Liquid Glass on inputs */
.form-group input,
.form-group select,
.form-group textarea,
.search-input,
#contacts-search {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    transition: all 0.2s ease !important;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.search-input:focus {
    border-color: rgba(201,169,78,0.5) !important;
    box-shadow: 0 0 0 3px rgba(201,169,78,0.1) !important;
}

/* Liquid Glass buttons */
.btn-sm,
.btn-ghost {
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-radius: 10px !important;
}

/* Contacts action buttons - liquid glass */
.view-header .btn-sm,
#view-contacts .btn-sm {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #c9a94e !important;
    border-radius: 10px !important;
    backdrop-filter: blur(10px) !important;
    padding: 8px 14px !important;
}
.view-header .btn-sm:hover,
#view-contacts .btn-sm:hover {
    background: rgba(201, 169, 78, 0.1) !important;
    border-color: rgba(201, 169, 78, 0.3) !important;
}

/* Sidebar - Liquid Glass */
.sidebar {
    background: rgba(17, 17, 24, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Mobile Menu Toggle Button */
#mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(201, 169, 78, 0.15);
    border: 1px solid rgba(201, 169, 78, 0.3);
    color: #c9a94e;
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Sidebar Overlay */
#sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Coin balance mini display for collapsed sidebar */
.sidebar-coins-mini {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 4px;
    margin: 6px auto;
    width: calc(100% - 8px);
    box-sizing: border-box;
    background: rgba(201, 169, 78, 0.15);
    border: 1px solid rgba(201, 169, 78, 0.35);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(201, 169, 78, 0.1);
}
.sidebar-coins-mini .coin-num {
    font-size: 13px;
    font-weight: 800;
    color: #c9a94e;
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.sidebar-coins-mini .coin-icon {
    font-size: 12px;
    color: #c9a94e;
    margin-bottom: 3px;
}

/* Calendar clickable days */
.calendar-day {
    cursor: pointer;
    transition: all 0.2s ease;
}
.calendar-day:hover {
    background: rgba(201, 169, 78, 0.08) !important;
    border-color: rgba(201, 169, 78, 0.3) !important;
}

/* FAQ Styles */
.faq-item.open .faq-answer {
    max-height: 200px !important;
    padding: 0 20px !important;
}
.faq-item.open .fa-chevron-down {
    transform: rotate(180deg) !important;
}

/* ============================================================
   MOBILE OVERHAUL
   ============================================================ */
@media (max-width: 768px) {
    /* Show hamburger */
    #mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Sidebar collapsed state */
    .sidebar {
        width: 60px !important;
        padding: 60px 6px 10px !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow: hidden !important;
    }
    .sidebar .sidebar-header {
        padding: 4px 0 8px !important;
    }
    .sidebar .sidebar-header span,
    .sidebar .sidebar-business-name {
        display: none !important;
    }
    .sidebar .sidebar-logo,
    .sidebar .logo-placeholder {
        width: 36px !important;
        height: 36px !important;
        margin: 0 auto !important;
    }
    
    /* Hide full coin box, show mini */
    .sidebar .sidebar-coins {
        display: none !important;
    }
    .sidebar-coins-mini {
        display: flex !important;
    }
    
    /* Hide nav labels in collapsed */
    .sidebar .nav-item span {
        display: none !important;
    }
    .sidebar .nav-item {
        justify-content: center !important;
        padding: 10px 6px !important;
    }
    .sidebar .nav-item i {
        margin: 0 !important;
    }
    
    /* Sidebar EXPANDED state (slide-out) */
    .sidebar.sidebar-expanded {
        width: 260px !important;
        padding: 60px 12px 10px !important;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5) !important;
        z-index: 200 !important;
    }
    .sidebar.sidebar-expanded .sidebar-header span,
    .sidebar.sidebar-expanded .sidebar-business-name {
        display: block !important;
        color: #f0f0f5 !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        margin-top: 8px !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 220px !important;
    }
    .sidebar.sidebar-expanded .sidebar-logo,
    .sidebar.sidebar-expanded .logo-placeholder {
        width: 48px !important;
        height: 48px !important;
    }
    .sidebar.sidebar-expanded .sidebar-coins {
        display: block !important;
    }
    .sidebar.sidebar-expanded .sidebar-coins-mini {
        display: none !important;
    }
    .sidebar.sidebar-expanded .nav-item span {
        display: inline !important;
    }
    .sidebar.sidebar-expanded .nav-item {
        justify-content: flex-start !important;
        padding: 11px 16px !important;
    }
    
    /* Main content - no overflow */
    .main-content {
        margin-left: 60px !important;
        padding: 60px 12px 12px !important;
        width: calc(100vw - 60px) !important;
        max-width: calc(100vw - 60px) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    
    /* Fix all overflow issues */
    .view-header {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .view-actions {
        flex-wrap: wrap !important;
        width: 100% !important;
    }
    .view-actions .search-input {
        width: 100% !important;
    }
    
    /* Contacts buttons - wrap properly */
    #view-contacts .view-header > div {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
    }
    
    /* Contractor Database - fix button cut off */
    #view-contractors .view-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    #view-contractors .btn-primary {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Calendar mobile */
    .calendar-grid {
        gap: 2px !important;
        padding: 6px !important;
    }
    .calendar-day {
        padding: 4px !important;
        min-height: 45px !important;
        font-size: 10px !important;
        border-radius: 6px !important;
    }
    
    /* Settings invite section */
    .settings-section .form-group[style*="display:flex"] {
        flex-direction: column !important;
    }
    
    /* Billing cards */
    #billing-plans-grid,
    #billing-topup-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* Email container */
    .email-container {
        grid-template-columns: 1fr !important;
    }
    
    /* Chat */
    .chat-container {
        height: calc(100vh - 80px) !important;
    }
    .chat-input-area {
        flex-wrap: nowrap !important;
    }
    .chat-input-area textarea {
        min-height: 40px !important;
        font-size: 16px !important;
    }
    
    /* Demo modal mobile */
    #demo-video-modal {
        padding: 10px !important;
    }
    #demo-video-container {
        border-radius: 12px !important;
    }
    
    /* Kanban mobile - horizontal scroll */
    .kanban-board {
        flex-direction: row !important;
        gap: 12px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-snap-type: x mandatory !important;
        padding-bottom: 12px !important;
    }
    .kanban-column {
        min-width: 260px !important;
        max-width: 280px !important;
        min-height: 200px !important;
        scroll-snap-align: start !important;
        flex-shrink: 0 !important;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 50px !important;
        padding: 55px 4px 8px !important;
    }
    .main-content {
        margin-left: 50px !important;
        padding: 55px 8px 8px !important;
        width: calc(100vw - 50px) !important;
        max-width: calc(100vw - 50px) !important;
    }
    #mobile-menu-toggle {
        top: 10px !important;
        left: 8px !important;
        width: 36px !important;
        height: 36px !important;
    }
    .nav-item {
        padding: 8px 4px !important;
    }
    .nav-item i {
        font-size: 15px !important;
    }
    .calendar-day {
        min-height: 35px !important;
        font-size: 9px !important;
    }
    .settings-section {
        padding: 16px !important;
    }
    .form-row {
        grid-template-columns: 1fr !important;
    }
}
/* Additional mobile fixes for invite row and contacts */
@media (max-width: 768px) {
    .invite-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .invite-row > div {
        width: 100% !important;
        min-width: 100% !important;
    }
    .invite-row select {
        width: 100% !important;
    }
    .invite-row button {
        width: 100% !important;
        justify-content: center !important;
    }
    /* Fix contacts action buttons */
    #view-contacts .btn-sm,
    #view-contacts .btn {
        font-size: 12px !important;
        padding: 8px 12px !important;
        white-space: nowrap !important;
    }
    /* Ensure all inputs are full width on mobile */
    .settings-section input,
    .settings-section select,
    .settings-section textarea {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    /* Admin panel mobile fix */
    #admin-screen {
        padding-left: 60px !important;
        padding-right: 12px !important;
    }
}
@media (max-width: 480px) {
    #admin-screen {
        padding-left: 50px !important;
        padding-right: 8px !important;
    }
}
