/* Base Styles for Printable Notepad Templates */
:root {
  --primary-color: #1a1a1a;
  --secondary-color: #666;
  --border-color: #333;
  --light-border: #ccc;
  --accent-color: #0066cc;
  --bg-light: #f9f9f9;
  --page-padding-x: 0.5in;
  --page-padding-top: 0.5in;
  --page-padding-bottom: 0.6in;
}

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

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10pt;
  line-height: 1.4;
  color: var(--primary-color);
  background: #eee;
}

/* Page Container */
.page {
  width: 8.5in;
  min-height: 11in;
  max-height: 11in;
  padding: var(--page-padding-top) var(--page-padding-x) var(--page-padding-bottom);
  margin: 0.5in auto;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Header Styles */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.12in;
  margin-bottom: 0.15in;
}

.page-title {
  font-size: 16pt;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.page-subtitle {
  font-size: 8pt;
  color: var(--secondary-color);
  margin-top: 2px;
}

.page-meta {
  text-align: right;
  font-size: 8pt;
}

.meta-field {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1in;
  margin-bottom: 4px;
}

.meta-label {
  color: var(--secondary-color);
}

.meta-input {
  border-bottom: 1px solid var(--light-border);
  min-width: 1.5in;
  height: 14px;
}

/* Section Styles */
.section {
  margin-bottom: 0.12in;
}

.section-header {
  font-size: 9pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--secondary-color);
  margin-bottom: 0.06in;
}

.section-content {
  padding-left: 0.1in;
}

/* Input Lines */
.input-line {
  border-bottom: 1px solid var(--light-border);
  height: 0.22in;
  margin-bottom: 2px;
}

.input-line.tall {
  height: 0.3in;
}

.input-area {
  border: 1px solid var(--light-border);
  min-height: 0.75in;
  padding: 0.05in;
}

/* Checkbox Items */
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.1in;
  margin-bottom: 0.08in;
}

.checkbox {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--border-color);
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-label {
  flex: 1;
  font-size: 9pt;
}

.checkbox-line {
  border-bottom: 1px solid var(--light-border);
  height: 0.18in;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15in;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.12in;
}

/* Task Card */
.task-card {
  border: 1px solid var(--border-color);
  padding: 0.08in;
  margin-bottom: 0.08in;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.08in;
}

.task-number {
  font-weight: 700;
  font-size: 10pt;
}

.task-priority {
  display: flex;
  gap: 4px;
}

.priority-box {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-color);
  font-size: 7pt;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Automation Flow */
.flow-section {
  border: 1px solid var(--border-color);
  padding: 0.1in;
  margin-bottom: 0.1in;
}

.flow-label {
  font-size: 8pt;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--secondary-color);
  margin-bottom: 0.05in;
}

.flow-content {
  min-height: 0.6in;
}

.flow-arrow {
  text-align: center;
  font-size: 14pt;
  color: var(--secondary-color);
  padding: 0.05in 0;
}

/* Test Path Row */
.test-row {
  display: grid;
  grid-template-columns: 25px 1fr 80px;
  gap: 0.1in;
  align-items: center;
  padding: 0.05in 0;
}

.test-number {
  font-weight: 600;
  font-size: 9pt;
  color: var(--secondary-color);
}

.test-status {
  display: flex;
  gap: 4px;
}

.status-box {
  width: 20px;
  height: 16px;
  border: 1px solid var(--border-color);
  font-size: 6pt;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Understanding Item */
.understanding-item {
  border: 1px solid var(--light-border);
  padding: 0.08in;
  margin-bottom: 0.08in;
}

.understanding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.08in;
}

.understanding-number {
  font-weight: 600;
  font-size: 9pt;
}

.understanding-approval {
  display: flex;
  gap: 0.15in;
}

.approval-option {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8pt;
}

.approval-box {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border-color);
}

/* Heuristics Grid */
.heuristic-category {
  margin-bottom: 0.1in;
}

.category-title {
  font-size: 8pt;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--bg-light);
  padding: 3px 6px;
  margin-bottom: 0.05in;
}

.heuristic-item {
  display: flex;
  align-items: center;
  gap: 0.08in;
  padding: 2px 0;
  font-size: 8pt;
}

