/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --primary: #2563EB;
  --primary-light: #DBEAFE;
  --primary-dark: #1D4ED8;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --transition: 0.15s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 24px; font-weight: 700; line-height: 1.3; }
h2 { font-size: 18px; font-weight: 600; line-height: 1.4; }
h3 { font-size: 15px; font-weight: 600; }

/* ===== LAYOUT ===== */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== NAVBAR ===== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 24px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px; color: var(--text);
  text-decoration: none;
}
.navbar-brand .brand-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; }
.navbar-user { display: flex; align-items: center; gap: 12px; }
.navbar-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border);
}
.navbar-avatar-placeholder {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: var(--transition);
  white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: white; }

.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); color: var(--text); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

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

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #059669; border-color: #059669; color: white; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-icon { padding: 7px; }

/* Google Sign-in Button */
.btn-google {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 24px; border-radius: var(--radius);
  background: white; color: #3c4043;
  border: 1px solid #dadce0; cursor: pointer;
  font-size: 15px; font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  transition: box-shadow var(--transition), background var(--transition);
  text-decoration: none;
}
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); background: #f8f9fa; color: #3c4043; text-decoration: none; }
.btn-google svg { flex-shrink: 0; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; color: var(--text);
  background: var(--surface); transition: border-color var(--transition);
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.badge-pending { background: var(--warning-light); color: #92400E; }
.badge-done { background: var(--success-light); color: #065F46; }
.badge-active { background: var(--primary-light); color: var(--primary-dark); }
.badge-closed { background: #F1F5F9; color: #475569; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 500; padding: 48px 16px;
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 520px;
  transform: translateY(-16px); transition: transform var(--transition);
  max-height: calc(100vh - 96px); overflow-y: auto;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-header h2 { font-size: 17px; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  position: sticky; bottom: 0; background: var(--surface);
}
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 4px; }
.modal-close:hover { color: var(--text); background: var(--bg); }

/* ===== DROPDOWN ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 160px; z-index: 200;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: opacity var(--transition), transform var(--transition);
}
.dropdown-menu.active { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; cursor: pointer; font-size: 13px;
  color: var(--text); transition: background var(--transition);
  border: none; background: none; width: 100%; text-align: left;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-separator { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  background: var(--text); color: white;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500;
  transform: translateX(110%); transition: transform 0.25s ease;
  max-width: 320px;
}
.toast.show { transform: translateX(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: #1c1917; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-secondary);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #EFF6FF 0%, #F8F9FA 60%, #F0FDF4 100%);
}
.login-card {
  background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 48px 40px;
  width: 100%; max-width: 400px; text-align: center;
}
.login-logo { margin-bottom: 32px; }
.login-logo-mark {
  width: 56px; height: 56px; background: var(--primary);
  border-radius: 14px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.login-logo-mark svg { color: white; }
.login-card h1 { font-size: 22px; margin-bottom: 8px; }
.login-card p { color: var(--text-secondary); margin-bottom: 32px; font-size: 14px; line-height: 1.6; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--text-muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-features { text-align: left; margin-top: 32px; }
.login-feature { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--text-secondary); }
.login-feature-icon { width: 18px; height: 18px; background: var(--primary-light); border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }

/* ===== DASHBOARD ===== */
.page-header {
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.page-header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: gap; gap: 12px; }
.page-header h1 { font-size: 20px; }
.page-header p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.meetings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 24px 0;
}

.meeting-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.meeting-card:hover { box-shadow: var(--shadow-md); border-color: #CBD5E1; }
.meeting-card.closed { opacity: 0.7; }
.meeting-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.meeting-card-name { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.4; }
.meeting-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 12px; }
.meeting-card-stats { display: flex; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.meeting-stat { text-align: center; }
.meeting-stat-num { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1; }
.meeting-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.meeting-card-participants { display: flex; align-items: center; margin-top: 10px; gap: 4px; }
.participant-chip {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  border: 2px solid white; margin-left: -6px;
}
.participant-chip:first-child { margin-left: 0; }
.participant-more { font-size: 11px; color: var(--text-muted); margin-left: 6px; }

/* ===== MEETING PAGE ===== */
.meeting-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: calc(100vh - 56px);
}

.meeting-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky; top: 56px; height: calc(100vh - 56px);
  overflow-y: auto;
}
.meeting-sidebar-section { padding: 0 16px; margin-bottom: 20px; }
.meeting-sidebar-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; padding: 0 4px; }

