* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f5f5f5; color: #333; padding: 20px; max-width: 1400px; margin: 0 auto; }
h1 { text-align: center; margin-bottom: 3px; font-size: 1.3em; }
.subtitle { text-align: center; color: #666; margin-bottom: 20px; font-size: 0.85em; }
h2 { margin: 20px 0 10px; font-size: 1em; border-bottom: 2px solid #2c3e50; padding-bottom: 5px; color: #2c3e50; }
h3 { margin: 12px 0 6px; font-size: 0.9em; color: #34495e; }
table { width: 100%; border-collapse: collapse; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-radius: 6px; overflow: hidden; margin-bottom: 20px; font-size: 0.75em; }
th { background: #2c3e50; color: white; padding: 8px 5px; text-align: left; font-size: 0.72em; }
th.right { text-align: right; }
td { padding: 5px; border-bottom: 1px solid #eee; vertical-align: top; }
td.right { text-align: right; }
td.center { text-align: center; }
tr:hover { background: #f0f7ff; }
tr.subtotal { background: #eceff1; font-weight: bold; }
tr.total { background: #2c3e50; color: white; font-weight: bold; }
.pending { background: #fff3cd; color: #856404; padding: 1px 4px; border-radius: 3px; font-size: 0.85em; }
.section { background: white; padding: 12px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 15px; }
.note { background: #e3f2fd; padding: 10px; border-radius: 6px; margin-bottom: 15px; font-size: 0.8em; border-left: 4px solid #1976d2; }
.note.warning { background: #fff3cd; border-left-color: #ffc107; }
.note.legal { background: #e8f5e9; border-left-color: #4caf50; }
.footer { text-align: center; color: #999; font-size: 0.7em; margin-top: 20px; }
a { color: #2c3e50; }
button, .btn { background: #2c3e50; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; margin: 5px 2px; font-size: 0.85em; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #34495e; }
.btn-sm { padding: 3px 8px; font-size: 0.75em; }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #e74c3c; }
.btn-success { background: #27ae60; }
.btn-success:hover { background: #2ecc71; }

/* Auth bar */
.auth-bar { position: fixed; top: 0; left: 0; right: 0; background: #2c3e50; color: white; padding: 6px 20px; font-size: 0.8em; display: flex; justify-content: space-between; align-items: center; z-index: 1000; }
.auth-bar a { color: #ecf0f1; }
body { padding-top: 40px; }

/* Nav - Desktop */
nav.main-nav { position: fixed; top: 40px; right: 10px; z-index: 999; display: flex; flex-direction: column; gap: 5px; }
nav.main-nav .nav-toggle { display: none; }
nav.main-nav .nav-links { display: flex; flex-direction: column; gap: 5px; }
nav.main-nav a { background: #2c3e50; color: white; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 16px; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
nav.main-nav a:hover { background: #34495e; }
nav.main-nav a.active { background: #e74c3c; }

/* Nav - Mobile */
@media (max-width: 768px) {
  nav.main-nav { top: 40px; left: 10px; right: auto; }
  nav.main-nav .nav-toggle { display: flex; align-items: center; justify-content: center; background: #2c3e50; color: white; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.3); margin: 0; padding: 0; }
  nav.main-nav .nav-toggle:hover { background: #34495e; }
  nav.main-nav .nav-links { display: none; }
  nav.main-nav.open .nav-links { display: flex; }
}

/* Forms */
input, select, textarea { padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85em; font-family: inherit; }
textarea { width: 100%; min-height: 60px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; align-items: flex-end; }
.form-row label { font-size: 0.75em; color: #666; display: block; margin-bottom: 2px; }
.form-group { display: flex; flex-direction: column; }

/* Login */
.login-container { max-width: 400px; margin: 100px auto; background: white; padding: 40px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.login-container h1 { margin-bottom: 20px; }
.login-container input { width: 100%; padding: 10px; margin-bottom: 15px; }
.login-container button { width: 100%; padding: 12px; }
.error { color: #c0392b; margin-bottom: 10px; font-size: 0.85em; }

/* Dashboard cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; }
.card { background: white; padding: 15px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); text-align: center; }
.card .number { font-size: 1.4em; font-weight: bold; color: #2c3e50; }
.card .label { font-size: 0.8em; color: #666; }

/* Money formatting */
.money { font-variant-numeric: tabular-nums; }

/* Markdown content */
.md-content { background: white; padding: 20px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); font-size: 0.85em; line-height: 1.6; }
.md-content table { font-size: 0.9em; }
.md-content h1 { text-align: left; font-size: 1.3em; border-bottom: 2px solid #2c3e50; padding-bottom: 5px; margin: 20px 0 10px; }
.md-content h2 { font-size: 1.1em; }
.md-content h3 { font-size: 0.95em; }
.md-content p { margin-bottom: 10px; }
.md-content ul, .md-content ol { margin-left: 20px; margin-bottom: 10px; }

/* Print */
@media print {
  .auth-bar, nav.main-nav, button, .btn, .no-print { display: none !important; }
  @page { size: landscape; margin: 8mm; }
  body { padding: 0; background: white; font-size: 7pt; padding-top: 0; }
  h1 { font-size: 10pt; }
  .subtitle { font-size: 7pt; margin-bottom: 8px; }
  h2 { font-size: 8pt; margin: 8px 0 4px; }
  table { font-size: 6pt; box-shadow: none; border: 1px solid #999; }
  th { padding: 3px 2px; font-size: 5.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  td { padding: 2px 3px; }
  tr.subtotal, tr.total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .section { box-shadow: none; border: 1px solid #ccc; padding: 6px; }
  .footer { font-size: 5.5pt; }
}
