/* ============================================================
   ASISTEN YESAYA — Jarvis Dark Theme
   ============================================================ */

:root {
  --bg-base:    #060a14;
  --bg-surface: #0d1526;
  --bg-card:    #111e35;
  --bg-hover:   #162240;
  --border:     #1e3158;
  --border-glow:#2a4a7f;

  --cyan:   #00d4ff;
  --blue:   #2979ff;
  --green:  #00e676;
  --orange: #ffab40;
  --red:    #ff5252;
  --purple: #b388ff;

  --text:   #cce0ff;
  --muted:  #4a6a9a;
  --dimmed: #2a3f60;

  --font: 'Segoe UI', 'Inter', system-ui, sans-serif;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.5);
  --glow-cyan: 0 0 16px rgba(0,212,255,0.3);
  --glow-blue: 0 0 16px rgba(41,121,255,0.3);
}

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

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 3px; }

/* ── Layout ────────────────────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 6px;
}

.sidebar-logo h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.5px;
  text-shadow: var(--glow-cyan);
}

.sidebar-logo p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-clock {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.clock-time {
  font-size: 22px;
  font-weight: 700;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  text-shadow: var(--glow-cyan);
}

.clock-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--bg-hover);
  color: var(--cyan);
  border-left-color: var(--cyan);
}

.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--dimmed);
}

/* ── Main Content ──────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.page-header {
  padding: 20px 28px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  background: var(--bg-surface);
}

.page-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.page-header h2 span { margin-right: 8px; }

.content { padding: 24px 28px; flex: 1; }

/* ── Section visibility ─────────────────────────────────── */
.section { display: none; }
.section.active { display: block; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Dashboard Grid ─────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
}

.stat-cards {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card.cyan  { border-top: 3px solid var(--cyan); }
.stat-card.blue  { border-top: 3px solid var(--blue); }
.stat-card.green { border-top: 3px solid var(--green); }

.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-sub   { font-size: 11px; color: var(--muted); }

.stat-card.cyan  .stat-value { color: var(--cyan);  text-shadow: var(--glow-cyan); }
.stat-card.blue  .stat-value { color: var(--blue);  text-shadow: var(--glow-blue); }
.stat-card.green .stat-value { color: var(--green); }

/* ── Schedule & Todo list items ─────────────────────────── */
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child { border-bottom: none; }

.list-item-icon { font-size: 16px; margin-top: 1px; min-width: 20px; }

.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }

.list-item-actions { display: flex; gap: 6px; align-items: center; }

.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
  font-size: 13px;
}
.empty-state .empty-icon { font-size: 36px; display: block; margin-bottom: 8px; opacity: 0.5; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--cyan);
  color: #000;
}
.btn-primary:hover { background: #33ddff; box-shadow: var(--glow-cyan); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid transparent;
}
.btn-danger:hover { background: rgba(255,82,82,0.1); border-color: var(--red); }

.btn-success {
  background: transparent;
  color: var(--green);
  border: 1px solid transparent;
}
.btn-success:hover { background: rgba(0,230,118,0.1); border-color: var(--green); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px; font-size: 15px; border-radius: 6px; background: transparent; border: 1px solid transparent; cursor: pointer; color: var(--muted); transition: all 0.2s; }
.btn-icon:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border); }

/* ── Toolbar / Filter bar ────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}

.filter-tab {
  padding: 5px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s;
  border: none;
  background: transparent;
  font-family: var(--font);
}

.filter-tab.active {
  background: var(--cyan);
  color: #000;
}

.filter-tab:hover:not(.active) { color: var(--text); }

/* ── Todo items ──────────────────────────────────────────── */
.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.todo-item:hover { border-color: var(--border-glow); }
.todo-item.done  { opacity: 0.5; }

.todo-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-glow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.todo-checkbox.checked {
  background: var(--green);
  border-color: var(--green);
  color: #000;
  font-size: 11px;
}

.todo-checkbox:hover:not(.checked) { border-color: var(--cyan); }

.todo-content { flex: 1; min-width: 0; }

.todo-title { font-size: 13px; font-weight: 600; color: var(--text); }
.todo-item.done .todo-title { text-decoration: line-through; color: var(--muted); }

.todo-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }

