* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       background: #1a1a2e; color: #e0e0e0; line-height: 1.6; }
a { color: #4fc3f7; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top nav */
nav { display: flex; align-items: center; gap: 24px; padding: 12px 24px;
      background: #16213e; border-bottom: 1px solid #0f3460; }
.nav-brand { font-weight: 700; font-size: 1.1em; color: #fff; }
.nav-user { margin-left: auto; font-size: 0.85em; color: #888; }

/* Sidebar layout */
.layout { display: flex; min-height: calc(100vh - 49px); }
.sidebar { width: 220px; background: #111827; border-right: 1px solid #0f3460;
           padding: 16px 0; flex-shrink: 0; }
.sidebar-heading { padding: 8px 20px; font-size: 0.75em; font-weight: 700;
                   text-transform: uppercase; letter-spacing: 0.05em; color: #666; margin-top: 8px; }
.sidebar a { display: block; padding: 8px 20px; color: #aaa; font-size: 0.9em;
             text-decoration: none; border-left: 3px solid transparent; }
.sidebar a:hover { background: #1a1a2e; color: #e0e0e0; text-decoration: none; }
.sidebar a.active { color: #4fc3f7; background: #1a1a2e; border-left-color: #4fc3f7; }

/* Main content */
main { flex: 1; padding: 24px; max-width: 1100px; }
h1 { font-size: 1.5em; margin-bottom: 16px; color: #fff; }
h2 { font-size: 1.2em; margin-bottom: 12px; color: #ddd; }

/* Forms & inputs */
input, select, textarea { background: #16213e; color: #e0e0e0; border: 1px solid #333;
                padding: 8px 12px; border-radius: 4px; font-size: 0.95em; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #4fc3f7; }
textarea { resize: vertical; min-height: 80px; }
button { background: #0f3460; color: #fff; border: none; padding: 8px 16px;
         border-radius: 4px; cursor: pointer; font-size: 0.95em; }
button:hover { background: #1a4a8a; }
button.btn-success { background: #1a5a2a; }
button.btn-success:hover { background: #2a7a3a; }
button.btn-danger { background: #5a1a1a; }
button.btn-danger:hover { background: #7a2a2a; }
label { display: block; margin-bottom: 4px; font-size: 0.85em; color: #aaa; }

/* Form grid */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-bottom: 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.form-full { grid-column: 1 / -1; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
th { text-align: left; padding: 8px 12px; background: #16213e; color: #aaa;
     border-bottom: 2px solid #0f3460; font-weight: 600; position: sticky; top: 0; }
td { padding: 8px 12px; border-bottom: 1px solid #222; }
tr:hover { background: #16213e; }

/* Status badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px;
         font-size: 0.8em; font-weight: 600; }
.badge-active { background: #1a3a1a; color: #4caf50; }
.badge-low { background: #3a2a1a; color: #ff9800; }
.badge-out { background: #3a1a1a; color: #f44336; }
.badge-ok { background: #1a2a3a; color: #4fc3f7; }

/* Search */
.search-box { display: flex; gap: 8px; margin-bottom: 20px; }
.search-box input { flex: 1; }

/* Cards */
.card { background: #16213e; border: 1px solid #0f3460; border-radius: 8px;
        padding: 16px; margin-bottom: 16px; }
.card h3 { color: #fff; margin-bottom: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { text-align: center; }
.stat-value { font-size: 1.8em; font-weight: 700; color: #fff; }
.stat-label { font-size: 0.8em; color: #888; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.alert-success { background: #1a3a1a; color: #4caf50; border: 1px solid #2a5a2a; }
.alert-error { background: #3a1a1a; color: #f44336; border: 1px solid #5a2a2a; }

/* Tab buttons */
.tab-btn { background: #1a1a2e; border: 1px solid #333; font-size: 0.85em; padding: 6px 14px; }
.tab-btn:hover { background: #0f3460; border-color: #4fc3f7; }

/* HTMX loading indicator */
.htmx-indicator { display: none; position: fixed; top: 50px; right: 20px;
                  background: #0f3460; color: #4fc3f7; padding: 8px 16px;
                  border-radius: 4px; font-size: 0.85em; z-index: 100; }
.htmx-request .htmx-indicator { display: block; }

/* Print styles */
@media print {
    nav, .sidebar, .search-box, button, .htmx-indicator { display: none !important; }
    .layout { display: block; }
    main { max-width: 100%; padding: 0; }
    body { background: #fff; color: #000; }
    .card { border-color: #ccc; background: #fff; }
    th { background: #eee; color: #333; border-bottom-color: #999; }
    td { border-bottom-color: #ddd; }
    .badge { border: 1px solid #999; }
    .badge-active { background: #e8f5e9; color: #2e7d32; }
    .badge-low { background: #fff3e0; color: #e65100; }
    .badge-out { background: #ffebee; color: #c62828; }
    .badge-ok { background: #e3f2fd; color: #1565c0; }
}
