/* =============================================
   YesMan.de – Dashboard / App Stylesheet
   Shared styles for all logged-in pages
   ============================================= */

/* --- Font --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- Variables (inherits from style.css) --- */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sidebar-width: 240px;
  --sidebar-bg: #1a2332;
  --sidebar-text: #a0aec0;
  --sidebar-active: #2D8CCA;
  --sidebar-hover: #243447;
  --topbar-height: 60px;
  --content-bg: #f5f7fa;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-primary: #1a2332;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --badge-open: #22c55e;
  --badge-progress: #f59e0b;
  --badge-completed: #94a3b8;
}

/* --- Dark Theme for App Pages --- */
[data-theme="dark"] {
  --sidebar-bg: #0F172A;
  --sidebar-text: #94A3B8;
  --sidebar-active: #2D8CCA;
  --sidebar-hover: #1E293B;
  --topbar-height: 60px;
  --content-bg: #0F172A;
  --card-bg: #1E293B;
  --card-border: #334155;
  --text-primary: #E2E8F0;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .form-select {
  background: #1E293B;
  color: #E2E8F0;
  border-color: #334155;
}

[data-theme="dark"] .chip {
  background: #334155;
  color: #E2E8F0;
}

[data-theme="dark"] .chip:hover {
  background: #475569;
}

[data-theme="dark"] .chip.active {
  background: rgba(45, 140, 202, 0.15);
  color: #2D8CCA;
}

[data-theme="dark"] .escrow-box {
  background: #0D1F2E;
  border-color: #1A2F42;
  color: #86EFAC;
}

[data-theme="dark"] .calendar-mini .cal-header {
  background: #334155;
  color: #E2E8F0;
}

[data-theme="dark"] .calendar-mini {
  border-color: #334155;
}

[data-theme="dark"] .message.received {
  background: #334155;
  color: #E2E8F0;
}

[data-theme="dark"] .recent-task-card {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .recent-task-card .info .title {
  color: #E2E8F0;
}

/* Buttons in dark mode */
[data-theme="dark"] .btn-secondary {
  background: #334155;
  color: #E2E8F0;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #475569;
}

[data-theme="dark"] .btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
}

[data-theme="dark"] .btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .btn-outline {
  border-color: #2D8CCA;
  color: #2D8CCA;
}

/* Profile page dark mode */
[data-theme="dark"] .profile-name {
  color: #E2E8F0;
}

[data-theme="dark"] .badge-open {
  background: #0D1F2E;
  color: #86EFAC;
}

[data-theme="dark"] .badge-progress {
  background: #451A03;
  color: #FCD34D;
}

[data-theme="dark"] .badge-completed {
  background: #334155;
  color: #94A3B8;
}

