/* Elevator Maintenance Management Platform — Design System
   Source of truth: DESIGN.md */

:root {
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --bg: #f8fafc;
    --surface: #ffffff;
    --header-bg: #0f172a;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --compliance-green: #22c55e;
    --compliance-amber: #f59e0b;
    --compliance-red: #ef4444;
    --compliance-black: #1a1a1a;
    --wo-emergency: #ef4444;
    --wo-callback: #f97316;
    --wo-pm: #0d9488;
    --wo-inspection: #22c55e;
    --wo-repair: #6b7280;
    --font-body: 'DM Sans', sans-serif;
    --font-data: 'JetBrains Mono', monospace;
}

/* Reset Bootstrap defaults */
body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    margin: 0;
}

/* Header */
.app-header {
    background: var(--header-bg);
    color: #f1f5f9;
    height: 48px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.app-logo {
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.05em;
    color: var(--primary);
}

/* Sidebar */
.app-sidebar {
    width: 220px;
    height: calc(100vh - 48px);
    background: var(--header-bg);
    border-right: none;
    padding: 16px 0;
    position: fixed;
    top: 48px;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.sidebar-section {
    margin-bottom: 16px;
}

.sidebar-heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 4px 16px;
    margin-bottom: 2px;
}

.sidebar-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.sidebar-toggle:hover {
    color: #f1f5f9;
}

.sidebar-chevron {
    font-size: 10px;
    transition: transform 0.15s ease;
}

.sidebar-section.collapsed .sidebar-chevron {
    transform: rotate(-90deg);
}

.sidebar-links {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.2s ease;
}

.sidebar-section.collapsed .sidebar-links {
    max-height: 0;
}

.sidebar-link {
    display: block;
    padding: 6px 16px;
    font-size: 13px;
    color: #cbd5e1;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: #1e293b;
    color: #f1f5f9;
}

.sidebar-link.active {
    background: #1e293b;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

.sidebar-link.disabled {
    color: #475569;
    opacity: 0.5;
    pointer-events: none;
}

/* Main content */
.app-content {
    margin-left: 220px;
    margin-top: 48px;
    padding: 24px;
    min-height: calc(100vh - 48px);
    width: calc(100% - 220px);
}

/* Bootstrap overrides */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-hover);
}

/* Tables — no border radius, left-aligned */
.table {
    font-size: 13px;
}

.table th {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
}

/* Data fields — monospace */
.data-mono {
    font-family: var(--font-data);
    font-size: 13px;
}

/* Compliance badges */
.compliance-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.compliance-badge--green {
    background: #dcfce7;
    color: #166534;
}

.compliance-badge--amber {
    background: #fef3c7;
    color: #92400e;
}

.compliance-badge--red {
    background: #fef2f2;
    color: #991b1b;
}

.compliance-badge--black {
    background: #f3f4f6;
    color: #1a1a1a;
}

/* Compliance icons for colorblind support */
.compliance-badge--green::before { content: "●"; color: var(--compliance-green); margin-right: 2px; }
.compliance-badge--amber::before { content: "▲"; color: var(--compliance-amber); margin-right: 2px; }
.compliance-badge--red::before { content: "■"; color: var(--compliance-red); margin-right: 2px; }
.compliance-badge--black::before { content: "✕"; color: var(--compliance-black); margin-right: 2px; }

