/* VietWP Admin Panel - style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117; --surface: #1a1d27; --surface-2: #21253a;
  --border: #2d3048; --primary: #6366f1; --primary-dim: #4f52c4;
  --success: #22c55e; --warning: #f59e0b; --danger: #ef4444; --info: #3b82f6;
  --text: #f1f5f9; --text-muted: #94a3b8; --text-dim: #64748b;
  --sidebar-w: 280px; --radius: 8px; --radius-sm: 4px; --radius-lg: 12px;
}
html, body {
  height: 100%; background: var(--bg); color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3d4270; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(9,10,18,0.92);
  backdrop-filter: blur(8px); display: flex;
  align-items: center; justify-content: center; z-index: 9999;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5); text-align: center;
}
.modal-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; }
.modal-logo .logo-icon { font-size: 28px; }
.modal-logo .logo-text { font-size: 22px; font-weight: 700; color: var(--text); }
.modal-title { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.modal-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }
.modal-form { display: flex; flex-direction: column; gap: 12px; }
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; border-bottom: 1px solid var(--border); }
.sidebar-logo .logo-icon { font-size: 22px; }
.logo-info { display: flex; flex-direction: column; }
.logo-name { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: 0.02em; }
.logo-sub { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.sidebar-nav { padding: 12px 10px 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius); border: none; background: transparent;
  color: var(--text-muted); font-family: inherit; font-size: 13.5px;
  font-weight: 500; cursor: pointer; text-align: left; width: 100%;
  transition: background 0.15s, color 0.15s; border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--border); color: var(--text); }
.nav-item.active { background: rgba(99,102,241,0.12); color: var(--primary); border-left-color: var(--primary); }
.nav-icon { font-size: 16px; }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); margin-top: auto; }
#sidebar-panel { flex: 1; overflow-y: auto; border-top: 1px solid var(--border); margin-top: 6px; }
.main-content { flex: 1; overflow-y: auto; background: var(--bg); }
#main-panel { min-height: 100%; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 24px; gap: 12px; color: var(--text-muted); }
.empty-icon { font-size: 40px; }
.loading-spinner { display: flex; align-items: center; justify-content: center; padding: 48px; color: var(--text-muted); gap: 10px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-input, .form-textarea, .form-select {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: inherit;
  font-size: 13.5px; padding: 9px 12px;
  transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-dim); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px; cursor: pointer;
}
.form-select option { background: var(--surface); }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: opacity 0.15s, background 0.15s, transform 0.1s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dim); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.85; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { opacity: 0.85; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 3px; }
.btn-full { width: 100%; }
.btn-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.badge-active    { background: rgba(34,197,94,0.15);   color: var(--success); }
.badge-closed    { background: rgba(99,102,241,0.15);  color: var(--primary); }
.badge-paused    { background: rgba(245,158,11,0.15);  color: var(--warning); }
.badge-draft     { background: rgba(100,116,139,0.15); color: var(--text-dim); }
.badge-archived  { background: rgba(100,116,139,0.15); color: var(--text-dim); }
.badge-completed { background: rgba(34,197,94,0.15);   color: var(--success); }
.badge-parked    { background: rgba(245,158,11,0.15);  color: var(--warning); }
.badge-addressed { background: rgba(34,197,94,0.15);   color: var(--success); }
.badge-dismissed { background: rgba(100,116,139,0.15); color: var(--text-dim); }
.badge-principle  { background: rgba(99,102,241,0.15);  color: var(--primary); }
.badge-framework  { background: rgba(59,130,246,0.15);  color: var(--info); }
.badge-definition { background: rgba(245,158,11,0.15);  color: var(--warning); }
.badge-checklist  { background: rgba(34,197,94,0.15);   color: var(--success); }
.badge-rule       { background: rgba(239,68,68,0.15);   color: var(--danger); }
.badge-template   { background: rgba(168,85,247,0.15);  color: #a855f7; }
.badge-insight    { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.badge-decision   { background: rgba(99,102,241,0.2);   color: var(--primary); }
.badge-change     { background: rgba(59,130,246,0.2);   color: var(--info); }
.badge-evidence   { background: rgba(34,197,94,0.2);    color: var(--success); }
.badge-output     { background: rgba(168,85,247,0.2);   color: #a855f7; }
.badge-learning   { background: rgba(251,191,36,0.2);   color: #fbbf24; }
.badge-blocker    { background: rgba(239,68,68,0.2);    color: var(--danger); }
.badge-question   { background: rgba(245,158,11,0.2);   color: var(--warning); }
.page-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px 16px; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.two-panel { display: flex; height: 100vh; }
.list-panel { width: var(--sidebar-w); min-width: var(--sidebar-w); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.list-panel-header { padding: 16px 12px 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.list-panel-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; padding: 0 4px; }
.list-panel-body { flex: 1; overflow-y: auto; padding: 6px 0; }
.list-item { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; cursor: pointer; border-left: 3px solid transparent; transition: background 0.12s, border-color 0.12s; }
.list-item:hover { background: var(--border); }
.list-item.active { background: rgba(99,102,241,0.1); border-left-color: var(--primary); }
.list-item-title { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.list-item-date { font-size: 11px; color: var(--text-dim); }
.detail-panel { flex: 1; overflow-y: auto; padding: 0; }
.detail-content { padding: 24px 28px 40px; max-width: 900px; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.detail-title { font-size: 18px; font-weight: 700; color: var(--text); }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 5px; }
.meta-item { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-title-count { background: var(--border); color: var(--text-muted); padding: 1px 6px; border-radius: 20px; font-size: 10px; }
.event-list { display: flex; flex-direction: column; gap: 8px; }
.event-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.event-content { flex: 1; font-size: 13px; color: var(--text); line-height: 1.5; }
.event-time { font-size: 11px; color: var(--text-dim); white-space: nowrap; margin-top: 2px; }
.action-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.action-text { flex: 1; font-size: 13px; color: var(--text); }
.action-text.done { text-decoration: line-through; color: var(--text-dim); }
.full-tab { padding: 0; min-height: 100vh; }
.full-tab-content { padding: 24px 28px 48px; max-width: 1100px; }
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn { padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.15s; }
.filter-btn:hover { background: var(--border); color: var(--text); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead tr { border-bottom: 2px solid var(--border); }
.data-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(45,48,72,0.4); }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 18px; color: var(--text); font-size: 13px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,0.4); display: flex; align-items: center; gap: 10px; min-width: 260px; pointer-events: auto; animation: toastIn 0.25s ease; border-left: 3px solid var(--primary); }
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
@keyframes toastIn  { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); }  to { opacity:0; transform:translateX(20px); } }
.toast.exiting { animation: toastOut 0.2s ease forwards; }
.parking-group { margin-bottom: 28px; }
.parking-group-header { display: flex; align-items: center; gap: 10px; padding: 10px 0 8px; border-bottom: 2px solid var(--border); }
.parking-group-title { font-size: 13px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.05em; }
.timeline-project { margin-bottom: 24px; }
.timeline-project-title { font-size: 14px; font-weight: 600; color: var(--primary); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.timeline-session { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-left: 2px solid var(--border); margin-left: 8px; margin-bottom: 4px; font-size: 13px; color: var(--text); }
.timeline-session:hover { border-left-color: var(--primary); background: rgba(99,102,241,0.05); cursor: pointer; }
.timeline-n { font-size: 11px; font-weight: 700; color: var(--text-dim); min-width: 48px; }
.timeline-events { font-size: 11px; color: var(--text-dim); margin-left: auto; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.readonly-field { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; color: var(--text-muted); }
.link-style { color: var(--primary); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color 0.15s; }
.link-style:hover { text-decoration-color: var(--primary); }
.no-data { padding: 24px; text-align: center; color: var(--text-dim); font-size: 13px; }
.search-wrap { position: relative; }
.search-wrap .search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 13px; pointer-events: none; }
.search-wrap .form-input { padding-left: 28px; }
