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

:root {
  color-scheme: light;
  --canvas: #f5f7f5;
  --paper: #ffffff;
  --ink: #202a26;
  --muted: #707c76;
  --line: #dfe6e1;
  --green: #1f6f52;
  --green-soft: #e7f2ec;
  --yellow: #f0c64e;
  --yellow-soft: #fbf4d9;
  --red: #b64d42;
  --red-soft: #f8e9e6;
  --blue: #416a9d;
  --blue-soft: #eaf0f8;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 30px; }
.brand { display: flex; align-items: center; padding: 0 8px; }
.brand-name { font: 700 14px 'Manrope', sans-serif; line-height: 1.25; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.nav-label { color: #89938d; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 0 10px; margin-bottom: 8px; }
.nav-list { display: grid; gap: 4px; }
.nav-button { border: 0; background: transparent; color: #526059; width: 100%; min-height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 11px; text-align: left; border-radius: 6px; font-size: 14px; }
.nav-button:hover { background: #f5f7f5; }
.nav-button.active { background: var(--green-soft); color: #16563e; font-weight: 700; }
.nav-symbol { width: 19px; text-align: center; font-size: 16px; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--line); padding: 17px 7px 0; }
.identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; color: #194f3a; background: #dcebe2; font-size: 13px; font-weight: 700; }
.identity-copy { min-width: 0; flex: 1; }
.identity-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-role { color: var(--muted); font-size: 12px; margin-top: 2px; }
.logout { border: 0; background: transparent; color: #65716b; padding: 7px 5px; margin-top: 12px; font-size: 13px; }

.main { min-width: 0; padding: 34px clamp(20px, 4vw, 56px) 52px; }
.topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font: 700 25px/1.2 'Manrope', sans-serif; margin-bottom: 7px; }
.page-description { color: var(--muted); margin: 0; font-size: 14px; }
.top-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.button { border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); min-height: 39px; padding: 0 14px; font-size: 13px; font-weight: 600; }
.button:hover { background: #f7f9f7; }
.button.primary { background: var(--green); color: #fff; border-color: var(--green); }
.button.primary:hover { background: #195b42; }
.button.small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.button:disabled { opacity: .48; cursor: not-allowed; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 29px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; min-height: 90px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font: 700 25px 'Manrope', sans-serif; margin-top: 9px; }
.stat-value.warn { color: #996f08; }
.stat-value.danger { color: var(--red); }
.stat-value.healthy { color: var(--green); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 29px 0 12px; }
.section-head h2 { font: 700 16px 'Manrope', sans-serif; margin: 0; }
.section-note { color: var(--muted); font-size: 12px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.channel-list { display: grid; }
.channel-row { padding: 15px 18px; display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(120px, .9fr) minmax(130px, 1fr) minmax(130px, .9fr) auto; gap: 14px; align-items: center; border-bottom: 1px solid #edf0ed; }
.channel-row:last-child { border-bottom: 0; }
.channel-name { font-weight: 700; font-size: 14px; }
.channel-sub { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.channel-health { font-size: 12px; font-weight: 600; margin-top: 6px; }
.channel-health.on-time { color: #267451; }
.channel-health.late { color: var(--red); }
.cell-label { font-size: 11px; color: #89938d; margin-bottom: 5px; }
.cell-value { font-size: 13px; font-weight: 600; }
.row-action { color: var(--green); border: 0; background: transparent; padding: 6px; font-size: 12px; font-weight: 700; }
.status { display: inline-flex; align-items: center; border-radius: 4px; padding: 5px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status.todo { color: #705300; background: var(--yellow-soft); }
.status.doing { color: #315d91; background: var(--blue-soft); }
.status.blocked { color: #a34238; background: var(--red-soft); }
.status.published { color: #195c41; background: var(--green-soft); }
.status.paused { color: #626b66; background: #eef0ee; }
.task-table { width: 100%; border-collapse: collapse; }
.task-table th { text-align: left; color: #76817b; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 11px 13px; background: #f8faf8; border-bottom: 1px solid var(--line); }
.task-table td { padding: 12px 13px; font-size: 13px; border-bottom: 1px solid #edf0ed; vertical-align: middle; }
.task-table tr:last-child td { border-bottom: 0; }
.task-title { font-weight: 600; }
.task-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.due { white-space: nowrap; font-weight: 600; }
.due.late { color: var(--red); }
.due.soon { color: #9a7007; }
.select-status { border: 1px solid var(--line); border-radius: 5px; background: #fff; padding: 6px 8px; color: var(--ink); font-size: 12px; }
.empty { padding: 26px 18px; color: var(--muted); font-size: 14px; }
.empty strong { display: block; color: var(--ink); margin-bottom: 5px; }
.notice { border: 1px solid #e5d69a; background: #fff9e5; color: #5d4b11; border-radius: 6px; padding: 12px 14px; font-size: 13px; line-height: 1.5; margin-bottom: 19px; }
.notice a { color: inherit; text-decoration: underline; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 450px); background: #fff; }
.login-aside { padding: clamp(32px, 6vw, 84px); display: flex; flex-direction: column; justify-content: space-between; background: #edf4ef; border-right: 1px solid var(--line); }
.login-aside h1 { font-size: clamp(30px, 4vw, 48px); max-width: 520px; line-height: 1.1; margin: auto 0 15px; }
.login-aside p { max-width: 460px; color: #52625a; line-height: 1.65; }
.login-aside .brand { padding: 0; }
.login-side-bottom { color: #617068; font-size: 13px; }
.login-form-side { display: grid; place-items: center; padding: 28px; }
.login-card { width: min(100%, 360px); }
.login-card h2 { font: 700 22px 'Manrope', sans-serif; margin-bottom: 8px; }
.login-card > p { color: var(--muted); font-size: 14px; margin-bottom: 23px; line-height: 1.5; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #cfd8d2; border-radius: 5px; padding: 10px 11px; min-height: 42px; color: var(--ink); background: #fff; outline: none; }
.field textarea { resize: vertical; min-height: 82px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 2px #d8ebe0; }
.login-card .button { width: 100%; margin-top: 7px; }
.login-toggle { color: var(--green); border: 0; background: transparent; padding: 12px 0; font-size: 13px; font-weight: 600; }
.form-error { border-radius: 5px; background: var(--red-soft); color: #873930; padding: 10px 11px; font-size: 13px; line-height: 1.45; margin: 12px 0; }
.form-success { border-radius: 5px; background: var(--green-soft); color: #195c41; padding: 10px 11px; font-size: 13px; line-height: 1.45; margin: 12px 0; }
.form-help { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 10px; }
.modal { border: 0; border-radius: 8px; padding: 0; width: min(100% - 28px, 520px); box-shadow: 0 20px 70px #17241d33; }
.modal::backdrop { background: #16231cb0; }
.modal-inner { padding: 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 19px; }
.modal-head h2 { font: 700 19px 'Manrope', sans-serif; margin: 0 0 4px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 13px; }
.modal-close { border: 0; background: transparent; font-size: 21px; color: var(--muted); padding: 0 3px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); background: #24352d; color: #fff; border-radius: 6px; padding: 12px 15px; font-size: 13px; box-shadow: 0 5px 24px #15241b2b; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; z-index: 10; }
.toast.show { opacity: 1; transform: translateY(0); }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.view-switch { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.view-switch button { border: 0; background: transparent; padding: 10px 12px; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; }
.view-switch button.active { color: var(--green); border-color: var(--green); font-weight: 700; }
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.person { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 15px; display: flex; align-items: center; gap: 11px; }
.person-copy { min-width: 0; flex: 1; }
.person-name { font-weight: 700; font-size: 13px; }
.person-email { color: var(--muted); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.person .row-action { flex: 0 0 auto; }
.pill { display: inline-flex; padding: 4px 7px; border-radius: 4px; background: #eef2ef; color: #506058; font-size: 11px; font-weight: 600; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.filters { display: flex; gap: 8px; align-items: center; }
.filters select { min-height: 35px; border: 1px solid var(--line); border-radius: 5px; padding: 0 9px; background: #fff; color: var(--ink); font-size: 12px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr); gap: 16px; }
.note-box { background: #f8faf8; border: 1px solid var(--line); padding: 12px; border-radius: 5px; color: #56635c; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.demo-tag { color: #6b5300; background: var(--yellow-soft); border: 1px solid #eadb9e; border-radius: 4px; padding: 4px 7px; font-size: 11px; font-weight: 700; white-space: nowrap; }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .main { padding-inline: 24px; }
  .channel-row { grid-template-columns: minmax(160px, 1.3fr) minmax(100px, .8fr) minmax(110px, .9fr) auto; }
  .channel-row > :nth-child(4) { display: none; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .app-shell { display: block; padding-bottom: 69px; }
  .sidebar { position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; height: 62px; padding: 5px 7px; border-right: 0; border-top: 1px solid var(--line); display: block; }
  .brand, .nav-label, .sidebar-bottom { display: none; }
  .nav-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; height: 100%; }
  .nav-button { height: 50px; min-height: 50px; display: grid; place-items: center; align-content: center; gap: 1px; padding: 3px 1px; text-align: center; font-size: 10px; }
  .nav-symbol { font-size: 17px; }
  .main { padding: 23px 14px 28px; }
  .topline { flex-direction: column; margin-bottom: 20px; }
  .top-actions { justify-content: flex-start; }
  h1 { font-size: 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 22px; }
  .stat { min-height: 78px; padding: 12px; }
  .stat-value { font-size: 22px; }
  .channel-row { grid-template-columns: minmax(0, 1fr) auto; padding: 13px; gap: 9px; }
  .channel-row > :nth-child(2), .channel-row > :nth-child(4) { display: none; }
  .channel-row > :nth-child(3) { grid-column: 1; }
  .channel-row > :nth-child(5) { grid-column: 2; grid-row: 1 / span 2; }
  .task-table, .task-table tbody, .task-table tr, .task-table td { display: block; width: 100%; }
  .task-table thead { display: none; }
  .task-table tr { position: relative; padding: 12px 13px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
  .task-table tr:last-child { border-bottom: 0; }
  .task-table td { padding: 0; border: 0; }
  .task-table td:first-child { grid-column: 1 / -1; }
  .task-table td:nth-child(2) { grid-column: 1; }
  .task-table td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .task-table td:nth-child(4) { grid-column: 1; }
  .task-table td:nth-child(5) { grid-column: 2; grid-row: 3; }
  .task-table td:last-child { grid-column: 1 / -1; }
  .two-col { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .login-wrap { display: flex; flex-direction: column; }
  .login-aside { min-height: 210px; padding: 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-aside h1 { font-size: 29px; margin-top: 30px; }
  .login-aside p { font-size: 14px; margin-bottom: 0; }
  .login-side-bottom { display: none; }
  .login-form-side { flex: 1; place-items: start center; padding: 28px 22px; }
}

:root {
  color-scheme: dark;
  --canvas: #141a17;
  --paper: #1e2622;
  --ink: #e8eeea;
  --muted: #a0aaa4;
  --line: #39443e;
  --green: #63c49a;
  --green-soft: #243c32;
  --yellow: #eac568;
  --yellow-soft: #40371f;
  --red: #e08175;
  --red-soft: #442a29;
  --blue: #8bb6e4;
  --blue-soft: #25394b;
}

body, .app-shell, .main { background: var(--canvas); color: var(--ink); }
.sidebar, .stat, .panel, .person, .modal, .login-wrap, .login-form-side { background: var(--paper); color: var(--ink); }
.sidebar { border-color: var(--line); }
.nav-label, .cell-label, .task-table th { color: #9aa69f; }
.nav-button { color: #c1cbc5; }
.nav-button:hover, .button:hover { background: #29332d; }
.nav-button.active { background: var(--green-soft); color: #9ce4c2; }
.avatar { color: #c2f2d9; background: #2c493a; }
.logout, .row-action, .login-toggle { color: var(--green); }
.button { background: #252e29; color: var(--ink); border-color: var(--line); }
.button.primary { color: #102019; background: var(--green); border-color: var(--green); }
.button.primary:hover { background: #82d6ad; }
.stat, .panel, .person { border-color: var(--line); }
.channel-row, .task-table td, .task-table th { border-color: #303a34; }
.channel-health.on-time { color: #8fdbb5; }
.task-table th { background: #222b26; }
.status.todo { color: #f0d68e; background: var(--yellow-soft); }
.status.doing { color: #add0f5; background: var(--blue-soft); }
.status.blocked { color: #f0a59c; background: var(--red-soft); }
.status.published { color: #a1e2bd; background: var(--green-soft); }
.status.paused, .pill { color: #bdc7c1; background: #303a34; }
.select-status, .filters select, .field input, .field select, .field textarea {
  color: var(--ink);
  background: #171e1a;
  border-color: #46534b;
}
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: 0 0 0 2px #28513c; }
.notice { color: #f0d68e; background: #302b1d; border-color: #5f512c; }
.login-aside { background: #1c3026; border-color: var(--line); }
.login-aside p, .login-side-bottom { color: #bccfc3; }
.form-error { color: #ffc0b8; }
.form-success { color: #a9e6c4; }
.note-box { color: #c6d0ca; background: #222b26; }
.modal::backdrop { background: #080c0ad9; }
.toast { background: #d5eee0; color: #17251c; }
.due.soon, .stat-value.warn { color: #f0d68e; }
.stat-value.healthy { color: #8fdbb5; }

.toolbar { flex-wrap: wrap; }
.filters { flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); background: #1a211d; border-radius: 6px; }
.segmented button { min-height: 29px; padding: 0 10px; color: var(--muted); border: 0; border-radius: 4px; background: transparent; font-size: 12px; }
.segmented button.active { color: var(--ink); background: #35423a; }
.calendar-panel { border: 1px solid var(--line); border-radius: 6px; background: var(--paper); overflow: hidden; }
.calendar-toolbar { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.month-navigation { display: flex; align-items: center; gap: 12px; }
.month-navigation h2 { min-width: 176px; margin: 0; text-transform: capitalize; text-align: center; font: 700 16px 'Manrope', sans-serif; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #252e29; font-size: 21px; line-height: 1; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); color: var(--muted); background: #222b26; }
.calendar-weekdays > div { padding: 9px 10px; text-align: right; font-size: 11px; font-weight: 700; }
.calendar-cell { min-width: 0; min-height: 132px; padding: 8px; border-right: 1px solid #303a34; border-bottom: 1px solid #303a34; }
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell.outside { background: #191f1b; }
.calendar-cell.today { background: #202e26; }
.calendar-day-head { min-height: 23px; display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-bottom: 5px; }
.calendar-day-number { width: 24px; height: 24px; display: grid; place-items: center; color: #bdc7c1; font-size: 12px; }
.calendar-day-number.current { border-radius: 50%; color: #102019; background: var(--green); font-weight: 700; }
.today-label { color: var(--green); font-size: 10px; }
.calendar-events { display: grid; align-content: start; gap: 5px; }
.calendar-task { min-width: 0; padding: 6px; border: 1px solid #46534b; border-left: 3px solid #83938a; border-radius: 4px; background: #252e29; }
.calendar-task.late { border-left-color: var(--red); }
.calendar-task.done { border-left-color: var(--green); opacity: .78; }
.calendar-task-top { display: flex; align-items: flex-start; gap: 6px; }
.published-check { flex: 0 0 21px; width: 21px; height: 21px; display: grid; place-items: center; padding: 0; border: 1px solid #728078; border-radius: 4px; color: #102019; background: transparent; }
button.published-check:hover { border-color: var(--green); background: #294536; }
.published-check.checked { color: #102019; border-color: var(--green); background: var(--green); font-weight: 800; }
.calendar-task-open { min-width: 0; display: grid; gap: 3px; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; }
.calendar-task-title, .calendar-task-channel { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.calendar-task-title { font-size: 11px; font-weight: 700; }
.calendar-task-channel { color: var(--muted); font-size: 10px; }
.calendar-task-bottom { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 5px; }
.calendar-assignee { min-width: 0; color: #c1cbc5; font-size: 10px; overflow-wrap: anywhere; }
.calendar-status { max-width: 100%; padding: 2px 4px; border: 1px solid #46534b; border-radius: 4px; color: #e7d390; background: #302a1c; font-size: 10px; }
.calendar-status.doing { color: #add0f5; background: var(--blue-soft); }
.calendar-status.blocked { color: #f0a59c; background: var(--red-soft); }
.calendar-status.published { color: #a1e2bd; background: var(--green-soft); }
.calendar-reason, .task-reason { margin-top: 4px; color: #f0a59c; font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.more-events { color: var(--muted); font-size: 10px; padding: 2px 4px; }
.calendar-agenda { display: none; }
.health-banner { padding: 15px 17px; border: 1px solid #345b43; border-radius: 6px; color: #a9e6c4; background: #1d3025; font-size: 13px; }

@media (max-width: 650px) {
  .calendar-panel { overflow: visible; border: 0; background: transparent; }
  .calendar-toolbar { border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
  .calendar-weekdays, .calendar-grid { display: none; }
  .calendar-agenda { display: grid; gap: 9px; margin-top: 10px; }
  .agenda-day { padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
  .agenda-day > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
  .agenda-day > header strong { font-size: 13px; text-transform: capitalize; }
  .agenda-day > header span { color: var(--muted); font-size: 11px; }
  .agenda-day.today { border-color: #52765f; }
  .agenda-events { display: grid; gap: 7px; }
  .calendar-task { padding: 9px; }
  .calendar-task-title { font-size: 12px; }
  .calendar-task-channel, .calendar-assignee, .calendar-reason { font-size: 11px; }
  .calendar-status { font-size: 11px; }
  .month-navigation { gap: 7px; }
  .month-navigation h2 { min-width: 135px; font-size: 14px; }
}
