/* ExcelCare Webapp — Documentation Stylesheet */
:root {
  --brand: #1d6fa4;
  --brand-dark: #145480;
  --accent: #2ecc71;
  --warn: #e67e22;
  --danger: #e74c3c;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #dde3ea;
  --text: #1a2332;
  --muted: #64748b;
  --code-bg: #1e293b;
  --code-text: #e2e8f0;
  --nav-width: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Sidebar nav ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}
.sidebar .logo {
  padding: 24px 20px 16px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.sidebar .logo span { color: #7dd3fc; }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a {
  display: block;
  padding: 9px 20px;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,0.1);
  border-left-color: #7dd3fc;
  color: #fff;
}
.sidebar nav .section-label {
  padding: 18px 20px 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.45);
}
.sidebar .footer-note {
  padding: 16px 20px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ── Main content ── */
.main {
  margin-left: 260px;
  flex: 1;
  max-width: 960px;
  padding: 48px 48px 80px;
}

/* ── Typography ── */
h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; color: var(--brand-dark); }
h1 .subtitle { font-size: 1rem; font-weight: 400; color: var(--muted); display: block; margin-top: 4px; }
h2 { font-size: 1.35rem; font-weight: 700; margin: 40px 0 12px; color: var(--brand); border-bottom: 2px solid var(--border); padding-bottom: 6px; }
h3 { font-size: 1.05rem; font-weight: 600; margin: 28px 0 8px; color: var(--text); }
h4 { font-size: 0.95rem; font-weight: 600; margin: 20px 0 6px; color: var(--text); }
p { margin-bottom: 14px; }
ul, ol { margin: 0 0 14px 24px; }
li { margin-bottom: 6px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; }

/* ── Code blocks ── */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  padding: 18px 20px;
  font-size: 0.82rem;
  overflow-x: auto;
  margin: 12px 0 20px;
  line-height: 1.6;
}
code {
  background: #e8edf3;
  color: #c0392b;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.85em;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
}
pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* ── Callout boxes ── */
.callout {
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.92rem;
}
.callout .icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.callout.info { background: #eff6ff; border-left: 4px solid #3b82f6; }
.callout.warn { background: #fffbeb; border-left: 4px solid var(--warn); }
.callout.danger { background: #fef2f2; border-left: 4px solid var(--danger); }
.callout.success { background: #f0fdf4; border-left: 4px solid var(--accent); }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 0.9rem; }
th { background: var(--brand); color: #fff; padding: 10px 14px; text-align: left; font-weight: 600; }
td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:nth-child(even) td { background: #f0f4f8; }

/* ── Step list ── */
.steps { counter-reset: step; list-style: none; margin: 16px 0 24px; padding: 0; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.steps li::before {
  content: counter(step);
  background: var(--brand);
  color: #fff;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.steps li .content { flex: 1; }

/* ── OS tabs ── */
.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 0; }
.tab-btn {
  padding: 8px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  font-weight: 500;
}
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-pane { display: none; padding: 20px 0; }
.tab-pane.active { display: block; }

/* ── Cards ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 20px 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); text-decoration: none; }
.card .icon { font-size: 2rem; margin-bottom: 10px; }
.card h3 { margin: 0 0 6px; font-size: 1rem; color: var(--brand); }
.card p { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* ── Page header strip ── */
.page-header {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: white;
  padding: 32px 40px;
  border-radius: 12px;
  margin-bottom: 36px;
}
.page-header h1 { color: white; margin-bottom: 6px; }
.page-header p { color: rgba(255,255,255,0.8); margin: 0; font-size: 1rem; }

/* ── Breadcrumb ── */
.breadcrumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--brand); }

/* ── Tag pills ── */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
}
.pill.mac { background: #dbeafe; color: #1e40af; }
.pill.win { background: #ede9fe; color: #5b21b6; }
.pill.both { background: #dcfce7; color: #166534; }

/* ── Top search bar (rendered on every page) ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
  margin-left: 260px;
  padding: 10px 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.topbar form {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.15s;
  width: 300px;
}
.topbar form:focus-within { border-color: var(--brand); background: #fff; }
.topbar form input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  color: var(--text);
  min-width: 0;
}
.topbar form button {
  border: none;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s;
}
.topbar form button:hover { background: var(--brand-dark); }

@media (max-width: 768px) {
  .topbar { margin-left: 0; padding: 10px 16px; }
  .topbar form { width: 100%; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .sidebar nav {
    max-height: 48vh;
    overflow-y: auto;
  }
  .sidebar .footer-note {
    display: none;
  }
  .main { margin-left: 0; padding: 24px 20px 60px; }
}

/* ── Login page ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.login-logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
}
.login-logo span { color: var(--text); }
.login-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}
.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #dc2626;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label { font-size: 13px; font-weight: 600; color: var(--text); }
.login-field input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}
.login-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29,111,164,0.12);
}
.login-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 11px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.login-btn:hover { background: var(--brand-dark); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Sidebar sign-out button ── */
.sidebar-signout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 12px 16px 0;
  padding: 8px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.sidebar-signout:hover {
  color: var(--danger);
  background: rgba(231,76,60,0.06);
  border-color: rgba(231,76,60,0.25);
}
