/* ==========================================================================
   نظام التصميم والتنسيق — قراءة الخطة البرمجية لمنصة SHBKNY
   Design System & Modern RTL Theme (Dark / Light Mode)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Tajawal:wght@400;500;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-body: #0a0d14;
  --bg-surface: #111622;
  --bg-surface-elevated: #161e30;
  --bg-surface-glass: rgba(17, 22, 34, 0.85);
  --border-subtle: #1e283d;
  --border-strong: #2c3a57;
  --border-glow: rgba(59, 130, 246, 0.25);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-link: #38bdf8;
  --text-link-hover: #7dd3fc;

  /* Domain / Semantic Colors */
  --color-primary: #3b82f6;
  --color-primary-rgb: 59, 130, 246;
  --color-accent: #6366f1;
  --color-backend: #0ea5e9;
  --color-frontend: #a855f7;
  --color-financial: #10b981;
  --color-security: #f43f5e;
  --color-warning: #f59e0b;
  --color-info: #06b6d4;

  /* Code Block Colors */
  --code-bg: #07090e;
  --code-border: #1a2234;
  --code-header-bg: #0d121c;
  --code-text: #e2e8f0;

  /* Typography */
  --font-heading: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-body: 'Tajawal', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Layout */
  --sidebar-width: 320px;
  --header-height: 70px;
  --content-max-width: 1040px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.18);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-glass: rgba(255, 255, 255, 0.88);
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-glow: rgba(59, 130, 246, 0.15);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-link: #0284c7;
  --text-link-hover: #0369a1;

  --code-bg: #1e293b;
  --code-border: #334155;
  --code-header-bg: #0f172a;
  --code-text: #f8fafc;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 26px -4px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.12);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  font-size: 16px;
  direction: rtl;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* Background Atmospheric Glow */
body::before {
  content: "";
  position: fixed;
  top: 0;
  right: 20%;
  width: 600px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, rgba(99, 102, 241, 0.03) 50%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  bottom: 0;
  left: 10%;
  width: 500px;
  height: 450px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.04) 0%, rgba(168, 85, 247, 0.03) 60%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* Selection */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Top Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3.5px;
  background: linear-gradient(90deg, var(--color-frontend), var(--color-primary), var(--color-financial));
  z-index: 1000;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 999;
  height: var(--header-height);
  background: var(--bg-surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  transition: all var(--transition-normal);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #ffffff;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.header-title-group h1 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.header-title-group .doc-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* Header Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 220px;
  height: 38px;
  padding: 0 2.2rem 0 0.8rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  width: 290px;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.btn-icon {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--bg-surface);
  transform: translateY(-1px);
}

.btn-text-action {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  border: none;
  height: 38px;
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all var(--transition-fast);
}

.btn-text-action:hover {
  opacity: 0.93;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* App Main Layout */
.app-container {
  display: flex;
  max-width: 1540px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

/* Sidebar / Table of Contents */
.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  max-height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;
  padding-left: 0.5rem;
  scrollbar-width: thin;
}

.toc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.toc-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-right: 2.5px solid transparent;
}

.toc-item a:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.toc-item.active a {
  color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
  font-weight: 700;
  border-right-color: var(--color-primary);
}

.toc-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
}

/* Quick Stats Bar */
.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-icon.blue { background: rgba(14, 165, 233, 0.12); color: var(--color-backend); }
.stat-icon.purple { background: rgba(168, 85, 247, 0.12); color: var(--color-frontend); }
.stat-icon.green { background: rgba(16, 185, 129, 0.12); color: var(--color-financial); }
.stat-icon.red { background: rgba(244, 63, 94, 0.12); color: var(--color-security); }

.stat-info .stat-num {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Main Content Area */
.app-content {
  flex: 1;
  min-width: 0;
}

.document-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow-md);
}

/* Typography Inside Document */
.doc-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Callout / Reference Box */
.callout-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-right: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.callout-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.callout-item:last-child {
  margin-bottom: 0;
}

.callout-tag {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Section Headings */
.section-block {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  scroll-margin-top: 90px;
}

.section-block:first-of-type {
  margin-top: 1.5rem;
  border-top: none;
}

.section-h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: 800;
  border: 1px solid var(--border-subtle);
}

.section-h3 {
  font-family: var(--font-heading);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
}

p, li {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}

ul, ol {
  padding-right: 1.75rem;
  margin-bottom: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
}

strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Custom Highlight Badges */
.pill-tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  direction: ltr;
}

.pill-tag.blue { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.pill-tag.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.3); }
.pill-tag.green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.pill-tag.red { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(251, 113, 133, 0.3); }
.pill-tag.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }

/* Interactive Note Cards */
.note-card {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
  border-right: 4px solid var(--color-backend);
}

.note-card.immutable {
  border-right-color: var(--color-financial);
  background: rgba(16, 185, 129, 0.05);
}

.note-card.security {
  border-right-color: var(--color-security);
  background: rgba(244, 63, 94, 0.05);
}

/* Code Blocks Styling */
.code-container {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  margin: 1.25rem 0 1.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  direction: ltr;
  text-align: left;
}

.code-header {
  background: var(--code-header-bg);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--code-border);
}

.code-lang-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-lang-tag::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
}

.btn-copy-code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-copy-code.copied {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--code-text);
  tab-size: 2;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

/* Inline Code */
p code, li code, td code {
  background: var(--bg-surface-elevated);
  color: var(--text-link);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  direction: ltr;
  display: inline-block;
}

/* Tables Styling */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.94rem;
}

thead {
  background: var(--bg-surface-elevated);
  border-bottom: 2px solid var(--border-strong);
}

th {
  padding: 0.9rem 1.25rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

/* Monorepo Directory Tree View */
.directory-tree {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.8;
  color: #cbd5e1;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}

.tree-folder {
  color: #38bdf8;
  font-weight: 600;
}

.tree-comment {
  color: #64748b;
  font-style: italic;
}

.tree-phase {
  color: #fbbf24;
  font-weight: 600;
}

/* Interactive Checklist (Security Section 5) */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0 2rem;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.checklist-item:hover {
  border-color: var(--color-security);
  background: rgba(244, 63, 94, 0.03);
}

.checklist-item.checked {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.checklist-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--color-financial);
  cursor: pointer;
}

.checklist-item.checked .checklist-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* State Machine Flow Diagram Cards */
.state-machine-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1rem 0;
}

.state-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  direction: ltr;
  margin-bottom: 0.5rem;
}

.state-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 600;
}

.state-arrow {
  color: var(--text-muted);
  font-weight: 700;
}

/* Password Protection Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 20, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.auth-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.auth-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  text-align: center;
  letter-spacing: 2px;
}

.auth-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-btn {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.auth-error {
  color: var(--color-security);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
}

/* Print Styles */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-header, .app-sidebar, .reading-progress-bar, .btn-copy-code, .header-actions, .auth-overlay {
    display: none !important;
  }
  .app-container {
    padding: 0;
    max-width: 100%;
  }
  .document-card {
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .code-container, .table-wrapper {
    break-inside: avoid;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
  .app-sidebar {
    display: none;
  }
  .app-sidebar.mobile-open {
    display: block;
    position: fixed;
    top: var(--header-height);
    right: 0;
    left: 0;
    width: 100%;
    max-height: calc(100vh - var(--header-height));
    z-index: 990;
    background: var(--bg-surface);
    padding: 1.5rem;
  }
  .document-card {
    padding: 1.75rem;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0 1rem;
  }
  .search-input {
    width: 140px;
  }
  .search-input:focus {
    width: 180px;
  }
  .doc-title {
    font-size: 1.5rem;
  }
  .quick-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}
