/* ═══════════════════════════════════════════════════════════════
   RestaurantAI Intern Portal — Premium Light SaaS Design
   Inspired by Linear, Notion, Stripe — crafted, not generated.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #FAFBFC;
  --bg-white: #FFFFFF;
  --bg-subtle: #F4F5F7;
  --bg-hover: #F0F1F3;
  --bg-sidebar: #FFFFFF;
  --bg-code: #1E1E2E;
  --border: #E2E4E9;
  --border-hover: #C8CCD4;
  --border-focus: #5046E5;
  --accent: #5046E5;
  --accent-light: rgba(80,70,229,0.08);
  --accent-mid: rgba(80,70,229,0.12);
  --accent-text: #4338CA;
  --text: #1A1D26;
  --text-secondary: #5E6278;
  --text-muted: #9CA3B4;
  --text-inverse: #FFFFFF;
  --green: #16A34A;
  --green-bg: rgba(22,163,74,0.08);
  --red: #DC2626;
  --red-bg: rgba(220,38,38,0.06);
  --amber: #D97706;
  --amber-bg: rgba(217,119,6,0.07);
  --cyan: #0891B2;
  --cyan-bg: rgba(8,145,178,0.07);
  --sidebar-w: 260px;
  --topbar-h: 54px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  overflow-x: hidden;
  min-height: 100vh;
}
::selection { background: var(--accent); color: var(--text-inverse); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ── Sidebar ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
  overflow: hidden;
}
.sidebar-header {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.6rem; }
.logo-text h1 { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; line-height: 1.2; }
.logo-subtitle { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 500; }

.sidebar-search { padding: 10px 14px; }
.sidebar-search input {
  width: 100%; padding: 7px 10px 7px 10px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 13px; outline: none; transition: var(--transition);
  font-family: var(--font);
}
.sidebar-search input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(80,70,229,0.1); }
.sidebar-search input::placeholder { color: var(--text-muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 0; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 18px; cursor: pointer; color: var(--text-secondary);
  transition: var(--transition); border-left: 2px solid transparent;
  font-size: 13px; font-weight: 500; user-select: none;
}
.nav-item:hover { background: var(--bg-subtle); color: var(--text); }
.nav-item.active {
  background: var(--accent-light); color: var(--accent-text);
  border-left-color: var(--accent);
  font-weight: 600;
}
.nav-item .nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-chevron { font-size: 9px; transition: transform var(--transition); color: var(--text-muted); }
.nav-item .nav-chevron.open { transform: rotate(90deg); }

.nav-sub { overflow: hidden; max-height: 0; transition: max-height 0.35s ease; }
.nav-sub.open { max-height: 600px; }
.nav-sub .nav-item { padding-left: 44px; font-size: 12.5px; font-weight: 450; }

.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--border); }
.footer-badge { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--green); font-weight: 500; }
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0.3); }
  50% { box-shadow: 0 0 0 4px rgba(22,163,74,0); }
}
.footer-version { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.25);
  z-index: 99; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { opacity: 1; pointer-events: all; }

/* ── Main Content ── */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin-left 0.25s ease; }

/* ── Top Bar ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  background: rgba(250,251,252,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 6px; flex-direction: column; gap: 4px; }
.hamburger span { display: block; width: 18px; height: 1.5px; background: var(--text); border-radius: 2px; transition: var(--transition); }
.topbar-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.breadcrumb-home { color: var(--text-muted); font-weight: 400; }
.breadcrumb-current { color: var(--text); font-weight: 600; }

.topbar-actions { margin-left: auto; }
.progress-indicator { display: flex; align-items: center; gap: 8px; }
.progress-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.progress-bar-mini { width: 80px; height: 3px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar-mini-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.5s ease; width: 0%; }
.progress-count { font-size: 11px; color: var(--accent-text); font-weight: 600; }

/* ── Content Area ── */
.content-area { padding: 28px; max-width: 960px; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Cards ── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-header h2 { margin-bottom: 0; font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.card-header h3 { margin-bottom: 0; }

/* ── Typography ── */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
h1 { font-size: 22px; }
h2 { font-size: 16px; margin-bottom: 12px; }
h3 { font-size: 14px; margin-bottom: 10px; }
.gradient-text { color: var(--text); }
p { color: var(--text-secondary); }
strong { color: var(--text); font-weight: 600; }

/* ── Hero ── */
.hero {
  text-align: center; padding: 40px 24px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #7C3AED, #0891B2);
}
.hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); margin-bottom: 8px; }
.hero p { font-size: 14px; color: var(--text-secondary); max-width: 520px; margin: 0 auto; }