.priority-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.priority-high   { background: rgba(255,82,82,0.15);  color: var(--red);    border: 1px solid rgba(255,82,82,0.3);  }
.priority-medium { background: rgba(255,171,64,0.15); color: var(--orange); border: 1px solid rgba(255,171,64,0.3); }
.priority-low    { background: rgba(0,230,118,0.15);  color: var(--green);  border: 1px solid rgba(0,230,118,0.3);  }

/* ── Schedule items ──────────────────────────────────────── */
.schedule-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.schedule-item:hover { border-color: var(--border-glow); border-left-color: var(--cyan); }

.schedule-time {
  min-width: 60px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  padding-top: 2px;
}

.schedule-body { flex: 1; min-width: 0; }
.schedule-title { font-size: 14px; font-weight: 600; color: var(--text); }
.schedule-meta  { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── Note items ──────────────────────────────────────────── */
.note-item {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.note-item:hover { border-color: var(--border-glow); }

.note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  justify-content: space-between;
}

.note-title { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.note-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-meeting     { background: rgba(0,212,255,0.15); color: var(--cyan);   border: 1px solid rgba(0,212,255,0.3); }
.type-revision    { background: rgba(255,171,64,0.15);color: var(--orange); border: 1px solid rgba(255,171,64,0.3);}
.type-development { background: rgba(179,136,255,0.15);color: var(--purple);border: 1px solid rgba(179,136,255,0.3);}
.type-general     { background: rgba(74,106,154,0.2); color: var(--muted); border: 1px solid var(--border); }

.note-preview { font-size: 12px; color: var(--muted); line-height: 1.5; }
.note-footer  { font-size: 11px; color: var(--dimmed); margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }

.tags-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 10px; padding: 1px 6px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 4px; color: var(--muted); }

/* ── Forms / Inputs ──────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0,212,255,0.1);
}

.textarea { min-height: 100px; resize: vertical; }

.form-row { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), var(--glow-cyan);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); background: var(--bg-hover); }

.modal-footer { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ── Note detail modal ───────────────────────────────────── */
.note-detail-content {
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

/* ── Date picker bar (schedules) ────────────────────────── */
.date-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
}

.date-bar label { font-size: 12px; color: var(--muted); font-weight: 600; }
.date-bar .input { width: auto; flex: 1; max-width: 200px; }

/* ── Search bar ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  flex: 1;
  max-width: 300px;
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  width: 100%;
}

.search-bar .icon { color: var(--muted); font-size: 14px; }

/* ── Loading spinner ─────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
  color: var(--muted);
}

/* ── Toast notifications ─────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease-out;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success { border-left: 4px solid var(--green); }
.toast.error   { border-left: 4px solid var(--red); }
.toast.info    { border-left: 4px solid var(--cyan); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Misc helpers ─────────────────────────────────────────── */
.flex  { display: flex; }
.gap-8 { gap: 8px; }
.ml-auto { margin-left: auto; }
.mt-12 { margin-top: 12px; }
.text-muted { color: var(--muted); font-size: 12px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 180px; min-width: 180px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .sidebar { display: none; }
  .stat-cards { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ── Login Screen ────────────────────────────────────────── */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-screen.hidden { display: none; }

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 40px 36px;
  width: 360px;
  text-align: center;
  box-shadow: var(--glow-cyan), var(--shadow);
}

.login-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 12px;
}

.login-title {
  color: var(--cyan);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: var(--glow-cyan);
  margin-bottom: 6px;
}

.login-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

#login-error {
  color: var(--red);
  font-size: 0.83rem;
  min-height: 1.4em;
  margin-bottom: 4px;
  text-align: left;
}

/* ── Tasks Layout (Todo + Jadwal) ────────────────────────── */
.tasks-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.tasks-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.tasks-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.tasks-panel-title {
  font-weight: 700;
  color: var(--cyan);
  font-size: 0.95rem;
  text-shadow: var(--glow-cyan);
}

@media (max-width: 900px) {
  .tasks-layout { grid-template-columns: 1fr; }
}

/* ── Note link & todo time improvements ─────────────────── */
.link-row { display: flex; gap: 8px; }
.link-row select { flex: 1; }

.todo-time-meta { font-size: 0.72rem; color: var(--dimmed); margin-top: 3px; }

.note-link-badge {
  font-size: 0.72rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 4px;
  color: var(--muted);
}

.btn-xs { padding: 2px 6px; font-size: 0.72rem; }
