/* ============ AGT Brand Studio — merah & putih ============ */
:root {
  --red: #D62828;
  --red-dark: #B21E1E;
  --red-soft: #FDECEC;
  --ink: #1F2430;
  --muted: #6B7280;
  --line: #E9EBF0;
  --bg: #F7F8FA;
  --white: #FFFFFF;
  --ok: #15803D;
  --ok-soft: #E7F6EC;
  --amber: #B45309;
  --amber-soft: #FEF3E2;
  --violet: #6D28D9;
  --violet-soft: #F1EBFD;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
}
.hidden { display: none !important; }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .85em; }

/* ---------- Logo ---------- */
.logo-mark {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--red); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.6rem;
}
.logo-mark.small { width: 36px; height: 36px; border-radius: 10px; font-size: 1.1rem; }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fff 0%, #fdf3f3 60%, #fbe7e7 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--white);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 40px 34px; text-align: center; box-shadow: var(--shadow);
}
.login-card h1 { font-size: 1.35rem; margin: 14px 0 4px; font-weight: 800; }
.login-sub { color: var(--muted); margin-bottom: 26px; }
.login-error { color: var(--red); margin-top: 12px; font-size: .9rem; }
.login-help { color: var(--muted); margin-top: 24px; font-size: .85rem; line-height: 1.6; }