.mission-card {
  background: var(--amber-bg);
  border: 1px solid rgba(217,119,6,0.15);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin: 20px 0;
}
.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px; text-align: center;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-number { font-size: 24px; font-weight: 800; color: var(--text); display: block; margin-bottom: 2px; letter-spacing: -0.5px; }
.stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* ── Tables ── */
.table-wrapper { overflow-x: auto; margin: 12px 0; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--bg-subtle); }
th { padding: 10px 14px; text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 10px 14px; border-bottom: 1px solid var(--bg-subtle); color: var(--text-secondary); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-hover); }

/* ── Code Blocks ── */
.code-block {
  background: var(--bg-code); border: 1px solid #2D2D3F;
  border-radius: var(--radius); padding: 16px 18px; margin: 12px 0;
  overflow-x: auto; position: relative;
  font-family: var(--font-mono); font-size: 12px;
  line-height: 1.65; color: #D4D4D8;
}
.code-block .copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  color: #9CA3AF; padding: 3px 8px;
  border-radius: 4px; cursor: pointer; font-size: 10px;
  transition: var(--transition); font-family: var(--font);
}
.code-block .copy-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.code-block pre { margin: 0; white-space: pre-wrap; word-break: break-word; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-smart { background: var(--accent-light); color: var(--accent-text); }
.badge-basic { background: var(--cyan-bg); color: var(--cyan); }
.badge-tool { background: var(--green-bg); color: var(--green); }
.badge-danger { background: var(--red-bg); color: var(--red); }
.badge-warning { background: var(--amber-bg); color: var(--amber); }

/* ── Task Checkboxes ── */
.task-list { list-style: none; }
.task-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 0; transition: var(--transition);
}
.task-check {
  width: 16px; height: 16px; border: 1.5px solid #CBD5E1;
  border-radius: 3px; cursor: pointer; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.task-check:hover { border-color: var(--accent); }
.task-check.checked { background: var(--accent); border-color: var(--accent); }
.task-check.checked::after { content: '✓'; color: var(--text-inverse); font-size: 10px; font-weight: 700; }
.task-item.done .task-text { text-decoration: line-through; color: var(--text-muted); }
.task-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ── Progress Bar ── */
.progress-bar-container { margin: 16px 0; }
.progress-bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.progress-bar-label span:first-child { color: var(--text-secondary); }
.progress-bar-label span:last-child { color: var(--accent-text); font-weight: 600; }
.progress-bar { height: 6px; background: var(--bg-subtle); border-radius: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width 0.5s ease; }

/* ── Day Cards ── */
.day-card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.day-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}
.day-header:hover { background: var(--bg-subtle); }
.day-number {
  background: var(--accent); color: var(--text-inverse);
  font-weight: 700; font-size: 11px;
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.day-title { font-weight: 600; font-size: 13px; flex: 1; color: var(--text); }
.day-chevron { color: var(--text-muted); transition: transform var(--transition); font-size: 12px; }
.day-chevron.open { transform: rotate(180deg); }
.day-body { padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.2s ease; }
.day-body.open { max-height: 2000px; padding: 14px 16px; border-top: 1px solid var(--border); }

.day-section-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted); margin: 10px 0 6px; font-weight: 700;
}
.eod-deliverable {
  background: var(--green-bg);
  border: 1px solid rgba(22,163,74,0.12);
  border-radius: var(--radius-sm);
  padding: 10px 14px; margin-top: 10px;
  font-size: 13px;
}
.eod-deliverable strong { color: var(--green); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Architecture ── */
.arch-diagram { display: flex; flex-direction: column; gap: 12px; padding: 20px 0; }
.arch-layer { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.arch-box {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px;
  text-align: center; transition: var(--transition);
  cursor: default; min-width: 120px;
}
.arch-box:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.arch-box .arch-label { font-weight: 600; font-size: 12px; color: var(--text); }
.arch-box .arch-desc { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.arch-arrow { color: var(--text-muted); font-size: 14px; }
.arch-layer-label { font-size: 9px; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); width: 90px; flex-shrink: 0; font-weight: 700; }
.arch-connector { text-align: center; color: var(--text-muted); font-size: 16px; }

/* ── Module ── */
.module-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.module-icon { font-size: 2rem; }
.module-meta { color: var(--text-secondary); font-size: 13px; }

/* ── Tool Cards ── */
.tool-card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  margin-bottom: 12px; transition: var(--transition);
}
.tool-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-xs); }
.tool-card h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tool-card .tool-why {
  margin: 10px 0; padding: 10px 12px;
  background: var(--bg-subtle); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary);
}

