/* ============================================
   happi mum - Monitor Test Guide Site
   Warm, friendly design for moms
   ============================================ */

:root {
  --primary: #e8927c;
  --primary-light: #fce4de;
  --primary-dark: #c56b55;
  --accent: #7bc8a4;
  --accent-light: #d4f0e3;
  --warm-yellow: #f5d76e;
  --warm-yellow-light: #fef9e7;
  --soft-blue: #7ec8e3;
  --soft-blue-light: #e1f3fa;
  --soft-purple: #b39ddb;
  --soft-purple-light: #ede7f6;
  --text: #4a3728;
  --text-light: #7a6b60;
  --bg: #fffaf5;
  --bg-card: #ffffff;
  --border: #f0e6dc;
  --shadow: rgba(139, 107, 80, 0.08);
  --sidebar-w: 300px;
}

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

body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #fff7f0 0%, #fff 100%);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s ease, width .3s ease;
}

/* Sidebar toggle button (PC) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  z-index: 110;
  width: 32px; height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px var(--shadow);
  transition: left .3s ease;
}
@media (min-width: 901px) {
  .sidebar-toggle {
    display: flex;
    left: calc(var(--sidebar-w) - 16px);
  }
  body.sidebar-collapsed .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  body.sidebar-collapsed .main {
    margin-left: 0;
  }
  body.sidebar-collapsed .sidebar-toggle {
    left: 12px;
  }
}
.sidebar-header {
  padding: 24px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--warm-yellow-light) 100%);
}
.sidebar-logo { font-size: 28px; margin-bottom: 4px; }
.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}
.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.nav-section {
  padding: 12px 0 4px;
}
.nav-section-title {
  padding: 0 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: var(--primary-light);
  border-left-color: var(--primary);
}
.nav-item.active {
  background: var(--primary-light);
  border-left-color: var(--primary);
  font-weight: 600;
  color: var(--primary-dark);
}
.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.nav-label { flex: 1; line-height: 1.3; }

/* icon bg colors */
.icon-overview { background: var(--warm-yellow-light); }
.icon-group { background: var(--accent-light); }
.icon-week { background: var(--soft-blue-light); }
.icon-admin { background: var(--soft-purple-light); }
.icon-kpi { background: #fce4ec; }
.icon-system { background: #e8eaf6; }

/* ---- Main Content ---- */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--warm-yellow-light) 50%, var(--accent-light) 100%);
  padding: 60px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: var(--warm-yellow);
  opacity: .12;
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30px; left: -30px;
  width: 160px; height: 160px;
  background: var(--primary);
  opacity: .08;
  border-radius: 50%;
}
.hero-emoji { font-size: 56px; margin-bottom: 12px; }
.hero h1 {
  font-size: 32px;
  color: var(--primary-dark);
  margin-bottom: 8px;
  position: relative;
}
.hero p {
  font-size: 16px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* Content area */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* ---- Page TOC (sticky left index) ---- */
.page-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.toc::-webkit-scrollbar { width: 4px; }
.toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.toc-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 12px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-item {
  display: block;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--text-light);
  text-decoration: none;
  border-left: 2px solid transparent;
  line-height: 1.5;
  cursor: pointer;
  transition: all .12s;
  word-break: break-all;
}
.toc-item:hover {
  color: var(--primary-dark);
  background: var(--primary-light);
  border-left-color: var(--primary);
}
.toc-item.active {
  color: var(--primary-dark);
  font-weight: 600;
  border-left-color: var(--primary);
  background: var(--primary-light);
}
.toc-item.toc-h3 {
  padding-left: 24px;
  font-size: 11.5px;
}
.toc-item.toc-h4 {
  padding-left: 36px;
  font-size: 11px;
}

/* No TOC on index page */
.page-body { min-width: 0; }

/* Article typography */
.article h1 {
  font-size: 28px;
  color: var(--primary-dark);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 12px;
}
.article h2 {
  font-size: 20px;
  color: var(--text);
  margin: 36px 0 16px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--primary-light) 0%, transparent 100%);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
}
.article h3 {
  font-size: 17px;
  color: var(--primary-dark);
  margin: 28px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.article h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text);
}
.article p {
  margin: 12px 0;
  line-height: 1.9;
}
.article strong {
  color: var(--primary-dark);
}
.article hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* Tables */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
}
.article thead th {
  background: var(--primary);
  color: white;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
}
.article tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.article tbody tr:nth-child(even) {
  background: #fdf8f4;
}
.article tbody tr:hover {
  background: var(--primary-light);
}

/* Lists */
.article ul, .article ol {
  margin: 12px 0;
  padding-left: 24px;
}
.article li {
  margin: 6px 0;
  line-height: 1.7;
}
.article li::marker {
  color: var(--primary);
}

