/* =========================================================
   Manava Calendar - gaya utama
   Token warna, tata letak, kalender, chat AI, animasi "bernafas".
   ========================================================= */
:root {
  --primary: #0f766e;
  --primary-600: #0d9488;
  --primary-100: #ccfbf1;
  --primary-50: #f0fdfa;
  --accent: #2563eb;
  --danger: #e11d48;
  --danger-bg: #fff1f2;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --bg: #f4f6f9;
  --bg-2: #eef1f5;
  --card: #ffffff;
  --card-2: #f8fafc;
  --border: #e6eaf0;
  --border-2: #d9dfe7;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --sidebar-bg: linear-gradient(180deg, #0c2a33 0%, #0b1f2a 100%);
  --sidebar-text: #b6c2cf;
  --sidebar-w: 284px;
  --topbar-h: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -14px rgba(15, 23, 42, .16);
  --shadow-lg: 0 20px 60px -20px rgba(15, 23, 42, .35), 0 2px 8px rgba(15, 23, 42, .06);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --hour-h: 56px;
  --now: #ef4444;
  --bottomnav-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1218; --bg-2: #0f1720; --card: #111a23; --card-2: #16212c; --border: #1f2b37; --border-2: #2a3846;
    --text: #e6edf3; --text-2: #c9d4de; --muted: #8b9bab; --muted-2: #66788a;
    --primary-100: #134e4a; --primary-50: #0f2f2c; --danger-bg: #3a1220; --warn-bg: #33250a; --ok-bg: #0d2c22;
    --sidebar-bg: linear-gradient(180deg, #0a1a21 0%, #07141b 100%);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 70px -20px rgba(0,0,0,.8), 0 2px 8px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1218; --bg-2: #0f1720; --card: #111a23; --card-2: #16212c; --border: #1f2b37; --border-2: #2a3846;
  --text: #e6edf3; --text-2: #c9d4de; --muted: #8b9bab; --muted-2: #66788a;
  --primary-100: #134e4a; --primary-50: #0f2f2c; --danger-bg: #3a1220; --warn-bg: #33250a; --ok-bg: #0d2c22;
  --sidebar-bg: linear-gradient(180deg, #0a1a21 0%, #07141b 100%);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 70px -20px rgba(0,0,0,.8), 0 2px 8px rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
kbd { font-family: inherit; font-size: .7rem; padding: 1px 6px; border-radius: 6px; background: rgba(148,163,184,.18); border: 1px solid rgba(148,163,184,.35); color: var(--muted); }
.muted { color: var(--muted); }
.grow { flex: 1; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
[hidden] { display: none !important; }

/* ---------- Tombol & input ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-sm); font-weight: 600; padding: .55rem 1rem; border: 1px solid transparent; transition: transform .12s var(--ease-out), background .15s, box-shadow .2s, color .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px -10px rgba(15,118,110,.7); }
.btn-primary:hover { background: #115e59; color: #fff; }
.btn-soft { background: var(--card-2); border-color: var(--border); color: var(--text-2); }
.btn-soft:hover { background: var(--bg-2); color: var(--text); }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); }
.btn-danger-soft:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-google { background: var(--card); border-color: var(--border-2); color: var(--text); width: 100%; padding: .7rem 1rem; }
.btn-google:hover { background: var(--card-2); color: var(--text); }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; font-size: 1.1rem; transition: background .15s, transform .12s, color .15s; position: relative; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.link-btn { background: none; border: 0; color: var(--primary); font-weight: 600; font-size: .85rem; padding: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], input[type="time"], select, textarea, .select-soft {
  width: 100%; border: 1px solid var(--border-2); background: var(--card); border-radius: var(--radius-sm); padding: .55rem .8rem; outline: 0; transition: border-color .15s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-600); box-shadow: 0 0 0 4px rgba(13,148,136,.15); }
textarea { resize: vertical; min-height: 70px; }
.select-soft { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.field > span { font-weight: 600; color: var(--text-2); font-size: .82rem; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.fgrid { display: grid; gap: 12px; }
.fgrid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .fgrid.two, .fgrid.three { grid-template-columns: 1fr; } }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: var(--border-2); position: relative; transition: background .2s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease-spring); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
.num { width: 64px !important; text-align: center; padding: .4rem .5rem; }

/* ---------- Kerangka ---------- */
.mc-shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.mc-sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-text);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 16px 16px; z-index: 1030; overflow-y: auto; scrollbar-width: thin;
  transition: transform .32s var(--ease-out);
}
.mc-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px 6px 6px; color: #fff; }
.mc-brand .brand-logo { width: 148px; height: auto; }
.brand-product { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; color: #fff; line-height: 1; margin-top: 2px; }
.brand-sub { font-size: .7rem; color: #7f94a5; font-weight: 500; }
.btn-create {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px 10px 10px; border: 0; border-radius: 14px;
  background: linear-gradient(135deg, #14b8a6, #0ea5e9); color: #fff; font-weight: 700; box-shadow: 0 10px 24px -10px rgba(20,184,166,.8);
  transition: transform .15s var(--ease-spring), box-shadow .2s;
}
.btn-create:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(20,184,166,.9); }
.btn-create:active { transform: scale(.98); }
.btn-create .plus { width: 30px; height: 30px; border-radius: 10px; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 1rem; }
.btn-create kbd { margin-left: auto; background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.25); color: #fff; }

/* Mini kalender */
.mini-cal { background: rgba(255,255,255,.05); border-radius: 14px; padding: 10px 10px 8px; }
.mini-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.mini-head strong { flex: 1; font-size: .85rem; color: #fff; text-transform: capitalize; }
.mini-head button { background: none; border: 0; color: #9fb1c1; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.mini-head button:hover { background: rgba(255,255,255,.08); color: #fff; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-grid .dn { font-size: .62rem; text-align: center; color: #6b8090; font-weight: 700; padding: 2px 0 4px; }
.mini-grid button { border: 0; background: none; color: #c9d4de; font-size: .74rem; height: 26px; border-radius: 8px; transition: background .12s, transform .12s; }
.mini-grid button:hover { background: rgba(255,255,255,.1); }
.mini-grid button.out { color: #4b5d6c; }
.mini-grid button.today { color: #5eead4; font-weight: 800; }
.mini-grid button.sel { background: #14b8a6; color: #fff; font-weight: 700; }
.mini-grid button.has::after { content: ""; display: block; width: 3px; height: 3px; border-radius: 50%; background: #5eead4; margin: -3px auto 0; }

/* Daftar kalender */
.cal-lists { display: flex; flex-direction: column; gap: 6px; }
.cal-group-head { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: #8ea1b1; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 8px 6px 4px; }
.cal-group-head i { transition: transform .25s var(--ease-out); font-size: .7rem; }
.cal-group.collapsed .cal-group-head i { transform: rotate(-90deg); }
.cal-group.collapsed .cal-list, .cal-group.collapsed .google-connect { display: none; }
.cal-group-head .icon-btn { width: 24px; height: 24px; border-radius: 8px; color: #9fb1c1; font-size: .95rem; }
.cal-group-head .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.cal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cal-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: .86rem; color: #c9d4de; cursor: pointer; transition: background .12s; }
.cal-item:hover { background: rgba(255,255,255,.06); }
.cal-item .box { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--c); display: grid; place-items: center; flex-shrink: 0; transition: background .15s, transform .15s var(--ease-spring); }
.cal-item.on .box { background: var(--c); }
.cal-item.on .box::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.cal-item:active .box { transform: scale(.85); }
.cal-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item .tag { font-size: .62rem; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.1); color: #9fb1c1; }
.cal-item .edit { opacity: 0; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: #9fb1c1; }
.cal-item:hover .edit { opacity: 1; }
.cal-item .edit:hover { background: rgba(255,255,255,.12); color: #fff; }
.cal-item.off { opacity: .7; }
.cal-empty { font-size: .78rem; color: #6b8090; padding: 6px 8px; }
.google-connect { display: flex; align-items: center; gap: 10px; margin: 6px 4px 2px; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,.06); color: #dbe7f0; font-size: .82rem; font-weight: 600; border: 1px dashed rgba(255,255,255,.18); transition: background .15s; }
.google-connect:hover { background: rgba(255,255,255,.1); color: #fff; }
.google-connect .g { width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 800; display: grid; place-items: center; font-size: .85rem; }
.google-connect .bi { margin-left: auto; }

.mc-nav { list-style: none; margin: auto 0 0; padding: 8px 0 0; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid rgba(255,255,255,.07); }
.mc-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: #b6c2cf; font-weight: 500; transition: background .15s, color .15s; }
.mc-nav a i { font-size: 1.05rem; width: 22px; text-align: center; }
.mc-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.mc-nav a.active { background: rgba(20,184,166,.18); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.mc-sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 6px 8px 0; font-size: .72rem; color: #64748b; }
.mc-env { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.06); font-weight: 600; }
.mc-env i { font-size: .45rem; }
.mc-env.live { color: #fda4af; }
.mc-env.local { color: #6ee7b7; }
.mc-backdrop { display: none; position: fixed; inset: 0; background: rgba(2,6,23,.45); z-index: 1029; opacity: 0; transition: opacity .25s; }

.mc-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mc-topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 10px; padding: 0 22px; border-bottom: 1px solid transparent;
}
.mc-topbar.scrolled { border-bottom-color: var(--border); }
.page-title { font-size: 1.15rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.cal-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 0 4px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
.btn-today { padding: .4rem .8rem; font-size: .85rem; }
.btn-today i { display: none; }
.nav-arrows { display: flex; }
.burger { display: none; }
.spacer { flex: 1; }

.view-switch { position: relative; display: flex; background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.view-switch button { position: relative; z-index: 1; border: 0; background: none; padding: 6px 12px; border-radius: 9px; font-weight: 600; font-size: .82rem; color: var(--muted); transition: color .2s; }
.view-switch button.active { color: var(--text); }
.view-switch .ind { position: absolute; top: 3px; bottom: 3px; left: 3px; width: 60px; border-radius: 9px; background: var(--card); box-shadow: 0 2px 8px rgba(15,23,42,.12); transition: transform .35s var(--ease-spring), width .35s var(--ease-spring); }

.search-wrap { position: relative; display: flex; align-items: center; gap: 8px; background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; padding: 0 10px; height: 38px; width: 240px; transition: width .3s var(--ease-out), box-shadow .2s, border-color .2s; }
.search-wrap:focus-within { width: 320px; border-color: var(--primary-600); box-shadow: 0 0 0 4px rgba(13,148,136,.12); }
.search-wrap i { color: var(--muted); }
.search-wrap input { border: 0; background: none; padding: 0; box-shadow: none !important; flex: 1; min-width: 0; }
.search-wrap kbd { flex-shrink: 0; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 20; animation: pop .2s var(--ease-out); max-height: 60vh; overflow-y: auto; }
.search-results .sr { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.search-results .sr:last-child { border-bottom: 0; }
.search-results .sr:hover { background: var(--card-2); }
.search-results .sr .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex-shrink: 0; }
.search-results .sr .t { font-weight: 600; font-size: .88rem; }
.search-results .sr small { display: block; color: var(--muted); font-size: .75rem; }
.search-results .sr-empty { padding: 14px; color: var(--muted); font-size: .85rem; text-align: center; }

.sync-btn .sync-dot { position: absolute; right: 7px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); opacity: 0; transition: opacity .3s; }
.sync-btn.syncing .sync-dot { opacity: 1; animation: breathe 1.4s ease-in-out infinite; }
.sync-btn.syncing i { animation: spin 1.2s linear infinite; }
.sync-btn.error .sync-dot { opacity: 1; background: var(--danger); }
.sync-btn.pending .sync-dot { opacity: 1; background: var(--warn); }

.notif-wrap, .user-wrap { position: relative; }
.notif-dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 800; display: grid; place-items: center; animation: pop .3s var(--ease-spring); }
.notif-dot.hidden { display: none; }
.notif-panel, .user-menu { position: absolute; top: calc(100% + 8px); right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 30; animation: pop .22s var(--ease-out); transform-origin: top right; }
.notif-panel { width: 360px; max-width: calc(100vw - 32px); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--card-2); }
.notif-item.unread { background: color-mix(in srgb, var(--primary-50) 60%, var(--card)); }
.notif-item .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-100); color: var(--primary); flex-shrink: 0; }
.notif-item.kind-ai .ico { background: #ede9fe; color: #7c3aed; }
.notif-item.kind-sync .ico { background: #dbeafe; color: #2563eb; }
.notif-item .t { font-weight: 600; font-size: .86rem; line-height: 1.3; }
.notif-item .b { font-size: .78rem; color: var(--muted); }
.notif-item .ago { font-size: .7rem; color: var(--muted-2); margin-left: auto; white-space: nowrap; }
.notif-empty { padding: 26px; text-align: center; color: var(--muted); font-size: .85rem; }
.user-btn { border: 0; background: none; padding: 0; border-radius: 50%; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--primary-100); color: var(--primary); display: grid; place-items: center; font-weight: 700; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--border); }
.user-menu { width: 230px; padding: 6px; }
.user-menu-head { padding: 10px 12px; display: flex; flex-direction: column; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-menu-head small { color: var(--muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; }
.user-menu a, .user-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: none; color: var(--text-2); font-size: .88rem; font-weight: 500; text-align: left; }
.user-menu a:hover, .user-menu button:hover { background: var(--card-2); color: var(--text); }

.mc-content { padding: 12px 22px 40px; flex: 1; display: flex; flex-direction: column; }
.flash-wrap { display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; font-size: .88rem; font-weight: 500; margin-bottom: 10px; animation: slideDown .3s var(--ease-out); border: 1px solid transparent; }
.flash .close { margin-left: auto; border: 0; background: none; font-size: 1.1rem; line-height: 1; color: inherit; opacity: .6; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-danger { background: var(--danger-bg); color: var(--danger); }
.flash-warning { background: var(--warn-bg); color: var(--warn); }
.flash-info { background: var(--primary-50); color: var(--primary); }

/* ---------- Kalender: panggung ---------- */
.calendar-root { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cal-stage { flex: none; min-height: 0; display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 52px); height: calc(100dvh - var(--topbar-h) - 52px); }
.cal-stage.anim-left > * { animation: slideL .38s var(--ease-out) both; }
.cal-stage.anim-right > * { animation: slideR .38s var(--ease-out) both; }
.cal-stage.anim-fade > * { animation: fadeUp .35s var(--ease-out) both; }
.cal-skeleton { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 34px; pointer-events: none; opacity: 1; transition: opacity .3s; }
.cal-skeleton.hide { opacity: 0; }
.sk-row { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.sk-cell { border-radius: 12px; background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

/* Bulan */
.month-grid { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.month-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--card-2); }
.month-head div { padding: 8px 10px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; }
.month-head div.wknd { color: var(--danger); opacity: .8; }
.month-body { flex: 1; min-height: 0; display: grid; grid-template-rows: repeat(var(--rows, 6), minmax(0, 1fr)); }
.month-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); min-height: 0; }
.month-row:last-child { border-bottom: 0; }
.month-cell { position: relative; border-right: 1px solid var(--border); padding: 6px 6px 4px; display: flex; flex-direction: column; gap: 3px; min-height: 0; overflow: hidden; cursor: pointer; transition: background .15s; }
.month-cell:last-child { border-right: 0; }
.month-cell:hover { background: color-mix(in srgb, var(--card-2) 70%, var(--card)); }
.month-cell.out { background: color-mix(in srgb, var(--bg) 55%, var(--card)); }
.month-cell.out .num { color: var(--muted-2); }
.month-cell.drop { background: var(--primary-50); box-shadow: inset 0 0 0 2px var(--primary-600); }
.month-cell .num { font-size: .8rem; font-weight: 700; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); align-self: flex-start; flex-shrink: 0; transition: transform .15s var(--ease-spring); }
.month-cell .num.first { width: auto; padding: 0 8px; border-radius: 13px; }
.month-cell:hover .num { transform: scale(1.08); }
.month-cell.today .num { background: var(--primary); color: #fff; box-shadow: 0 0 0 0 rgba(15,118,110,.45); animation: ring 3.2s ease-in-out infinite; }
.month-cell .evs { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: hidden; }
.more-link { font-size: .72rem; color: var(--primary); font-weight: 700; padding: 1px 6px; border-radius: 6px; align-self: flex-start; }
.more-link:hover { background: var(--primary-50); }

.ev-chip { --c: var(--primary); display: flex; align-items: center; gap: 5px; padding: 2px 6px; border-radius: 7px; font-size: .74rem; font-weight: 600; line-height: 1.35; color: var(--text); background: color-mix(in srgb, var(--c) 14%, var(--card)); border-left: 3px solid var(--c); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; user-select: none; -webkit-user-select: none; transition: transform .15s var(--ease-spring), box-shadow .2s, background .15s; animation: pop .35s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 14ms); }
.ev-chip:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 22%, var(--card)); }
.ev-chip .t { overflow: hidden; text-overflow: ellipsis; }
.ev-chip .tm { color: var(--muted); font-weight: 600; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ev-chip.allday { background: var(--c); color: #fff; border-left-color: transparent; }
.ev-chip.allday .tm { color: rgba(255,255,255,.85); }
.ev-chip.cont { border-radius: 0 7px 7px 0; border-left-color: transparent; opacity: .85; }
.ev-chip.google::after, .ev-block.google .g { content: ""; }
.ev-chip.tent, .ev-block.tent { opacity: .7; border-left-style: dashed; }
.ev-chip.dragging { opacity: .35; }
.ev-chip.readonly { cursor: default; }
.ev-chip .rep { font-size: .68rem; opacity: .7; flex-shrink: 0; }
.ev-chip.hit { animation: hit .8s var(--ease-spring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent); }

/* Minggu & hari */
.time-grid { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tg-head { display: grid; grid-template-columns: 58px repeat(var(--cols, 7), minmax(0, 1fr)); border-bottom: 1px solid var(--border); background: var(--card-2); }
.tg-head .corner { border-right: 1px solid var(--border); }
.tg-day { text-align: center; padding: 8px 4px 6px; border-right: 1px solid var(--border); cursor: pointer; }
.tg-day:last-child { border-right: 0; }
.tg-day .dn { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tg-day .num { font-size: 1.25rem; font-weight: 800; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; margin: 2px auto 0; color: var(--text); transition: background .15s; }
.tg-day:hover .num { background: var(--bg-2); }
.tg-day.today .dn { color: var(--primary); }
.tg-day.today .num { background: var(--primary); color: #fff; animation: ring 3.2s ease-in-out infinite; }
.tg-day.wknd .dn { color: var(--danger); opacity: .8; }
.allday-row { display: grid; grid-template-columns: 58px repeat(var(--cols, 7), minmax(0, 1fr)); border-bottom: 1px solid var(--border); min-height: 30px; max-height: 96px; overflow-y: auto; }
.allday-row .lbl { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding: 8px 6px; border-right: 1px solid var(--border); text-align: right; }
.allday-cell { border-right: 1px solid var(--border); padding: 3px 3px; display: flex; flex-direction: column; gap: 2px; }
.allday-cell:last-child { border-right: 0; }
.tg-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; scroll-behavior: smooth; }
.tg-inner { display: grid; grid-template-columns: 58px repeat(var(--cols, 7), minmax(0, 1fr)); position: relative; height: calc(var(--hour-h) * 24); }
.tg-gutter { border-right: 1px solid var(--border); position: relative; }
.tg-gutter .hr { position: absolute; right: 8px; transform: translateY(-50%); font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.day-col { position: relative; border-right: 1px solid var(--border); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-h) - 1px), var(--border) calc(var(--hour-h) - 1px), var(--border) var(--hour-h)); }
.day-col:last-child { border-right: 0; }
.day-col.today { background-color: color-mix(in srgb, var(--primary-50) 45%, transparent); }
.day-col .work { position: absolute; left: 0; right: 0; background: color-mix(in srgb, var(--card) 40%, transparent); pointer-events: none; }
.day-col.drop { background-color: var(--primary-50); }
.slot-ghost { position: absolute; left: 4px; right: 4px; border-radius: 8px; background: color-mix(in srgb, var(--primary) 18%, transparent); border: 1px dashed var(--primary-600); pointer-events: none; font-size: .7rem; padding: 3px 6px; color: var(--primary); font-weight: 700; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--now); z-index: 5; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); box-shadow: 0 0 0 0 rgba(239,68,68,.5); animation: ring-red 2.4s ease-in-out infinite; }
.ev-block { --c: var(--primary); position: absolute; left: 3px; right: 6px; border-radius: 9px; padding: 4px 7px; font-size: .74rem; line-height: 1.3; overflow: hidden; color: #fff; background: var(--c); box-shadow: 0 2px 6px -2px color-mix(in srgb, var(--c) 60%, transparent); cursor: pointer; user-select: none; -webkit-user-select: none; transition: transform .15s var(--ease-spring), box-shadow .2s, opacity .2s; animation: pop .32s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 12ms); z-index: 2; }
.ev-block:hover { transform: scale(1.015); box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--c) 90%, #000), 0 0 0 1px rgba(255,255,255,.3) inset; z-index: 4; }
.ev-block .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-block .tm { opacity: .85; font-size: .68rem; font-variant-numeric: tabular-nums; }
.ev-block .loc { opacity: .8; font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-block.short { padding: 2px 7px; display: flex; gap: 6px; align-items: center; }
.ev-block.short .tm { display: none; }
.ev-block .resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.ev-block .resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.55); transform: translateX(-50%); opacity: 0; transition: opacity .15s; }
.ev-block:hover .resize::after { opacity: 1; }
.ev-block.dragging { opacity: .9; z-index: 20; box-shadow: 0 18px 40px -12px rgba(0,0,0,.45); transform: scale(1.03); transition: none; cursor: grabbing; }
.ev-block.readonly { cursor: default; }
.ev-block.hit { animation: hit .8s var(--ease-spring); }

/* Agenda (dalam kalender & halaman) */
.agenda-page, .agenda-list { display: flex; flex-direction: column; gap: 16px; }
.agenda-list { overflow-y: auto; flex: 1; min-height: 0; padding: 2px; }
.agenda-day { display: grid; grid-template-columns: 74px 1fr; gap: 12px; animation: fadeUp .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
.agenda-date { display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.agenda-date .dow { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.agenda-date .num { font-size: 1.6rem; font-weight: 800; line-height: 1.1; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.agenda-date .mon { font-size: .68rem; color: var(--muted); text-align: center; }
.agenda-date.is-today .num { background: var(--primary); color: #fff; animation: ring 3.2s ease-in-out infinite; }
.agenda-items { display: flex; flex-direction: column; gap: 8px; }
.agenda-item { --c: var(--primary); display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--card); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); transition: transform .18s var(--ease-spring), box-shadow .2s, border-color .2s; position: relative; overflow: hidden; }
.agenda-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.agenda-item .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); flex-shrink: 0; }
.agenda-item .time { width: 96px; font-size: .78rem; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.agenda-item .body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.agenda-item .ttl { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-item .sub { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-mark { width: 20px; height: 20px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--border); color: #4285f4; font-size: .68rem; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.agenda-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 22px 24px; border-radius: 20px; background: linear-gradient(135deg, #0f766e 0%, #0e7490 60%, #1d4ed8 140%); color: #fff; box-shadow: var(--shadow-lg); }
.agenda-hero h2 { margin: 4px 0 6px; font-size: 1.35rem; letter-spacing: -.01em; }
.agenda-hero p { margin: 0; opacity: .85; font-size: .9rem; }
.agenda-hero .eyebrow { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.agenda-hero > div:not(.blob) { position: relative; z-index: 1; }
.hero-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.agenda-hero .btn-primary { background: #fff; color: var(--primary); box-shadow: none; }
.agenda-hero .btn-soft { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.25); color: #fff; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-art { width: 84px; height: 84px; border-radius: 28px; margin: 0 auto 14px; display: grid; place-items: center; font-size: 2.2rem; color: var(--primary); background: var(--primary-50); animation: breathe 4s ease-in-out infinite; }
.empty-state h3 { margin: 0 0 6px; color: var(--text); }
.empty-state p { margin: 0; font-size: .9rem; }

/* Blob "bernafas" */
.blob { position: absolute; border-radius: 50%; filter: blur(30px); opacity: .55; pointer-events: none; animation: drift 16s ease-in-out infinite alternate; }
.blob.b1 { width: 260px; height: 260px; background: #34d399; top: -90px; right: -40px; }
.blob.b2 { width: 220px; height: 220px; background: #60a5fa; bottom: -100px; left: 20%; animation-delay: -6s; animation-duration: 20s; }
.blob.b3 { width: 180px; height: 180px; background: #f472b6; top: 40%; left: -60px; animation-delay: -11s; }

/* ---------- Pop-up detail acara ---------- */
.event-pop { position: fixed; z-index: 1050; width: 340px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .22s var(--ease-spring); transform-origin: var(--ox, 50%) var(--oy, 0); }
.event-pop .ph { --c: var(--primary); padding: 14px 14px 12px 16px; background: color-mix(in srgb, var(--c) 12%, var(--card)); border-left: 5px solid var(--c); display: flex; gap: 8px; align-items: flex-start; }
.event-pop .ph h3 { margin: 0; font-size: 1rem; line-height: 1.3; flex: 1; }
.event-pop .ph .icon-btn { width: 30px; height: 30px; }
.event-pop .pb { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; font-size: .86rem; }
.event-pop .pb div { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.event-pop .pb i { color: var(--muted); width: 18px; text-align: center; margin-top: 2px; }
.event-pop .pb .desc { max-height: 96px; overflow: auto; white-space: pre-wrap; }
.event-pop .pf { display: flex; gap: 6px; padding: 8px 12px 12px; border-top: 1px solid var(--border); }
.event-pop .chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--card-2); border: 1px solid var(--border); }
.event-pop .chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.event-pop .sync-warn { font-size: .74rem; color: var(--warn); }
@media (max-width: 640px) { .event-pop { left: 12px !important; right: 12px !important; width: auto; top: auto !important; bottom: calc(var(--bottomnav-h) + 12px); transform-origin: bottom center; } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 1060; display: grid; place-items: center; padding: 16px; background: rgba(2,6,23,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card { width: 560px; max-width: 100%; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); background: var(--card); border-radius: 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; transform: translateY(24px) scale(.96); opacity: 0; transition: transform .35s var(--ease-spring), opacity .25s; }
.modal.open .modal-card { transform: none; opacity: 1; }
.modal-sm .modal-card { width: 420px; }
.modal form { display: flex; flex-direction: column; min-height: 0; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 20px; }
.modal-head .title-input { border: 0; border-bottom: 2px solid var(--border-2); border-radius: 0; font-size: 1.25rem; font-weight: 700; padding: 6px 2px; box-shadow: none !important; }
.modal-head .title-input:focus { border-bottom-color: var(--primary); }
.color-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--primary); flex-shrink: 0; transition: background .2s, transform .2s var(--ease-spring); }
.modal-body { padding: 6px 20px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.frow { display: flex; align-items: flex-start; gap: 12px; }
.frow > i, .frow > .ico { width: 22px; text-align: center; color: var(--muted); font-size: 1.05rem; margin-top: 9px; flex-shrink: 0; }
.frow > input, .frow > textarea, .frow > .fgrid, .frow > .reminders, .frow > .repeat-box { flex: 1; min-width: 0; }
.frow-inline { align-items: center; gap: 14px; flex-wrap: wrap; }
.frow-inline .select-soft { width: auto; }
.tgrid { grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.tgrid .dash { color: var(--muted); }
.tgrid input[type="date"] { min-width: 0; padding-left: .5rem; padding-right: .3rem; }
.tgrid input[type="time"] { width: 86px; padding-left: .5rem; padding-right: .3rem; }
.modal-body { overflow-x: hidden; }
.modal.allday .tgrid input[type="time"] { display: none; }
@media (max-width: 560px) { .tgrid { grid-template-columns: 1fr 1fr; } .tgrid .dash { display: none; } }
.scope-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: .82rem; font-weight: 600; }
.scope-bar label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.repeat-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--border); font-size: .86rem; }
.rc-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-line .select-soft { width: auto; padding: .4rem 2rem .4rem .7rem; }
.rc-days { display: flex; gap: 6px; }
.rc-days label { position: relative; }
.rc-days input { position: absolute; opacity: 0; inset: 0; }
.rc-days span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--card); border: 1px solid var(--border-2); font-size: .74rem; font-weight: 700; color: var(--muted); cursor: pointer; transition: all .15s var(--ease-spring); }
.rc-days input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.06); }
.color-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.color-chips button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; transition: transform .15s var(--ease-spring), box-shadow .15s; padding: 0; }
.color-chips button:hover { transform: scale(1.15); }
.color-chips button.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
.color-chips button.none { background: var(--card); border-color: var(--border-2); position: relative; }
.color-chips button.none::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px; background: var(--muted-2); transform: rotate(-45deg); }
.reminders { display: flex; flex-direction: column; gap: 6px; }
.rem-item { display: flex; align-items: center; gap: 6px; }
.rem-item .select-soft { width: auto; flex: 1; padding: .4rem 2rem .4rem .7rem; }
.rem-item .icon-btn { width: 30px; height: 30px; }
.rem-add { align-self: flex-start; }
.rem-note { font-size: .8rem; color: var(--muted); }
.ev-meta { font-size: .76rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.ev-meta a { font-weight: 600; }

/* ---------- Dialog konfirmasi & toast ---------- */
.mc-dialog { position: fixed; inset: 0; z-index: 1090; display: grid; place-items: center; background: rgba(2,6,23,.45); backdrop-filter: blur(4px); animation: fadeIn .2s; padding: 16px; }
.mc-dialog .card { width: 380px; max-width: 100%; background: var(--card); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-lg); animation: pop .3s var(--ease-spring); }
.mc-dialog h4 { margin: 0 0 6px; font-size: 1.02rem; }
.mc-dialog p { margin: 0 0 16px; color: var(--muted); font-size: .88rem; }
.mc-dialog .opts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.mc-dialog .opts label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; font-size: .88rem; }
.mc-dialog .opts label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.mc-dialog .acts { display: flex; gap: 8px; justify-content: flex-end; }
.toast-wrap { position: fixed; right: 16px; bottom: 90px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: .86rem; font-weight: 500; max-width: 360px; animation: toastIn .4s var(--ease-spring); pointer-events: auto; }
.toast.success i { color: #34d399; }
.toast.danger i { color: #fb7185; }
.toast.info i { color: #7dd3fc; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; margin-left: 6px; opacity: .8; }
@media (max-width: 640px) { .toast-wrap { left: 12px; right: 12px; bottom: calc(var(--bottomnav-h) + 14px); } .toast { max-width: none; } }

/* ---------- Tombol melayang & laci AI ---------- */
.fab-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 1040; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab { width: 56px; height: 56px; border-radius: 18px; border: 0; background: linear-gradient(135deg, #14b8a6, #2563eb); color: #fff; font-size: 1.5rem; display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(37,99,235,.7); transition: transform .3s var(--ease-spring), box-shadow .2s; }
.fab:hover { transform: translateY(-2px) scale(1.04); }
.fab-wrap.open .fab { transform: rotate(45deg); }
.fab-menu { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; opacity: 0; transform: translateY(10px) scale(.95); pointer-events: none; transition: opacity .2s, transform .3s var(--ease-spring); }
.fab-wrap.open .fab-menu { opacity: 1; transform: none; pointer-events: auto; }
.fab-menu button { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); padding: 9px 14px; border-radius: 14px; font-weight: 600; font-size: .86rem; box-shadow: var(--shadow-lg); transition: transform .15s var(--ease-spring); }
.fab-menu button:hover { transform: translateX(-3px); }
.fab-menu button i { color: var(--primary); font-size: 1.05rem; }
.section-ai .fab-wrap { display: none; }

.ai-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100%; background: var(--card); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 1070; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .4s var(--ease-out); }
.ai-drawer.open { transform: none; }
.ai-drawer-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--border); }
.ai-drawer-head small { display: block; color: var(--muted); font-size: .72rem; }
.ai-drawer-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ai-orb { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(from 0deg, #14b8a6, #3b82f6, #a855f7, #14b8a6); filter: saturate(1.2); box-shadow: 0 0 20px -4px rgba(59,130,246,.7); animation: breathe 3.5s ease-in-out infinite, spin 12s linear infinite; flex-shrink: 0; }
.ai-orb.thinking { animation: breathe 1s ease-in-out infinite, spin 3s linear infinite; }

/* ---------- Chat AI ---------- */
.ai-page { display: grid; grid-template-columns: 260px 1fr; gap: 16px; flex: none; min-height: 0; height: calc(100vh - var(--topbar-h) - 52px); height: calc(100dvh - var(--topbar-h) - 52px); }
.chat-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chat-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.chat-list a { display: flex; flex-direction: column; padding: 9px 12px; border-radius: 12px; color: var(--text-2); transition: background .12s; }
.chat-list a:hover { background: var(--card-2); }
.chat-list a.active { background: var(--card); box-shadow: var(--shadow); color: var(--text); }
.chat-list .t { font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list small { color: var(--muted); font-size: .7rem; }
.chat-side-foot { display: flex; flex-direction: column; gap: 8px; }
.mode-toggle { display: flex; background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; }
.mode-toggle button { flex: 1; border: 0; background: none; padding: 7px 6px; border-radius: 9px; font-size: .76rem; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: all .2s; }
.mode-toggle button.active { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(15,23,42,.12); }
.model-tag { color: var(--muted); font-size: .72rem; display: flex; gap: 6px; align-items: center; padding: 0 4px; }
.chat-main { min-height: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.chat-empty { margin: auto; text-align: center; max-width: 440px; padding: 20px; }
.chat-empty .ai-orb { width: 58px; height: 58px; margin: 0 auto 14px; }
.chat-empty h3 { margin: 0 0 6px; }
.chat-empty p { color: var(--muted); font-size: .88rem; margin: 0 0 16px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sugg button { border: 1px solid var(--border); background: var(--card-2); color: var(--text-2); font-size: .8rem; padding: 7px 12px; border-radius: 999px; transition: all .15s var(--ease-spring); animation: fadeUp .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
.sugg button:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.msg { display: flex; flex-direction: column; gap: 6px; max-width: 86%; animation: fadeUp .35s var(--ease-out) both; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; }
.bubble { padding: 10px 14px; border-radius: 18px; font-size: .9rem; line-height: 1.5; word-break: break-word; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant .bubble { background: var(--card-2); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg.assistant .bubble.failed { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin: 0; }
.bubble ul, .bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.bubble table { border-collapse: collapse; font-size: .82rem; margin: 6px 0; display: block; overflow-x: auto; }
.bubble th, .bubble td { border: 1px solid var(--border-2); padding: 4px 8px; }
.bubble code { background: rgba(148,163,184,.2); padding: 1px 5px; border-radius: 5px; font-size: .82em; }
.msg .meta { font-size: .68rem; color: var(--muted-2); padding: 0 6px; }
.msg-atts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.msg-atts img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); cursor: zoom-in; transition: transform .2s var(--ease-spring); }
.msg-atts img:hover { transform: scale(1.03); }
.msg-atts .file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--border); font-size: .78rem; color: var(--text-2); }
.thinking { display: flex; gap: 5px; align-items: center; padding: 12px 16px; }
.thinking span { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-600); animation: dots 1.2s ease-in-out infinite; }
.thinking span:nth-child(2) { animation-delay: .15s; }
.thinking span:nth-child(3) { animation-delay: .3s; }
.act-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.act-card { --c: var(--primary); display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--c); box-shadow: var(--shadow); animation: fadeUp .35s var(--ease-out) both; transition: opacity .3s; }
.act-card.create { --c: var(--ok); }
.act-card.update { --c: var(--accent); }
.act-card.delete { --c: var(--danger); }
.act-card .ico { width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--c); display: grid; place-items: center; }
.act-card .lbl { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c); }
.act-card .ttl { font-weight: 700; font-size: .9rem; }
.act-card .ln { font-size: .78rem; color: var(--muted); }
.act-card .st { font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.act-card.applied .st { background: var(--ok-bg); color: var(--ok); }
.act-card.failed .st { background: var(--danger-bg); color: var(--danger); }
.act-card.rejected, .act-card.undone { opacity: .55; }
.act-card .btns { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.act-card .btns .btn { padding: .35rem .7rem; font-size: .78rem; }
.act-card .err { grid-column: 1 / -1; font-size: .76rem; color: var(--danger); }
.act-all { display: flex; gap: 8px; align-items: center; font-size: .8rem; color: var(--muted); }
.chat-composer { border-top: 1px solid var(--border); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--card); }
.chat-composer.dragover { background: var(--primary-50); outline: 2px dashed var(--primary-600); outline-offset: -6px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs .th { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--card-2); display: grid; place-items: center; font-size: .6rem; color: var(--muted); text-align: center; padding: 3px; animation: pop .25s var(--ease-spring); }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .th button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(15,23,42,.7); color: #fff; font-size: .65rem; display: grid; place-items: center; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer-row textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; border-radius: 14px; padding: .6rem .9rem; line-height: 1.4; }
.composer-row .icon-btn { flex-shrink: 0; height: 42px; width: 42px; border-radius: 14px; }
.composer-row .send { background: var(--primary); color: #fff; }
.composer-row .send:hover { background: #115e59; }
.composer-row .send:disabled { opacity: .5; cursor: default; }
.composer-hint { font-size: .7rem; color: var(--muted-2); text-align: center; }
.chat.compact .chat-scroll { padding: 12px 12px 6px; }
.chat.compact .msg { max-width: 94%; }

/* ---------- Pengaturan ---------- */
.settings-page { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.panel-head { display: flex; gap: 12px; align-items: center; }
.panel-head small { display: block; color: var(--muted); font-size: .8rem; }
.panel-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; }
.g-badge { width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--border); color: #4285f4; font-weight: 800; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
.kv div { display: flex; flex-direction: column; font-size: .88rem; }
.kv span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); cursor: pointer; transition: all .2s; }
.choice input { position: absolute; opacity: 0; }
.choice i { font-size: 1.2rem; color: var(--primary); }
.choice small { color: var(--muted); font-size: .76rem; }
.choice.active, .choice:has(input:checked) { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.steps { margin: 0; padding-left: 18px; font-size: .88rem; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }

/* ---------- Auth ---------- */
.auth-body { background: var(--bg); }
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { position: relative; overflow: hidden; background: linear-gradient(160deg, #0c2a33 0%, #0b1f2a 100%); color: #dbe7f0; padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.auth-side .blob { opacity: .35; }
.auth-brand { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; }
.auth-brand img { width: 180px; height: auto; }
.auth-brand .sub { color: #7f94a5; font-size: .8rem; }
.auth-copy { position: relative; z-index: 1; }
.auth-copy h2 { font-size: 2rem; letter-spacing: -.02em; margin: 0 0 12px; color: #fff; line-height: 1.15; }
.auth-copy p { color: #a9bccb; font-size: 1rem; margin: 0 0 24px; max-width: 520px; }
.auth-feat { display: flex; flex-direction: column; gap: 14px; }
.auth-feat div { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; color: #c9d4de; animation: fadeUp .5s var(--ease-out) both; }
.auth-feat div:nth-child(2) { animation-delay: .1s; } .auth-feat div:nth-child(3) { animation-delay: .2s; } .auth-feat div:nth-child(4) { animation-delay: .3s; }
.auth-feat i { width: 34px; height: 34px; border-radius: 10px; background: rgba(20,184,166,.18); color: #5eead4; display: grid; place-items: center; flex-shrink: 0; font-size: 1rem; }
.auth-foot { font-size: .78rem; color: #64748b; position: relative; z-index: 1; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 400px; max-width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 30px 30px 26px; }
.auth-title { margin: 0 0 4px; font-size: 1.45rem; letter-spacing: -.01em; }
.auth-lead { margin: 0 0 20px; color: var(--muted); font-size: .9rem; }
.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted-2); font-size: .78rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.auth-alt { margin: 16px 0 0; text-align: center; font-size: .88rem; color: var(--muted); }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { padding: 30px 24px; min-height: 0; } .auth-copy h2 { font-size: 1.5rem; } .auth-feat { display: none; } }

/* ---------- Bantuan keyboard ---------- */
.kbd-help { position: fixed; inset: 0; z-index: 1080; display: grid; place-items: center; background: rgba(2,6,23,.45); backdrop-filter: blur(4px); padding: 16px; }
.kbd-card { width: 420px; max-width: 100%; background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 16px 18px 18px; animation: pop .3s var(--ease-spring); }
.kbd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kbd-grid { display: flex; flex-direction: column; gap: 8px; }
.kbd-grid div { display: flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--text-2); }
.kbd-grid span { margin-left: auto; color: var(--muted); }

/* ---------- Navigasi bawah (ponsel) ---------- */
.mc-bottomnav { display: none; }

/* ---------- Animasi ---------- */
.reveal { animation: fadeUp .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes slideL { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(15,118,110,.45); } 50% { box-shadow: 0 0 0 7px rgba(15,118,110,0); } }
@keyframes ring-red { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(24px, -18px) scale(1.12); } 100% { transform: translate(-16px, 22px) scale(.95); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes dots { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes hit { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Layar kecil ---------- */
@media (max-width: 991.98px) {
  .mc-sidebar { transform: translateX(-104%); width: min(84vw, 320px); box-shadow: none; }
  .mc-sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.35); }
  .mc-backdrop.show { display: block; opacity: 1; }
  .mc-main { margin-left: 0; }
  .burger { display: inline-grid; order: 0; }
  .mc-topbar { padding: 8px 12px; gap: 6px; height: auto; flex-wrap: wrap; }
  .section-kalender { --topbar-h: 108px; }
  .mc-content { padding: 10px 12px calc(var(--bottomnav-h) + 24px); }
  .cal-nav { flex: 1; min-width: 0; order: 1; gap: 4px; }
  .page-title { flex: 1; min-width: 0; order: 1; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .spacer { display: none; }
  .search-wrap { width: 38px; height: 36px; padding: 0; justify-content: center; overflow: visible; order: 2; }
  .search-wrap input, .search-wrap kbd { display: none; }
  .search-wrap.expanded { position: absolute; left: 12px; right: 12px; top: 8px; width: auto !important; height: 40px; padding: 0 10px; z-index: 5; background: var(--card); }
  .search-wrap.expanded input { display: block; }
  .sync-btn { order: 3; } .notif-wrap { order: 4; } .user-wrap { order: 5; }
  .view-switch { order: 10; width: 100%; }
  .view-switch button { flex: 1; padding: 6px 8px; font-size: .78rem; }
  .btn-today { padding: 0; width: 34px; height: 34px; display: grid; place-items: center; font-size: .95rem; }
  .btn-today span { display: none; }
  .btn-today i { display: inline; }
  .cal-title { font-size: 1rem; }
  .cal-stage { height: calc(100dvh - var(--topbar-h) - var(--bottomnav-h) - 30px); }
  .ai-page { grid-template-columns: 1fr; height: calc(100dvh - var(--topbar-h) - var(--bottomnav-h) - 30px); }
  .chat-side { display: none; }
  .mc-bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); z-index: 1035; align-items: stretch; }
  .mc-bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .64rem; font-weight: 600; color: var(--muted); }
  .mc-bottomnav a i { font-size: 1.2rem; transition: transform .2s var(--ease-spring); }
  .mc-bottomnav a.active { color: var(--primary); }
  .mc-bottomnav a.active i { transform: translateY(-2px) scale(1.1); }
  .bn-create { width: 54px; height: 54px; margin: -18px 6px 0; border-radius: 18px; border: 0; align-self: flex-start; background: linear-gradient(135deg, #14b8a6, #2563eb); color: #fff; font-size: 1.4rem; display: grid; place-items: center; box-shadow: 0 12px 24px -8px rgba(37,99,235,.7); }
  .fab-wrap { display: none; }
  .ai-drawer { width: 100%; }
  .month-cell { padding: 3px 2px; }
  .month-cell .num { width: 22px; height: 22px; font-size: .72rem; }
  .ev-chip { font-size: .62rem; padding: 1px 4px; gap: 3px; border-left-width: 2px; }
  .ev-chip .tm { display: none; }
  .month-head div { padding: 6px 2px; font-size: .62rem; }
  .tg-head, .allday-row, .tg-inner { grid-template-columns: 44px repeat(var(--cols, 7), minmax(0, 1fr)); }
  .tg-day .num { width: 30px; height: 30px; font-size: 1rem; }
  .ev-block { font-size: .66rem; padding: 2px 4px; left: 1px; right: 2px; }
  .agenda-day { grid-template-columns: 56px 1fr; }
  .agenda-item .time { width: 78px; font-size: .72rem; }
  .agenda-hero { flex-direction: column; align-items: flex-start; padding: 18px; }
  .hero-actions { margin-left: 0; }
  .modal { padding: 0; align-items: end; }
  .modal-card { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; transform: translateY(40px); }
  .modal.open .modal-card { transform: none; }
  .modal-sm .modal-card { width: 100%; }
}
@media (max-width: 480px) {
  .month-cell .evs { display: flex; flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .month-cell .evs .ev-chip { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; background: var(--c); }
  .month-cell .evs .ev-chip .t, .month-cell .evs .ev-chip .rep { display: none; }
  .month-cell .more-link { font-size: .58rem; padding: 0 2px; }
}
