/* TAKTARI Shared Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0a0a0a; --fg: #fafafa; --muted: #888;
  --accent: #FBBF24; --accent-text: #0a0a0a; --border: #222; --card-bg: #111;
  --success: #10b981; --warning: #FB923C; --danger: #ef4444;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--fg); min-height: 100vh;
}

/* Header + Nav */
header {
  padding: 1rem 2rem; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.logo { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.logo a { color: var(--fg); text-decoration: none; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 0.875rem;
  padding: 0.25rem 0; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.active { color: var(--fg); border-bottom-color: var(--accent); }
.header-actions { display: flex; gap: 0.75rem; align-items: center; }
.header-actions span { color: var(--muted); font-size: 0.875rem; }
.btn-logout, .btn-nav {
  padding: 0.5rem 1rem; background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.875rem; cursor: pointer;
}
.btn-logout:hover, .btn-nav:hover { border-color: var(--accent); color: var(--fg); }

/* Layout */
main { max-width: 1200px; margin: 0 auto; padding: 2rem; }
h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.subtitle { color: var(--muted); margin-bottom: 2rem; }
.section { margin-bottom: 2rem; }

/* Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem;
}
.card-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.card-value { font-size: 1.5rem; font-weight: 700; }
.card-sub { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.card-clickable { cursor: pointer; transition: border-color 0.2s; }
.card-clickable:hover { border-color: var(--accent); }

/* Buttons */
.btn-primary {
  padding: 0.75rem 1.5rem; border-radius: 8px; border: none;
  background: var(--accent); color: white; font-size: 0.875rem;
  font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  padding: 0.75rem 1.5rem; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--fg); font-size: 0.875rem; cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
.btn-danger { background: #7f1d1d; color: #fca5a5; }
.btn-success { background: #065f46; color: #6ee7b7; }

/* Score badges */
.score-badge {
  display: inline-block; padding: 0.15rem 0.5rem;
  border-radius: 4px; font-size: 0.75rem; font-weight: 600;
}
.score-high { background: #065f46; color: #6ee7b7; }
.score-mid { background: #78350f; color: #fcd34d; }
.score-low { background: #7f1d1d; color: #fca5a5; }

/* Stage colors */
.stage-0 { border-left: 3px solid #6b7280; }
.stage-1 { border-left: 3px solid #8b5cf6; }
.stage-2 { border-left: 3px solid #3b82f6; }
.stage-3 { border-left: 3px solid #f59e0b; }
.stage-4 { border-left: 3px solid #10b981; }
.stage-5 { border-left: 3px solid #ef4444; }
.stage-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.5rem; }
.stage-dot-0 { background: #6b7280; }
.stage-dot-1 { background: #8b5cf6; }
.stage-dot-2 { background: #3b82f6; }
.stage-dot-3 { background: #f59e0b; }
.stage-dot-4 { background: #10b981; }
.stage-dot-5 { background: #ef4444; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.75rem; padding-bottom: 1rem; }
.kanban-column { min-width: 0; }
.kanban-header {
  font-size: 0.7rem; text-transform: uppercase; color: var(--muted);
  letter-spacing: 0.05em; margin-bottom: 0.75rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.kanban-header .count { font-weight: 700; color: var(--fg); margin-left: 0.25rem; }
.kanban-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.75rem; margin-bottom: 0.5rem;
  cursor: pointer; transition: border-color 0.2s;
}
.kanban-card:hover { border-color: var(--accent); }
.kanban-card-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.25rem; }
.kanban-card-meta { font-size: 0.7rem; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }

/* Progress bar */
.progress-bar { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1.5rem; }
.progress-step {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; border: 2px solid var(--border);
  color: var(--muted); transition: all 0.3s;
}
.progress-step.active { border-color: var(--accent); color: var(--accent); background: rgba(59, 130, 246, 0.1); }
.progress-step.completed { border-color: var(--success); color: var(--success); background: rgba(16, 185, 129, 0.1); }
.progress-line { flex: 1; height: 2px; background: var(--border); }
.progress-line.completed { background: var(--success); }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tab {
  padding: 0.75rem 1.25rem; cursor: pointer; font-size: 0.875rem;
  color: var(--muted); border-bottom: 2px solid transparent;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.25rem; text-transform: uppercase; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.6rem 0.8rem; background: #1a1a1a;
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--fg); font-size: 0.875rem; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--accent);
}
.form-group textarea { min-height: 80px; resize: vertical; }

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 100; display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 2rem; max-width: 500px; width: 90%;
}
.modal h3 { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* Toast */
.toast {
  position: fixed; top: 1rem; right: 1rem;
  padding: 1rem 1.5rem; border-radius: 8px;
  font-size: 0.875rem; font-weight: 500;
  z-index: 1000; opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.success { background: #065f46; color: #6ee7b7; }
.toast.error { background: #7f1d1d; color: #fca5a5; }

/* Evolution level circle */
.evo-circle {
  width: 120px; height: 120px; border-radius: 50%; position: relative;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  border: 4px solid var(--border);
}
.evo-circle .level { font-size: 2rem; font-weight: 800; line-height: 1; }
.evo-circle .stage { font-size: 0.65rem; color: var(--muted); text-align: center; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.data-table th { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; }
.data-table tr:hover { background: rgba(255,255,255,0.02); }

/* States */
.loading { color: var(--muted); text-align: center; padding: 2rem; }
.error { color: #ef4444; text-align: center; padding: 2rem; }
.empty-state { color: var(--muted); text-align: center; padding: 2rem; font-size: 0.875rem; }

/* Responsive */
@media (max-width: 768px) {
  main { padding: 1rem; }
  .grid { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .kanban-column { min-width: unset; }
  .nav-links { gap: 0.75rem; }
  .nav-links a { font-size: 0.75rem; }
  header { padding: 0.75rem 1rem; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}