.meeting-main { padding: 24px; }
.meeting-main-header { margin-bottom: 20px; }

/* Participant list in sidebar */
.participant-list { display: flex; flex-direction: column; gap: 6px; }
.participant-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius);
  font-size: 13px;
}
.participant-item:hover { background: var(--bg); }
.participant-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.participant-info { flex: 1; min-width: 0; }
.participant-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-email { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-remove { opacity: 0; transition: opacity var(--transition); background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 2px; border-radius: 3px; }
.participant-item:hover .participant-remove { opacity: 1; }

/* ===== TASK LIST ===== */
.tasks-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tasks-filters { display: flex; gap: 6px; }
.filter-btn {
  padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; cursor: pointer; font-size: 12px; color: var(--text-secondary);
  transition: var(--transition);
}
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.task-list { display: flex; flex-direction: column; gap: 10px; }

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: box-shadow var(--transition);
  position: relative;
}
.task-card:hover { box-shadow: var(--shadow); }
.task-card.done { opacity: 0.65; }
.task-card.done .task-content { text-decoration: line-through; color: var(--text-secondary); }

.task-card-top { display: flex; align-items: flex-start; gap: 10px; }
.task-checkbox {
  width: 18px; height: 18px; border-radius: 4px;
  border: 2px solid var(--border); cursor: pointer;
  flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.task-checkbox.checked { background: var(--success); border-color: var(--success); }
.task-checkbox svg { display: none; }
.task-checkbox.checked svg { display: block; }

.task-content { font-size: 14px; flex: 1; line-height: 1.5; }
.task-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.task-card:hover .task-actions { opacity: 1; }

.task-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.task-meta-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.task-meta-item svg { opacity: 0.6; }

.task-assignees { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.assignee-tag {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px; background: var(--primary-light);
  color: var(--primary-dark); border-radius: 20px; font-size: 11px; font-weight: 500;
}
.assignee-tag.overdue { background: var(--danger-light); color: #B91C1C; }

.cal-btn-group { display: flex; gap: 6px; margin-top: 10px; }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: var(--transition); background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== CONTACT PICKER ===== */
.contact-search { margin-bottom: 12px; position: relative; }
.contact-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.contact-search input { padding-left: 32px; }
.contact-list-scroll { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.contact-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer; transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.contact-list-item:last-child { border-bottom: none; }
.contact-list-item:hover { background: var(--bg); }
.contact-list-item.selected { background: var(--primary-light); }
.contact-check { width: 16px; height: 16px; border-radius: 3px; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.contact-list-item.selected .contact-check { background: var(--primary); border-color: var(--primary); }
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 13px; font-weight: 500; }
.contact-email { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.selected-tag {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px; background: var(--primary-light); color: var(--primary-dark);
  border-radius: 20px; font-size: 12px;
}
.selected-tag-remove { background: none; border: none; cursor: pointer; color: var(--primary-dark); line-height: 1; padding: 0; }

/* ===== CALENDAR EVENT LIST ===== */
.cal-event-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; transition: var(--transition);
}
.cal-event-item:hover { border-color: var(--primary); background: var(--primary-light); }
.cal-event-item.selected { border-color: var(--primary); background: var(--primary-light); }
.cal-event-date {
  background: var(--primary); color: white; border-radius: 6px;
  padding: 4px 8px; font-size: 11px; font-weight: 600; white-space: nowrap; text-align: center; min-width: 48px;
}
.cal-event-info { flex: 1; }
.cal-event-name { font-size: 13px; font-weight: 500; }
.cal-event-attendees { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== LOADING ===== */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 40px;
  color: var(--text-secondary); font-size: 13px;
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex; gap: 24px; padding: 16px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.stat-item { text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== MEETING STATUS BANNER ===== */
.status-banner {
  padding: 10px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; display: flex;
  align-items: center; gap: 8px; margin-bottom: 16px;
}
.status-banner.closed { background: #F1F5F9; color: #475569; }
.status-banner.active { background: var(--success-light); color: #065F46; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .meeting-layout { grid-template-columns: 1fr; }
  .meeting-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .meetings-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
  .stats-bar { flex-wrap: wrap; gap: 12px; }
}

/* ===== UTILITY ===== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 12px; }
.font-medium { font-weight: 500; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