/* Checkboxes */
.article input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 8px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.article input[type="checkbox"]:checked {
  background: var(--primary);
}
.article input[type="checkbox"]:checked::after {
  content: '\2713';
  color: white;
  font-size: 12px;
  position: absolute;
  top: 0; left: 3px;
}

/* Blockquotes */
.article blockquote {
  background: var(--warm-yellow-light);
  border-left: 4px solid var(--warm-yellow);
  padding: 16px 20px;
  margin: 16px 0;
  border-radius: 0 12px 12px 0;
  font-size: 14px;
}
.article blockquote p { margin: 4px 0; }

/* Code blocks */
.article pre {
  background: #2d2419;
  color: #f0e6dc;
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
}
.article code {
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--primary-dark);
}
.article pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ---- Index Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px var(--shadow);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(139,107,80,.15);
  border-color: var(--primary);
}
.card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.card-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

/* Section banners on index */
.section-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin: 36px 0 16px;
  background: linear-gradient(90deg, var(--primary-light), transparent);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}
.section-banner-icon { font-size: 28px; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 24px;
}
.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px; height: 48px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  display: none;
  z-index: 200;
  transition: opacity .2s;
}
.back-to-top.show { display: flex; align-items: center; justify-content: center; }

/* Mobile hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  width: 44px; height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 22px;
  cursor: pointer;
  z-index: 150;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  align-items: center;
  justify-content: center;
}
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 90;
}

/* ---- Illustrations (CSS-based) ---- */
.illust-house {
  width: 80px; height: 80px;
  position: relative;
  margin: 0 auto 16px;
}
.illust-house::before {
  content: '';
  position: absolute;
  bottom: 0; left: 10px;
  width: 60px; height: 45px;
  background: var(--warm-yellow-light);
  border: 3px solid var(--warm-yellow);
  border-radius: 4px;
}
.illust-house::after {
  content: '';
  position: absolute;
  top: 5px; left: 0;
  width: 0; height: 0;
  border-left: 40px solid transparent;
  border-right: 40px solid transparent;
  border-bottom: 30px solid var(--primary);
}

/* Progress bar */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 8px 0 24px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width .5s ease;
}

/* ---- Week status badges (sidebar) ---- */
.nav-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
.nav-badge-closed {
  background: #e0e0e0;
  color: #757575;
}
.nav-badge-current {
  background: var(--primary);
  color: white;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}
.nav-item-closed {
  opacity: .55;
}
.nav-item-current {
  background: var(--warm-yellow-light) !important;
  border-left-color: var(--warm-yellow) !important;
  font-weight: 600;
}

/* ---- Card status (index) ---- */
.card-closed {
  opacity: .5;
  filter: grayscale(40%);
}
.card-closed:hover { opacity: .75; }
.card-current {
  border: 2px solid var(--primary) !important;
  box-shadow: 0 4px 20px rgba(232,146,124,.25) !important;
}
.card-badge {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}
.card-badge-closed {
  background: #e0e0e0;
  color: #757575;
}
.card-badge-current {
  background: var(--primary);
  color: white;
}

/* ---- Current week banner (index top) ---- */
.current-week-banner {
  background: linear-gradient(135deg, var(--warm-yellow-light) 0%, var(--primary-light) 100%);
  border: 2px solid var(--primary);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 28px;
}
.current-week-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  border-radius: 12px;
  transition: background .15s;
}
.current-week-link:hover {
  background: rgba(255,255,255,.5);
}

/* ---- Page status banner (detail) ---- */
.page-status-banner {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}
.page-status-closed {
  background: #f5f5f5;
  color: #757575;
  border: 1px solid #e0e0e0;
}
.page-status-current {
  background: linear-gradient(90deg, var(--warm-yellow-light), var(--primary-light));
  color: var(--primary-dark);
  border: 1px solid var(--primary);
}

/* ---- Checklist Memos ---- */
.chk-memo-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  margin-left: 4px;
  border-radius: 4px;
  opacity: .4;
  transition: opacity .15s;
  vertical-align: middle;
}
.chk-memo-btn:hover, .chk-memo-btn.has-memo { opacity: 1; }
.chk-memo-wrap {
  margin: 6px 0 8px 26px;
}
.chk-memo-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fdfaf7;
  min-height: 48px;
  resize: vertical;
  line-height: 1.5;
}
.chk-memo-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}
/* Report card memos */
.report-memos {
  margin-top: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.report-memos summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  padding: 4px 0;
}
.report-memos-list {
  margin-top: 6px;
}
.report-memo-item {
  font-size: 12px;
  padding: 4px 8px;
  margin: 3px 0;
  background: var(--warm-yellow-light);
  border-radius: 6px;
  line-height: 1.5;
}
.report-memo-id {
  display: inline-block;
  background: var(--border);
  color: var(--text-light);
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  margin-right: 6px;
  font-family: monospace;
}

