:root {
  --ink: #242923;
  --ink-soft: #566057;
  --cream: #f6f5f0;
  --paper: #fffefa;
  --line: #e2e0d7;
  --lime: #dce8a8;
  --lime-deep: #b9cb60;
  --orange: #e76d42;
  --orange-soft: #fff0e8;
  --teal: #227a70;
  --teal-soft: #e5f3ef;
  --muted: #898e88;
  --red: #bb4a39;
  --shadow: 0 18px 50px rgba(43, 47, 36, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--cream); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--cream); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(34, 122, 112, 0.3); outline-offset: 2px; }

.page-loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.app-shell { min-height: 100vh; }
.topbar { width: min(1220px, calc(100% - 40px)); height: 82px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: var(--lime); font-size: 21px; font-weight: 900; letter-spacing: -2px; }
.topbar .brand-mark-logo { width: 96px; height: 36px; padding: 0 14px; border-radius: 10px; }
.brand-mark-logo img { display: block; width: 100%; height: auto; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 15px; letter-spacing: -0.02em; }
.brand-copy span { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; margin-left: -8px; border: 2px solid var(--cream); border-radius: 50%; background: var(--avatar-bg, var(--lime)); color: var(--ink); font-size: 11px; font-weight: 800; }
.avatar:nth-child(2) { --avatar-bg: #ffd3c1; }
.avatar:nth-child(3) { --avatar-bg: #cfeae3; }
.profile { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 4px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,250,0.64); }
.profile-name { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 4px; font-size: 13px; font-weight: 700; }
.profile .avatar { width: 28px; height: 28px; margin: 0; border: 0; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); }
.icon-button:hover { background: #ebeae4; color: var(--ink); }
.icon-button.danger:hover { color: var(--red); background: #f8e6e1; }
.icon-button svg { width: 18px; height: 18px; }

.hero {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(255, 254, 250, 0.16), rgba(255, 254, 250, 0.16)),
    url("/assets/utkan-sketch-banner.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.hero-inner { width: min(1220px, calc(100% - 40px)); min-height: 124px; margin: 0 auto; padding: 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 14px; font-weight: 800; letter-spacing: 0.11em; line-height: 1.25; text-transform: uppercase; }
h1 { max-width: 720px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(37px, 5vw, 64px); font-weight: 500; line-height: 0.98; letter-spacing: -0.055em; }
.quote-block { max-width: 820px; }
.daily-quote { margin: 0; color: var(--ink-soft); font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.5; letter-spacing: 0.01em; }
.new-task-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; flex: none; min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--ink); color: #fffefa; box-shadow: 0 5px 0 #0e100e; font-size: 14px; font-weight: 800; transition: transform 140ms ease, box-shadow 140ms ease; }
.new-task-button:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #0e100e; }
.new-task-button:active { transform: translateY(2px); box-shadow: 0 3px 0 #0e100e; }
.new-task-button svg { width: 18px; height: 18px; }

.dashboard { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 54px; }
.overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.metric { min-height: 93px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,250,0.68); }
.metric span { display: block; color: var(--muted); font-size: 12px; font-weight: 650; }
.metric strong { display: block; margin-top: 8px; font-family: Georgia, "Times New Roman", serif; font-size: 29px; line-height: 1; letter-spacing: -0.05em; }
.metric:nth-child(2) { background: #edf4d3; border-color: #d9e4ab; }
.metric:nth-child(3) { background: var(--orange-soft); border-color: #f2d7ca; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.task-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 1px 0 rgba(36, 41, 35, 0.025); }
.task-panel.shared { background: #fdfdf8; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 21px 22px 18px; border-bottom: 1px solid var(--line); }
.panel-heading { display: flex; align-items: flex-start; gap: 11px; }
.panel-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 12px; background: var(--lime); color: #39421d; }
.shared .panel-icon { background: var(--teal-soft); color: var(--teal); }
.panel-icon svg { width: 20px; height: 20px; }
.panel-title { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.025em; }
.panel-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.task-count { display: inline-flex; align-items: center; justify-content: center; min-width: 27px; height: 27px; border-radius: 50%; background: #f0efe9; color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.shared .task-count { background: #e5f1ee; color: var(--teal); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 16px 17px; border-bottom: 1px solid #eceae4; transition: background 160ms ease; }
.task:last-child { border-bottom: 0; }
.task:hover { background: #fbfaf5; }
.task.task-done { background: #f9f9f5; }
.task.task-done .task-title { color: #899087; text-decoration: line-through; text-decoration-thickness: 1px; }
.check { width: 22px; height: 22px; display: grid; place-items: center; flex: none; margin-top: 2px; padding: 0; border: 1.5px solid #abb1a8; border-radius: 50%; background: transparent; color: transparent; transition: 150ms ease; }
.check:hover:not(:disabled) { border-color: var(--teal); background: #eef8f5; }
.check.completed { border-color: var(--teal); background: var(--teal); color: white; }
.check:disabled { opacity: 0.52; }
.check svg { width: 14px; height: 14px; }
.task-main { min-width: 0; }
.task-title { margin: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 750; line-height: 1.4; letter-spacing: -0.01em; }
.task-note { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 7px; margin-top: 9px; }
.due { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.due svg { width: 13px; height: 13px; }
.due.overdue { color: var(--red); }
.due.today { color: var(--orange); }
.due.unknown { color: var(--teal); }
.assignee { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px 3px 4px; border: 1px solid #d9e7e2; border-radius: 999px; background: #f1f8f6; color: #357368; font-size: 10px; font-weight: 750; }
.assignee .mini-avatar { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; background: #cbe8df; color: #22665c; font-size: 8px; }
.permission-hint { flex-basis: 100%; color: var(--muted); font-size: 10px; }
.task-actions { display: flex; align-items: flex-start; min-width: 30px; }
.task-actions .icon-button { width: 29px; height: 29px; opacity: 0; }
.task:hover .task-actions .icon-button, .task-actions .icon-button:focus-visible { opacity: 1; }
.completed-block { border-top: 1px dashed var(--line); }
.completed-block summary { padding: 13px 18px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
.completed-block[open] summary { border-bottom: 1px solid var(--line); }
.empty { display: grid; min-height: 250px; place-content: center; padding: 30px; text-align: center; }
.empty-illustration { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 17px; background: #f0efe9; color: #9ca39a; }
.shared .empty-illustration { background: var(--teal-soft); color: #71a69c; }
.empty-illustration svg { width: 24px; height: 24px; }
.empty strong { display: block; font-size: 13px; }
.empty p { max-width: 230px; margin: 5px auto 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.empty button { margin: 14px auto 0; }
.text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: var(--teal); font-size: 12px; font-weight: 800; }
.text-button:hover { background: #eaf4f1; }

.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(33, 38, 32, 0.46); backdrop-filter: blur(4px); }
.modal { width: min(600px, 100%); max-height: min(780px, calc(100vh - 44px)); overflow: auto; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 19px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 2px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; letter-spacing: -0.045em; }
.modal-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.task-form { padding: 23px 26px 27px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: block; margin: 0 0 17px; }
.field > span { display: block; margin: 0 0 7px; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.field .optional { color: var(--muted); font-weight: 500; }
.input, .select, .textarea { width: 100%; border: 1px solid #d9d8d0; border-radius: 11px; background: #fffefa; color: var(--ink); font-size: 14px; transition: border 140ms ease, box-shadow 140ms ease; }
.input, .select { height: 43px; padding: 0 12px; }
.textarea { min-height: 84px; padding: 11px 12px; resize: vertical; line-height: 1.45; }
.input:hover, .select:hover, .textarea:hover { border-color: #b7bbb2; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(34, 122, 112, 0.12); outline: 0; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 12px; background: #f0efe9; }
.segment { min-height: 35px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.segment.selected { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(24, 30, 21, 0.1); }
.date-help { margin: -8px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-error { display: none; margin: 0 0 15px; padding: 10px 12px; border-radius: 10px; background: #fff0eb; color: #a44635; font-size: 12px; line-height: 1.4; }
.form-error.visible { display: block; }
.form-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 3px; padding-top: 18px; border-top: 1px solid var(--line); }
.secondary-button { min-height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.secondary-button:hover { background: #f0efe9; }
.primary-button { min-height: 42px; padding: 0 16px; border: 0; border-radius: 11px; background: var(--teal); color: white; font-size: 13px; font-weight: 800; }
.primary-button:hover { background: #17645b; }
.primary-button:disabled { opacity: 0.65; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(390px, 0.9fr); background: var(--cream); }
.login-art { position: relative; overflow: hidden; padding: 50px clamp(34px, 7vw, 100px); background: var(--ink); color: #fffefa; }
.login-art::before, .login-art::after { position: absolute; content: ""; border-radius: 50%; }
.login-art::before { width: 530px; height: 530px; top: -190px; right: -110px; border: 1px solid rgba(220, 232, 168, 0.3); box-shadow: 0 0 0 52px rgba(220, 232, 168, 0.07), 0 0 0 104px rgba(220, 232, 168, 0.05); }
.login-art::after { width: 240px; height: 240px; bottom: -90px; left: 10%; background: var(--orange); opacity: 0.9; }
.login-art .brand { position: relative; z-index: 1; color: #fffefa; }
.login-art .brand-mark { background: var(--lime); color: var(--ink); }
.login-art .brand-copy span { color: #b8c0b2; }
.login-message { position: relative; z-index: 1; max-width: 550px; margin-top: clamp(150px, 29vh, 310px); }
.login-message .eyebrow { color: var(--lime); }
.login-message h1 { font-size: clamp(45px, 5.5vw, 76px); }
.login-message h1 em { color: var(--lime); }
.login-message p { max-width: 405px; margin: 20px 0 0; color: #cbd1c6; font-size: 16px; line-height: 1.6; }
.login-card-area { display: grid; place-items: center; padding: 30px; }
.login-card { width: min(400px, 100%); }
.login-card .brand { display: none; margin-bottom: 50px; }
.login-card h2 { margin: 7px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 37px; font-weight: 500; letter-spacing: -0.05em; }
.login-card .intro { margin: 0 0 30px; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.login-note { display: flex; gap: 9px; margin-top: 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.login-note svg { width: 16px; height: 16px; flex: none; color: var(--teal); }
.code-wrap { display: none; }
.code-wrap.active { display: block; }
.email-wrap.hidden { display: none; }
.code-input { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 800; letter-spacing: 0.25em; text-align: center; }
.code-hint { margin: -7px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.inline-link { display: inline; padding: 0; border: 0; background: transparent; color: var(--teal); font-size: inherit; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; width: min(440px, calc(100% - 32px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 15px; border-radius: 12px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 13px; line-height: 1.4; transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: #9e4030; }

@media (max-width: 800px) {
  .topbar, .hero-inner, .dashboard { width: min(100% - 28px, 650px); }
  .topbar { height: 70px; }
  .profile-name { max-width: 90px; }
  .hero-inner { min-height: 0; padding: 22px 0; display: block; }
  h1 { max-width: 590px; font-size: clamp(39px, 10vw, 56px); }
  .eyebrow, .daily-quote { font-size: 13px; }
  .new-task-button { width: 100%; margin-top: 18px; }
  .dashboard { padding-top: 20px; }
  .overview { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(3) { grid-column: 1 / -1; }
  .workspace { grid-template-columns: 1fr; }
  .task-actions .icon-button { opacity: 1; }
  .login-shell { display: block; }
  .login-art { min-height: 264px; padding: 30px 28px; }
  .login-message { margin-top: 55px; }
  .login-message h1 { font-size: 43px; }
  .login-message p { display: none; }
  .login-card-area { min-height: calc(100vh - 264px); padding: 42px 28px; }
}

@media (max-width: 500px) {
  .topbar, .hero-inner, .dashboard { width: min(100% - 24px, 650px); }
  .brand-copy span { display: none; }
  .profile { border: 0; background: transparent; padding: 0; }
  .profile-name { display: none; }
  .overview { gap: 8px; }
  .metric { min-height: 79px; padding: 14px; }
  .metric strong { margin-top: 6px; font-size: 26px; }
  .panel-header { padding: 18px 16px 15px; }
  .task { padding: 15px 13px; gap: 10px; }
  .task-actions { min-width: 25px; }
  .task-actions .icon-button { width: 25px; height: 25px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { max-height: calc(100vh - 16px); border-radius: 21px 21px 0 0; }
  .modal-header, .task-form { padding-left: 18px; padding-right: 18px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-footer { position: sticky; bottom: -27px; margin: 0 -18px -27px; padding: 13px 18px; background: var(--paper); }
  .form-footer button { flex: 1; }
  .segmented { gap: 3px; }
  .segment { font-size: 11px; }
}
