@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  --bg: #0b0f1d;
  --bg-soft: #101628;
  --panel: #0f1526;
  --panel-soft: #141b2f;
  --panel-strong: #1a2340;
  --text: #e6e9f2;
  --muted: #8b92a6;
  --accent: #6f4bff;
  --accent-2: #2f5bff;
  --success: #22c55e;
  --warning: #fbbf24;
  --danger: #f43f5e;
  --border: rgba(255, 255, 255, 0.08);
  --glow: rgba(111, 75, 255, 0.35);
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

body.theme-light {
  --bg: #f5f6fb;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f0f2f8;
  --panel-strong: #e2e6f0;
  --text: #141824;
  --muted: #5b6272;
  --accent: #5a3bff;
  --accent-2: #2f5bff;
  --border: rgba(20, 24, 36, 0.08);
  --shadow: 0 24px 40px rgba(35, 39, 52, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Manrope', sans-serif;
  background: radial-gradient(circle at top, #141a2e, #070a14 60%);
  color: var(--text);
  min-height: 100%;
}

body.theme-light {
  background: radial-gradient(circle at top, #ffffff, #e7ebf7 60%);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, rgba(15, 20, 40, 0.95), rgba(7, 10, 20, 0.98));
  border-right: 1px solid var(--border);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.brand .logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6f4bff, #1c4cff);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
}

.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a {
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  transition: 0.2s ease;
  border: 1px solid transparent;
  position: relative;
}

.nav-icon {
  width: 22px;
  height: 22px;
  color: #9aa2b5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
}

.nav a.active .nav-icon,
.nav a:hover .nav-icon {
  color: #b9a7ff;
}

.action-card {
  position: relative;
  overflow: hidden;
}

.emoji-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(245, 247, 255, 0.95);
  transition: transform 0.2s ease, background 0.2s ease;
}

.emoji-btn svg {
  width: 22px;
  height: 22px;
}

.action-card:hover .emoji-btn {
  transform: translateX(6px);
  background: rgba(255, 255, 255, 0.14);
}

.nav a.active,
.nav a:hover {
  color: var(--text);
  background: rgba(111, 75, 255, 0.12);
  border: 1px solid rgba(111, 75, 255, 0.3);
  box-shadow: inset 0 0 0 1px rgba(111, 75, 255, 0.12);
}




.main {
  padding: 32px 40px 48px;
}

.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  margin: 0 0 6px;
}

.page-subtitle {
  color: var(--muted);
  margin: 0 0 28px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--panel);
  border-radius: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.priority-card {
  position: relative;
  cursor: pointer;
}

.priority-delete {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.priority-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

.priority-card.open .priority-details {
  max-height: 320px;
  opacity: 1;
  margin-top: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
}

.detail-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-top: 4px;
}

.color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
}

.color-dot.active {
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.priority-card.open .priority-delete {
  opacity: 1;
  pointer-events: auto;
  border-color: rgba(255, 255, 255, 0.12);
}

.priority-delete:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}

.priority-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-right: 52px;
}

.priority-coverage {
  font-weight: 700;
}

.card.soft {
  background: var(--panel-soft);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}


.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(47, 91, 255, 0.15);
  color: #8fb0ff;
  font-size: 12px;
}

