/**
 * PulsePro 5 — Global Stylesheet
 * Identik dengan pulsepro4, tanpa dependency GAS
 */

:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light: #ede9fe;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --danger: #ef4444;
  --success: #10b981;
  --info: #3b82f6;
  --bg-dark: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: #f1f5f9;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout Shell ───────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  color: white;
  flex-shrink: 0;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

.sidebar-logo .logo-icon { font-size: 20px; }

.nav-section {
  padding: 12px 12px 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  margin: 2px 8px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  border: none; background: none; width: calc(100% - 16px); text-align: left;
}

.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { background: var(--primary); color: white; font-weight: 600; }
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 13px; }

.main-content {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}

.topbar-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

#appCanvas { padding: 20px 24px; flex: 1; }

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; }
.card-body { padding: 20px; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s ease;
  text-decoration: none;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-p { background: var(--primary); color: white; }
.btn-p:hover:not(:disabled) { background: var(--primary-dark); }
.btn-s { background: #f1f5f9; color: var(--text-primary); border: 1px solid var(--border); }
.btn-s:hover:not(:disabled) { background: var(--border); }
.btn-d { background: var(--danger); color: white; }
.btn-d:hover:not(:disabled) { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: #f1f5f9; }
.btn-sm { padding: 5px 10px; font-size: 11px; border-radius: 6px; }

/* ── Form Inputs ────────────────────────────────────── */
.fi {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border .15s ease;
  background: white;
}
.fi:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
select.fi { appearance: none; cursor: pointer; }

/* ── Modals ─────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.6);
  z-index: 1000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: white;
  border-radius: 16px;
  max-width: 560px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity:0; transform:scale(.96) translateY(8px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

/* ── Funnel / Tag Badges ────────────────────────────── */
.card-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}
.badge-tofu   { background: #dbeafe; color: #1d4ed8; }
.badge-mofu   { background: #fef9c3; color: #92400e; }
.badge-bofu   { background: #dcfce7; color: #15803d; }
.badge-nofrl  { background: #f1f5f9; color: #94a3b8; border: 1px dashed #cbd5e1; }

/* ── Kanban Columns ─────────────────────────────────── */
.kanban-col {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 500px;
  flex: 1;
}
.kanban-col-header {
  padding: 14px 16px;
  font-size: 13px; font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.kanban-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }

/* ── Login Page ─────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(10px);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
  color: white;
}
.login-logo .icon { font-size: 40px; }
.login-logo h1 { font-size: 24px; font-weight: 800; margin: 8px 0 4px; }
.login-logo p { font-size: 13px; opacity: .5; }

.login-card .fi {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.15);
  color: white;
}
.login-card .fi::placeholder { color: rgba(255,255,255,.4); }
.login-card .fi:focus { border-color: var(--primary); }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.6); margin-bottom: 6px; }

/* ── Toast ──────────────────────────────────────────── */
.pp5-toast {
  position: fixed; bottom: 20px; right: 20px;
  background: #0f172a; color: white;
  padding: 12px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: toastIn .25s ease;
}
@keyframes toastIn {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* ── Utils ──────────────────────────────────────────── */
.hidden { display: none !important; }
.loading { opacity: .6; pointer-events: none; cursor: wait; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
