/* ============================================================
   UMUM — CSS v2  (matches refined mockup)
   DM Sans + DM Mono | CSS Variables | Dark Mode html.dark
   ============================================================ */

/* ── 1. Variables ───────────────────────────────────────────── */
:root {
  --bg:             #fafafa;
  --surface:        #ffffff;
  --border:         #ebebeb;
  --border-subtle:  #f3f3f3;
  --text:           #0a0a0a;
  --text-sec:       #6b6b6b;
  --text-muted:     #a8a8a8;
  --accent:         #2563eb;
  --accent-light:   #dbeafe;
  --accent-dim:     #eff6ff;
  --success:        #16a34a;
  --warning:        #d97706;
  --danger:         #dc2626;
  --sidebar-w:      224px;

  --av-blue:   #2563eb;
  --av-violet: #7c3aed;
  --av-green:  #16a34a;
  --av-amber:  #d97706;
  --av-rose:   #e11d48;
  --av-cyan:   #0891b2;

  --ce-blue:   #2563eb;
  --ce-violet: #7c3aed;
  --ce-green:  #16a34a;
  --ce-amber:  #d97706;
  --ce-rose:   #dc2626;

  --radius:    6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --trans:     .12s ease;
}

html.dark {
  --bg:            #0f1117;
  --surface:       #161923;
  --border:        #252836;
  --border-subtle: #1e2030;
  --text:          #e8eaf6;
  --text-sec:      #8b92b9;
  --text-muted:    #545878;
  --accent-dim:    #1a2550;
  --accent-light:  #1e2f60;
}