.heuristic-check {
  width: 10px;
  height: 10px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* Systems List */
.system-entry {
  display: grid;
  grid-template-columns: 0.3in 1.5in 1fr 0.8in;
  gap: 0.1in;
  align-items: center;
  padding: 0.06in 0;
  border-bottom: 1px solid var(--light-border);
}

.system-number {
  font-size: 8pt;
  color: var(--secondary-color);
}

.system-name-field {
  border-bottom: 1px solid var(--light-border);
  height: 16px;
}

.system-purpose-field {
  border-bottom: 1px solid var(--light-border);
  height: 16px;
}

.system-rating {
  display: flex;
  gap: 2px;
}

.rating-box {
  width: 12px;
  height: 12px;
  border: 1px solid var(--border-color);
  font-size: 6pt;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
.page-footer {
  margin-top: auto;
  padding-top: 0.12in;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 7pt;
  color: var(--secondary-color);
  flex-shrink: 0;
}

.footer-logo {
  height: 0.35in;
  width: auto;
  opacity: 0.4;
}

/* Print Styles */
@media print {
  body {
    background: white;
  }

  .page {
    margin: 0;
    box-shadow: none;
    page-break-after: always;
    page-break-inside: avoid;
    padding-bottom: 0.65in;
  }

  .page:last-child {
    page-break-after: avoid;
  }

  .no-print {
    display: none !important;
  }

  .page-footer {
    position: absolute;
    bottom: var(--page-padding-bottom);
    left: var(--page-padding-x);
    right: var(--page-padding-x);
  }
}

@page {
  size: letter;
  margin: 0;
}

/* Sidebar Navigation - Potatuhs Brand */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 200px;
  background: #2C2915;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 2px solid #e19816;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 11pt;
  font-weight: 800;
  color: #e19816;
  letter-spacing: -0.5px;
}

.sidebar-subtitle {
  font-size: 8pt;
  color: #a09070;
  margin-top: 4px;
}

/* Buttons docked at top, below header */
.sidebar-footer {
  padding: 12px 16px;
  border-bottom: 2px solid #3d3a25;
  flex-shrink: 0;
  order: -1;
  margin-top: 0;
}

.sidebar-footer a {
  display: block;
  padding: 10px 12px;
  background: #3d3a25;
  color: #c0b090;
  text-decoration: none;
  font-size: 8pt;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
  transition: all 0.15s;
  border: 1px solid #4d4a35;
}

.sidebar-footer a:hover {
  background: #e19816;
  color: #2C2915;
  border-color: #e19816;
}

.sidebar-footer .download-btn {
  display: block;
  padding: 12px 12px;
  background: #e19816;
  color: #2C2915;
  border: none;
  font-size: 9pt;
  font-weight: 700;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  transition: all 0.15s;
}

.sidebar-footer .download-btn:hover {
  background: #e16416;
}

/* Scrollable template list */
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  padding-top: 8px;
  padding-bottom: 20px;
}

.sidebar-nav li {
  margin: 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #c0b090;
  text-decoration: none;
  font-size: 9pt;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: #3d3a25;
  color: #fff;
}

.sidebar-nav a.active {
  background: #3d3a25;
  color: #fff;
  border-left-color: #e19816;
}

.sidebar-nav .nav-abbrev {
  font-size: 7pt;
  font-weight: 700;
  background: #1d1c10;
  color: #e19816;
  padding: 4px 6px;
  min-width: 42px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid #3d3a25;
}

.sidebar-nav a.active .nav-abbrev,
.sidebar-nav a:hover .nav-abbrev {
  background: #e19816;
  color: #2C2915;
  border-color: #e19816;
}

.sidebar-nav .nav-label {
  flex: 1;
}

/* Adjust page container when sidebar is present */
.with-sidebar {
  margin-left: 200px;
}

.with-sidebar .page {
  margin-left: calc((100% - 8.5in) / 2);
}

@media print {
  .sidebar {
    display: none !important;
  }

  .with-sidebar {
    margin-left: 0;
  }

  .with-sidebar .page {
    margin-left: auto;
  }
}

/* Navigation (Screen Only) */
.nav-container {
  max-width: 8.5in;
  margin: 0 auto;
  padding: 0.5in;
  background: white;
}

.nav-title {
  font-size: 24pt;
  font-weight: 700;
  margin-bottom: 0.2in;
}

.nav-description {
  color: var(--secondary-color);
  margin-bottom: 0.3in;
  line-height: 1.6;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.2in;
}

.nav-card {
  border: 1px solid var(--border-color);
  padding: 0.2in;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.nav-card:hover {
  background: var(--bg-light);
  border-color: var(--accent-color);
}

.nav-card-title {
  font-weight: 600;
  margin-bottom: 0.05in;
}

.nav-card-desc {
  font-size: 8pt;
  color: var(--secondary-color);
}

/* Page Content Wrapper - ensures footer spacing */
.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    max-height: none;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar-nav li {
    flex: 0 0 auto;
  }

  .sidebar-nav a {
    padding: 8px 12px;
    border-radius: 6px;
    border-left: none;
    background: #3d3a25;
    white-space: nowrap;
  }

  .sidebar-nav a.active {
    background: #e19816;
    color: #2C2915;
    border-left: none;
  }

  .sidebar-nav a.active .nav-abbrev {
    background: #2C2915;
    color: #e19816;
  }

  .with-sidebar {
    margin-left: 0;
  }

  .with-sidebar .page {
    margin: 1rem auto;
    width: 100%;
    max-width: 100%;
    min-height: auto;
    max-height: none;
    padding: 1rem;
  }

  .page {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    max-height: none;
    margin: 1rem;
    padding: 1rem;
    font-size: 9pt;
  }

  .page-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .page-meta {
    text-align: left;
  }

  .meta-field {
    justify-content: flex-start;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .system-entry {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .page-title {
    font-size: 14pt;
  }

  .sidebar-footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .sidebar-footer a,
  .sidebar-footer .download-btn {
    flex: 1;
    min-width: 120px;
    margin-top: 0;
  }
}

/* Utility Classes */
.flex-grow {
  flex: 1;
  min-height: 0;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mb-sm {
  margin-bottom: 0.05in;
}

.mb-md {
  margin-bottom: 0.1in;
}

.mb-lg {
  margin-bottom: 0.2in;
}
