/* ===== Bogesunds Projektportal - Custom Styles ===== */

:root {
    --brand: #1a2744;
    --brand-dark: #0f1a2e;
    --brand-accent: #009e96;
    --brand-accent-light: #00c4ba;
    --brand-accent-bg: #e6f7f6;
    --sidebar-width: 240px;
}

/* ===== Base ===== */
html { font-size: 15px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f4f6f9; color: #333; }

/* ===== Brand Utilities ===== */
.bg-brand { background-color: var(--brand) !important; }
.bg-brand-accent { background-color: var(--brand-accent) !important; }
.btn-brand { background: var(--brand-accent); color: #fff; border: none; }
.btn-brand:hover { background: var(--brand-accent-light); color: #fff; }
.btn-outline-brand { color: var(--brand-accent); border-color: var(--brand-accent); }
.btn-outline-brand:hover { background: var(--brand-accent); color: #fff; }
.text-brand-accent { color: var(--brand-accent) !important; }
.badge.bg-brand-accent { background-color: var(--brand-accent) !important; }

/* ===== Login ===== */
.login-body { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 50%, #0d2137 100%);
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-container { width: 100%; max-width: 400px; }
.login-card { background: #fff; border-radius: 16px; padding: 2rem; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-demo-info { background: #f8f9fa; border-radius: 8px; padding: 12px; margin-top: 8px; }
.login-demo-info table { margin-bottom: 0; }
.login-demo-info th, .login-demo-info td { padding: 2px 8px; border: none; }

/* ===== Navbar ===== */
.navbar { padding: 8px 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); z-index: 1040; }
.navbar-brand { font-size: 1rem; font-weight: 600; }

/* ===== Avatar ===== */
.avatar-sm, .avatar-md, .avatar-xs { display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 600; color: #fff; flex-shrink: 0; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; background: var(--brand-accent); }
.avatar-md { width: 40px; height: 40px; font-size: 0.85rem; background: var(--brand-accent); }
.avatar-xs { width: 24px; height: 24px; font-size: 0.6rem; }
.avatar-blue { background: #4a90d9; }
.avatar-green { background: #27ae60; }
.avatar-purple { background: #8e44ad; }
.avatar-orange { background: #e67e22; }

/* ===== Sidebar ===== */
.sidebar { position: fixed; top: 56px; left: 0; bottom: 0; width: var(--sidebar-width);
    background: var(--brand); z-index: 1030; display: flex; flex-direction: column;
    transform: translateX(-100%); transition: transform 0.3s ease; }
.sidebar.open { transform: translateX(0); }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1025;
    opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 20px;
    color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; transition: all 0.15s; }
.sidebar-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-link.active { background: rgba(0,158,150,0.3); color: #fff; border-left: 3px solid var(--brand-accent); }
.sidebar-link i { font-size: 1.1rem; width: 24px; text-align: center; }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 8px 16px; }
.sidebar-footer { padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.1); }

/* ===== Main Content ===== */
.main-content { padding: 72px 16px 24px; min-height: 100vh; }
.page-header { margin-bottom: 1rem; }

/* Desktop: show sidebar, shift content */
@media (min-width: 992px) {
    .sidebar { transform: translateX(0); }
    .sidebar-overlay { display: none !important; }
    .main-content { margin-left: var(--sidebar-width); padding: 72px 24px 24px; }
}

/* ===== Cards ===== */
.card { border: none; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.card-header { background: #fff; border-bottom: 1px solid #eee; font-weight: 600; font-size: 0.9rem;
    padding: 12px 16px; border-radius: 12px 12px 0 0 !important; }

/* ===== Stat Cards ===== */
.stat-card { border-left: 4px solid transparent; }
.stat-card.stat-brand { border-left-color: var(--brand-accent); }
.stat-card.stat-info { border-left-color: #4a90d9; }
.stat-card.stat-success { border-left-color: #28a745; }
.stat-card.stat-warning { border-left-color: #ffc107; }
.stat-icon { font-size: 1.8rem; opacity: 0.3; }
.stat-number { font-size: 1.8rem; font-weight: 700; color: var(--brand); line-height: 1; }
.stat-label { font-size: 0.75rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== Marker dots (dashboard) ===== */
.marker-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-red { background: #dc3545; }
.dot-orange { background: #fd7e14; }
.dot-blue { background: #0d6efd; }
.dot-green { background: #198754; }

/* ===== Project cards ===== */
.project-card { transition: transform 0.15s, box-shadow 0.15s; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.mini-stat { font-size: 0.8rem; color: #555; }
.mini-stat i { font-size: 0.85rem; }

/* ===== Plan cards ===== */
.plan-preview { height: 80px; background: #f0f4f8; border-radius: 8px; display: flex;
    align-items: center; justify-content: center; }
.plan-card { transition: transform 0.15s; }
.plan-card:hover { transform: translateY(-2px); }

/* ===== Status badges ===== */
.badge-status-todo { background: #fff5f5; color: #dc3545; border: 1px solid #dc3545; }
.badge-status-cabled { background: #fff8f0; color: #fd7e14; border: 1px solid #fd7e14; }
.badge-status-installed { background: #f0f6ff; color: #0d6efd; border: 1px solid #0d6efd; }
.badge-status-tested { background: #f0faf4; color: #198754; border: 1px solid #198754; }

/* ===== Tabs (mobile-friendly) ===== */
.nav-tabs-mobile { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
.nav-tabs-mobile .nav-link { white-space: nowrap; font-size: 0.85rem; padding: 8px 12px;
    color: #666; border: none; border-bottom: 2px solid transparent; }
.nav-tabs-mobile .nav-link.active { color: var(--brand-accent); border-bottom-color: var(--brand-accent);
    background: none; font-weight: 600; }

/* ===== Self-check table ===== */
.selfcheck-desc { cursor: pointer; padding: 4px; border-radius: 4px; }
.selfcheck-desc:hover { background: var(--brand-accent-bg); }
.selfcheck-table .badge { cursor: pointer; }

/* ===== Photo cards ===== */
.photo-thumb { height: 120px; display: flex; align-items: center; justify-content: center;
    border-radius: 12px 12px 0 0; }
.photo-card { overflow: hidden; }

/* ===== Toasts ===== */
.toast { border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* ===== Print Styles ===== */
.print-only { display: none; }

@media print {
    .navbar, .sidebar, .sidebar-overlay, .nav-tabs-mobile,
    .page-header .btn, .tab-pane:not(#tabChecks) { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .print-only { display: block !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    .selfcheck-table { font-size: 12px; }
    .selfcheck-desc { cursor: default; }
    .selfcheck-desc:hover { background: none; }
}

/* ===== Responsive helpers ===== */
@media (max-width: 576px) {
    .stat-number { font-size: 1.4rem; }
    .stat-label { font-size: 0.65rem; }
    .card-body { padding: 12px; }
}

/* ===== Scrollbar (subtle) ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ===== Selection ===== */
::selection { background: var(--brand-accent); color: #fff; }
