/* ==========================================================================
   BIOMATE ADMIN USER GUIDE - DESIGN SYSTEM & STYLESHEET
   Brand Colors: Forest Green (#004832), Success Green (#27C25A), Cream (#F6F2E6)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap");

:root {
  /* Brand Color Tokens */
  --color-forest: #004832;
  --color-forest-dark: #003323;
  --color-forest-light: #006647;
  --color-forest-surface: #e6f0ed;

  --color-success: #27c25a;
  --color-success-light: #e9f9ee;

  --color-cream: #f6f2e6;
  --color-cream-dark: #ebd9c0;

  --color-gold: #d97706;
  --color-gold-light: #fef3c7;

  --color-danger: #ef4444;
  --color-danger-light: #fee2e2;

  --color-info: #3b82f6;
  --color-info-light: #dbeafe;

  /* Neutral Tokens */
  --bg-main: #f6f2e6;
  --bg-surface: #ffffff;
  --bg-sidebar: #004832;
  --bg-card: #ffffff;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-on-dark: #f8fafc;

  --border-color: #e2e8f0;
  --border-dark: rgba(255, 255, 255, 0.12);

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 20px rgba(39, 194, 90, 0.25);

  /* Layout Dimensions */
  --sidebar-width: 310px;
  --header-height: 72px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

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

/* Dark Mode Overrides */
[data-theme="dark"] {
  --bg-main: #0a0f0d;
  --bg-surface: #121a16;
  --bg-card: #16221c;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #23352b;
  --color-forest-surface: #122c22;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family:
    "Plus Jakarta Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

.app-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* SIDEBAR NAVIGATION */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-on-dark);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border-dark);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-logo-badge {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--color-success), #1fa74c);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(39, 194, 90, 0.3);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: white;
}

.brand-subtitle {
  font-size: 11px;
  color: #a3c4b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.search-box {
  position: relative;
  margin-top: 8px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: white;
  font-size: 13.5px;
  outline: none;
  transition: var(--transition-fast);
}

.search-box input::placeholder {
  color: #88b3a3;
}

.search-box input:focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(39, 194, 90, 0.2);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #88b3a3;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* NAV MENU */
.nav-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-scrollable::-webkit-scrollbar {
  width: 5px;
}

.nav-scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #76a896;
  padding: 12px 12px 6px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #d1e5dd;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-item a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-item.active a {
  background: linear-gradient(90deg, rgba(39, 194, 90, 0.22), rgba(39, 194, 90, 0.05));
  border-left: 3.5px solid var(--color-success);
  color: white;
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #76a896;
}

.nav-item.active svg,
.nav-item a:hover svg {
  color: var(--color-success);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
}

.theme-toggle,
.print-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition-fast);
}

.theme-toggle:hover,
.print-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* MAIN CONTENT AREA */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
}

.content-header {
  margin-bottom: 40px;
  background: var(--bg-card);
  padding: 32px 36px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.content-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-forest), var(--color-success));
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--color-forest-surface);
  color: var(--color-forest);
  font-weight: 700;
  font-size: 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.header-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-forest);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.header-description {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 800px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-forest-surface);
  color: var(--color-forest);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-val {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
}

/* SECTION CARD STYLES */
.doc-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 32px;
  transition: var(--transition-normal);
  scroll-margin-top: 30px;
}

.doc-section:hover {
  box-shadow: var(--shadow-md);
}

.section-header-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--color-forest-surface);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-forest), var(--color-forest-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 72, 50, 0.2);
}

.section-title-wrap h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-forest);
}

.perm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  font-family: "Fira Code", monospace;
}

/* ACCORDIONS / STEPS */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.step-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.step-card:hover {
  border-color: var(--color-forest);
  background: var(--bg-surface);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-forest);
  color: white;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-body {
  flex: 1;
}

.step-body h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.step-body p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* CALLOUT BOXES */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 14px;
}

.callout-info {
  background: var(--color-info-light);
  border-left: 4px solid var(--color-info);
  color: #1e40af;
}

.callout-warning {
  background: var(--color-gold-light);
  border-left: 4px solid var(--color-gold);
  color: #92400e;
}

.callout-success {
  background: var(--color-success-light);
  border-left: 4px solid var(--color-success);
  color: #14532d;
}

.callout svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* DATA TABLE STYLES */
.table-responsive {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.doc-table th {
  background: var(--color-forest-surface);
  color: var(--color-forest);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.doc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table tr:hover td {
  background: rgba(0, 72, 50, 0.02);
}

/* DIRECT LINK BUTTON */
.btn-direct-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-forest);
  color: white;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition-fast);
  margin-top: 12px;
}

.btn-direct-link:hover {
  background: var(--color-forest-dark);
  box-shadow: var(--shadow-sm);
}

/* SEARCH HIGHLIGHT */
mark.highlight {
  background-color: #fef08a;
  color: #854d0e;
  padding: 2px 4px;
  border-radius: 3px;
}

.hidden-by-search {
  display: none !important;
}

/* MOBILE TOGGLE */
.mobile-menu-btn {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-forest);
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 200;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   PRINT STYLES (@media print)
   ========================================================================== */
@media print {
  .sidebar,
  .sidebar-footer,
  .mobile-menu-btn,
  .btn-direct-link,
  .search-box {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .doc-section {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
    margin-bottom: 24px !important;
  }

  body {
    background: white !important;
    color: black !important;
  }
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 24px 20px;
  }

  .mobile-menu-btn {
    display: flex;
  }
}