/* ---------- Fields ---------- */
.field { display: block; text-align: left; margin-bottom: 14px; }
.field span { display: block; font-size: .82rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.field span em { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select, .inline-add input, #bulk-ideas {
  width: 100%; background: var(--white);
  border: 1px solid #D8DCE3; color: var(--ink);
  border-radius: 10px; padding: 10px 14px;
  font-size: .95rem; font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus, .inline-add input:focus, #bulk-ideas:focus {
  border-color: var(--red); box-shadow: 0 0 0 3px #d6282822;
}
textarea { resize: vertical; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 10px; padding: 10px 20px;
  font-size: .92rem; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { background: var(--white); color: var(--red); border: 1.5px solid var(--red); }
.btn-outline:hover { background: var(--red-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-row { display: flex; gap: 10px; margin: 6px 0 4px; flex-wrap: wrap; }
.btn-icon {
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  width: 36px; height: 36px; cursor: pointer; font-size: 1.1rem; color: var(--muted);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: 10px 18px; position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name { font-size: 1rem; white-space: nowrap; } .brand-name b { color: var(--red); }

/* ---------- Sidebar ---------- */
#edge-hotzone { position: fixed; left: 0; top: 0; bottom: 0; width: 14px; z-index: 39; }
.backdrop { position: fixed; inset: 0; background: rgba(20,24,34,.35); z-index: 40; }
.sidebar {
  position: fixed; left: 12px; top: 12px; bottom: 12px; width: 250px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: 0 18px 50px rgba(16,24,40,.16);
  padding: 18px 12px; z-index: 41;
  display: flex; flex-direction: column; gap: 6px;
  transform: translateX(calc(-100% - 24px));
  transition: transform .22s ease;
}
.sidebar.open { transform: none; }
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.sidebar-foot { margin-top: auto; color: var(--muted); font-size: .75rem; padding: 12px 8px 4px; border-top: 1px solid var(--line); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  background: none; border: none; font-family: inherit; cursor: pointer;
  padding: 13px 16px; font-size: .95rem; color: var(--muted); font-weight: 600;
  border-radius: 12px; text-align: left; min-height: 46px;
}
.nav-btn:hover { color: var(--ink); background: var(--bg); }
.nav-btn.active { color: var(--red); background: var(--red-soft); }
.user-area { display: flex; align-items: center; gap: 10px; }
.user-chip {
  background: var(--red-soft); color: var(--red-dark);
  font-weight: 700; font-size: .85rem;
  padding: 7px 14px; border-radius: 999px;
}
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 44px; background: var(--white);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  min-width: 210px; padding: 6px; z-index: 30;
}
.menu button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font-family: inherit; font-size: .9rem; padding: 10px 12px; cursor: pointer;
  border-radius: 8px; color: var(--ink);
}
.menu button:hover { background: var(--bg); }
.menu .menu-danger { color: var(--red); }

.demo-banner {
  background: var(--amber-soft); color: var(--amber);
  font-size: .85rem; padding: 8px 26px; border-bottom: 1px solid #f3e3c8;
}

/* ---------- Layout ---------- */
.content { max-width: 980px; margin: 0 auto; padding: 28px 22px 60px; }
.view { display: flex; flex-direction: column; gap: 18px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.view-head h2 { font-size: 1.4rem; font-weight: 800; }
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.02rem; font-weight: 800; margin-bottom: 6px; }
.card-desc { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hint { color: var(--muted); font-size: .82rem; margin-top: 10px; }
.empty-note { color: var(--muted); text-align: center; padding: 16px 0 4px; }

/* ---------- Hero / Beranda ---------- */
.hero {
  background: linear-gradient(120deg, #D62828, #EF4444);
  color: #fff; border-radius: var(--radius); padding: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
}
.hero h2 { font-size: 1.5rem; font-weight: 800; }
.hero p { opacity: .9; margin-top: 4px; }
.hero-level { min-width: 260px; }
.level-name { font-weight: 800; font-size: 1.05rem; display: block; margin-bottom: 8px; }
.progress-bar { height: 10px; background: #ffffff44; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: #fff; border-radius: 999px; transition: width .4s; }
.progress-label { font-size: .82rem; opacity: .9; display: block; margin-top: 6px; }
.step-list { margin-left: 20px; line-height: 2.1; color: var(--muted); }
.step-list b { color: var(--ink); }
.step-list .done { color: var(--ok); }
.checklist { list-style: none; max-height: 300px; overflow-y: auto; }
.checklist li { padding: 6px 0; border-bottom: 1px solid var(--bg); color: var(--muted); font-size: .9rem; display: flex; gap: 8px; }
.checklist li.done { color: var(--ok); text-decoration: line-through; }
.upcoming-list { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Step cards ---------- */
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.step-num {
  width: 30px; height: 30px; border-radius: 999px; flex-shrink: 0;
  background: var(--red); color: #fff; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; font-size: .9rem;
}
.result-box {
  background: var(--bg); border: 1px dashed #D8DCE3;
  border-radius: 12px; padding: 16px; margin-top: 14px;
}
.result-label { font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; }

/* ---------- AI segment ---------- */
.ai-seg { display: inline-flex; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.ai-seg button {
  border: none; background: none; font-family: inherit; cursor: pointer;
  padding: 6px 14px; font-size: .82rem; font-weight: 600; color: var(--muted); border-radius: 999px;
}
.ai-seg button.active { background: var(--red); color: #fff; }

/* ---------- Pillar ---------- */
.inline-add { display: flex; gap: 10px; margin-bottom: 12px; }
.inline-add input { flex: 1; }
.pillar-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.pillar-list li {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 8px 7px 14px; font-size: .88rem; font-weight: 600;
}
.pillar-list li button {
  background: var(--red-soft); color: var(--red); border: none; cursor: pointer;
  width: 22px; height: 22px; border-radius: 999px; font-size: .75rem;
}
.pillar-list .none { color: var(--muted); border: none; background: none; font-weight: 400; }

/* ---------- Funnel ---------- */
.funnel-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.funnel-card {
  text-align: left; background: var(--white); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px 14px; cursor: pointer; font-family: inherit;
}
.funnel-card b { display: block; margin-bottom: 4px; font-size: .92rem; }
.funnel-card small { color: var(--muted); font-size: .76rem; line-height: 1.4; display: block; }
.funnel-card.active { border-color: var(--red); background: var(--red-soft); }
.funnel-card.active b { color: var(--red-dark); }

.tag { display: inline-block; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.tag-TOFU { background: #E8F1FD; color: #1D4ED8; }
.tag-MOFU { background: var(--amber-soft); color: var(--amber); }
.tag-BOFU { background: var(--ok-soft); color: var(--ok); }
.tag-mitra { background: var(--red-soft); color: var(--red-dark); }
.tag-pure { background: var(--violet-soft); color: var(--violet); }
.tag-status-Idea { background: var(--bg); color: var(--muted); }
.tag-status-Scripting { background: var(--amber-soft); color: var(--amber); }
.tag-status-Shooting { background: #FDEBE3; color: #C2410C; }
.tag-status-Editing { background: var(--violet-soft); color: var(--violet); }
.tag-status-POST { background: var(--ok-soft); color: var(--ok); }

/* ---------- Planner table ---------- */
.table-wrap { overflow-x: auto; }
.planner-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.planner-table th {
  text-align: left; color: var(--muted); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .5px; padding: 10px 8px; border-bottom: 1px solid var(--line);
}
.planner-table td { padding: 8px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.planner-table input, .planner-table select {
  background: var(--white); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 7px 9px; font-family: inherit; font-size: .86rem; width: 100%;
}
.planner-table .row-actions { display: flex; gap: 6px; }
.planner-table .row-actions button {
  background: var(--bg); border: 1px solid var(--line); cursor: pointer;
  border-radius: 8px; width: 32px; height: 32px; font-size: .9rem;
}
.planner-table .row-actions .del:hover { background: var(--red-soft); border-color: var(--red); }

/* ---------- Kalender tim ---------- */
.cal-day { margin-bottom: 18px; }
.cal-date {
  font-weight: 800; font-size: .85rem; color: var(--red-dark);
  padding-bottom: 6px; border-bottom: 2px solid var(--red-soft); margin-bottom: 8px;
}
.cal-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px;
  background: var(--white); font-size: .9rem;
}
.cal-item .title { flex: 1; font-weight: 600; min-width: 160px; }
.avatar {
  width: 26px; height: 26px; border-radius: 999px; flex-shrink: 0;
  background: var(--red); color: #fff; font-size: .7rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.owner-name { color: var(--muted); font-size: .82rem; }

/* ---------- Admin monitor ---------- */
.monitor-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--bg);
}
.monitor-row:last-child { border-bottom: none; }
.monitor-id { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.monitor-id b { display: block; font-size: .92rem; }
.monitor-id small { color: var(--muted); font-size: .76rem; }
.monitor-progress { flex: 1; min-width: 160px; }
.monitor-progress .progress-bar { background: var(--bg); border: 1px solid var(--line); height: 9px; }
.monitor-progress .progress-fill { background: var(--red); }
.monitor-progress small { color: var(--muted); font-size: .76rem; }
.monitor-now { flex: 1.2; min-width: 200px; font-size: .85rem; color: var(--muted); }
.monitor-now b { color: var(--ink); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 24, 34, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white); border-radius: var(--radius);
  width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto;
  padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 1.1rem; font-weight: 800; }
.modal-close {
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  width: 32px; height: 32px; cursor: pointer; font-size: 1.1rem; color: var(--muted);
}
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

/* ---------- Kalender grid ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-month { font-weight: 800; font-size: 1.05rem; min-width: 150px; text-align: center; }
.cal-legend { margin-left: auto; display: flex; gap: 6px; }
.cal-scroll { overflow-x: auto; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  min-width: 700px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.cal-dow {
  background: var(--bg); color: var(--muted);
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  padding: 8px; text-align: center; border-bottom: 1px solid var(--line);
}
.cal-cell {
  min-height: 92px; padding: 6px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--white);
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.other { background: var(--bg); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--red); }
.cal-daynum { font-size: .74rem; font-weight: 700; color: var(--muted); text-align: right; }
.cal-cell.today .cal-daynum { color: var(--red); }
.cal-chip {
  display: flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 700;
  border-radius: 7px; padding: 3px 6px;
  cursor: default; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border: 1px solid transparent;
}
.cal-chip .who {
  flex-shrink: 0; width: 17px; height: 17px; border-radius: 999px;
  background: rgba(0,0,0,.14); font-size: .58rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.cal-chip.f-TOFU { background: #E8F1FD; color: #1D4ED8; border-color: #c8ddf8; }
.cal-chip.f-MOFU { background: var(--amber-soft); color: var(--amber); border-color: #f3ddb8; }
.cal-chip.f-BOFU { background: var(--ok-soft); color: var(--ok); border-color: #c4e8cf; }
.cal-chip.done { opacity: .55; text-decoration: line-through; }
.cal-more { font-size: .68rem; color: var(--muted); font-weight: 700; }

/* ---------- Toast / footer ---------- */
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-weight: 600; font-size: .9rem;
  padding: 12px 24px; border-radius: 999px; box-shadow: var(--shadow); z-index: 99;
}

/* ---------- Print ---------- */
.print-only { display: none; }
@media print {
  body * { visibility: hidden; }
  .print-only, .print-only * { visibility: visible; display: block; }
  .print-only { position: absolute; top: 0; left: 0; width: 100%; color: #000; background: #fff; padding: 20px; }
  .print-only h1 { font-size: 20px; margin-bottom: 4px; }
  .print-only h2 { font-size: 15px; margin: 14px 0 6px; border-bottom: 1px solid #999; padding-bottom: 3px; }
  .print-only p { font-size: 12px; margin: 3px 0; }
  .print-only table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .print-only th, .print-only td { border: 1px solid #999; padding: 5px 7px; text-align: left; }
}

/* ---------- Fokus & aksesibilitas ---------- */
:focus-visible { outline: 3px solid #d6282855; outline-offset: 2px; border-radius: 8px; }
.btn-icon { min-width: 40px; min-height: 40px; }
.row-actions button { min-width: 36px; min-height: 36px; }
@media (prefers-reduced-motion: reduce) {
  .sidebar, .progress-fill { transition: none; }
}

/* ---------- Discuss box ---------- */
.discuss-box {
  background: var(--red-soft); border: 1px dashed #f0b9b9;
  border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
}
.discuss-box p { font-size: .88rem; color: var(--ink); margin-bottom: 10px; }
.discuss-box .btn-row { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .grid-2, .grid-3, .grid-2col, .funnel-row { grid-template-columns: 1fr; }
  .funnel-row { display: grid; }
  .topbar { gap: 10px; }
  .brand-name { font-size: .92rem; }
  .sidebar { left: 10px; top: 10px; bottom: 10px; width: min(280px, 82vw); }
  .content { padding: 18px 14px 50px; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-level { width: 100%; }
  .view-head { flex-direction: column; align-items: flex-start; }
}