/* Cards — no shadows per DESIGN.md */
.card {
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: none;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

/* Search */
.search-bar {
    max-width: 360px;
}

/* Flash messages */
.flash-success {
    background: #dcfce7;
    color: #166534;
    padding: 8px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
}

.flash-error {
    background: #fef2f2;
    color: #991b1b;
    padding: 8px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* Form styles */
.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.form-control, .form-select {
    font-size: 14px;
    border-color: var(--border);
    border-radius: 4px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}

/* Detail view labels */
.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.detail-value {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 12px;
}

.detail-value.mono {
    font-family: var(--font-data);
    font-size: 13px;
}

/* Work Order type badges */
.wo-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.wo-badge--emergency { background: #fef2f2; color: #991b1b; }
.wo-badge--callback  { background: #fff7ed; color: #9a3412; }
.wo-badge--pm        { background: #f0fdfa; color: #115e59; }
.wo-badge--inspection { background: #dcfce7; color: #166534; }
.wo-badge--repair    { background: #f3f4f6; color: #374151; }

/* Status pill */
.status-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: var(--text);
}

/* Dispatch board grid */
.dispatch-grid-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.dispatch-grid {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 12px;
}

.dispatch-grid th {
    background: #f8fafc;
    padding: 6px 4px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.dispatch-tech-col {
    width: 160px;
    min-width: 160px;
    text-align: left !important;
    padding-left: 12px !important;
}

.dispatch-time-col {
    width: 40px;
    min-width: 40px;
}

.dispatch-grid td {
    border: 1px solid #f1f5f9;
    padding: 2px;
    height: 48px;
    vertical-align: top;
}

.dispatch-tech-cell {
    background: var(--surface);
    padding: 8px 12px !important;
    font-size: 13px;
    border-right: 2px solid var(--border);
    white-space: nowrap;
}

.dispatch-empty-cell {
    background: var(--surface);
}

.dispatch-wo-cell {
    padding: 2px !important;
}

.dispatch-wo-card {
    padding: 4px 8px;
    border-radius: 4px;
    height: 100%;
    overflow: hidden;
}

.dispatch-unassigned-card {
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px dashed var(--border);
}

.dispatch-unassigned-card:hover {
    border-style: solid;
    text-decoration: none;
}

/* Violation severity badges */
.violation-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 4px;
}

/* Calendar grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 16px;
}

.calendar-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 4px 0;
}

.calendar-day {
    min-height: 64px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 8px;
    background: var(--surface);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-day--empty {
    background: transparent;
    border-color: transparent;
}

.calendar-day--today {
    border-color: var(--primary);
    background: #f0fdfa;
}

.calendar-day-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-data);
}

.calendar-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 9999px;
    font-family: var(--font-data);
}

.calendar-badge--green  { background: #dcfce7; color: #166534; }
.calendar-badge--amber  { background: #fef3c7; color: #92400e; }
.calendar-badge--red    { background: #fee2e2; color: #991b1b; }

/* Checklist mobile styles */
.checklist-progress-wrap {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    margin: -24px -24px 0 -24px;
}

.checklist-section-heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 8px 0 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 8px;
}

.checklist-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 10px;
    background: var(--surface);
}

.checklist-item--answered {
    border-color: #d1fae5;
    background: #f0fdf4;
}

.checklist-item-description {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.checklist-item-form {
    /* no extra styles needed */
}

.checklist-response-group {
    display: flex;
    gap: 8px;
}

.checklist-response-btn {
    min-height: 44px;
    min-width: 80px;
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
}

.checklist-response-btn--pass { color: #166534; }
.checklist-response-btn--pass:hover, .checklist-response-btn--pass.active {
    background: #dcfce7;
    border-color: #86efac;
}

.checklist-response-btn--fail { color: #991b1b; }
.checklist-response-btn--fail:hover, .checklist-response-btn--fail.active {
    background: #fee2e2;
    border-color: #fca5a5;
}

.checklist-response-btn--na { color: var(--text-muted); }
.checklist-response-btn--na:hover, .checklist-response-btn--na.active {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.checklist-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    margin-top: 24px;
}

.offline-banner {
    background: #1a1a1a;
    color: #f59e0b;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 8px;
    position: sticky;
    top: 48px;
    z-index: 50;
}

/* Print styles for inspection report */
@media print {
    .app-sidebar, .app-header { display: none !important; }
    .app-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .report-page { box-shadow: none; border: none; }
    body { background: white; }
}

/* Invoice status badges */
.invoice-badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 4px; }
.invoice-badge--draft { background: #f1f5f9; color: #475569; }
.invoice-badge--sent { background: #dbeafe; color: #1e40af; }
.invoice-badge--paid { background: #dcfce7; color: #166534; }
.invoice-badge--partially_paid { background: #fef3c7; color: #92400e; }
.invoice-badge--overdue { background: #fef2f2; color: #991b1b; }
.invoice-badge--void { background: #f3f4f6; color: #6b7280; }

/* Portal layout */
.portal-header { background: var(--header-bg); color: #f1f5f9; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.portal-content { max-width: 1200px; margin: 0 auto; padding: 24px; }
.portal-stat-card { border: 1px solid var(--border); border-radius: 4px; padding: 16px; text-align: center; }
.portal-stat-number { font-family: var(--font-data); font-size: 32px; font-weight: 700; }

/* Report cards */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.report-card { border: 1px solid var(--border); border-radius: 4px; padding: 20px; text-decoration: none; color: var(--text); transition: border-color 0.15s; }
.report-card:hover { border-color: var(--primary); }
.report-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.report-card p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* Report tables */
.report-filters { display: flex; gap: 12px; margin-bottom: 16px; align-items: end; }
.report-summary { display: flex; gap: 16px; margin-bottom: 24px; }
.report-summary-card { border: 1px solid var(--border); border-radius: 4px; padding: 12px 16px; flex: 1; }
.report-summary-label { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }
.report-summary-value { font-family: var(--font-data); font-size: 24px; font-weight: 700; }

/* Admin layout */
.admin-header { background: #1e293b; color: #f1f5f9; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; }
.admin-badge { background: #ef4444; color: white; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; letter-spacing: 0.05em; margin-left: 12px; }
.admin-content { max-width: 1400px; margin: 0 auto; padding: 24px; }
.admin-metric { border: 1px solid var(--border); border-radius: 4px; padding: 24px; text-align: center; }
.admin-metric-number { font-family: var(--font-data); font-size: 42px; font-weight: 700; }
.admin-metric-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Onboarding wizard */
.onboarding-header { background: var(--header-bg); color: #f1f5f9; padding: 16px 24px; text-align: center; }
.onboarding-content { max-width: 700px; margin: 0 auto; padding: 32px 24px; }
.onboarding-progress { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.onboarding-step { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; border: 2px solid #334155; color: #94a3b8; }
.onboarding-step--active { background: var(--primary); border-color: var(--primary); color: white; }
.onboarding-step--done { background: #22c55e; border-color: #22c55e; color: white; }
.onboarding-step-label { font-size: 10px; color: #94a3b8; text-align: center; margin-top: 4px; }

/* Plan cards */
.plan-card { border: 2px solid var(--border); border-radius: 8px; padding: 24px; text-align: center; transition: border-color 0.15s; }
.plan-card--current { border-color: var(--primary); background: #f0fdfa; }
.plan-card h3 { font-size: 18px; font-weight: 600; }
.plan-card .price { font-family: var(--font-data); font-size: 32px; font-weight: 700; }
.plan-card .period { font-size: 13px; color: var(--text-muted); }

/* Invitation status */
.invite-pending { color: var(--compliance-amber); }
.invite-accepted { color: var(--compliance-green); }
.invite-expired { color: var(--text-muted); }

/* Dispatch calendar */
.dispatch-calendar {
    max-width: 500px;
}

.dispatch-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.dispatch-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.dispatch-cal-day {
    min-height: 52px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 6px;
    background: var(--surface);
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: border-color 0.1s;
}

.dispatch-cal-day:hover {
    border-color: var(--primary);
    text-decoration: none;
    color: var(--text);
}

.dispatch-cal-day--empty {
    background: transparent;
    border-color: transparent;
}

.dispatch-cal-day--today {
    border-color: var(--primary);
    background: #f0fdfa;
}

.dispatch-cal-day--selected {
    border-color: var(--primary);
    border-width: 2px;
    background: #ccfbf1;
}

.dispatch-cal-num {
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-data);
    color: var(--text-muted);
}

.dispatch-cal-day--today .dispatch-cal-num,
.dispatch-cal-day--selected .dispatch-cal-num {
    color: var(--primary);
}

.dispatch-cal-dots {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.dispatch-cal-dot {
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-data);
    width: 18px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.dispatch-cal-dot--emergency {
    background: #fef2f2;
    color: #991b1b;
}

.dispatch-cal-dot--pm {
    background: #f0fdfa;
    color: #115e59;
}

.dispatch-cal-dot--other {
    background: #f3f4f6;
    color: #374151;
}

/* Drag and drop */
.dispatch-wo-card[draggable="true"] {
    cursor: grab;
}

.dispatch-wo-card.dragging {
    opacity: 0.4;
}

.dispatch-empty-cell.drop-highlight {
    background: #f0fdfa;
    border: 2px dashed var(--primary);
}

.dispatch-empty-cell.drop-active {
    background: #ccfbf1;
    border: 2px solid var(--primary);
}

.dispatch-unassigned-card[draggable="true"] {
    cursor: grab;
}

.dispatch-unassigned-card.dragging {
    opacity: 0.4;
}

/* Enhanced dispatch drag-and-drop */
.dispatch-wo-card {
    position: relative;
    cursor: grab;
    user-select: none;
}

.dispatch-wo-card.dragging {
    opacity: 0.3;
    outline: 2px dashed #0d9488;
}

.dispatch-wo-card.selected {
    outline: 2px solid #0d9488;
    outline-offset: 1px;
}

.dispatch-wo-card .resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    background: transparent;
    border-radius: 0 4px 4px 0;
}

.dispatch-wo-card .resize-handle:hover {
    background: rgba(13, 148, 136, 0.3);
}

.dispatch-wo-card .resize-handle:active {
    background: rgba(13, 148, 136, 0.5);
}

.dispatch-empty-cell.drop-target {
    background: #ccfbf1 !important;
    outline: 2px solid #0d9488;
}

.dispatch-empty-cell.drop-collision {
    background: #fef2f2 !important;
    outline: 2px solid #ef4444;
}

.dispatch-ghost {
    position: fixed;
    pointer-events: none;
    opacity: 0.7;
    z-index: 1000;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
}

/* Context menu */
.dispatch-context-menu {
    position: fixed;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 4px 0;
    z-index: 9999;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.dispatch-context-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    font-size: 13px;
    color: #f1f5f9;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-body);
}

.dispatch-context-item:hover {
    background: #334155;
}

.dispatch-context-item--danger {
    color: #fca5a5;
}

.dispatch-context-item--danger:hover {
    background: #7f1d1d;
}

.dispatch-context-separator {
    height: 1px;
    background: #334155;
    margin: 4px 0;
}

.dispatch-context-submenu {
    padding-left: 24px;
}

/* Undo toast */
.dispatch-undo-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.dispatch-undo-btn {
    background: #0d9488;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Queue sort buttons */
.dispatch-queue-sort {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.dispatch-sort-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.dispatch-sort-btn--active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* SLA Timer */
.sla-timer {
    font-family: var(--font-data);
    font-size: 14px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}
.sla-timer--green { background: #dcfce7; color: #166534; }
.sla-timer--amber { background: #fef3c7; color: #92400e; }
.sla-timer--red { background: #fef2f2; color: #991b1b; animation: sla-pulse 1s infinite; }
.sla-timer--breach { background: #991b1b; color: white; animation: sla-pulse 0.5s infinite; }
@keyframes sla-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ============================================================
   Technician Mobile View
   ============================================================ */
.tech-body {
    background: var(--bg);
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.tech-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--header-bg);
    color: #f1f5f9;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 100;
}

.tech-header-logo {
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.05em;
    color: var(--primary);
    text-decoration: none;
}

.tech-header-name {
    font-size: 13px;
    color: #94a3b8;
    margin-left: auto;
}

.tech-content {
    padding: 68px 16px 80px 16px;
    max-width: 600px;
    margin: 0 auto;
}

.tech-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--header-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 100;
    border-top: 1px solid #1e293b;
}

.tech-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #64748b;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    padding: 6px 12px;
    min-width: 64px;
}

.tech-nav-item--active {
    color: var(--primary);
}

.tech-nav-item:hover {
    color: #f1f5f9;
    text-decoration: none;
}

.tech-greeting {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.tech-greeting-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.tech-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s;
}

.tech-card:hover {
    border-color: var(--primary);
    text-decoration: none;
    color: var(--text);
}

.tech-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}

.tech-card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.tech-card-meta {
    font-size: 12px;
    font-family: var(--font-data);
    color: var(--text-muted);
    margin-top: 6px;
}

.tech-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.tech-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 10px;
    text-align: center;
}

.tech-stat-number {
    font-family: var(--font-data);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.tech-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.tech-status-btn {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 12px;
    min-height: 52px;
}

.tech-status-btn--primary {
    background: var(--primary);
    color: white;
}

.tech-status-btn--primary:hover {
    background: var(--primary-hover);
}

.tech-status-btn--danger {
    background: var(--compliance-red);
    color: white;
}

.tech-access-card {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

.tech-access-card h6 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #92400e;
    margin-bottom: 6px;
}

.tech-filter-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tech-filter-pill {
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--surface);
}

.tech-filter-pill--active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tech-schedule-day {
    margin-bottom: 20px;
}

.tech-schedule-date {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.tech-schedule-date--today {
    color: var(--primary);
}

/* Dark mode for tech view */
[data-bs-theme="dark"] .tech-body,
[data-bs-theme="dark"] body {
    background: #0f172a;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .tech-card,
[data-bs-theme="dark"] .tech-stat {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .tech-card-subtitle,
[data-bs-theme="dark"] .tech-card-meta,
[data-bs-theme="dark"] .tech-stat-label {
    color: #94a3b8;
}

[data-bs-theme="dark"] .tech-access-card {
    background: #1c1917;
    border-color: #78716c;
}

/* Responsive: collapse sidebar on small screens */
@media (max-width: 768px) {
    .app-sidebar {
        display: none;
    }
    .app-content {
        margin-left: 0;
        width: 100%;
    }
}
