:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #d9e1ea;
  --text: #18212b;
  --muted: #657487;
  --primary: #0f766e;
  --primary-soft: #dff5f2;
  --danger: #c0392b;
  --danger-soft: #fdeceb;
  --warning: #b76e00;
  --warning-soft: #fff4de;
  --success: #2e7d32;
  --success-soft: #e7f7ea;
  --info: #2358c5;
  --info-soft: #eaf0ff;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
  color: var(--text);
}
.app { min-height: 100vh; }
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #102331;
  color: #eef7fb;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  z-index: 100;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, #34d399, #0f766e);
  display: grid; place-items: center;
  font-weight: 800; color: white;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.35);
}
.brand h1 { margin: 0; font-size: 1rem; font-weight: 700; }
.brand p { margin: 2px 0 0; color: #9db0bf; font-size: 0.84rem; }
.nav-group { display: grid; gap: 8px; }
.nav-title {
  color: #7f93a3; font-size: 0.76rem;
  text-transform: uppercase; letter-spacing: .08em;
  margin: 0 0 4px;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; border-radius: 14px;
  color: #dce7ef; text-decoration: none; background: transparent;
  font-size: 0.95rem;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.08); color: #fff; }
.badge {
  min-width: 26px; padding: 4px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; text-align: center;
  background: rgba(255,255,255,.12); color: #fff;
}
.sidebar-card {
  margin-top: auto;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px; padding: 18px;
}
.sidebar-card h3 { margin: 0 0 8px; font-size: .95rem; }
.sidebar-card p { margin: 0 0 14px; color: #a8bac8; font-size: .88rem; line-height: 1.5; }
.sidebar-card button {
  width: 100%; border: 0; background: #ecfeff; color: #0f4f53;
  font-weight: 700; border-radius: 12px; padding: 11px 14px; cursor: pointer;
}
.main { margin-left: 280px; padding: 26px; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.topbar h2 { margin: 0; font-size: 1.7rem; line-height: 1.15; }
.topbar p { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px; min-width: 300px;
  box-shadow: var(--shadow);
}
.search input {
  border: 0; outline: 0; width: 100%;
  font-size: .95rem; background: transparent;
}
.btn {
  border: 0; border-radius: 14px; padding: 12px 16px;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn.primary {
  background: linear-gradient(135deg, #0f766e, #159a8b);
  color: white; box-shadow: 0 14px 28px rgba(15, 118, 110, 0.24);
}
.btn.secondary {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); box-shadow: var(--shadow);
}
.layout { display: grid; grid-template-columns: 1.65fr 1fr; gap: 20px; }
.stack { display: grid; gap: 20px; }
.panel {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(217,225,234,.8);
  border-radius: 22px; padding: 20px; box-shadow: var(--shadow);
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.panel-header h3 { margin: 0; font-size: 1rem; }
.panel-header span { color: var(--muted); font-size: .88rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric {
  background: linear-gradient(180deg, #ffffff, #f7fafc);
  border: 1px solid #e4eaf1; border-radius: 18px; padding: 16px;
}
.metric .label { color: var(--muted); font-size: .82rem; margin-bottom: 10px; }
.metric .value { font-size: 1.65rem; font-weight: 800; margin-bottom: 8px; }
.delta { font-size: .8rem; font-weight: 700; display: inline-flex; padding: 6px 10px; border-radius: 999px; }
.delta.good { color: var(--success); background: var(--success-soft); }
.delta.bad { color: var(--danger); background: var(--danger-soft); }
.delta.warn { color: var(--warning); background: var(--warning-soft); }
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; align-items: stretch; }
.hero-card {
  padding: 22px; border-radius: 22px;
  background: linear-gradient(135deg, #123047, #154f5a 70%, #0f766e 100%);
  color: white; position: relative; overflow: hidden; min-height: 240px;
}
.hero-card::after {
  content: ""; position: absolute; inset: auto -40px -50px auto;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,.16), rgba(255,255,255,0));
  border-radius: 50%;
}
.eyebrow {
  display: inline-flex; padding: 6px 10px;
  background: rgba(255,255,255,.14); border-radius: 999px;
  font-size: .78rem; margin-bottom: 12px;
}
.hero-card h3 { margin: 0; font-size: 1.7rem; line-height: 1.2; max-width: 12ch; }
.hero-card p { color: rgba(255,255,255,.78); max-width: 52ch; line-height: 1.55; }
.hero-footer { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-pill {
  padding: 9px 12px; border-radius: 12px;
  background: rgba(255,255,255,.1); font-size: .82rem; color: #eff8ff;
}
.meeting-card {
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
  border: 1px solid #e4eaf1; border-radius: 22px;
  padding: 20px; display: grid; gap: 14px;
}
.meeting-time {
  display: inline-flex; padding: 8px 12px; border-radius: 999px;
  color: var(--info); background: var(--info-soft);
  width: fit-content; font-size: .82rem; font-weight: 700;
}
.meeting-card h4, .task-card h4, .activity-item h4 { margin: 0; }
.meeting-list, .task-list, .activity-list { display: grid; gap: 12px; }
.task-card, .activity-item {
  background: #fff; border: 1px solid #e6ecf2;
  border-radius: 18px; padding: 16px;
}
.task-top, .row-between {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  padding: 6px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700;
}
.chip.priority { background: var(--danger-soft); color: var(--danger); }
.chip.followup { background: var(--warning-soft); color: var(--warning); }
.chip.meeting { background: var(--info-soft); color: var(--info); }
.chip.done { background: var(--success-soft); color: var(--success); }
.meta, .subtle { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.avatars { display: flex; align-items: center; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .76rem; font-weight: 800; color: #fff;
  border: 2px solid #fff; margin-left: -8px;
}
.avatar:first-child { margin-left: 0; }
.a1 { background: #0f766e; }
.a2 { background: #1d4ed8; }
.a3 { background: #be185d; }
.progress-wrap { margin-top: 16px; display: grid; gap: 10px; }
.bar { height: 10px; border-radius: 999px; background: #edf2f7; overflow: hidden; }
.bar > span {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #27b7a6);
}
.calendar-mini { display: grid; grid-template-columns: repeat(7,1fr); gap: 8px; margin-top: 12px; }
.day {
  text-align: center; padding: 9px 0; border-radius: 12px;
  font-size: .82rem; background: var(--surface-2); color: var(--muted);
}
.day.active { background: #123047; color: white; font-weight: 700; }
.day.warn { background: var(--warning-soft); color: var(--warning); font-weight: 700; }
.timeline { display: grid; gap: 14px; }
.timeline-item {
  display: grid; grid-template-columns: 12px 1fr;
  gap: 12px; align-items: start;
}
.dot {
  width: 12px; height: 12px; border-radius: 50%; margin-top: 6px;
  background: #0f766e; box-shadow: 0 0 0 6px rgba(15,118,110,.12);
}
.dot.warn { background: #d97706; box-shadow: 0 0 0 6px rgba(217,119,6,.12); }
.dot.bad { background: #dc2626; box-shadow: 0 0 0 6px rgba(220,38,38,.12); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-box {
  border: 1px solid #e6ecf2; border-radius: 18px;
  padding: 16px; background: #fff;
}
.stat-box .num { font-size: 1.4rem; font-weight: 800; margin: 8px 0; }
.footer-note { margin-top: 14px; font-size: .82rem; color: var(--muted); }
.user-menu {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 8px 12px 8px 14px; box-shadow: var(--shadow);
}
.user-menu .user-name { font-size: 0.88rem; font-weight: 600; }
.user-menu .logout {
  border: 0; background: var(--surface-3); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font-size: 0.82rem;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
.filter-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px;
}
.filter-tab {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); border-radius: 999px; padding: 8px 14px;
  font-size: 0.86rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.filter-tab.active {
  background: var(--primary-soft); border-color: #b8e8e2;
  color: var(--primary);
}
.task-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: start;
  background: #fff; border: 1px solid #e6ecf2;
  border-radius: 18px; padding: 16px;
}
.task-row + .task-row { margin-top: 10px; }
.task-check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border); margin-top: 2px;
}
.task-check.done { background: var(--primary); border-color: var(--primary); }
.task-due { font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.task-due.overdue { color: var(--danger); }
.task-due.today { color: var(--warning); }
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.kanban-column {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kanban-column-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 4px 4px 8px;
}
.kanban-column-header h4 {
  margin: 0; font-size: 0.88rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.kanban-column-header h4::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
}
.kanban-column.todo .kanban-column-header h4::before { background: var(--muted); }
.kanban-column.progress .kanban-column-header h4::before { background: var(--info); }
.kanban-column.review .kanban-column-header h4::before { background: var(--warning); }
.kanban-column.done .kanban-column-header h4::before { background: var(--success); }
.kanban-count {
  font-size: 0.76rem; font-weight: 700; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 9px;
}
.kanban-cards { display: grid; gap: 10px; flex: 1; }
.kanban-card {
  background: #fff; border: 1px solid #e6ecf2;
  border-radius: 14px; padding: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  cursor: grab;
  transition: box-shadow .15s, transform .15s;
}
.kanban-card:hover {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.kanban-card h4 {
  margin: 0 0 8px; font-size: 0.92rem; line-height: 1.35;
}
.kanban-card .meta { margin-bottom: 10px; font-size: 0.8rem; }
.kanban-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.kanban-card-footer .task-due { font-size: 0.76rem; }
.kanban-card .chips { margin-top: 0; }
.kanban-card.dragging { opacity: 0.5; cursor: grabbing; }
.kanban-column.drag-over {
  background: var(--primary-soft);
  border-color: #b8e8e2;
}
.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-card {
  border: 1px solid #e6ecf2; border-radius: 18px;
  padding: 18px; background: #fff;
}
.info-card h4 { margin: 0 0 8px; }
.message-item {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid #e6ecf2;
}
.message-item:last-child { border-bottom: 0; }
.message-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 800; color: #fff;
}
.unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
}
.mobile-header,
.sidebar-backdrop { display: none; }
.menu-toggle {
  width: 42px; height: 42px; border: 0; border-radius: 12px;
  background: rgba(255,255,255,.1); cursor: pointer;
  display: grid; place-content: center; gap: 5px; padding: 0;
}
.menu-toggle span {
  display: block; width: 18px; height: 2px;
  background: #eef7fb; border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.mobile-brand {
  display: flex; align-items: center; gap: 10px;
  color: #eef7fb; font-weight: 700; font-size: 0.95rem;
}
.mobile-brand .logo { width: 36px; height: 36px; font-size: 0.9rem; }
body.nav-open { overflow: hidden; }

@media (max-width: 1180px) {
  .layout, .hero { grid-template-columns: 1fr; }
  .metric-grid, .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .topbar h2 { font-size: 1.45rem; }
  .kanban-board {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
  }
}

@media (max-width: 900px) {
  .mobile-header {
    display: flex; align-items: center; gap: 12px;
    position: fixed; top: 0; left: 0; right: 0;
    height: 60px; padding: 0 16px;
    background: #102331; z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
  }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(16, 35, 49, 0.55);
    z-index: 250; opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  body.nav-open .sidebar-backdrop {
    opacity: 1; pointer-events: auto;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 300;
    width: min(280px, 88vw);
    padding-top: 20px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  body.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .main {
    margin-left: 0;
    padding: 76px 20px 24px;
  }
  .topbar {
    flex-direction: column; align-items: stretch; gap: 14px;
  }
  .topbar h2 { font-size: 1.35rem; }
  .topbar p { font-size: 0.9rem; }
  .actions { width: 100%; }
  .search { min-width: 0; width: 100%; flex: 1 1 100%; }
  .panel-header {
    flex-direction: column; align-items: flex-start; gap: 4px;
  }
  .hero-card { min-height: auto; }
  .hero-card h3 { font-size: 1.35rem; max-width: none; }
  .row-between { flex-wrap: wrap; gap: 8px; }
  .task-top { flex-direction: column; }
  .filter-tabs {
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab { flex: 0 0 auto; }
  .user-menu { width: 100%; justify-content: space-between; }
  .kanban-board {
    display: flex; gap: 14px;
    scroll-snap-type: x mandatory;
  }
  .kanban-column {
    flex: 0 0 min(85vw, 280px);
    scroll-snap-align: start;
    min-height: 280px;
  }
}

@media (max-width: 640px) {
  .main { padding: 72px 14px 20px; }
  .metric-grid, .split, .grid-cards { grid-template-columns: 1fr; }
  .metric .value { font-size: 1.4rem; }
  .actions {
    flex-direction: column; align-items: stretch; gap: 10px;
  }
  .actions .btn,
  .actions .search,
  .actions .user-menu { width: 100%; }
  .btn { width: 100%; text-align: center; }
  .panel { padding: 16px; border-radius: 18px; }
  .task-row {
    grid-template-columns: auto 1fr;
    gap: 10px; padding: 14px;
  }
  .task-due {
    grid-column: 2; white-space: normal;
    font-size: 0.78rem;
  }
  .message-item {
    grid-template-columns: auto 1fr;
    gap: 10px; align-items: start;
  }
  .message-item > div:last-child {
    grid-column: 2; justify-self: start;
    display: flex; align-items: center; gap: 8px;
  }
  .activity-item .row-between,
  .task-card .row-between { flex-direction: column; }
  .calendar-mini { gap: 6px; }
  .day { padding: 8px 0; font-size: 0.76rem; }
  .hero-footer { gap: 8px; }
  .hero-pill { font-size: 0.76rem; padding: 7px 10px; }
  .chip { font-size: 0.7rem; }
}

@media (max-width: 400px) {
  .topbar h2 { font-size: 1.2rem; }
  .mobile-header { padding: 0 12px; }
  .brand h1 { font-size: 0.92rem; }
  .nav-item { font-size: 0.9rem; padding: 11px 12px; }
}
