/* ============================================================
   cal.kobatech.dev — kitchen dashboard styles
   ============================================================ */

:root {
  --bg:            #f5f1ea;
  --bg-grad-a:     #f7f3ec;
  --bg-grad-b:     #efe7db;
  --surface:       #fffdf9;
  --surface-2:     #f4efe6;
  --border:        #e6ddcf;
  --text:          #2c2924;
  --text-soft:     #6f675b;
  --text-faint:    #a89d8c;
  --accent:        #c9603f;
  --accent-soft:   #f5e4dc;
  --accent-ink:    #8f3d24;
  --good:          #4c8a5b;
  --shadow:        0 10px 30px rgba(60, 47, 30, 0.10), 0 2px 8px rgba(60, 47, 30, 0.05);
  --radius:        22px;
  --radius-sm:     14px;
  --font: "Fraunces", ui-serif, Georgia, serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #17140f;
    --bg-grad-a:   #1b1712;
    --bg-grad-b:   #120f0b;
    --surface:     #221d16;
    --surface-2:   #2b241b;
    --border:      #38301f;
    --text:        #f2ebdd;
    --text-soft:   #b6ab97;
    --text-faint:  #7d7462;
    --accent:      #e08363;
    --accent-soft: #3a271f;
    --accent-ink:  #f0a98f;
    --good:        #74b487;
    --shadow:      0 12px 34px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.3);
  }
}
:root[data-theme="dark"] {
  --bg:          #17140f;
  --bg-grad-a:   #1b1712;
  --bg-grad-b:   #120f0b;
  --surface:     #221d16;
  --surface-2:   #2b241b;
  --border:      #38301f;
  --text:        #f2ebdd;
  --text-soft:   #b6ab97;
  --text-faint:  #7d7462;
  --accent:      #e08363;
  --accent-soft: #3a271f;
  --accent-ink:  #f0a98f;
  --good:        #74b487;
  --shadow:      0 12px 34px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 12% -10%, var(--bg-grad-a), transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, var(--bg-grad-b), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

.signin {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.signin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px 40px 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}
.signin-card .mark {
  width: 62px; height: 62px; margin: 0 auto 18px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  border-radius: 18px;
  color: var(--accent-ink);
}
.signin-card h1 {
  font-family: var(--font);
  font-weight: 600;
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.signin-card p {
  color: var(--text-soft);
  margin: 0 0 26px;
  font-size: 15px;
  line-height: 1.5;
}
.gbtn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.gbtn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.gbtn:active { transform: translateY(0); }
.gbtn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.signin .note {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.signin .error {
  margin-top: 18px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.45;
}

.app { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 22px clamp(18px, 4vw, 40px) 10px;
}
.brand { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.clock {
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.clock .ampm { font-size: 0.42em; color: var(--text-faint); margin-left: 6px; font-family: var(--font-ui); font-weight: 600; }
.datestack { display: flex; flex-direction: column; }
.greeting { font-size: clamp(15px, 2vw, 18px); color: var(--accent-ink); font-weight: 600; }
.today { font-size: clamp(13px, 1.6vw, 15px); color: var(--text-soft); }

.topbar .spacer { flex: 1; }
.iconbtn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
.iconbtn:hover { color: var(--text); transform: translateY(-1px); }
.user {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 6px 5px 14px;
}
.user .name { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.user img { width: 34px; height: 34px; border-radius: 50%; display: block; }
.user .avatar-fallback {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 700; font-size: 14px;
}

.grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 4fr) 6fr;
  gap: clamp(16px, 2.4vw, 26px);
  padding: 12px clamp(18px, 4vw, 40px) clamp(18px, 4vw, 34px);
  min-height: 0;
}
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px 14px;
}
.card-head h2 {
  font-family: var(--font);
  font-weight: 600;
  font-size: 21px;
  margin: 0;
  letter-spacing: -0.01em;
}
.card-head .count {
  margin-left: auto;
  font-size: 13px; font-weight: 600;
  color: var(--text-faint);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px 11px;
}

.todo-card { min-height: 360px; }
.add-row {
  display: flex; gap: 10px;
  padding: 4px 18px 16px;
}
.add-row input {
  flex: 1;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 13px 18px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.add-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.add-row button {
  flex: 0 0 auto;
  width: 48px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.add-row button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.add-row button:active { transform: translateY(0); }

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0 12px 14px;
  overflow-y: auto;
  flex: 1;
}
.todo-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 12px;
  border-radius: var(--radius-sm);
  transition: background .12s ease;
}
.todo-item:hover { background: var(--surface-2); }
.todo-item:hover .del { opacity: 1; }

.check {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--text-faint);
  background: transparent;
  cursor: pointer;
  display: grid; place-items: center;
  color: #fff;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}
.check:hover { border-color: var(--accent); }
.check.done { background: var(--good); border-color: var(--good); }
.check svg { width: 15px; height: 15px; opacity: 0; transform: scale(.6); transition: opacity .12s ease, transform .12s ease; }
.check.done svg { opacity: 1; transform: scale(1); }

.todo-text {
  flex: 1;
  font-size: 16.5px;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}
.todo-item.completed .todo-text {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
}
.del {
  flex: 0 0 auto;
  border: none; background: none; cursor: pointer;
  color: var(--text-faint);
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease, background .12s ease;
}
.del:hover { color: var(--accent-ink); background: var(--accent-soft); }

.empty {
  text-align: center;
  color: var(--text-faint);
  padding: 40px 20px;
  font-size: 15px;
  line-height: 1.6;
}
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; }
.list-sep {
  padding: 14px 14px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.cal-card { min-height: 420px; }
.cal-head .views { margin-left: auto; display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.cal-head .views button {
  border: none; background: none; cursor: pointer;
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  color: var(--text-soft);
  padding: 7px 14px; border-radius: 999px;
  transition: background .12s ease, color .12s ease;
}
.cal-head .views button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.cal-wrap { flex: 1; position: relative; min-height: 0; }
.cal-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.hidden { display: none !important; }
.spin {
  width: 20px; height: 20px;
  border: 2.5px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  min-height: 100dvh; display: grid; place-items: center;
}