/* Interest card dark mode */
[data-theme="dark"] .interest-card {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .interest-card .user-name {
  color: #E2E8F0;
}

/* Chat dark mode */
[data-theme="dark"] .chat-header {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .chat-input {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .chat-input input {
  background: #0F172A;
  color: #E2E8F0;
  border-color: #334155;
}

[data-theme="dark"] .chat-sidebar {
  background: #1E293B;
  border-color: #334155;
}

/* Topbar dark mode */
[data-theme="dark"] .topbar {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .btn-close {
  background: #334155;
  color: #94A3B8;
}

[data-theme="dark"] .btn-close:hover {
  background: #475569;
}

/* Footer dark mode */
[data-theme="dark"] .app-footer {
  border-top-color: #334155;
}

[data-theme="dark"] .app-footer h4 {
  color: #E2E8F0;
}

/* Generic dark-mode text color fix */
[data-theme="dark"] body,
[data-theme="dark"] .card,
[data-theme="dark"] .content-area,
[data-theme="dark"] .completion-overlay {
  color: var(--text-primary);
}

/* Map container dark mode */
[data-theme="dark"] .map-container {
  background: #334155;
  color: #94A3B8;
}

/* Step indicators dark mode */
[data-theme="dark"] .step-label {
  color: #E2E8F0;
}

/* Profile inline stat values */
[data-theme="dark"] .profile-stat .stat-value {
  color: #2D8CCA;
}

/* Completion overlay */
[data-theme="dark"] .completion-icon {
  background: #0D1F2E;
}

/* Theme toggle in topbar */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: rgba(0,191,166,0.1);
  color: #2D8CCA;
}

/* --- Base for app pages --- */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--content-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--content-bg);
  overflow-x: hidden;
}

/* Mobile menu toggle - hidden on desktop, shown on mobile */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-btn:hover {
  background: rgba(0,191,166,0.1);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
}

/* --- Sidebar (matches mockup: large icons + text) --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 48px;
  height: 48px;
}

.sidebar-logo .logo-icon img {
  width: 48px;
  height: 48px;
}

.sidebar-logo .logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 500;
  transition: all 0.2s;
  border-radius: 12px;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.sidebar-nav a.active {
  background: var(--sidebar-hover);
  color: #fff;
  font-weight: 600;
}

.sidebar-nav a .nav-icon {
  width: 24px;
  height: 24px;
  opacity: 0.6;
}

.sidebar-nav a.active .nav-icon {
  opacity: 1;
}

.sidebar-user {
  padding: 20px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2D8CCA;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.sidebar-user .user-name {
  font-size: 0.9rem;
  color: #e2e8f0;
  font-weight: 500;
}

/* --- Bottom Tab Bar (mobile) --- */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--sidebar-bg);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 200;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}

.bottom-tabs nav {
  display: flex;
  justify-content: space-around;
}

.bottom-tabs a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  transition: color 0.2s;
}

.bottom-tabs a .tab-icon {
  width: 22px;
  height: 22px;
}

.bottom-tabs a.active {
  color: #2D8CCA;
}

.bottom-tabs a.active .tab-icon {
  color: #2D8CCA;
}

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

