/* PresentTool™ — Dashboard styles */
:root {
  --pt-primary:  #8B4513;
  --pt-secondary: #C8956C;
  --pt-text:     #1A1A1A;
  --pt-muted:    #6B6B6B;
  --pt-bg:       #FAFAF8;
  --pt-surface:  #FFFFFF;
  --pt-border:   #E5E5E0;
  --pt-sidebar-w: 220px;
  --pt-ok:       #22C55E;
  --pt-warn:     #F59E0B;
  --pt-error:    #EF4444;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { display: flex; height: 100vh; overflow: hidden; background: var(--pt-bg); color: var(--pt-text); }
img  { max-width: 100%; display: block; }
a    { color: var(--pt-primary); }

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.dash-sidebar {
  width: var(--pt-sidebar-w); min-width: var(--pt-sidebar-w);
  background: var(--pt-surface); border-right: 1px solid var(--pt-border);
  display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin;
}
.dash-brand { padding: 18px 16px; border-bottom: 1px solid var(--pt-border); }
.dash-logo  { height: 30px; }
.dash-nav   { flex: 1; padding: 8px 0; display: flex; flex-direction: column; gap: 1px; }
.dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 16px;
  background: none; border: none; cursor: pointer;
  color: var(--pt-muted); font-size: 13px; font-weight: 500; text-align: left;
  border-radius: 0; transition: background 150ms, color 150ms;
}
.dash-nav-item:hover { background: rgba(0,0,0,0.04); color: var(--pt-text); }
.dash-nav-item.is-active { background: rgba(139,69,19,0.08); color: var(--pt-primary); border-left: 2px solid var(--pt-primary); }
.dash-sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--pt-border); }
.dash-logout-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  color: var(--pt-muted); font-size: 12px; padding: 6px 0;
  transition: color 150ms;
}
.dash-logout-btn:hover { color: var(--pt-error); }

/* ─── Main ────────────────────────────────────────────────────────────────── */
.dash-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.dash-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 52px; flex-shrink: 0;
  background: var(--pt-surface); border-bottom: 1px solid var(--pt-border);
}
.dash-topbar-title { font-family: "Source Serif 4", serif; font-size: 16px; font-weight: 600; }
.dash-topbar-right { display: flex; align-items: center; gap: 16px; }
.dash-credits-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--pt-muted);
  background: var(--pt-bg); padding: 5px 10px; border-radius: 20px;
  border: 1px solid var(--pt-border);
}
.dash-user-email { font-size: 12px; color: var(--pt-muted); }

.dash-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ─── Toast ───────────────────────────────────────────────────────────────── */
.dash-toast-area {
  position: fixed; top: 60px; right: 16px; display: flex;
  flex-direction: column; gap: 8px; z-index: 200; pointer-events: none;
}
.dash-toast {
  background: var(--pt-surface); border: 1px solid var(--pt-border);
  border-radius: 8px; padding: 10px 16px; font-size: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1); pointer-events: all;
  animation: toast-in 250ms ease-out both;
}
.dash-toast.is-error   { border-color: var(--pt-error); }
.dash-toast.is-success { border-color: var(--pt-ok); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ─── Cards & tables ──────────────────────────────────────────────────────── */
.dash-card { background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.dash-card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.dash-stat { background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: 10px; padding: 20px; }
.dash-stat-val { font-family: "Source Serif 4", serif; font-size: 32px; font-weight: 600; color: var(--pt-primary); margin-bottom: 4px; animation: count-in 600ms ease-out; }
.dash-stat-label { font-size: 12px; color: var(--pt-muted); }
@keyframes count-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th, .dash-table td { padding: 10px 12px; text-align: left; font-size: 12px; }
.dash-table th { color: var(--pt-muted); font-weight: 600; border-bottom: 1px solid var(--pt-border); }
.dash-table td { border-bottom: 1px solid rgba(0,0,0,0.04); }
.dash-table tr:hover td { background: rgba(0,0,0,0.02); }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge--green  { background: rgba(34,197,94,0.1);  color: #16A34A; }
.badge--amber  { background: rgba(245,158,11,0.1); color: #D97706; }
.badge--red    { background: rgba(239,68,68,0.1);  color: #DC2626; }
.badge--gray   { background: rgba(0,0,0,0.06);     color: var(--pt-muted); }

/* Forms */
.dash-field   { margin-bottom: 14px; }
.dash-label   { display: block; font-size: 11px; font-weight: 500; color: var(--pt-muted); margin-bottom: 4px; }
.dash-input   { width: 100%; padding: 9px 11px; border: 1px solid var(--pt-border); border-radius: 6px; background: var(--pt-bg); color: var(--pt-text); font-size: 13px; font-family: inherit; transition: border-color 150ms; }
.dash-input:focus { outline: none; border-color: var(--pt-primary); }
.dash-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--pt-border); background: var(--pt-surface); color: var(--pt-text); font-size: 12px; font-weight: 500; cursor: pointer; transition: all 150ms; }
.dash-btn:hover { background: rgba(0,0,0,0.04); }
.dash-btn--primary { background: var(--pt-primary); color: white; border-color: var(--pt-primary); }
.dash-btn--primary:hover { background: #6B3410; }
.dash-btn--sm { padding: 6px 12px; font-size: 11px; }
.dash-btn--danger { color: var(--pt-error); border-color: rgba(239,68,68,0.3); }
.dash-btn--danger:hover { background: rgba(239,68,68,0.08); }

/* Skeleton */
.skeleton { height: 80px; border-radius: 8px; background: linear-gradient(90deg, var(--pt-border) 25%, rgba(0,0,0,0.02) 50%, var(--pt-border) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.dash-skeleton-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* ─── Login overlay ───────────────────────────────────────────────────────── */
.dash-login-overlay { position: fixed; inset: 0; background: rgba(250,250,248,0.98); display: flex; align-items: center; justify-content: center; z-index: 500; }
.dash-login-card { background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: 12px; padding: 36px 32px; width: 360px; box-shadow: 0 16px 48px rgba(0,0,0,0.1); }
.dash-login-error { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.3); border-radius: 6px; padding: 8px 12px; color: var(--pt-error); font-size: 12px; margin-bottom: 14px; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dash-sidebar { display: none; }
  .dash-grid-3  { grid-template-columns: 1fr; }
  .dash-grid-2  { grid-template-columns: 1fr; }
}
