/* MyDash — Premium mobile-first design system */
:root {
  --gray-950: #0c1018;
  --gray-900: #141b26;
  --gray-850: #1a2332;
  --gray-800: #243044;
  --gray-700: #3d4d63;
  --gray-500: #6b7c93;
  --gray-400: #94a3b8;
  --gray-200: #e2e8f4;
  --gray-100: #f0f3f9;
  --gray-50: #f8f9fc;

  --blue-700: #1d4f9e;
  --blue-600: #2563b8;
  --blue-500: #3b7dd8;
  --blue-400: #5b9cf0;
  --blue-300: #93c5fd;
  --blue-glow: rgba(59, 125, 216, 0.45);
  --blue-soft: rgba(59, 125, 216, 0.12);
  --blue-warm: #eef4fc;

  --accent: var(--blue-500);
  --accent-hover: var(--blue-600);
  --accent-light: var(--blue-400);

  --sidebar-bg: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-950) 100%);
  --topbar-bg: rgba(20, 27, 38, 0.92);
  --bg-main: var(--gray-50);
  --bg-card: #ffffff;
  --bg-warm: linear-gradient(160deg, #fafbfd 0%, #f4f7fc 50%, #f0f4fa 100%);
  --border: rgba(36, 48, 68, 0.08);
  --border-strong: #e2e8f4;
  --text: #1a2332;
  --text-muted: #5c6b82;
  --text-soft: #8494a7;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #7c6cf0;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(20, 27, 38, 0.04);
  --shadow: 0 4px 16px rgba(20, 27, 38, 0.06), 0 1px 3px rgba(20, 27, 38, 0.04);
  --shadow-md: 0 8px 30px rgba(20, 27, 38, 0.08), 0 2px 8px rgba(20, 27, 38, 0.04);
  --shadow-nav: 4px 0 24px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 0 1px rgba(91, 156, 240, 0.2), 0 4px 20px var(--blue-glow);

  --sidebar-width: 260px;
  --topbar-height: 56px;
  --toolbar-height: 64px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.22s var(--ease);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-main);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

/* —— Sidebar backdrop (mobile) —— */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 24, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

body.nav-open .sidebar-backdrop {
  opacity: 1;
  visibility: visible;
}

/* —— Sidebar —— */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--gray-900);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  color: #c5d0e0;
  z-index: 100;
  box-shadow: var(--shadow-nav);
  transition: transform var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-700) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 11px;
  font-weight: 500;
  color: var(--blue-300);
  opacity: 0.85;
}

.sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 20px;
  -webkit-overflow-scrolling: touch;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: #a8b8cc;
  border: none;
  background: none;
  width: 100%;
  font: inherit;
  text-align: left;
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: linear-gradient(180deg, var(--blue-400), var(--blue-600));
  border-radius: 0 3px 3px 0;
  transition: transform var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e8eef5;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 125, 216, 0.22) 0%, rgba(59, 125, 216, 0.06) 100%);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(91, 156, 240, 0.15);
}

.nav-item.active::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}

.nav-item.active .nav-icon-wrap {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  box-shadow: 0 2px 12px var(--blue-glow);
  transform: scale(1.02);
}

.nav-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav-item.active .nav-label {
  font-weight: 600;
}

.nav-badge {
  background: linear-gradient(135deg, #f87171, var(--danger));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

/* —— Main area —— */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-warm);
}

.topbar {
  min-height: var(--topbar-height);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #e8eef5;
  display: flex;
  align-items: center;
  padding: 0 12px 0 8px;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 50;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.menu-toggle:hover {
  background: rgba(91, 156, 240, 0.25);
}

.menu-toggle svg {
  display: block;
}

.topbar-title {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.topbar-module-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.topbar-tabs {
  display: none;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 4px;
}

.topbar-tabs::-webkit-scrollbar {
  display: none;
}

.topbar-tab {
  padding: 7px 14px;
  border-radius: 20px;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: none;
  font: inherit;
  white-space: nowrap;
  transition: all var(--transition);
}

.topbar-tab:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
}

.topbar-tab.active {
  color: #fff;
  background: rgba(59, 125, 216, 0.35);
  box-shadow: inset 0 0 0 1px rgba(91, 156, 240, 0.3);
}

.topbar-spacer {
  flex: 1;
  min-width: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.topbar-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: #c5d0e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background var(--transition), color var(--transition);
}

.topbar-icon-btn:hover {
  background: rgba(91, 156, 240, 0.2);
  color: #fff;
}

.topbar-icon-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--success);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  border: 2px solid var(--gray-900);
}

