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

:root {
  --bg: #f5f6fa;
  --sidebar-bg: #1a1d23;
  --sidebar-text: #9ca3af;
  --sidebar-active: #fff;
  --card-bg: #fff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 8px;
}

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

/* App layout */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header h1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.nav-links {
  list-style: none;
  padding: 12px 0;
  flex: 1;
}

.nav-links li a {
  display: block;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
}

.nav-links li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.nav-links li a.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-right: 3px solid var(--primary);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.logout-link {
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
}

.logout-link:hover { color: #fff; }

/* Content */
.content {
  flex: 1;
  padding: 32px;
  max-width: 1100px;
  min-width: 0;
}

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

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.card-highlight {
  border-left: 4px solid var(--primary);
}

.card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.event-venue {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.event-location a {
  font-size: 13px;
  color: var(--text-muted);
}

.event-time {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* Status */
.status-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-none { background: #f3f4f6; color: #6b7280; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-sent { background: #dbeafe; color: #1e40af; }
.status-confirmed { background: #d1fae5; color: #065f46; }
.status-overdue { background: #fee2e2; color: #991b1b; }
.status-failed { background: #fee2e2; color: #991b1b; }
.status-not-needed { background: #f3f4f6; color: #9ca3af; }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
}

.dot-none { background: #d1d5db; }
.dot-pending { background: #f59e0b; }
.dot-sent { background: #3b82f6; }
.dot-confirmed { background: #10b981; }
.dot-overdue { background: #ef4444; }
.dot-failed { background: #ef4444; }
.dot-not-needed { background: #d1d5db; }

.overdue-tag {
  font-size: 11px;
  color: var(--danger);
  font-weight: 600;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #f9fafb;
}

.nowrap { white-space: nowrap; }

.actions-cell {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 4px 8px; font-size: 12px; }
.btn-full { width: 100%; }

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.form-actions {
  margin-top: 24px;
}

.settings-form .card {
  margin-bottom: 20px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
}

.activity-item:last-child { border-bottom: none; }

.activity-time {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  min-width: 120px;
}

.activity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  min-width: 60px;
  text-align: center;
}

.badge-invite { background: #dbeafe; color: #1e40af; }
.badge-booking { background: #fef3c7; color: #92400e; }
.badge-status { background: #e0e7ff; color: #3730a3; }
.badge-alert { background: #fee2e2; color: #991b1b; }
.badge-system { background: #f3f4f6; color: #6b7280; }
.badge-settings { background: #ede9fe; color: #5b21b6; }
.badge-scheduler { background: #d1fae5; color: #065f46; }
.badge-error { background: #fee2e2; color: #991b1b; }

.activity-msg {
  flex: 1;
  min-width: 0;
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 4px;
}

.tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.15s;
}

.tab:hover { background: #e5e7eb; color: var(--text); }
.tab.active { background: var(--primary); color: #fff; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 9999;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

/* Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-card h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.login-card .form-group {
  text-align: left;
}

.login-card .btn {
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 0;
  }
  .sidebar-header { padding: 12px 16px; border-bottom: none; }
  .sidebar-header h1 { font-size: 14px; }
  .nav-links {
    display: flex;
    padding: 0;
    overflow-x: auto;
  }
  .nav-links li a {
    padding: 12px 14px;
    white-space: nowrap;
  }
  .nav-links li a.active { border-right: none; border-bottom: 2px solid var(--primary); }
  .sidebar-footer { display: none; }
  .content { padding: 16px; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 8px 6px; }
  .actions-cell { flex-direction: column; }
}
