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

:root {
  --ink: #1d2925;
  --muted: #7b8780;
  --line: #e6e9e1;
  --paper: #f5f4ef;
  --card: #fffefa;
  --mint: #dceee5;
  --mint-strong: #4e8d79;
  --navy: #203d4b;
  --coral: #e99075;
  --yellow: #f3cf76;
  --shadow: 0 18px 45px rgba(32, 61, 75, 0.08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 90% 5%, rgba(220, 238, 229, 0.7), transparent 30%), var(--paper); font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.dashboard-view { width: min(100%, 520px); min-height: 100vh; margin: 0 auto; padding: 34px 20px 24px; }
.dashboard-header, .section-heading, .admin-card-heading, .admin-header, .admin-header-actions, .dashboard-footer, .welcome-row { display: flex; align-items: center; justify-content: space-between; }
.dashboard-header { margin-bottom: 42px; }
.brand-mark { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 800; letter-spacing: -0.02em; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 5px rgba(233, 144, 117, 0.13); }
.icon-button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 14px; color: var(--navy); background: rgba(255, 254, 250, 0.78); font-size: 18px; transition: transform .2s, background .2s; }
.icon-button:hover { transform: translateY(-2px); background: var(--card); }

.welcome-row { align-items: flex-end; margin-bottom: 26px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; line-height: 1.4; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: 'Playfair Display', Georgia, serif; font-size: clamp(55px, 14vw, 76px); font-weight: 600; letter-spacing: -0.06em; line-height: .85; }
h2 { margin-bottom: 0; font-size: 21px; letter-spacing: -0.04em; line-height: 1.1; }
.weather-card { padding: 20px 21px 17px; border-color: rgba(220, 238, 229, .9); background: linear-gradient(145deg, rgba(255, 254, 250, .96), rgba(236, 247, 240, .88)); }
.weather-now { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.weather-current-line { display: flex; align-items: center; gap: 9px; }
.weather-icon { font-size: 29px; line-height: 1; }
.weather-current-line strong { font-size: 29px; letter-spacing: -.07em; }
.weather-current-line > span:last-child { max-width: 145px; color: var(--muted); font-size: 11px; line-height: 1.2; }
.weather-meta { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.weather-range { padding-top: 3px; color: var(--navy); font-size: 13px; font-weight: 800; white-space: nowrap; }
.weather-day-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 19px; padding-top: 15px; border-top: 1px solid rgba(78, 141, 121, .14); }
.weather-day-heading h2 { font-size: 14px; }
.weather-day-heading span { color: var(--muted); font-size: 10px; }
.weather-day-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.weather-slot { display: grid; gap: 4px; min-height: 55px; padding: 8px 7px; border-radius: 12px; background: rgba(255, 255, 255, .58); }
.weather-slot > span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.weather-slot strong { color: var(--navy); font-size: 12px; white-space: nowrap; }
.weather-slot small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.weather-unconfigured { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }

.card { margin-bottom: 15px; border: 1px solid rgba(230, 233, 225, .85); border-radius: 27px; background: rgba(255, 254, 250, .9); box-shadow: var(--shadow); }
.transport-card { padding: 22px 21px 18px; background: var(--navy); color: #f8fbf7; border-color: transparent; box-shadow: 0 20px 45px rgba(32, 61, 75, .17); }
.transport-card .eyebrow { color: rgba(248, 251, 247, .58); }
.transport-card h2 { color: #fff; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #9fe0a8; box-shadow: 0 0 0 5px rgba(159, 224, 168, .1); }
.transport-list { margin: 20px 0 17px; }
.transport-empty { display: grid; gap: 5px; padding: 15px 0 4px; color: rgba(248, 251, 247, .78); }
.transport-empty strong { color: #fff; font-size: 13px; }
.transport-empty span { max-width: 300px; color: rgba(248, 251, 247, .56); font-size: 10px; line-height: 1.45; }
.transport-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.transport-row:first-child { border-top: 0; }
.route-badge { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .12); font-size: 12px; font-weight: 800; }
.route-direction { font-size: 13px; font-weight: 600; }
.transport-route-copy { min-width: 0; }
.arrival-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.arrival-pills span { padding: 4px 6px; border-radius: 7px; color: rgba(248, 251, 247, .75); background: rgba(255, 255, 255, .11); font-size: 9px; white-space: nowrap; }
.route-note { display: block; margin-top: 2px; color: rgba(248, 251, 247, .54); font-size: 10px; }
.route-time { font-size: 18px; font-weight: 800; letter-spacing: -.04em; }
.route-time span { color: rgba(248, 251, 247, .56); font-size: 10px; font-weight: 500; }
.muted-note { margin: 0; color: rgba(248, 251, 247, .56); font-size: 10px; }

.tasks-card, .calendar-card { padding: 22px 21px 20px; }
.section-symbol { color: var(--mint-strong); font-size: 23px; font-weight: 500; }
.count-pill { display: inline-flex; min-width: 31px; height: 22px; align-items: center; justify-content: center; margin-left: 5px; padding: 0 7px; border-radius: 8px; color: var(--mint-strong); background: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: 0; vertical-align: 3px; }
.task-list { margin-top: 19px; }
.task-row { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 10px 0; border-top: 1px solid var(--line); }
.task-row:first-child { border-top: 0; }
.task-check { display: grid; flex: 0 0 auto; width: 25px; height: 25px; place-items: center; border: 1px solid #c9d6ce; border-radius: 9px; color: transparent; background: #f9fbf8; cursor: pointer; transition: .2s; }
.task-check:hover { border-color: var(--mint-strong); }
.task-row.is-done .task-check { border-color: var(--mint-strong); color: white; background: var(--mint-strong); }
.task-row.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.task-copy { min-width: 0; flex: 1; }
.task-title { display: block; font-size: 13px; font-weight: 700; transition: .2s; }
.task-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.task-arrow { color: #b5c0b9; font-size: 18px; }
.task-complete { flex: 0 0 92px; min-height: 50px; border: 0; border-radius: 15px; color: #fff; background: var(--mint-strong); box-shadow: 0 7px 15px rgba(78, 141, 121, .16); cursor: pointer; font-size: 12px; font-weight: 800; transition: transform .2s, background .2s; }
.task-complete:hover { transform: translateY(-1px); background: #3e7b68; }
.task-row.is-done .task-complete { color: var(--mint-strong); background: var(--mint); box-shadow: none; }
.empty-state { padding: 30px 0 8px; color: var(--muted); font-size: 13px; text-align: center; }

.calendar-heading { margin-bottom: 15px; }
.plan-list { display: grid; gap: 8px; }
.plan-row { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px; min-height: 54px; padding: 7px 0; border-top: 1px solid var(--line); }
.plan-row:first-child { border-top: 0; }
.plan-date { display: grid; place-items: center; align-content: center; width: 48px; height: 43px; border-radius: 13px; color: var(--navy); background: #eef5f0; }
.plan-date strong { font-size: 17px; line-height: 1; }
.plan-date span { margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: lowercase; }
.plan-copy { min-width: 0; display: grid; gap: 4px; }
.plan-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.plan-copy span { color: var(--muted); font-size: 10px; }
.plan-row.is-today .plan-date { color: #fff; background: var(--coral); }
.plan-row.is-today .plan-copy strong { color: var(--coral); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calendar-weekday { padding-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; display: flex; min-height: 34px; align-items: center; justify-content: center; border-radius: 10px; color: var(--ink); font-size: 11px; }
.calendar-day.is-other { color: #c6cbc5; }
.calendar-day.is-today { color: #fff; background: var(--coral); font-weight: 800; }
.calendar-day.has-event::after { position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--mint-strong); content: ''; }
.calendar-day.is-today.has-event::after { background: #fff; }
.event-strip { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.event-chip { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 10px; color: var(--navy); background: #eef5f0; font-size: 10px; font-weight: 700; }
.event-chip::before { width: 5px; height: 5px; border-radius: 50%; background: var(--mint-strong); content: ''; }
.dashboard-footer { padding: 4px 4px 0; color: #9aa39d; font-size: 9px; letter-spacing: .02em; }

/* Admin */
.admin-view { width: min(100% - 48px, 1260px); margin: 0 auto; padding: 48px 0 70px; }
.admin-header { align-items: flex-end; gap: 30px; margin-bottom: 36px; }
.admin-header h1 { margin: 8px 0 7px; font-size: clamp(42px, 6vw, 74px); line-height: .95; }
.admin-header p { margin: 0; color: var(--muted); font-size: 14px; }
.back-link { color: var(--mint-strong); font-size: 12px; font-weight: 800; }
.admin-header-actions { flex-shrink: 0; gap: 14px; }
.connection-status { color: var(--muted); font-size: 10px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #78bd83; }
.primary-button, .secondary-button { border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer; font-size: 12px; font-weight: 800; transition: transform .2s, box-shadow .2s; }
.primary-button { color: #fff; background: var(--navy); box-shadow: 0 9px 18px rgba(32, 61, 75, .15); }
.secondary-button { color: var(--navy); background: var(--mint); }
.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); }
.admin-overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-card { min-height: 132px; padding: 19px; border: 1px solid var(--line); border-radius: 21px; background: rgba(255, 254, 250, .78); }
.metric-card strong { display: block; margin: 17px 0 5px; color: var(--navy); font-family: 'Playfair Display', Georgia, serif; font-size: 34px; line-height: .8; }
.metric-card span:last-child { color: var(--muted); font-size: 11px; }
.metric-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.accent-metric { border-color: #d2e8dc; background: var(--mint); }
.accent-metric strong { font-family: 'Manrope', sans-serif; font-size: 26px; }
.admin-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.admin-card { padding: 25px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255, 254, 250, .84); box-shadow: 0 10px 30px rgba(32, 61, 75, .035); }
.wide-card { grid-column: span 1; }
.admin-card-heading { align-items: flex-start; margin-bottom: 22px; }
.admin-card h2 { font-size: 22px; }
.admin-item-list { display: grid; gap: 8px; margin-bottom: 19px; }
.admin-item { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid #edf0e9; border-radius: 14px; background: #fffefa; }
.admin-item-main { min-width: 0; flex: 1; }
.admin-item-title { display: block; overflow: hidden; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.admin-item-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.admin-item-state { padding: 5px 7px; border-radius: 7px; color: var(--mint-strong); background: #eef5f0; font-size: 9px; font-weight: 800; white-space: nowrap; }
.admin-item-state.is-done { color: #a07a34; background: #fff3d9; }
.item-delete { border: 0; color: #b3bcb5; background: transparent; cursor: pointer; font-size: 16px; }
.item-delete:hover { color: #cf6f61; }
.inline-form { display: flex; gap: 8px; }
.inline-form input, .inline-form select, .stacked-form input, .field-label input { min-width: 0; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--ink); background: #fffefa; padding: 11px 12px; font-size: 11px; }
.inline-form input:focus, .inline-form select:focus, .stacked-form input:focus, .field-label input:focus { border-color: var(--mint-strong); box-shadow: 0 0 0 3px rgba(78, 141, 121, .12); }
.inline-form input[name="title"] { flex: 1; }
.inline-form input[type="time"] { width: 100px; }
.inline-form select { width: 130px; }
.form-hint { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.stacked-form { display: grid; gap: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stacked-form input { width: 100%; }
.stacked-form button { width: 100%; }
.compact-list { max-height: 244px; overflow-y: auto; }
.compact-list .admin-item { padding: 10px 11px; }
.compact-list .admin-item-title { font-size: 11px; }
.field-label { display: grid; gap: 7px; margin-bottom: 15px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.field-label input { width: 100%; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.route-settings-list { display: grid; gap: 7px; margin-bottom: 13px; }
.route-setting { display: grid; grid-template-columns: 33px 1fr auto; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 11px; background: #f4f7f2; }
.route-setting .route-badge { width: 27px; height: 27px; border-radius: 8px; font-size: 10px; color: #fff; background: var(--navy); }
.route-setting span:nth-child(2) { font-size: 11px; font-weight: 700; }
.route-setting small { color: var(--muted); font-size: 9px; }
.route-setting button { border: 0; color: #b3bcb5; background: transparent; cursor: pointer; }
.route-form input:first-child { width: 54px; }
.route-form input:nth-child(2) { flex: 1; }
.route-form input:nth-child(3) { width: 66px; }
.toggle-list { display: grid; gap: 4px; margin-bottom: 20px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row span { display: grid; gap: 4px; }
.toggle-row strong { font-size: 12px; }
.toggle-row small, .integration-row small { color: var(--muted); font-size: 10px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; display: block; width: 40px; height: 23px; border-radius: 30px; background: #d7ddd8; transition: .2s; }
.toggle-row i::after { position: absolute; top: 4px; left: 4px; width: 15px; height: 15px; border-radius: 50%; background: #fff; content: ''; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.toggle-row input:checked + i { background: var(--mint-strong); }
.toggle-row input:checked + i::after { transform: translateX(17px); }
.integration-row { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 9px; padding: 10px 0; border-top: 1px solid var(--line); }
.integration-row span:nth-child(2) { display: grid; gap: 3px; }
.integration-row strong { font-size: 11px; }
.integration-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 800; }
.integration-icon.telegram { background: #3a9bd3; }
.integration-icon.yandex { background: #dc5243; }
.integration-badge { color: var(--mint-strong); font-size: 9px; font-weight: 800; }
code { padding: 2px 4px; border-radius: 4px; color: var(--navy); background: #eef5f0; font-size: 9px; }
.toast { position: fixed; right: 24px; bottom: 22px; max-width: 300px; transform: translateY(20px); padding: 12px 15px; border-radius: 12px; color: #fff; background: var(--navy); box-shadow: 0 12px 30px rgba(32, 61, 75, .2); font-size: 11px; opacity: 0; pointer-events: none; transition: .25s; }
.toast.is-visible { transform: translateY(0); opacity: 1; }

@media (max-width: 920px) {
  .admin-view { width: min(100% - 32px, 700px); padding-top: 28px; }
  .admin-header { display: block; }
  .admin-header-actions { justify-content: space-between; margin-top: 20px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-overview { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .dashboard-view { padding: 22px 14px 18px; }
  .dashboard-header { margin-bottom: 30px; }
  .admin-view { width: min(100% - 24px, 520px); padding: 22px 0 40px; }
  .admin-header h1 { font-size: 48px; }
  .admin-header-actions { align-items: flex-start; display: grid; gap: 10px; }
  .admin-header-actions .primary-button { width: 100%; }
  .admin-overview { gap: 8px; }
  .metric-card { min-height: 112px; padding: 14px; }
  .metric-card strong { margin-top: 15px; }
  .admin-card { padding: 19px 16px; }
  .inline-form { display: grid; grid-template-columns: 1fr 1fr; }
  .inline-form input[name="title"] { grid-column: span 2; }
  .inline-form .primary-button, .inline-form .secondary-button { grid-column: span 2; }
  .route-form { grid-template-columns: 54px 1fr; }
  .route-form input:nth-child(3) { width: auto; }
  .route-form input:nth-child(2) { width: auto; }
  .route-form input:nth-child(3), .route-form button { grid-column: span 1; }
  .welcome-row { align-items: flex-end; }
  .weather-card { padding: 17px 16px 15px; }
  .weather-current-line strong { font-size: 25px; }
  .weather-current-line > span:last-child { max-width: 120px; }
  .weather-slot { padding: 7px 5px; }
  .weather-slot strong { font-size: 11px; }
  .task-complete { flex-basis: 84px; }
}