.topbar-icon-btn .badge.red {
  background: var(--danger);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  margin-left: 4px;
  box-shadow: 0 2px 12px var(--blue-glow);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.content {
  flex: 1;
  overflow: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-warm);
}

/* —— Toolbar —— */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-strong);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 12px rgba(59, 125, 216, 0.35);
  transition: transform 0.15s var(--ease), box-shadow var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 125, 216, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--gray-50);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition);
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: var(--blue-300);
  background: var(--blue-warm);
}

.page-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.search-wrap {
  flex: 1 1 100%;
  min-width: 0;
  order: 3;
  position: relative;
}

@media (min-width: 640px) {
  .search-wrap {
    flex: 1;
    order: unset;
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  .search-wrap {
    max-width: 480px;
  }
}

.search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: var(--gray-50);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--blue-400);
  background: #fff;
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  font-size: 14px;
  pointer-events: none;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
  transition: all var(--transition);
}

.pagination button:hover {
  border-color: var(--blue-400);
  color: var(--blue-600);
}

.view-switcher {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--gray-50);
}

.view-btn {
  padding: 8px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-soft);
  transition: all var(--transition);
}

.view-btn.active {
  background: var(--bg-card);
  color: var(--blue-600);
  box-shadow: var(--shadow-sm);
}

/* —— Tables —— */
.table-wrap {
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 16px;
}

@media (min-width: 768px) {
  .table-wrap {
    margin: 0 16px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
  background: var(--gray-50);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--blue-warm);
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* —— Badges —— */
.badge-pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-draft {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.badge-generated {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-approved {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

/* —— Filters & split layout —— */
.filter-sidebar {
  width: 100%;
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--border-strong);
  padding: 16px;
}

.filter-sidebar h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 8px;
  font-weight: 600;
}

.filter-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  transition: all var(--transition);
}

.filter-item:hover,
.filter-item.active {
  background: var(--blue-warm);
  color: var(--blue-600);
}

.split-layout {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (min-width: 768px) {
  .split-layout {
    flex-direction: row;
    height: calc(100dvh - var(--topbar-height) - var(--toolbar-height));
  }

  .filter-sidebar {
    width: 220px;
    min-width: 220px;
    border-right: 1px solid var(--border-strong);
    border-bottom: none;
  }
}

.employee-grid {
  flex: 1;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  overflow-y: auto;
  align-content: start;
}

@media (min-width: 480px) {
  .employee-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .employee-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

.emp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}

.emp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 125, 216, 0.2);
}

.emp-card .status-dot {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.emp-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gray-700), var(--gray-800));
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.emp-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.emp-card .role {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.emp-card .email {
  font-size: 12px;
  color: var(--blue-600);
  font-weight: 500;
}

/* —— Kanban —— */
.kanban {
  display: flex;
  gap: 14px;
  padding: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 280px;
  align-items: flex-start;
  padding-bottom: 24px;
}

.kanban-col {
  min-width: 260px;
  max-width: 280px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.kanban-col h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--transition);
  font-weight: 500;
}

.kanban-card:hover {
  box-shadow: var(--shadow);
}

/* —— Dashboard —— */
.dashboard {
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  .dashboard {
    padding: 24px;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

@media (min-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .stats-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-400));
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .label {
  font-size: 11px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--text);
  letter-spacing: -0.03em;
}

@media (min-width: 768px) {
  .stat-card .value {
    font-size: 28px;
  }
}