.btn {
  background: linear-gradient(135deg, #5f42ff, #1e4bff);
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn.secondary {
  background: rgba(111, 75, 255, 0.12);
  color: var(--text);
  border: 1px solid rgba(111, 75, 255, 0.35);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn:hover {
  transform: translateY(-1px);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-row .btn {
  text-align: left;
  white-space: normal;
  line-height: 1.3;
}

.preset-row .btn.is-active {
  border-color: rgba(120, 138, 255, 0.7);
  background: rgba(120, 138, 255, 0.18);
  color: #e8eeff;
  box-shadow: 0 0 0 1px rgba(120, 138, 255, 0.12) inset;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.year-month {
  padding: 12px 14px 14px;
  border-radius: 16px;
  background: rgba(15, 21, 43, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.year-month-header {
  font-size: 15px;
  text-transform: capitalize;
  margin-bottom: 8px;
}

.year-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.year-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 12px;
}

.year-day {
  display: grid;
  place-items: center;
  height: 22px;
  color: var(--text);
  border-radius: 999px;
}

.year-day-number {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.year-day-number:hover {
  background: rgba(111, 75, 255, 0.18);
}

.year-day.is-outside {
  color: rgba(255, 255, 255, 0.35);
}

.year-day.is-today {
  background: #2b4f91;
  color: #e6f0ff;
}

.year-day.is-selected .year-day-number {
  background: #2b4f91;
  color: #e6f0ff;
}

.year-popover {
  position: absolute;
  width: 240px;
  background: var(--panel);
  border-radius: 24px;
  padding: 18px 18px 16px;
  color: var(--text);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  z-index: 60;
}

.year-popover-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-size: 12px;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.year-popover-spacer {
  width: 18px;
  height: 18px;
}

.year-popover-weekday {
  justify-self: center;
}

.year-popover-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  justify-self: end;
}

.year-popover-day {
  font-size: 44px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  margin: 6px 0 10px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.year-popover-day:hover {
  color: var(--accent);
}

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

.year-popover-item {
  display: grid;
  grid-template-columns: 10px auto 1fr;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.year-popover-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.year-popover-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.year-popover-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.year-popover-empty {
  font-size: 13px;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.divider {
  height: 1px;
  background: var(--border);
  opacity: 0.6;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 13px;
}

.chip.muted {
  color: var(--muted);
}

.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.color-swatch::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--swatch-color);
  box-shadow: 0 0 0 2px rgba(12, 18, 33, 0.7);
}

.color-swatch.active {
  border-color: rgba(111, 75, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(111, 75, 255, 0.2);
  transform: translateY(-1px);
}

.event-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 20, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.event-detail-card {
  width: min(560px, 92vw);
  background: var(--panel);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: 0 24px 60px rgba(5, 8, 18, 0.45);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.event-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(111, 75, 255, 0.5);
}

.event-detail-title {
  font-size: 20px;
  font-weight: 700;
}

.event-detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.event-detail-section {
  display: grid;
  gap: 6px;
}

.event-detail-description {
  color: var(--text);
  line-height: 1.5;
}

.event-detail-actions {
  display: flex;
  justify-content: flex-end;
}

.event-detail-edit {
  display: none;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.event-detail-edit.active {
  display: block;
}

.event-detail-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.priority-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #facc15;
}

.banner.success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.banner-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #facc15;
}

.banner.success .banner-icon {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.priority-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.progress {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.kpi {
  font-size: 32px;
  font-weight: 700;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.dashboard-panels {
  align-items: stretch;
}

.consistency-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.consistency-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(27, 35, 66, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.consistency-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.consistency-name {
  font-weight: 600;
}

.consistency-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  background:
    conic-gradient(rgba(111, 75, 255, 0.7) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.08) 0);
  position: relative;
}

.consistency-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #0f152b;
}

.consistency-ring span {
  position: relative;
  z-index: 1;
}

.kpi-card {
  padding: 22px;
}

.kpi-head {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--text-soft);
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-size: 16px;
}

.kpi-icon svg {
  width: 18px;
  height: 18px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  margin-top: 12px;
}

.kpi-icon.is-positive {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.kpi-icon.is-negative {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.kpi-crown-icon {
  background: rgba(250, 204, 21, 0.18);
  color: #fde68a;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.18) inset;
}

.circle-metric {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.08);
  position: relative;
  font-weight: 700;
}

.circle-metric::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 6px solid rgba(111, 75, 255, 0.3);
  clip-path: polygon(50% 50%, 50% 0, 100% 0, 100% 100%, 0 100%, 0 0);
  opacity: 0.35;
}

.pie {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: conic-gradient(#6f4bff 0deg 60deg, #2f5bff 60deg 120deg, #f59e0b 120deg 170deg, #f472b6 170deg 220deg, #22d3ee 220deg 290deg, #a3e635 290deg 360deg);
  display: grid;
  place-items: center;
  position: relative;
  --pie-sweep: 0;
}

.pie::after {
  content: '';
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--panel);
}

.pie.hidden {
  display: none;
}

.pie.animate {
  animation: pieSweep 1.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  -webkit-mask: conic-gradient(#000 0deg calc(var(--pie-sweep) * 1turn), transparent 0);
  mask: conic-gradient(#000 0deg calc(var(--pie-sweep) * 1turn), transparent 0);
}

@keyframes pieSweep {
  from {
    --pie-sweep: 0;
  }
  to {
    --pie-sweep: 1;
  }
}

@property --pie-sweep {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.pie-empty {
  width: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  text-align: center;
}

.calendar {
  display: grid;
  gap: 12px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.calendar-views-mobile {
  display: none;
}

@media (max-width: 720px) {
  .calendar-views-desktop {
    display: none !important;
  }
  .calendar-views-mobile {
    display: block;
  }
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-cell {
  background: var(--panel-soft);
  border-radius: 12px;
  padding: 10px;
  min-height: 90px;
  border: 1px solid var(--border);
}

.calendar-cell small {
  color: var(--muted);
}

.event-pill {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  background: rgba(111, 75, 255, 0.2);
  border: 1px solid rgba(111, 75, 255, 0.45);
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.month-grid {
  gap: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.month-cell {
  background: transparent;
  border: none;
  min-height: 140px;
  padding: 10px 12px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.month-grid .month-cell:nth-child(7n) {
  border-right: none;
}

.month-cell.is-outside {
  color: rgba(255, 255, 255, 0.45);
}

.month-cell.is-today .month-day {
  background: #2b4f91;
  color: #e6f0ff;
}

.month-cell-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
}

.month-weekday {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.month-day {
  font-size: 14px;
  border-radius: 999px;
  padding: 2px 8px;
}

.month-grid .event-pill {
  border-radius: 12px;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: 8px 1fr;
  column-gap: 6px;
  align-items: start;
}

.month-grid .event-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
  grid-row: 1 / span 2;
  align-self: start;
  margin-top: 3px;
}

.event-pill .event-title,
.event-pill .event-time {
  grid-column: 2;
}

.event-pill .event-time {
  color: var(--text-soft);
  font-size: 11px;
}

.event-menu {
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
  z-index: 20;
}

.event-menu button {
  width: 100%;
}

.article-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 22px;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
}

.filter-chip.active {
  background: rgba(111, 75, 255, 0.2);
  border-color: rgba(111, 75, 255, 0.5);
  color: #d8cbff;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 900px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
}

.article-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(19, 25, 45, 0.95), rgba(15, 19, 35, 0.98));
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: 160px auto;
  cursor: pointer;
}

.article-modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 20, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.article-modal.open {
  display: flex;
}

.article-modal-content {
  width: min(780px, 92vw);
  max-height: 80vh;
  overflow: auto;
  background: linear-gradient(180deg, rgba(18, 24, 44, 0.98), rgba(12, 16, 30, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 22px 24px 26px;
  position: relative;
}

.article-modal-content h2 {
  margin: 0 0 12px;
}

.article-modal-body {
  white-space: pre-wrap;
  color: var(--text-soft);
  line-height: 1.6;
}

.article-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.article-media {
  background-size: cover;
  background-position: center;
  position: relative;
}

.article-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 10, 20, 0.1), rgba(7, 10, 20, 0.55));
}

.article-image-one {
  background-image: linear-gradient(120deg, rgba(37, 99, 235, 0.4), rgba(94, 234, 212, 0.2)),
    linear-gradient(0deg, rgba(12, 15, 29, 0.8), rgba(12, 15, 29, 0.4));
}

.article-image-two {
  background-image: linear-gradient(120deg, rgba(234, 88, 12, 0.35), rgba(168, 85, 247, 0.2)),
    linear-gradient(0deg, rgba(12, 15, 29, 0.8), rgba(12, 15, 29, 0.4));
}

.article-body {
  padding: 18px 20px 20px;
  display: grid;
  gap: 10px;
}

.article-body h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
  transition: color 0.2s ease;
}

.article-body h3:hover {
  color: #8b7bff;
}

.article-body p {
  margin: 0;
  color: var(--text-soft);
}

.article-tag {
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
}

.tag-start {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.tag-productivity {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.article-time {
  color: var(--text-soft);
  font-size: 13px;
}

.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.report-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 22px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
}

.report-summary {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(32, 45, 70, 0.6);
}

.report-summary.is-strong {
  border-color: rgba(87, 227, 140, 0.4);
  background: rgba(28, 60, 46, 0.7);
}

.report-summary.is-weak {
  border-color: rgba(255, 90, 90, 0.4);
  background: rgba(80, 25, 35, 0.75);
}

.report-score {
  font-size: 44px;
  font-weight: 700;
  color: #60e89a;
}

.report-summary.is-weak .report-score {
  color: #ff6b6b;
}

.report-list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.report-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(35, 34, 46, 0.7);
}

.report-card.is-good {
  border-color: rgba(87, 227, 140, 0.35);
  background: rgba(20, 45, 45, 0.75);
}

.report-card.is-bad {
  border-color: rgba(255, 90, 90, 0.25);
  background: rgba(49, 29, 46, 0.75);
}

.report-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.report-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}

.report-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.report-status.good {
  color: #60e89a;
}

.report-status.bad {
  color: #ff6b6b;
}

.report-status-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  font-size: 12px;
}

.report-bar {
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.report-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--priority-color, #7c4dff);
}

.report-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-soft);
}

.report-hint {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(16, 22, 36, 0.6);
  color: var(--text);
}

.chat-box {
  display: grid;
  gap: 12px;
}

.chat-message {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.chat-message.me {
  background: rgba(111, 75, 255, 0.2);
}

.planner-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.planner-day h3 {
  margin: 0;
  font-size: 18px;
}

.planner-day .notice {
  margin-top: 4px;
}

.day-view {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  overflow: hidden;
  --hour-height: 56px;
}

.day-hours {
  display: grid;
  grid-template-rows: repeat(24, var(--hour-height));
}

.day-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: flex-start;
  position: relative;
}

.day-hour-label {
  color: var(--text-soft);
  font-size: 12px;
  padding: 0 8px 0 14px;
  line-height: 1;
}

.day-hour-line {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  height: 1px;
  margin-top: 0;
}

.day-overlay {
  position: absolute;
  top: 0;
  left: 64px;
  right: 0;
  height: calc(var(--hour-height) * 24);
}

.day-event {
  position: absolute;
  left: 12px;
  right: 18px;
  border: 1px solid rgba(111, 75, 255, 0.45);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(111, 75, 255, 0.18);
  color: var(--text);
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.day-event small {
  color: var(--text-soft);
  font-size: 12px;
}

.day-now {
  position: absolute;
  left: 0;
  right: 10px;
  height: 2px;
  background: #ff6666;
}

.week-view {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.week-header {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
  gap: 12px;
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 700px;
}

.week-header-spacer {
  height: 1px;
  position: sticky;
  left: 0;
  background: var(--panel-soft);
  z-index: 11;
}

.week-day-label {
  background: #1b2438;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text-soft);
  font-weight: 600;
  text-transform: lowercase;
  scroll-snap-align: start;
}

.week-body {
  display: grid;
  grid-template-columns: 64px 1fr;
  min-width: 700px;
}

.week-time-col {
  display: grid;
  grid-template-rows: repeat(24, 56px);
  padding: 0;
  color: var(--text-soft);
  font-size: 12px;
  position: sticky;
  left: 0;
  background: var(--panel-soft);
  z-index: 10;
  border-right: 1px solid rgba(255, 255, 255, 0.02);
}

.week-time-row {
  padding: 0 8px 0 14px;
  display: flex;
  align-items: flex-start;
  line-height: 1;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.week-day-col {
  position: relative;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  scroll-snap-align: start;
}

.week-lines {
  display: grid;
  grid-template-rows: repeat(24, 56px);
}

.week-line {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.week-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(56px * 24);
}

.week-event {
  position: absolute;
  left: 8px;
  right: 8px;
  border: 1px solid rgba(111, 75, 255, 0.45);
  border-radius: 12px;
  padding: 6px 8px;
  background: rgba(111, 75, 255, 0.18);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  overflow: hidden;
}

.week-event .event-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.event-pill.is-completed,
.week-event.is-completed,
.day-event.is-completed,
.card.is-completed,
.event-pill.is-past,
.week-event.is-past,
.day-event.is-past,
.card.is-past {
  opacity: 0.55;
  text-decoration: line-through;
}


.week-event small {
  color: var(--text-soft);
  font-size: 12px;
}

.week-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ff6666;
}

.time-select {
  position: absolute;
  left: 8px;
  right: 8px;
  border-radius: 12px;
  border: 1px dashed rgba(111, 75, 255, 0.65);
  background: rgba(111, 75, 255, 0.16);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(111, 75, 255, 0.18);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 6px 8px;
}

.time-select-label {
  font-size: 11px;
  color: #e6e0ff;
  background: rgba(18, 24, 48, 0.75);
  border: 1px solid rgba(111, 75, 255, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
}

.planner-card {
  display: grid;
  gap: 14px;
}

.planner-prompt {
  align-self: start;
  background: #20283d;
  border-radius: 16px;
  padding: 14px 18px;
  color: #d1d6e4;
  font-weight: 600;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  max-width: 60%;
}

.planner-input {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: auto;
}

.planner-input .input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 16px;
  background: #151c2f;
}

.send-btn {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c4dff, #3c5bff);
  border: none;
  color: white;
  cursor: pointer;
}

.send-btn svg {
  width: 22px;
  height: 22px;
}

.range-wrap {
  position: relative;
  padding: 8px 0 4px;
}

.range-value {
  position: absolute;
  right: 0;
  top: -4px;
  color: var(--text);
  font-weight: 600;
}

.slider {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(111, 75, 255, 0.35), rgba(111, 75, 255, 0.12));
  outline: none;
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #a78bfa;
  border: 3px solid #1b1333;
  box-shadow: 0 0 0 4px rgba(111, 75, 255, 0.3);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #a78bfa;
  border: 3px solid #1b1333;
}

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

.justify-between {
  justify-content: space-between;
}

.space-between {
  justify-content: space-between;
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(6, 40px);
  gap: 12px;
  margin-top: 8px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
}

.color-swatch.active {
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.notice {
  color: var(--muted);
  font-size: 13px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.pie-layout {
  display: flex;
  align-items: center;
  gap: 32px;
}

@media (max-width: 720px) {
  .pie-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 90px 1fr;
  }
  .nav a .nav-label,
  .brand small {
    display: none;
  }
  .nav a {
    justify-content: center;
  }
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mobile-menu-toggle {
  display: none;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    display: block;
  }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: 6px 0 10px;
    background: rgba(10, 14, 28, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: none;
    border-top: 1px solid var(--border);
    border-bottom: none;
    z-index: 100;
    display: block;
    overflow: visible;
  }
  body.theme-light .sidebar {
    background: rgba(255, 255, 255, 0.95);
  }
  .brand {
    display: none;
  }
  .mobile-menu-toggle {
    display: none;
  }
  .nav {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin-top: 0;
    padding: 0;
    justify-content: space-around;
    align-items: center;
    opacity: 1;
    pointer-events: auto;
  }
  .nav a, .mobile-more-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 6px;
    gap: 4px;
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 11px;
    color: var(--muted);
    text-decoration: none;
  }
  .nav a.active {
    color: var(--text);
  }
  .nav a .nav-icon, .mobile-more-btn .nav-icon {
    margin-right: 0;
  }
  .nav a .nav-label {
    display: block !important;
    font-size: 10px;
    font-weight: 500;
  }
  
  .nav a[data-nav="stats"] { order: 1; display: flex; }
  .nav a[data-nav="priorities"] { order: 2; display: flex; }
  .nav a[data-nav="calendar"] { 
    order: 3; 
    display: flex; 
    position: relative;
    top: -14px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6f4bff, #2f5bff) !important;
    box-shadow: 0 8px 24px rgba(111,75,255,0.4) !important;
    color: white !important;
    align-items: center;
    justify-content: center;
  }
  .nav a[data-nav="calendar"] .nav-label {
    display: none !important;
  }
  .nav a[data-nav="calendar"] .nav-icon {
    font-size: 28px !important;
    margin: 0;
  }
  .nav a[data-nav="planner"] { order: 4; display: flex; }
  .mobile-more-btn { order: 5; display: flex; }
  
  .nav a[data-nav="settings"],
  .nav a[data-nav="dashboard"],
  .nav a[data-nav="friends"],
  .nav a[data-nav="articles"] {
    display: none !important;
  }

  /* Bottom sheet styles */
  .mobile-bottom-sheet {
    position: fixed;
    bottom: -150%;
    left: 0;
    width: 100%;
    background: rgba(18, 24, 44, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    padding: 24px 24px 40px;
    z-index: 90;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  }
  body.theme-light .mobile-bottom-sheet {
    background: rgba(255, 255, 255, 0.98);
  }
  .mobile-bottom-sheet.open {
    bottom: 50px;
  }
  .sheet-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .sheet-content a, .sheet-content button {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    font-weight: 500;
    font-size: 15px;
    border: none;
    cursor: pointer;
    text-align: left;
  }
  body.theme-light .sheet-content a, body.theme-light .sheet-content button {
    background: rgba(0,0,0,0.03);
  }
  .sheet-content a svg, .sheet-content button svg {
    width: 20px;
    height: 20px;
    margin-right: 14px;
    color: var(--muted);
  }

  .main {
    padding-bottom: 90px;
  }
}

@media (max-width: 720px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .dashboard-kpis {
    grid-template-columns: 1fr;
  }
  .consistency-grid {
    grid-template-columns: 1fr;
  }
  .year-grid {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 24px;
    padding-bottom: 90px;
  }
}