.topbar {
  height: var(--topbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.content-area {
  padding: 24px 32px;
  flex: 1;
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-open { background: #dcfce7; color: #166534; }
.badge-progress { background: #fef3c7; color: #92400e; }
.badge-completed { background: #f1f5f9; color: #475569; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: #2D8CCA;
  color: #fff;
}

.btn-primary:hover {
  background: #00997F;
  box-shadow: 0 4px 12px rgba(0,191,166,0.3);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid #2D8CCA;
  color: #2D8CCA;
}

.btn-outline:hover {
  background: rgba(0,191,166,0.08);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
}

.btn-danger:hover {
  background: #fee2e2;
}

/* --- Task Card (horizontal list item matching mockup) --- */
.task-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.task-card:hover {
  border-color: #2D8CCA;
  box-shadow: 0 2px 8px rgba(45, 140, 202, 0.15);
}

.task-card .task-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

[data-theme="dark"] .task-card .task-thumb {
  background: #334155;
}

.task-card .task-info {
  flex: 1;
  min-width: 0;
}

.task-card .task-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.task-card .task-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.task-card .task-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.task-card .task-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2D8CCA;
  white-space: nowrap;
}
  white-space: nowrap;
}

/* --- Form elements --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: #2D8CCA;
  box-shadow: 0 0 0 3px rgba(0,191,166,0.1);
}

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

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Step indicator --- */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2D8CCA;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* --- Category chips --- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  background: #f1f5f9;
  color: var(--text-primary);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s;
}

.chip:hover { background: #e2e8f0; }
.chip.active {
  background: rgba(0,191,166,0.1);
  border-color: #2D8CCA;
  color: #2D8CCA;
}

/* --- Interest list --- */
.interest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  margin-bottom: 10px;
}

.interest-card .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e2e8f0;
  overflow: hidden;
  flex-shrink: 0;
}

.interest-card .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.interest-card .user-info {
  flex: 1;
}

.interest-card .user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.interest-card .user-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.interest-card .actions {
  display: flex;
  gap: 6px;
}

/* --- Stars --- */
.stars {
  color: #fbbf24;
  font-size: 0.9rem;
  display: inline-flex;
  gap: 1px;
}

.stars .empty { color: #d1d5db; }

/* --- Chat --- */
.chat-layout {
  display: flex;
  height: calc(100vh - var(--topbar-height));
}

/* --- Chat Contacts List (left panel, Telegram-style) --- */
.chat-contacts {
  width: 320px;
  border-right: 1px solid var(--card-border);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-contacts-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chat-contacts-header input {
  width: 100%;
  padding: 8px 14px;
  border: none;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: #e2e8f0;
  font-size: 0.85rem;
  font-family: inherit;
}

.chat-contacts-header input::placeholder {
  color: var(--sidebar-text);
}

.chat-contacts-header input:focus {
  outline: none;
  background: rgba(255,255,255,0.12);
}

.chat-contacts-list {
  flex: 1;
  overflow-y: auto;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
}

.contact-item:hover {
  background: rgba(255,255,255,0.04);
}

.contact-item.active {
  background: rgba(45, 140, 202, 0.15);
  border-left-color: #2D8CCA;
}

.contact-item .contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.contact-item .contact-info {
  flex: 1;
  min-width: 0;
}

.contact-item .contact-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 2px;
}

.contact-item .contact-preview {
  font-size: 0.8rem;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-item .contact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.contact-item .contact-time {
  font-size: 0.72rem;
  color: var(--sidebar-text);
}

.contact-item .contact-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #2D8CCA;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
}

.chat-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2D8CCA;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}

.message {
  max-width: 70%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.message.sent {
  background: #2D8CCA;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message.received {
  background: #f1f5f9;
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message .time {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 4px;
}

.chat-input {
  padding: 12px 20px;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
}

.chat-input input {
  flex: 1;
  padding: 10px 16px;
  border: 1.5px solid var(--card-border);
  border-radius: 24px;
  font-size: 0.9rem;
  font-family: inherit;
}

.chat-input input:focus {
  outline: none;
  border-color: #2D8CCA;
}

.chat-sidebar {
  width: 280px;
  border-left: 1px solid var(--card-border);
  padding: 20px;
  background: var(--card-bg);
  overflow-y: auto;
}

.chat-sidebar .status-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.chat-sidebar .status-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* --- Profile --- */
.profile-header {
  text-align: center;
  padding: 32px 20px;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #e2e8f0;
  margin: 0 auto 16px;
  overflow: hidden;
  border: 3px solid #2D8CCA;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 16px;
}

.profile-stat {
  text-align: center;
}

.profile-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2D8CCA;
}

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

/* --- Completion --- */
.completion-overlay {
  max-width: 480px;
  margin: 40px auto;
  text-align: center;
}

.completion-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #dcfce7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.completion-icon svg {
  width: 40px;
  height: 40px;
  color: #16a34a;
}

.star-rating {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
}

.star-rating .star {
  font-size: 2rem;
  color: #d1d5db;
  cursor: pointer;
  transition: color 0.2s;
}

.star-rating .star.active {
  color: #fbbf24;
}

/* --- Map placeholder --- */
.map-container {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.map-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Calendar mini --- */
.calendar-mini {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-mini .cal-header {
  background: #f8fafc;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
}

.calendar-mini .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding: 4px;
}

.calendar-mini .cal-day {
  text-align: center;
  padding: 6px 2px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
}

.calendar-mini .cal-day.header {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.calendar-mini .cal-day:hover {
  background: #f1f5f9;
}

.calendar-mini .cal-day.selected {
  background: #2D8CCA;
  color: #fff;
  border-radius: 50%;
}

/* --- Escrow info --- */
.escrow-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #166534;
}

/* --- Two-column layout --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* --- Filter bar --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.filter-bar .form-input {
  max-width: 300px;
}

/* --- Explore Map --- */
.map-mobile-toggle {
  display: none;
}

/* --- Post Task: single-column stacked form --- */
.post-task-grid {
  max-width: 720px;
}

.post-task-grid > .card {
  min-width: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }
  .app-layout {
    width: 100%;
    min-width: 0;
  }
  /* Hide sidebar, show bottom tabs */
  .sidebar {
    display: none;
  }
  .bottom-tabs {
    display: block;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding-bottom: 64px; /* space for bottom tabs */
  }
  .topbar {
    padding: 0 12px;
  }
  .topbar-title {
    font-size: 1.1rem;
  }
  .mobile-menu-btn {
    display: none; /* no hamburger, we use bottom tabs */
  }
  .content-area {
    padding: 12px;
    min-width: 0;
    overflow-x: hidden;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .chat-contacts {
    display: none;
  }
  /* Map: hidden by default on mobile, togglable */
  .explore-map {
    display: none;
  }
  .explore-map.visible {
    display: block;
  }
  .map-mobile-toggle {
    display: flex;
  }
  .chat-sidebar {
    display: none;
  }
  .profile-stats {
    gap: 16px;
  }
  /* Task cards on mobile */
  .task-card {
    padding: 12px;
    gap: 12px;
  }
  .task-card .task-thumb {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
  .task-card .task-title {
    font-size: 0.9rem;
  }
  .task-card .task-meta {
    font-size: 0.75rem;
  }
  /* Filter bar: stack on mobile */
  .filter-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .filter-bar .form-input {
    max-width: 100%;
    width: 100%;
    flex: unset;
    min-width: 0;
  }
  .filter-bar .form-select {
    flex: 1;
    min-width: 0;
    max-width: 100%;
  }
  /* Interest cards: stack actions below */
  .interest-card {
    flex-wrap: wrap;
  }
  .interest-card .actions {
    width: 100%;
    justify-content: flex-end;
  }
  /* Profile stats: 2x2 grid on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Recent tasks grid: 2 columns on mobile */
  .recent-tasks-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  /* Chips wrap properly */
  .chip-group {
    flex-wrap: wrap;
  }
  .calendar-mini {
    overflow-x: auto;
  }
  /* Footer: 2 columns on mobile */
  .app-footer {
    grid-template-columns: repeat(2, 1fr);
    padding: 24px 16px;
    gap: 16px;
  }
  /* Landing page sections */
  .section-title {
    font-size: 1.3rem !important;
  }
  .section-subtitle {
    font-size: 0.9rem !important;
  }
  /* Map responsive */
  #yesman-map {
    height: 300px !important;
    border-radius: 12px !important;
  }
  /* Hero adjustments */
  .hero-title {
    font-size: 1.8rem !important;
    word-break: break-word;
  }
  .hero-subtitle {
    font-size: 1rem !important;
  }
  .hero-cta {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .hero-cta .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
  /* Steps cards */
  .steps-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    max-width: 100% !important;
  }
  .step-card {
    padding: 20px !important;
  }
  /* Prevent any horizontal overflow */
  html, body {
    max-width: 100vw;
  }
  .container {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* --- Recent tasks grid (landing) --- */
.recent-tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.recent-task-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.recent-task-card:hover {
  border-color: #2D8CCA;
  box-shadow: 0 4px 12px rgba(0,191,166,0.1);
}

.recent-task-card .thumb {
  height: 100px;
  background: linear-gradient(135deg, #1a2332, #243447);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2D8CCA;
  font-size: 2rem;
}

.recent-task-card .info {
  padding: 10px 12px;
}

.recent-task-card .info .title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-task-card .info .price {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2D8CCA;
}

/* --- Footer links --- */
.app-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 40px 32px;
  border-top: 1px solid var(--card-border);
  margin-top: 40px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.app-footer h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.app-footer a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 2px 0;
}

.app-footer a:hover {
  color: #2D8CCA;
}

/* --- Close button --- */
.btn-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: background 0.2s;
}

.btn-close:hover {
  background: #e2e8f0;
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: #2D8CCA; }
.text-sm { font-size: 0.85rem; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