/* ── 2. Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[x-cloak] { display: none !important; }
.mono { font-family: 'DM Mono', monospace; }

/* ── 3. App Shell ───────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
}
.page-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.page-content::-webkit-scrollbar { width: 4px; }
.page-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── 4. Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 0 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 16px 20px;
}
.logo-icon {
  width: 28px; height: 28px;
  background: var(--text);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 15px; height: 15px; fill: #fff; }
.logo-text { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; color: var(--text); }
.sidebar-nav { flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 16px;
  cursor: pointer; color: var(--text-sec);
  font-size: 13.5px; font-weight: 400;
  transition: background var(--trans), color var(--trans);
  position: relative; user-select: none; text-decoration: none;
}
.nav-item:hover { background: var(--border-subtle); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 500; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; }
.badge {
  margin-left: auto;
  font-size: 11px; font-family: 'DM Mono', monospace;
  color: var(--text-muted); background: var(--border-subtle);
  padding: 1px 7px; border-radius: 10px; line-height: 1.6;
}
.nav-item.active .badge { background: var(--accent-light); color: var(--accent); }
.sidebar-bottom { border-top: 1px solid var(--border); }
.dark-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 16px;
  border: none; background: transparent;
  color: var(--text-sec); font-size: 13px; font-family: inherit;
  cursor: pointer; transition: background var(--trans), color var(--trans);
  text-align: left;
}
.dark-toggle:hover { background: var(--border-subtle); color: var(--text); }
.dark-toggle .icon { width: 14px; height: 14px; flex-shrink: 0; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  cursor: pointer; transition: background var(--trans); text-decoration: none;
}
.user-card:hover { background: var(--border-subtle); text-decoration: none; }
.user-name  { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--text-muted); }
.user-info  { flex: 1; min-width: 0; }
.logout-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  color: var(--text-muted); font-size: 13px;
  cursor: pointer; transition: background var(--trans), color var(--trans); text-decoration: none;
}
.logout-btn:hover { background: var(--border-subtle); color: var(--danger); text-decoration: none; }
.logout-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── 5. Avatar ──────────────────────────────────────────────── */
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #fff;
  flex-shrink: 0; user-select: none;
}
.avatar-lg  { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar-sm  {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--surface);
  font-size: 9px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.avatar-sm:first-child { border: none; }
.av-blue   { background: var(--av-blue); }
.av-violet { background: var(--av-violet); }
.av-green  { background: var(--av-green); }
.av-amber  { background: var(--av-amber); }
.av-rose   { background: var(--av-rose); }
.av-cyan   { background: var(--av-cyan); }
.unassigned {
  background: var(--border) !important;
  color: var(--text-muted) !important;
  border: 1.5px dashed var(--border) !important;
}

/* ── 6. Header ─────────────────────────────────────────────── */
.app-header {
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 10px;
  background: var(--surface);
  flex-shrink: 0;
}
.app-header h1 { font-size: 15px; font-weight: 600; letter-spacing: -.2px; color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ── 7. Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius);
  border: none; font-family: inherit;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background var(--trans), color var(--trans), transform .1s;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; color: #fff; text-decoration: none; }
.btn-ghost    { background: transparent; color: var(--text-sec); }
.btn-ghost:hover { background: var(--border-subtle); color: var(--text); }
.btn-outline  { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--border-subtle); }
.btn-danger   { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.icon-btn {
  width: 28px; height: 28px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  background: transparent; color: var(--text-muted);
  transition: background var(--trans), color var(--trans);
}
.icon-btn:hover { background: var(--border-subtle); color: var(--text); }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn.danger:hover { background: #fef2f2; color: var(--danger); }

/* ── 8. Forms ───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text-sec); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="datetime-local"], input[type="time"],
select, textarea {
  width: 100%; padding: 8px 12px;
  border-radius: var(--radius); border: 1px solid var(--border);
  font-family: inherit; font-size: 13.5px;
  color: var(--text); background: var(--bg);
  outline: none;
  transition: border-color var(--trans), box-shadow var(--trans);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
textarea { resize: vertical; min-height: 80px; }
.form-section-title {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  padding: 10px 0 6px; border-top: 1px solid var(--border);
  margin-top: 4px; margin-bottom: 12px;
}
.form-section-title .optional { font-weight: 400; text-transform: none; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 8px; }

/* ── 9. Alerts ──────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.alert-error   { background: #fef2f2; color: #c0392b; border: 1px solid #fecdd3; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ── 10. Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.28);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(1px);
}
.modal {
  background: var(--surface);
  border-radius: 14px; padding: 24px;
  width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-header h3 { font-size: 15px; font-weight: 600; letter-spacing: -.2px; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px 8px; border-radius: 4px; font-size: 1rem; }
.modal-close:hover { background: var(--border-subtle); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── 11. Toast ──────────────────────────────────────────────── */
.toast-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff;
  padding: 10px 20px; border-radius: 100px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  z-index: 9999; pointer-events: none; white-space: nowrap;
}

/* ── 12. Auth ───────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f1117 0%, #1a1d2e 100%);
  padding: 24px; overflow: auto;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 36px;
  width: 100%; max-width: 400px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; margin-bottom: 28px; color: var(--text); }
.auth-logo .logo-icon { width: 32px; height: 32px; }
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 5px; letter-spacing: -.3px; }
.auth-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }
.auth-sub a { font-weight: 500; }

/* ── 13. Dashboard ──────────────────────────────────────────── */
.dash-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  overflow-y: auto;
  align-content: start;
}
.dash-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  transition: box-shadow .15s;
}
.dash-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.hero-card { background: linear-gradient(135deg,#1e3a8a 0%,#2563eb 100%); border: none; color: #fff; }
.hero-greeting { font-size: 22px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 4px; }
.hero-date     { font-size: 13px; color: rgba(255,255,255,.65); }
.hero-stats    { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.stat-pill {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px; padding: 10px 14px;
  flex: 1; min-width: 120px;
}
.stat-pill-icon {
  width: 28px; height: 28px; background: rgba(255,255,255,.2);
  border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-pill-icon svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2; }
.stat-num { font-size: 18px; font-weight: 700; letter-spacing: -.5px; color: #fff; }
.stat-lbl { font-size: 10.5px; color: rgba(255,255,255,.6); }
.card-label {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-link { font-size: 11px; color: var(--accent); font-weight: 500; text-transform: none; letter-spacing: 0; }
.quick-task {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13.5px;
}
.quick-task:last-child { border: none; }
.quick-task-name { flex: 1; color: var(--text); }
.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 44px; margin-top: 14px; }
.mini-bar { flex: 1; border-radius: 4px 4px 0 0; background: var(--accent-light); cursor: pointer; transition: background .15s; min-height: 4px; }
.mini-bar:hover, .mini-bar.today-bar { background: var(--accent); }
.stat-big { font-size: 36px; font-weight: 700; letter-spacing: -1.5px; color: var(--text); line-height: 1; }
.stat-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
.up { color: var(--success); font-weight: 500; }
.notif-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.notif-row:last-child { border: none; }
.notif-row.unread { background: var(--accent-dim); border-radius: var(--radius); padding: 10px; margin: 2px -8px; }
.notif-icon-sm { width: 28px; height: 28px; border-radius: 50%; background: var(--border-subtle); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.notif-msg  { font-size: 13px; color: var(--text-sec); line-height: 1.4; }
.notif-time { font-size: 11.5px; color: var(--text-muted); font-family: 'DM Mono', monospace; display: block; margin-top: 2px; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }
.event-row { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--bg); margin-bottom: 6px; }
.event-title { font-size: 13px; font-weight: 600; color: var(--text); }
.event-time  { font-size: 11.5px; color: var(--text-muted); font-family: 'DM Mono', monospace; }

/* ── 14. Toolbar ────────────────────────────────────────────── */
.toolbar {
  padding: 10px 24px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface); flex-shrink: 0; flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 5px; font-size: 12.5px;
  font-family: inherit; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-sec);
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.chip:hover { background: var(--border-subtle); }
.chip.on, .chip.active { background: var(--accent-dim); border-color: var(--accent-light); color: var(--accent); font-weight: 500; }
.search-box {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg);
  margin-left: auto; min-width: 170px;
}
.search-box svg { width: 13px; height: 13px; color: var(--text-muted); flex-shrink: 0; }
.search-box input { border: none; background: transparent; outline: none; font-family: inherit; font-size: 13px; color: var(--text); width: 100%; padding: 0; box-shadow: none; }
.search-box input:focus { box-shadow: none; border: none; }
.search-box input::placeholder { color: var(--text-muted); }

/* ── 15. Tasks Page ─────────────────────────────────────────── */
.tasks-layout { display: flex; flex: 1; overflow: hidden; }
.tasks-main   { flex: 1; overflow-y: auto; }
.tasks-main::-webkit-scrollbar { width: 4px; }
.tasks-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.group-header { display: flex; align-items: center; gap: 8px; padding: 16px 24px 8px; }
.group-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.group-title { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.group-count { font-size: 11px; font-family: 'DM Mono', monospace; color: var(--text-muted); background: var(--border-subtle); padding: 1px 7px; border-radius: 10px; }
.task-list { padding: 0 16px 8px; }
.task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: 8px;
  cursor: pointer; border: 1px solid transparent;
  margin-bottom: 1px;
  transition: background var(--trans), border-color var(--trans), box-shadow var(--trans);
  animation: fadeUp .22s ease both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.task-row:hover { background: var(--surface); border-color: var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.task-row:hover .row-actions { opacity: 1; }
.task-row.done .task-name { color: var(--text-muted); text-decoration: line-through; }
.status-icon {
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; transition: transform .12s;
}
.status-icon:hover { transform: scale(1.15); }
.si-todo     { border: 1.5px solid var(--text-muted); }
.si-progress { border: 1.5px solid var(--accent); background: var(--accent-dim); position: relative; overflow: hidden; }
.si-progress::after { content: ''; position: absolute; left: 0; top: 0; width: 50%; height: 100%; background: var(--accent); }
.si-done     { background: var(--success); border: 1.5px solid var(--success); }
.si-blocked  { background: #fef2f2; border: 1.5px solid var(--danger); }
.si-done svg, .si-blocked svg { width: 10px; height: 10px; }
.task-id   { font-size: 11.5px; font-family: 'DM Mono', monospace; color: var(--text-muted); min-width: 52px; }
.task-name { flex: 1; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.task-code { font-family: 'DM Mono', monospace; font-size: 11.5px; color: var(--text-muted); }
.priority { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; }
.priority svg { width: 9px; height: 9px; }
.p-urgent { color: var(--danger); background: #fef2f2; }
.p-high   { color: var(--warning); background: #fffbeb; }
.p-medium { color: var(--accent); background: var(--accent-dim); }
.p-low    { color: var(--text-muted); background: var(--border-subtle); }
.label-tag { font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; border: 1px solid; }
.l-bug           { color: #dc2626; border-color: #fecaca; background: #fff5f5; }
.l-feat, .l-feature { color: #7c3aed; border-color: #e9d5ff; background: #f5f3ff; }
.l-design        { color: #0891b2; border-color: #a5f3fc; background: #ecfeff; }
.l-infra         { color: #6b6b6b; border-color: #e5e5e5; background: var(--bg); }
.due-date { font-size: 12px; font-family: 'DM Mono', monospace; color: var(--text-muted); flex-shrink: 0; min-width: 58px; text-align: right; }
.due-date.overdue { color: var(--danger); }
.due-date.soon    { color: var(--warning); }
.avatar-group { display: flex; flex-shrink: 0; }
.row-actions  { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; flex-shrink: 0; }
.right-panel {
  width: 276px; border-left: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow: hidden;
  transition: width .22s, opacity .22s;
}
.right-panel.hidden { width: 0; opacity: 0; pointer-events: none; }
.rp-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.rp-title  { font-size: 13px; font-weight: 600; font-family: 'DM Mono', monospace; color: var(--text-muted); }
.rp-body   { padding: 16px; flex: 1; overflow-y: auto; }
.detail-name  { font-size: 15px; font-weight: 600; letter-spacing: -.2px; margin-bottom: 16px; line-height: 1.4; }
.detail-row   { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); }
.detail-label { font-size: 12px; color: var(--text-muted); }
.detail-value { font-size: 12.5px; color: var(--text-sec); font-weight: 500; }
.act-title { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 600; margin: 16px 0 10px; }
.act-item  { display: flex; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--text-sec); line-height: 1.5; }
.act-av    { width: 20px; height: 20px; border-radius: 50%; font-size: 8px; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.act-time  { font-size: 11px; color: var(--text-muted); font-family: 'DM Mono', monospace; }
.popup-assign {
  position: fixed; z-index: 2000;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-md);
  min-width: 180px; padding: 6px;
}
.popup-header { font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 4px 8px 6px; text-transform: uppercase; letter-spacing: .04em; }
.popup-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; background: none; border: none; cursor: pointer; border-radius: 6px; font-size: 13px; color: var(--text); transition: background var(--trans); text-align: left; }
.popup-item:hover { background: var(--border-subtle); }
.summary-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 11px 24px; border-top: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
  font-size: 12px; color: var(--text-muted);
}
.sum-item { display: flex; align-items: center; gap: 6px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; }
.prog-wrap { flex: 1; max-width: 180px; height: 4px; background: var(--border-subtle); border-radius: 10px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--accent); border-radius: 10px; transition: width .5s ease; }

/* ── 16. Inbox ──────────────────────────────────────────────── */
.inbox-tabs {
  display: flex; gap: 4px;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.tab {
  padding: 5px 14px; border-radius: var(--radius);
  border: none; background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; color: var(--text-sec);
  transition: all var(--trans);
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { background: var(--border-subtle); color: var(--text); }
.tab.active { background: var(--accent-dim); color: var(--accent); }
.badge-inline { background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 9px; }
.notif-list { padding: 0 12px; overflow-y: auto; flex: 1; }
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 10px; border-bottom: 1px solid var(--border-subtle);
  cursor: pointer; transition: background var(--trans);
  border-radius: var(--radius); margin: 2px 0;
}
.notif-item:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.notif-item.unread { background: var(--accent-dim); }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--border-subtle); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.notif-content { flex: 1; min-width: 0; }
.notif-msg-text { font-size: 13px; line-height: 1.5; color: var(--text-sec); }
.notif-msg-text.unread-text { font-weight: 500; color: var(--text); }
.notif-meta { font-size: 11.5px; color: var(--text-muted); font-family: 'DM Mono', monospace; margin-top: 2px; }
.notif-dot  { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }

/* ── 17. Calendar ───────────────────────────────────────────── */

.cal-wrap { display: flex; flex: 1; overflow: hidden; }

/* ─── Sidebar ─────────────────────────── */
.cal-sidebar {
  width: 240px; border-right: 1px solid var(--border);
  padding: 18px 14px 16px; overflow-y: auto;
  flex-shrink: 0; background: var(--surface);
}
.cal-sidebar::-webkit-scrollbar { width: 3px; }
.cal-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.mini-cal-wrap   { margin-bottom: 20px; }
.mini-cal-header { margin-bottom: 10px; }
.mini-cal-title  { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -.2px; }
.mini-cal-grid   { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; margin-bottom: 20px; }
.cal-day-label   { font-size: 10px; font-weight: 600; color: var(--text-muted); text-align: center; padding: 3px 0 5px; }
.cal-day {
  font-size: 11.5px; text-align: center; border-radius: 6px;
  cursor: default; color: var(--text-sec); aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; line-height: 1; transition: background var(--trans);
}
.cal-day.today-mini         { background: var(--accent); color: #fff; font-weight: 700; }
.cal-day.in-week            { background: var(--accent-dim); color: var(--accent); font-weight: 500; }
.cal-day.in-week.today-mini { background: var(--accent); color: #fff; }
.cal-day.other-m            { color: var(--text-muted); opacity: .3; }
.mini-dot { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cal-day.today-mini .mini-dot { background: rgba(255,255,255,.75); }

.upcoming-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  color: var(--text-muted); margin-bottom: 10px;
}
.upcoming-item {
  display: flex; gap: 10px; padding: 9px 6px; border-radius: 8px;
  cursor: default; margin-bottom: 2px; background: transparent;
  transition: background var(--trans); align-items: flex-start;
}
.upcoming-item:hover  { background: var(--border-subtle); }
.upcoming-date-col    { text-align: center; min-width: 30px; flex-shrink: 0; }
.upcoming-day-num     { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1; letter-spacing: -.5px; }
.upcoming-day-name    { font-size: 9.5px; color: var(--text-muted); font-weight: 600; letter-spacing: .04em; margin-top: 1px; }
.upcoming-info        { flex: 1; min-width: 0; }
.upcoming-name        { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.upcoming-time-row    { font-size: 11.5px; color: var(--text-muted); font-family: 'DM Mono', monospace; margin-bottom: 5px; }
.upcoming-tag         { display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 9px; border-radius: 20px; }
.up-tag-blue          { color: #1d4ed8; background: #dbeafe; }
.up-tag-rose          { color: #be123c; background: #ffe4e6; }
.up-tag-amber         { color: #b45309; background: #fef3c7; }
.up-tag-violet        { color: #6d28d9; background: #ede9fe; }
.up-tag-green         { color: #15803d; background: #dcfce7; }

.cal-nav-btn {
  width: 30px !important; height: 30px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  border-radius: 7px; color: var(--text-sec) !important;
}
.cal-nav-btn:hover { background: var(--border-subtle) !important; color: var(--text) !important; }
.cal-nav-btn svg { width: 13px; height: 13px; }

/* ─── Main — CRITICAL: NO display:flex ── */
.cal-main { flex: 1; overflow-y: auto; overflow-x: auto; }
.cal-main::-webkit-scrollbar { width: 4px; height: 4px; }
.cal-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.cal-week-header  { padding: 14px 20px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-week-label   { font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -.4px; }
.cal-week-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────
   WEEK GRID — Column-based (fix Alpine nested x-for)

   .week-grid (flex row)
   ├── .wg-time-col          ← kolom jam, stack vertikal
   │    ├── .wg-corner
   │    └── .wg-time-cell ×n
   └── .wg-day-col ×7        ← kolom hari, x-for weekDays
        ├── .wg-day-header
        └── .wg-cell ×n      ← sel jam, stack vertikal otomatis
───────────────────────────────────────────────────── */
.week-grid {
  display: flex; flex-direction: row;
  margin: 0 20px 24px;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--surface);
  min-width: 560px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

/* Kolom jam kiri */
.wg-time-col {
  width: 56px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.wg-corner {
  height: 54px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.wg-time-cell {
  height: 56px; flex-shrink: 0;
  padding: 6px 8px 0;
  font-size: 10.5px; font-family: 'DM Mono', monospace;
  color: var(--text-muted); border-bottom: 1px solid var(--border-subtle);
  text-align: right; line-height: 1; user-select: none;
  background: var(--surface);
}
.wg-time-cell:last-child { border-bottom: none; }

/* Kolom hari */
.wg-day-col {
  flex: 1; display: flex; flex-direction: column;
  border-left: 1px solid var(--border-subtle); min-width: 0;
}
.wg-day-col.weekend-col { background: var(--bg); }
html.dark .wg-day-col.weekend-col { background: rgba(255,255,255,.015); }

/* Header hari */
.wg-day-header {
  height: 54px; flex-shrink: 0;
  padding: 8px 4px 6px; text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.wg-day-header.today-col .wdh-name { color: var(--accent); }
.wg-day-header.today-col .wdh-num  { background: var(--accent); color: #fff; }
.wdh-name {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 4px;
}
.wdh-num {
  font-size: 16px; font-weight: 700; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; border-radius: 50%; color: var(--text); letter-spacing: -.5px;
}
.wdh-today { background: var(--accent) !important; color: #fff !important; }

/* Sel jam */
.wg-cell {
  height: 56px; flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
  position: relative; cursor: pointer;
  transition: background var(--trans);
}
.wg-cell:hover { background: var(--accent-dim); }
.wg-cell:last-child { border-bottom: none; }

/* Garis jam sekarang */
.time-now-line {
  position: absolute; left: 0; right: 0;
  height: 2px; background: var(--accent); z-index: 5; pointer-events: none;
}
.time-now-line::before {
  content: ''; position: absolute; left: -1px; top: -3px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* Event pills */
.cal-event {
  position: absolute; left: 3px; right: 3px;
  border-radius: 5px; padding: 4px 7px;
  cursor: pointer; z-index: 2; overflow: hidden;
  display: flex; flex-direction: column; gap: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: filter .12s, box-shadow .12s;
}
.cal-event:hover { filter: brightness(.92); box-shadow: 0 2px 8px rgba(0,0,0,.14); z-index: 3; }
.ce-title { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.ce-time  { font-size: 10px; font-family: 'DM Mono', monospace; opacity: .72; line-height: 1; }

.ce-blue          { background: #dbeafe; color: #1e40af; border-left: 3px solid #3b82f6; }
.ce-violet        { background: #ede9fe; color: #6d28d9; border-left: 3px solid #8b5cf6; }
.ce-green         { background: #dcfce7; color: #166534; border-left: 3px solid #22c55e; }
.ce-amber         { background: #fef9c3; color: #92400e; border-left: 3px solid #f59e0b; }
.ce-rose, .ce-red { background: #fee2e2; color: #991b1b; border-left: 3px solid #f87171; }
html.dark .ce-blue   { background: rgba(59,130,246,.18);  color: #93c5fd; border-color: #3b82f6; }
html.dark .ce-violet { background: rgba(139,92,246,.18);  color: #c4b5fd; border-color: #8b5cf6; }
html.dark .ce-green  { background: rgba(34,197,94,.18);   color: #86efac; border-color: #22c55e; }
html.dark .ce-amber  { background: rgba(245,158,11,.18);  color: #fcd34d; border-color: #f59e0b; }
html.dark .ce-rose   { background: rgba(248,113,113,.18); color: #fca5a5; border-color: #f87171; }

.color-swatches { display: flex; gap: 8px; }
.color-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; outline: none;
  transition: transform var(--trans), box-shadow var(--trans);
}
.color-swatch:hover    { transform: scale(1.1); }
.color-swatch.selected { transform: scale(1.2); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.color-swatch.ce-blue   { background: #3b82f6; }
.color-swatch.ce-violet { background: #8b5cf6; }
.color-swatch.ce-green  { background: #22c55e; }
.color-swatch.ce-amber  { background: #f59e0b; }
.color-swatch.ce-rose   { background: #f87171; }

.cal-modal { max-width: 460px; }
.modal-cats { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 18px; }
.modal-cats .chip { font-size: 12.5px; }
.event-preview {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 4px; border: 1px solid transparent;
}
.event-preview.ce-blue   { background: #dbeafe; border-color: #bfdbfe; }
.event-preview.ce-violet { background: #ede9fe; border-color: #ddd6fe; }
.event-preview.ce-green  { background: #dcfce7; border-color: #bbf7d0; }
.event-preview.ce-amber  { background: #fef9c3; border-color: #fde68a; }
.event-preview.ce-rose   { background: #fee2e2; border-color: #fecaca; }
html.dark .event-preview.ce-blue   { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.25); }
html.dark .event-preview.ce-violet { background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.25); }
html.dark .event-preview.ce-green  { background: rgba(34,197,94,.12);  border-color: rgba(34,197,94,.25); }
html.dark .event-preview.ce-amber  { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25); }
html.dark .event-preview.ce-rose   { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.25); }
.ep-title { font-size: 13px; font-weight: 600; color: var(--text); }
.ep-meta  { font-size: 11.5px; color: var(--text-muted); font-family: 'DM Mono', monospace; margin-top: 2px; }

@media (max-width: 768px) {
  .cal-wrap { flex-direction: column; }
  .cal-sidebar { width: 100%; max-height: 220px; border-right: none; border-bottom: 1px solid var(--border); }
  .week-grid { min-width: 0; }
  .cal-week-header { flex-wrap: wrap; gap: 8px; }
}

/* ── 18. Docs (Document Library) ───────────────────────────── */

/* Layout wrapper */
.dlib-wrap {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.dlib-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dlib-sidebar::-webkit-scrollbar { width: 3px; }
.dlib-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.dlib-sidebar-section {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted);
  padding: 8px 6px 4px;
}

.dlib-divider { border-top: 1px solid var(--border); margin: 10px 0 2px; }

.dlib-cat-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 8px;
  border: none; background: transparent;
  border-radius: 7px; cursor: pointer;
  font-family: inherit; font-size: 13px;
  color: var(--text-sec);
  transition: background var(--trans), color var(--trans);
  text-align: left;
}
.dlib-cat-btn:hover { background: var(--border-subtle); color: var(--text); }
.dlib-cat-btn.is-active { background: var(--accent-dim); color: var(--accent); font-weight: 500; }

.dlib-cat-ic {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dlib-cat-ic svg { width: 13px; height: 13px; }

.dlib-cat-lbl { flex: 1; }
.dlib-cat-num {
  font-size: 11px; font-family: 'DM Mono', monospace;
  color: var(--text-muted); background: var(--border-subtle);
  padding: 1px 6px; border-radius: 8px; min-width: 18px; text-align: center;
}
.dlib-cat-btn.is-active .dlib-cat-num { background: var(--accent-light); color: var(--accent); }

/* View toggle */
.dlib-view-row { display: flex; gap: 4px; padding: 4px 2px; }
.dlib-view-opt {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; font-family: inherit; font-size: 12px;
  color: var(--text-muted); cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.dlib-view-opt svg { width: 12px; height: 12px; }
.dlib-view-opt:hover   { background: var(--border-subtle); color: var(--text); }
.dlib-view-opt.is-active { background: var(--accent-dim); border-color: var(--accent-light); color: var(--accent); }

/* ─── Main ──────────────────────────────────────────────────── */
.dlib-main {
  flex: 1; min-width: 0;
  overflow-y: auto;
  padding: 0 0 32px;
}
.dlib-main::-webkit-scrollbar { width: 4px; }
.dlib-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Breadcrumb */
.dlib-breadcrumb {
  display: flex; align-items: center; gap: 4px;
  padding: 12px 24px 0;
  font-size: 12.5px; color: var(--text-muted);
}
.dlib-bc-item {
  background: none; border: none; font-family: inherit; font-size: 12.5px;
  cursor: default; padding: 0; color: var(--text-muted);
}
.dlib-bc-link { cursor: pointer; color: var(--accent); }
.dlib-bc-link:hover { text-decoration: underline; }
.dlib-bc-current { font-weight: 600; color: var(--text); }
.dlib-bc-sep { color: var(--text-muted); margin: 0 2px; font-size: 13px; }

/* Toolbar */
.dlib-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 24px 14px;
}

.dlib-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg);
  transition: border-color var(--trans), box-shadow var(--trans);
}
.dlib-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.dlib-search svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.dlib-search input {
  flex: 1; border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 13.5px; color: var(--text);
  padding: 0; box-shadow: none !important;
}
.dlib-search input::placeholder { color: var(--text-muted); }
.dlib-clear-btn {
  border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 11px; padding: 0 2px;
  transition: color var(--trans);
}
.dlib-clear-btn:hover { color: var(--text); }

/* Status filter tabs */
.dlib-status-tabs { display: flex; gap: 4px; flex-shrink: 0; }
.dlib-stab {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; font-family: inherit; font-size: 12.5px;
  color: var(--text-sec); cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.dlib-stab:hover { background: var(--border-subtle); }
.dlib-stab.active { background: var(--border-subtle); font-weight: 500; color: var(--text); }
.dlib-stab-lanjut.active { background: #f0fdf4; border-color: #86efac; color: #16a34a; }
.dlib-stab-tidak.active  { background: #fef2f2; border-color: #fecaca; color: #dc2626; }

/* Sort */
.dlib-sort {
  padding: 7px 10px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--bg); font-family: inherit; font-size: 13px;
  color: var(--text); cursor: pointer; outline: none;
  flex-shrink: 0;
}
.dlib-sort:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.dlib-result-count { font-size: 12px; color: var(--text-muted); font-family: 'DM Mono', monospace; flex-shrink: 0; }

/* Empty */
.dlib-empty {
  text-align: center; padding: 64px 24px;
  color: var(--text-muted); font-size: 13.5px;
}
.dlib-empty-icon { font-size: 40px; margin-bottom: 10px; }

/* ─── GRID VIEW ─────────────────────────────────────────────── */
.dlib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  padding: 0 24px;
}

.dlib-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  cursor: pointer; position: relative;
  transition: box-shadow var(--trans), transform var(--trans), border-color var(--trans);
}
.dlib-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.09);
  transform: translateY(-2px);
  border-color: var(--text-muted);
}
.dlib-card:hover .dlib-card-hover { opacity: 1; }

/* Status badge Surat Masuk */
.dlib-card-status {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px;
  pointer-events: none; line-height: 1.5;
  display: inline-block;
}
/* Hanya di dalam grid card, badge absolute di pojok kiri atas */
.dlib-card .dlib-card-status {
  position: absolute; top: 7px; left: 7px; z-index: 3;
}
/* Badge di list view — inline, tidak absolute */
.dlib-list-status {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px;
  line-height: 1.5;
}
.st-lanjut { background: #dcfce7; color: #15803d; }
.st-tidak  { background: #fee2e2; color: #dc2626; }

/* Top icon area */
.dlib-card-top {
  height: 80px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.dlib-card-emoji { font-size: 28px; line-height: 1; user-select: none; }
.dlib-card-type {
  position: absolute; bottom: 7px; right: 7px;
  font-size: 9px; font-weight: 700; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 4px; color: #fff;
}

/* Card body */
.dlib-card-body { padding: 10px 10px 11px; }
.dlib-card-name {
  font-size: 12.5px; font-weight: 500; color: var(--text);
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 4px;
}
.dlib-card-ref {
  font-size: 10.5px; color: var(--text-muted); font-family: 'DM Mono', monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px;
}
.dlib-card-date { font-size: 10.5px; color: var(--text-muted); font-family: 'DM Mono', monospace; }

/* Hover actions overlay */
.dlib-card-hover {
  position: absolute; top: 7px; right: 7px;
  display: flex; gap: 3px;
  opacity: 0; transition: opacity var(--trans);
}
.dlib-card-hover .icon-btn {
  width: 26px; height: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.dlib-card-hover .icon-btn svg { width: 12px; height: 12px; }

/* ─── LIST VIEW ─────────────────────────────────────────────── */
.dlib-list { padding: 0 24px; }

.dlib-list-head {
  display: flex; align-items: center;
  padding: 8px 12px;
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.dlib-list-row {
  display: flex; align-items: center;
  padding: 10px 12px;
  border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; margin-bottom: 1px;
  transition: background var(--trans), border-color var(--trans), box-shadow var(--trans);
  font-size: 13px;
}
.dlib-list-row:hover {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.dlib-list-row:hover .dlib-row-acts { opacity: 1; }

/* List columns */
.dlh-name   { flex: 1; min-width: 0; }
.dlh-cat    { width: 90px; flex-shrink: 0; }
.dlh-ref    { width: 120px; flex-shrink: 0; font-size: 11.5px; color: var(--text-muted); }
.dlh-date   { width: 110px; flex-shrink: 0; font-size: 11.5px; color: var(--text-muted); }
.dlh-status { width: 100px; flex-shrink: 0; }
.dlh-act    { width: 64px; flex-shrink: 0; }

.dlr-name {
  display: flex; align-items: center; gap: 9px;
  flex: 1; min-width: 0;
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dlr-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.dlr-cat-pill {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px; letter-spacing: .03em;
}

.dlib-row-acts {
  display: flex; gap: 2px;
  opacity: 0; transition: opacity var(--trans);
}

/* ─── Pagination ─────────────────────────────────────────────── */
.dlib-pagination {
  display: flex; align-items: center; gap: 4px;
  padding: 20px 24px 0; flex-wrap: wrap;
}
.dlib-pg-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); font-family: inherit;
  font-size: 13px; color: var(--text-sec); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans), color var(--trans);
}
.dlib-pg-btn:hover:not(:disabled) { background: var(--border-subtle); color: var(--text); }
.dlib-pg-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.dlib-pg-btn:disabled { opacity: .35; cursor: not-allowed; }
.dlib-pg-btn svg { width: 13px; height: 13px; }
.dlib-pg-info { font-size: 12px; color: var(--text-muted); font-family: 'DM Mono', monospace; margin-left: 6px; }

/* ─── Modal pieces ───────────────────────────────────────────── */
.dlib-cat-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dlib-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; font-family: inherit; font-size: 12.5px;
  color: var(--text-sec); cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.dlib-chip:hover { background: var(--border-subtle); }

/* Status toggle in modal */
.dlib-status-btn {
  padding: 7px 16px; border-radius: 7px; border: 1px solid var(--border);
  background: transparent; font-family: inherit; font-size: 13px;
  color: var(--text-sec); cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.dlib-status-btn:hover { background: var(--border-subtle); }
.dlib-status-btn.sl-active { background: #f0fdf4; border-color: #86efac; color: #16a34a; font-weight: 600; }
.dlib-status-btn.st-active { background: #fef2f2; border-color: #fecaca; color: #dc2626; font-weight: 600; }

/* Doc preview in modal */
.dlib-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; border: 1px solid;
  margin-bottom: 4px;
}

/* View modal */
.dlib-view-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.dlib-view-meta {
  font-size: 12px; color: var(--text-muted); margin-top: 3px;
  font-family: 'DM Mono', monospace;
}
.dlib-view-body {
  background: var(--bg); border-radius: 8px; padding: 16px;
  font-size: 14px; color: var(--text-sec); line-height: 1.7;
  min-height: 80px; white-space: pre-wrap; margin-bottom: 4px;
}

/* ─── Upload / Dropzone ──────────────────────────────────────── */
.dlib-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--trans), background var(--trans);
  background: var(--bg);
}
.dlib-dropzone:hover,
.dlib-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.dlib-dropzone-inner {
  display: flex; flex-direction: column;
  align-items: center; pointer-events: none;
}
.dlib-file-preview {
  display: flex; align-items: center; gap: 12px;
  text-align: left;
}
.dlib-file-icon { font-size: 28px; flex-shrink: 0; }
.dlib-file-info { flex: 1; min-width: 0; }

/* Attached file in view modal */
.dlib-attached-file {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 14px;
}

/* Spinner animation */
.dlib-spin {
  animation: dlib-rotate .8s linear infinite;
}
@keyframes dlib-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}



/* ── 19. Profile ────────────────────────────────────────────── */
.profile-wrap { display: flex; justify-content: center; padding: 32px 24px; overflow-y: auto; }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px; width: 100%; max-width: 500px; box-shadow: var(--shadow-sm); }
.profile-avatar-preview { text-align: center; margin-bottom: 24px; }
.avatar-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.avatar-swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: transform var(--trans), border-color var(--trans); }
.avatar-swatch.selected { transform: scale(1.2); border-color: var(--text); }
.avatar-swatch.av-blue   { background: var(--av-blue); }
.avatar-swatch.av-violet { background: var(--av-violet); }
.avatar-swatch.av-green  { background: var(--av-green); }
.avatar-swatch.av-amber  { background: var(--av-amber); }
.avatar-swatch.av-rose   { background: var(--av-rose); }
.avatar-swatch.av-cyan   { background: var(--av-cyan); }

/* ── 20. Scrollbars ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── 21. Misc ───────────────────────────────────────────────── */
.empty-state { text-align: center; color: var(--text-muted); font-size: 13px; padding: 24px; }
.line-through { text-decoration: line-through; }

/* ── 22. Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .app-main { margin-left: 0; }
  .dash-grid { grid-template-columns: 1fr; padding: 16px; }
  .span-2, .span-3 { grid-column: span 1; }
  .form-row { grid-template-columns: 1fr; }
  .docs-layout, .cal-wrap { flex-direction: column; }
  .docs-sidebar, .cal-sidebar { width: 100%; max-height: 220px; border-right: none; border-bottom: 1px solid var(--border); }
  .right-panel { display: none; }
}

/* ── Page-level header actions overlay ── */
/* Tombol action dari halaman ditaruh di sini, float ke kanan header */
.page-actions {
    position: absolute;
    top: 0; right: 24px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}
.app-main { position: relative; }

/* ── Pages Navbar ── */
/* Tombol Parent Manajemen slip */
.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-group-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Chevron */
.nav-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-group.open .nav-chevron {
    transform: rotate(90deg);
}


/* Children tersembunyi by default */
.nav-children {
    display: none;
    flex-direction: column;
    padding-left: 1rem;
    border-left: 2px solid rgba(255,255,255,0.1);
    margin-left: 1.1rem;
    margin-top: 0.25rem;
}

.nav-group.open .nav-children {
    display: flex;
}

/* Child item sedikit lebih kecil */
.nav-child {
    font-size: 0.875rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    opacity: 0.8;
}

.nav-child:hover,
.nav-child.active {
    opacity: 1;
}
/* ── Upcoming item action buttons ── */
.upcoming-actions {
  display: flex; gap: 3px; align-items: center;
  opacity: 0; transition: opacity var(--trans);
  flex-shrink: 0; margin-left: auto;
}
.upcoming-item:hover .upcoming-actions { opacity: 1; }
.up-act-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.up-act-btn:hover { background: var(--surface); color: var(--text); border-color: var(--text-muted); }
.up-act-danger:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