/* ── Rules ── */
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rules-col h3 { margin-bottom: 12px; font-size: 14px; }
.rule-item {
  display: flex; gap: 8px; padding: 5px 0;
  font-size: 13px; color: var(--text-secondary);
}
.rule-icon { flex-shrink: 0; font-size: 13px; }

/* ── MCP Compare ── */
.mcp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.mcp-col { padding: 16px; border-radius: var(--radius); font-size: 13px; }
.mcp-col.without { background: var(--red-bg); border: 1px solid rgba(220,38,38,0.1); }
.mcp-col.with { background: var(--green-bg); border: 1px solid rgba(22,163,74,0.1); }
.mcp-col h4 { margin-bottom: 8px; font-size: 13px; }

/* ── Intern Profile ── */
.intern-profile {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; margin-bottom: 20px;
  background: var(--bg-white);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.intern-avatar {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: var(--text-inverse); flex-shrink: 0;
}
.intern-info h2 { margin-bottom: 1px; font-size: 15px; }
.intern-info .north-star { color: var(--text-secondary); font-style: italic; font-size: 12.5px; }
.intern-tools { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }

/* ── DB Grid ── */
.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.db-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: var(--transition); }
.db-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-xs); }
.db-card h4 { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--text); }
.db-field { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
.db-field-name { color: var(--text); font-family: var(--font-mono); font-size: 11.5px; }
.db-field-type { color: var(--text-muted); font-family: var(--font-mono); font-size: 10.5px; }
.db-fk { color: var(--accent-text); font-size: 11px; margin-top: 6px; }

/* ── Hierarchy ── */
.hierarchy { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0; }
.hierarchy-node { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 16px; text-align: center; font-size: 13px; }
.hierarchy-node.lead { border-color: var(--accent); background: var(--accent-light); font-weight: 600; }
.hierarchy-connector { color: var(--text-muted); font-size: 14px; }

/* ── Sprint ── */
.sprint-week { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--bg-subtle); }
.sprint-week:last-child { border-bottom: none; }
.week-badge {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; flex-shrink: 0;
  background: var(--accent); color: var(--text-inverse);
}
.week-content { flex: 1; }
.week-theme { font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--text); }
.week-details { font-size: 12.5px; color: var(--text-secondary); }

/* ── Scroll to Top ── */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-white); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  font-size: 16px;
}
.scroll-top.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.scroll-top:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-md); }

/* ── Utilities ── */
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 13px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .content-area { padding: 20px 14px; }
  .hero h1 { font-size: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .rules-grid { grid-template-columns: 1fr; }
  .mcp-compare { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .arch-layer { flex-direction: column; }
  .arch-layer-label { width: auto; text-align: center; }
  .intern-profile { flex-direction: column; text-align: center; }
  .db-grid { grid-template-columns: 1fr; }
}

/* ── Print ── */
@media print {
  .sidebar, .topbar, .scroll-top, .hamburger, .sidebar-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .card { break-inside: avoid; }
  body { background: #fff; }
}