.stat-card .sub {
  font-size: 12px;
  color: var(--success);
  margin-top: 6px;
  font-weight: 500;
}

.welcome-banner {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-850) 50%, #1e3a5f 100%);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #fff;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 50%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(91, 156, 240, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-banner strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
}

.welcome-banner .banner-text {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

.welcome-banner .btn-primary {
  align-self: flex-start;
  position: relative;
}

@media (min-width: 640px) {
  .welcome-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px;
  }
}

.calendar-banner {
  background: var(--blue-warm);
  border: 1px solid rgba(59, 125, 216, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-weight: 500;
  color: var(--text);
}

@media (min-width: 640px) {
  .calendar-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.calendar-view {
  padding: 16px;
}

.calendar-grid {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-strong);
}

.cal-days {
  display: grid;
  grid-template-columns: 48px repeat(7, 1fr);
  overflow-x: auto;
}

.cal-time {
  border-right: 1px solid var(--border);
  padding: 4px 6px;
  font-size: 10px;
  color: var(--text-soft);
  height: 36px;
  border-bottom: 1px solid var(--border);
}

.cal-day-head {
  text-align: center;
  padding: 8px 4px;
  font-weight: 600;
  font-size: 11px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--gray-50);
}

.cal-day-head.today {
  color: var(--blue-600);
  background: var(--blue-warm);
}

.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}

/* —— Discussion —— */
.discussion-layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--topbar-height));
}

@media (min-width: 768px) {
  .discussion-layout {
    flex-direction: row;
    height: calc(100dvh - var(--topbar-height));
  }
}

.discuss-sidebar {
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid var(--border-strong);
  padding: 16px;
}

@media (min-width: 768px) {
  .discuss-sidebar {
    width: 280px;
    border-right: 1px solid var(--border-strong);
    border-bottom: none;
  }
}

.discuss-sidebar .btn-primary {
  width: 100%;
  margin-bottom: 16px;
}

.discuss-menu-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}

.discuss-menu-item.active {
  background: var(--blue-warm);
  color: var(--blue-600);
  font-weight: 600;
}

.discuss-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin: 18px 0 8px;
  padding: 0 14px;
  font-weight: 600;
}

.dm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.dm-item:hover {
  background: var(--gray-100);
}

.dm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 280px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-card);
}

.empty-state h2 {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .empty-state h2 {
    font-size: 22px;
  }
}

/* —— Leaves —— */
.leaves-layout {
  display: flex;
  flex-direction: column;
}

.leaves-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 16px;
}

@media (min-width: 640px) {
  .leaves-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .leaves-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.month-mini {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 10px;
  box-shadow: var(--shadow-sm);
}

.month-mini h5 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.month-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.month-days span {
  padding: 3px 1px;
  border-radius: 4px;
  font-size: 9px;
}

.month-days .weekend {
  background: var(--gray-100);
  color: var(--text-soft);
}

.month-days .today {
  background: var(--blue-500);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
}

.leaves-panel {
  width: 100%;
  padding: 20px;
  border-top: 1px solid var(--border-strong);
  background: var(--bg-card);
}

@media (min-width: 900px) {
  .leaves-layout {
    flex-direction: row;
  }

  .leaves-panel {
    width: 240px;
    border-top: none;
    border-left: 1px solid var(--border-strong);
  }
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 10px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

/* —— Contacts —— */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 16px;
}

@media (min-width: 640px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .contact-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  transition: all var(--transition);
}

.contact-card:hover {
  border-color: rgba(59, 125, 216, 0.25);
  box-shadow: var(--shadow);
}

.contact-swatch {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.checkbox-col {
  width: 40px;
}

input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--blue-500);
  width: 16px;
  height: 16px;
}

/* —— Mobile: slide-out nav —— */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    height: 100dvh;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .menu-toggle {
    display: flex;
  }

  .sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .topbar-tabs {
    display: none !important;
  }
}

/* —— Desktop enhancements —— */
@media (min-width: 1024px) {
  .topbar-tabs {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }
}

@media (min-width: 1280px) {
  :root {
    --sidebar-width: 272px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
