@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700;800&display=swap");

:root {
  --bg: #0f172a;
  --bg-2: #151d35;
  --card: #1e293b;
  --card-2: #161f33;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --faint: #64748b;
  --blue: #6366f1;
  --teal: #0ea5e9;
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  padding: 0;
}

body {
  background: radial-gradient(circle at 8% 8%, #1c2f52 0, transparent 38%),
    radial-gradient(circle at 90% 16%, #162845 0, transparent 34%),
    linear-gradient(135deg, var(--bg) 0, #111a2f 38%, #121b30 100%);
  color: var(--text);
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 42%, black 16%, transparent 72%);
  pointer-events: none;
}

.glow {
  border-radius: 999px;
  filter: blur(72px);
  opacity: 0.45;
  pointer-events: none;
  position: fixed;
}

.glow-a {
  background: #3b82f6;
  bottom: -140px;
  height: 300px;
  left: -120px;
  width: 300px;
}

.glow-b {
  background: #4f46e5;
  height: 300px;
  right: -120px;
  top: -110px;
  width: 300px;
}

.shell {
  margin: 0 auto;
  max-width: 980px;
  padding: 0 14px 18px;
  position: relative;
  z-index: 1;
}

.topbar {
  align-items: center;
  background: linear-gradient(135deg, var(--bg) 0, var(--bg-2) 100%);
  border-bottom: 1px solid #1e293b;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin: 0 -14px;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border-radius: 10px;
  display: flex;
  font-size: 20px;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand h1 {
  color: #f1f5f9;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.05;
  margin: 0;
}

.brand p {
  color: var(--faint);
  font-size: 11px;
  margin: 3px 0 0;
}

.top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  transition: transform 140ms ease, opacity 140ms ease, border-color 140ms ease;
}

.btn:hover {
  border-color: #475569;
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  color: #a5b4fc;
}

.notice {
  background: #0f2818;
  border: 1px solid #065f46;
  border-radius: 10px;
  color: #6ee7b7;
  font-size: 12px;
  margin: 12px 0 0;
  padding: 10px 12px;
}

.notice.error {
  background: #1c1017;
  border-color: #7f1d1d;
  color: #fca5a5;
}

.hidden {
  display: none;
}

.tabs,
.filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.tabs {
  border-bottom: 1px solid #1e293b;
  margin-top: 10px;
  padding: 10px 0;
}

.filters {
  border-bottom: 1px solid #1e293b;
  padding: 8px 0;
}

.tab,
.pill {
  background: transparent;
  border: 1px solid #1e293b;
  border-radius: 999px;
  color: var(--faint);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  white-space: nowrap;
}

.tab {
  border: none;
  border-radius: 6px;
  padding: 7px 13px;
}

.tab.active {
  background: #1e293b;
  color: #f1f5f9;
}

.pill.active {
  background: #334155;
  border-color: #475569;
  color: #e2e8f0;
}

.content {
  display: grid;
  gap: 14px;
  margin: 14px 0 0;
}

.card {
  background: var(--card);
  border: 1px solid #273449;
  border-radius: 12px;
  padding: 12px;
}

.card h2,
.card h3 {
  color: #f1f5f9;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.stat {
  background: var(--card);
  border: 1px solid #273449;
  border-left: 4px solid #475569;
  border-radius: 10px;
  padding: 12px;
}

.stat .n {
  color: #f1f5f9;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.stat .l {
  color: var(--faint);
  font-size: 11px;
  margin-top: 4px;
}

.stat .warn {
  color: #fca5a5;
}

.stat-danger {
  border-left-color: var(--red);
}

.stat-good {
  border-left-color: var(--green);
}

.stat-lead {
  border-left-color: #0d9488;
}

.stat-tasks {
  border-left-color: var(--amber);
}

.stats-ship {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.stat.mini .title {
  font-size: 14px;
  margin-bottom: 7px;
}

.stat.mini .meta {
  margin-top: 4px;
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  background: var(--card-2);
  border: 1px solid #2b3950;
  border-left: 3px solid #334155;
  border-radius: 10px;
  padding: 11px;
}

.item.mail-high {
  border-left-color: #dc2626;
}

.item.mail-medium {
  border-left-color: #d97706;
}

.item.mail-low {
  border-left-color: #475569;
}

.item-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.push {
  margin-left: auto;
}

.tag {
  border-radius: 10px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
}

.tag.priority-high {
  background: #dc2626;
}

.tag.priority-medium {
  background: #d97706;
}

.tag.priority-low {
  background: #475569;
}

.tag.cat {
  border-radius: 999px;
}

.cat-lead {
  background: #0d9488;
}

.cat-carrier {
  background: #6366f1;
}

.cat-client {
  background: #2563eb;
}

.cat-spam {
  background: #52525b;
}

.meta {
  color: var(--faint);
  font-size: 11px;
}

.title {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
}

.summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 5px;
}

.next {
  color: #818cf8;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.btn-soft {
  background: #334155;
  border: 1px solid #475569;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 11px;
  text-decoration: none;
}

.btn-good {
  background: #065f46;
  border-color: #065f46;
  color: #6ee7b7;
}

.btn-danger {
  background: #7f1d1d;
  border-color: #7f1d1d;
  color: #fca5a5;
}

.resolved {
  opacity: 0.55;
}

.grid-days {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.day {
  background: #1e293b;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px;
}

.day .head {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.day .head b {
  color: #e2e8f0;
  font-size: 13px;
}

.small {
  color: var(--faint);
  font-size: 10px;
}

.event {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 60px 1fr auto;
  margin-top: 4px;
}

.event .time {
  color: var(--faint);
  font-size: 10px;
}

.event .label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.cal-badge {
  background: #334155;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  white-space: nowrap;
}

.cal-sb {
  background: #312e81;
  color: #a5b4fc;
}

.cal-personal {
  background: #5b3a07;
  color: #fcd34d;
}

.cal-nicole {
  background: #14532d;
  color: #86efac;
}

.overview-cal-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
}

.overview-day {
  background: #1e293b;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 9px;
}

.overview-day.today {
  background: #1a2744;
  border-color: #3b82f6;
}

.overview-day-head {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.overview-day-name {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
}

.overview-day-date {
  color: #64748b;
  font-size: 10px;
}

.overview-day-count {
  background: #334155;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 700;
  margin-left: auto;
  padding: 1px 6px;
}

.overview-event {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-bottom: 3px;
}

.overview-event-text {
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-list {
  display: grid;
  gap: 10px;
}

.calendar-day {
  background: var(--card-2);
  border: 1px solid #26354b;
  border-radius: 10px;
  overflow: hidden;
}

.calendar-day-head {
  align-items: center;
  background: #0f172a;
  border-bottom: 1px solid #223149;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}

.calendar-day-name {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
}

.calendar-day-date {
  color: #94a3b8;
  font-size: 12px;
}

.calendar-day-count {
  background: #334155;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
  padding: 2px 8px;
}

.calendar-row {
  align-items: center;
  border-bottom: 1px solid #1f2c42;
  display: grid;
  gap: 8px;
  grid-template-columns: 66px 8px 1fr auto;
  padding: 8px 12px;
}

.calendar-row:last-child {
  border-bottom: none;
}

.calendar-time {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.calendar-title {
  color: #e2e8f0;
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cal-dot {
  border-radius: 999px;
  height: 8px;
  width: 8px;
}

.dot-billing {
  background: #f59e0b;
}

.dot-meeting {
  background: #6366f1;
}

.dot-carrier {
  background: #818cf8;
}

.dot-finance {
  background: #10b981;
}

.dot-marketing {
  background: #ec4899;
}

.dot-ops {
  background: #06b6d4;
}

.dot-home {
  background: #78716c;
}

.dot-personal {
  background: #94a3b8;
}

.dot-outreach {
  background: #f97316;
}

.dot-sub {
  background: #a78bfa;
}

.dot-maint {
  background: #64748b;
}

.dot-elim {
  background: #14b8a6;
}

.draft {
  background: #0f172a;
  border: 1px solid #312e81;
  border-radius: 8px;
  margin-top: 10px;
  padding: 12px;
}

.draft pre {
  color: #cbd5e1;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.7;
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.input,
.select {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  padding: 8px 10px;
}

.input {
  flex: 1;
  min-width: 260px;
}

.help {
  color: var(--faint);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 6px;
}

.muted {
  color: var(--faint);
  font-size: 12px;
}

.kv {
  display: grid;
  gap: 8px;
}

.kv div {
  border-bottom: 1px solid #2f3d52;
  display: flex;
  font-size: 12px;
  gap: 10px;
  justify-content: space-between;
  padding-bottom: 6px;
}

@media (max-width: 720px) {
  .shell {
    padding: 0 10px 14px;
  }

  .topbar {
    margin: 0 -10px;
    padding: 12px 10px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .input {
    min-width: 100%;
  }
}