/* ---- Login Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74,55,40,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: white;
  border-radius: 20px;
  padding: 36px 32px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 12px 48px rgba(0,0,0,.2);
}

/* ---- Forms ---- */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fdfaf7;
  transition: border-color .15s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}
.form-group textarea {
  min-height: 80px;
  resize: vertical;
}
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--accent-light);
  color: var(--text);
}
.btn-secondary:hover { background: var(--accent); color: white; }
.btn-warning {
  background: var(--warm-yellow);
  color: var(--text);
}
.btn-warning:hover { background: #e6c85e; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ---- Sidebar User ---- */
.sidebar-user {
  padding: 12px 20px;
  background: var(--accent-light);
  border-bottom: 1px solid var(--border);
}
.sidebar-actions {
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}

/* ---- Report Form ---- */
.report-form {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 12px var(--shadow);
  border: 1px solid var(--border);
  margin: 20px 0;
}
.report-form h2 {
  margin: 0 0 20px;
  background: none;
  padding: 0;
  border: none;
}
.report-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ---- Checklist Progress ---- */
.check-progress {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 16px;
  z-index: 50;
  box-shadow: 0 -2px 12px var(--shadow);
}
.check-progress-bar {
  flex: 1;
  min-width: 120px;
}
.check-progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* ---- Admin Tabs ---- */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.admin-tab {
  padding: 12px 24px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-tab:hover {
  color: var(--primary-dark);
  background: var(--primary-light);
}
.admin-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}
.tab-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}
.admin-tab.active .tab-badge {
  background: var(--primary);
  color: white;
}
.admin-tab-content {
  min-height: 200px;
}

/* ---- Admin Dashboard ---- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  background: var(--primary);
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
}
.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-table tr:hover td { background: var(--primary-light); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}
.badge-admin { background: var(--primary-light); color: var(--primary-dark); }
.badge-tester { background: var(--accent-light); color: #2e7d32; }

/* ---- Admin-only sections hidden in tester view ---- */
.admin-memo { display: none; }
body.view-admin .admin-memo {
  display: block;
  background: #ede7f6;
  border: 1px dashed var(--soft-purple);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
}
body.view-admin .admin-memo::before {
  content: '👑 管理者メモ';
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--soft-purple);
  margin-bottom: 8px;
}

/* Report history cards */
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.report-card-title { font-weight: 600; font-size: 15px; }
.report-card-date { font-size: 12px; color: var(--text-light); }
.report-card-body { font-size: 13px; color: var(--text-light); }
.report-card .badge-giveup { background: var(--warm-yellow-light); color: #e65100; }

/* Print */
@media print {
  .sidebar, .hamburger, .back-to-top, .overlay { display: none !important; }
  .main { margin-left: 0 !important; }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .page-layout {
    grid-template-columns: 180px 1fr;
    gap: 24px;
  }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .overlay.show { display: block; }
  .main { margin-left: 0; }
  .hero { padding: 40px 20px; }
  .hero h1 { font-size: 24px; }
  .content { padding: 24px 16px 60px; }
  .card-grid { grid-template-columns: 1fr; }
  .article h1 { font-size: 22px; }
  .article table { font-size: 12px; }
  .article thead th, .article tbody td { padding: 8px 10px; }
  .page-layout {
    grid-template-columns: 1fr;
  }
  .toc {
    position: relative;
    top: 0;
    max-height: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 0;
    margin-bottom: 8px;
  }
}

/* ==== Bug Report Styles ==== */
.bug-quick-action {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #fff5f5 0%, #fce4ec 100%);
  border: 2px dashed #ef9a9a;
  border-radius: 16px;
  text-decoration: none;
  transition: all .2s;
}
.bug-quick-action:hover {
  border-color: #c62828;
  background: linear-gradient(135deg, #fce4ec 0%, #ffcdd2 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(198,40,40,.15);
}

.bug-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  transition: box-shadow .2s;
}
.bug-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.bug-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}
.bug-ticket-id {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  background: #263238;
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
}
.bug-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.bug-card-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.bug-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bug-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.bug-image-thumb {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.bug-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bug-admin-note {
  background: #fffde7;
  border: 1px solid #fff9c4;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.5;
}

/* Bug Report Form - Image Upload */
.bug-image-upload {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 16px;
  background: #fafafa;
}
.bug-image-dropzone {
  text-align: center;
  padding: 24px 16px;
  cursor: pointer;
  border-radius: 8px;
  transition: all .2s;
  font-size: 14px;
  color: var(--text-light);
}
.bug-image-dropzone:hover,
.bug-image-dropzone.dragover {
  background: #e3f2fd;
  color: var(--primary-dark);
}
.bug-image-previews {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.bug-preview-item {
  position: relative;
  width: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bug-preview-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}
.bug-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bug-preview-name {
  font-size: 10px;
  padding: 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  color: var(--text-light);
}
.bug-admin-actions {
  margin-top: -12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
