:root {
    --bp-navy: #1B3F6E;
    --bp-navy-dark: #122B4D;
    --bp-teal: #2D73BA;
    --bp-teal-dark: #1E5A96;
    /* The second half of "Bogeflow" on the navy header. Lighter than the teal,
       which reads at only 2.2:1 against the navy; this reads at 5.0:1 and
       sits between the logo's cyan and blue. */
    --bp-brand-light: #6CB8F8;
    --bp-bg: #F4F6FA;
    --bp-surface: #ffffff;
    --bp-text: #1f2330;
    --bp-text-muted: #6b7280;
    --bp-border: #e3e6ec;
    --bp-danger: #b3261e;
    --bp-active-bg: #E5EFF9;
}

html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bp-bg);
    color: var(--bp-text);
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--bp-teal-dark); text-decoration: none; }

.bp-mobile-navbar {
    background: var(--bp-navy);
    color: #fff;
    height: 56px;
    display: flex; align-items: center;
    padding: 0 8px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    z-index: 10;
}
.bp-mobile-navbar .bp-mobile-title { flex: 1; min-width: 0; text-align: center; font-size: 15px; font-weight: 500; }
.bp-mobile-project { display: flex; flex-direction: column; align-items: center; line-height: 1.25; min-width: 0; }
.bp-mobile-project-name {
    max-width: 100%;
    font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bp-mobile-project-sub { font-size: 11px; color: rgba(255,255,255,0.7); }
.bp-mobile-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; line-height: 1; }
.bp-mobile-brand-logo { height: 28px; width: auto; display: block; }
.bp-mobile-brand-text { display: inline-block; }
.bp-mobile-accent { color: var(--bp-brand-light); }
.bp-mobile-iconbtn {
    width: 44px; height: 44px;
    background: transparent;
    color: #fff;
    border: none;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.bp-mobile-iconbtn:hover { background: rgba(255,255,255,0.08); }
/* The account menu under the avatar. The backdrop is invisible and only there
   to catch a tap outside the menu. */
.bp-user-menu-backdrop { position: fixed; inset: 0; z-index: 940; background: transparent; }
.bp-user-menu {
    position: fixed;
    top: 60px;
    right: 8px;
    z-index: 950;
    width: min(300px, calc(100vw - 16px));
    background: var(--bp-surface);
    color: var(--bp-text);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.22);
    overflow: hidden;
}
.bp-user-menu-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--bp-border); }
.bp-user-menu-avatar { width: 42px; height: 42px; font-size: 15px; flex-shrink: 0; }
.bp-user-menu-who { min-width: 0; }
.bp-user-menu-name { font-weight: 600; }
.bp-user-menu-meta { font-size: 13px; color: var(--bp-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-user-menu-note { padding: 10px 16px; font-size: 13px; color: var(--bp-text-muted); border-bottom: 1px solid var(--bp-border); }
.bp-user-menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--bp-text);
    font-size: 15px;
    text-align: left;
}
.bp-user-menu-item:active { background: var(--bp-bg); }
.bp-offline-pill, .bp-queue-pill {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    margin-right: 6px;
}
.bp-offline-pill { background: var(--bp-danger); }
.bp-queue-pill { background: rgba(212,160,23,0.85); }
.bp-mobile-avatar {
    width: 32px; height: 32px;
    background: var(--bp-teal);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
    color: #fff;
}

/* Login screen */
.bp-login-shell {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--bp-navy) 0%, var(--bp-navy-dark) 100%);
    padding: 16px;
}
.bp-login-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 100%; max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.bp-login-card .bp-login-logo {
    display: block;
    max-width: 240px;
    width: 100%;
    height: auto;
    margin: 0 auto 14px auto;
}
.bp-login-card h1 { color: var(--bp-navy); margin: 0 0 4px 0; font-size: 20px; text-align: center; }
.bp-login-card .bp-login-sub { color: var(--bp-text-muted); font-size: 13px; margin-bottom: 18px; text-align: center; }
.bp-login-card .bp-input {
    display: block; width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bp-border);
    border-radius: 8px;
    font: inherit; color: inherit;
    background: #fff;
    box-sizing: border-box;
}
.bp-login-card .bp-input:focus { outline: 2px solid var(--bp-teal); outline-offset: -1px; }
.bp-login-card .mb-3 { margin-bottom: 12px; }
.bp-login-card .bp-btn { width: 100%; justify-content: center; padding: 10px 14px; font-size: 15px; }
.bp-user-pick {
    display: flex; align-items: center; gap: 12px;
    padding: 12px;
    border: 1px solid var(--bp-border);
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fff;
    width: 100%;
    font: inherit; color: inherit;
    text-align: left;
    cursor: pointer;
}
.bp-user-pick:active { background: var(--bp-active-bg); }
.bp-user-pick .bp-pick-avatar {
    width: 38px; height: 38px;
    background: var(--bp-teal);
    color: #fff; font-weight: 700;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.bp-user-pick .bp-pick-name { font-weight: 500; }
.bp-user-pick .bp-pick-meta { color: var(--bp-text-muted); font-size: 12px; margin-top: 2px; }

.bp-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.bp-badge-active { background: #d8e8f5; color: var(--bp-teal-dark); }
.bp-badge-planned { background: #ffe9c5; color: #8a5a00; }
.bp-badge-completed { background: #dde3ed; color: var(--bp-navy); }
/* Role badges are built from the role name, so these track UserRole. The top
   role keeps the purple it had under its old name; bp-badge-superadmin stays
   because other badges — Globalt documents — borrowed it as a colour. */
.bp-badge-admin { background: #e0d8f3; color: #4a2c8c; }
.bp-badge-projectmanager { background: #d8e8f5; color: var(--bp-teal-dark); }
.bp-badge-technician { background: #dde3ed; color: var(--bp-navy); }
.bp-badge-noaccess { background: #f1f2f4; color: var(--bp-text-muted); border: 1px dashed #c9ced6; }
.bp-badge-superadmin { background: #e0d8f3; color: #4a2c8c; }

/* Lists */
.bp-page { padding: 12px; box-sizing: border-box; max-width: 100%; overflow-x: hidden; }
.bp-page *, .bp-page *::before, .bp-page *::after { box-sizing: border-box; }
.bp-page h2 { font-size: 18px; margin: 4px 4px 12px 4px; color: var(--bp-navy); }
.bp-list-card {
    display: flex; flex-direction: column;
    background: var(--bp-surface);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--bp-border);
}
.bp-list-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--bp-border);
    color: var(--bp-text); text-decoration: none;
}
.bp-list-row:last-child { border-bottom: none; }
.bp-list-row:active { background: var(--bp-active-bg); }
.bp-list-row .bp-list-icon {
    width: 36px; height: 36px;
    background: var(--bp-active-bg); color: var(--bp-teal-dark);
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.bp-list-row .bp-list-main { flex: 1; min-width: 0; }
.bp-list-row .bp-list-title { font-weight: 500; }
.bp-list-row .bp-list-sub { color: var(--bp-text-muted); font-size: 12px; margin-top: 2px; }

/* Filter switch: a row of choices where exactly one is on. Sized for thumbs. */
.bp-segmented { display: flex; gap: 0; border: 1px solid var(--bp-border); border-radius: 10px; overflow: hidden; }
.bp-segmented button {
    flex: 1; padding: 10px 8px;
    background: var(--bp-surface); color: var(--bp-text);
    border: none; border-right: 1px solid var(--bp-border);
    font-size: 14px; cursor: pointer;
}
.bp-segmented button:last-child { border-right: none; }
.bp-segmented button.active { background: var(--bp-teal); color: #fff; font-weight: 600; }

.bp-empty { padding: 32px; text-align: center; color: var(--bp-text-muted); }
.bp-loading {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 32px;
    color: var(--bp-text-muted);
}
.bp-spinner {
    width: 20px; height: 20px; flex-shrink: 0;
    border: 2px solid var(--bp-border);
    border-top-color: var(--bp-teal);
    border-radius: 50%;
    animation: bp-spin 0.7s linear infinite;
}
@keyframes bp-spin { to { transform: rotate(360deg); } }
.bp-toast {
    position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
    background: var(--bp-text); color: #fff;
    padding: 10px 16px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 4000; font-size: 13px;
}
.bp-toast.bp-toast-error { background: var(--bp-danger); }

/* Loading / error from default Blazor template */
.loading-progress {
    position: relative; display: block; width: 8rem; height: 8rem; margin: 20vh auto 1rem;
}
.loading-progress circle { fill: none; stroke: #e0e0e0; stroke-width: 0.6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--bp-teal); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; transition: stroke-dasharray 0.05s ease-in-out; }
.loading-progress-text { position: absolute; text-align: center; font-weight: 600; inset: calc(20vh + 3.25rem) 0 auto 0; }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

#blazor-error-ui {
    background: #fdb; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* Plan viewer */
.bp-plan-shell { display: flex; flex-direction: column; height: 100vh; background: #1f2229; color: #fff; }
.bp-plan-toolbar { background: var(--bp-navy); display: flex; align-items: center; padding: 8px; height: 56px; flex-shrink: 0; gap: 6px; }
.bp-plan-toolbar .bp-mobile-iconbtn { color: #fff; }
.bp-plan-toolbar .title { flex:1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-plan-stage-wrap { flex: 1; overflow: hidden; touch-action: none; position: relative; cursor: grab; }
.bp-plan-stage-wrap.grabbing { cursor: grabbing; }
.bp-plan-stage { transform-origin: 0 0; position: relative; }
.bp-plan-zoom-controls {
    position: absolute; bottom: 16px; right: 16px; z-index: 50;
    display: flex; flex-direction: column; gap: 4px;
}
.bp-plan-zoom-controls button {
    width: 40px; height: 40px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.6); color: #fff; border: 1px solid rgba(255,255,255,0.15);
    font-size: 1.1rem; cursor: pointer;
}
.bp-plan-zoom-controls button:hover { background: rgba(0,0,0,0.8); }
.bp-plan-stage canvas { display: block; box-shadow: 0 0 30px rgba(0,0,0,0.5); }
.bp-plan-stage.adding canvas { cursor: crosshair; }
.bp-marker {
    position: absolute; transform: translate(-50%, -50%) scale(var(--marker-cs, 1));
    transform-origin: center center;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 12px;
    border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.bp-marker.selected { outline: 3px solid #fff; outline-offset: 2px; }
/* Picked up to be moved: it wiggles until it is put down, like an app icon
   being rearranged on a phone's home screen, and grows under the finger while
   it is dragged. The drag itself moves it with the translate property, which
   sits on top of this transform. */
.bp-marker.moving {
    z-index: 5;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.85), 0 6px 16px rgba(0,0,0,0.6);
    animation: bp-marker-wiggle 0.3s ease-in-out infinite;
}
.bp-marker.moving.dragging {
    animation: none;
    transform: translate(-50%, -50%) scale(calc(var(--marker-cs, 1) * 1.3));
}
@keyframes bp-marker-wiggle {
    0%, 100% { transform: translate(-50%, -50%) scale(var(--marker-cs, 1)) rotate(-9deg); }
    50% { transform: translate(-50%, -50%) scale(var(--marker-cs, 1)) rotate(9deg); }
}
@media (prefers-reduced-motion: reduce) {
    .bp-marker.moving { animation: none; }
}

.bp-add-bar {
    position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
    background: var(--bp-navy); color: #fff;
    padding: 8px 12px; border-radius: 28px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    z-index: 100;
}
.bp-status-dropdown { position: relative; }
.bp-status-dropdown-toggle {
    display: flex; align-items: center; gap: 6px;
    background: #fff; color: var(--bp-text); border-radius: 6px;
    padding: 6px 10px; cursor: pointer; font-size: 13px;
    white-space: nowrap; max-width: 260px; overflow: hidden;
}
.bp-status-dropdown-toggle .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.bp-status-dropdown-menu {
    position: absolute; bottom: 100%; left: 0; margin-bottom: 6px;
    background: #fff; color: var(--bp-text); border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25); min-width: 280px;
    z-index: 110; overflow: hidden;
}
.bp-status-dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; cursor: pointer; font-size: 13px;
}
.bp-status-dropdown-item:hover { background: var(--bp-bg, #f5f5f5); }
.bp-status-dropdown-item.active { background: var(--bp-active-bg, #e8f4f8); }
.bp-status-dropdown-item .dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.bp-add-bar button { background: var(--bp-teal); color:#fff; border:none; padding: 6px 12px; border-radius: 18px; white-space: nowrap; }
.bp-add-bar button.secondary { background: transparent; border: 1px solid rgba(255,255,255,0.45); }

.bp-marker-sheet {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; color: var(--bp-text);
    border-top-left-radius: 16px; border-top-right-radius: 16px;
    padding: 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    z-index: 200;
    max-height: 70vh; overflow-y: auto;
}
.bp-marker-sheet .sheet-handle { width: 40px; height: 4px; background: #ccc; border-radius: 2px; margin: -8px auto 12px; }
.bp-marker-sheet .status-pick {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1px solid var(--bp-border); border-radius: 8px;
    margin-bottom: 6px; background: #fff; cursor: pointer;
}
.bp-marker-sheet .status-pick.active { border-color: var(--bp-teal); background: var(--bp-active-bg); }
.bp-marker-sheet .status-pick .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--bp-border); flex-shrink: 0; }
.bp-marker-sheet .marker-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bp-marker-sheet .marker-tip { color: var(--bp-text-muted); font-size: 12px; margin-top: 6px; }
.bp-marker-sheet .history-row { padding: 6px 0; border-bottom: 1px solid #f0eeed; font-size: 12px; }
.bp-marker-sheet .history-row .when { color: var(--bp-text-muted); font-size: 11px; }

.bp-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; border: 1px solid transparent; font-size: 14px; cursor: pointer; }
.bp-btn-primary { background: var(--bp-teal); color: #fff; }
.bp-btn-secondary { background: #fff; color: var(--bp-text); border-color: var(--bp-border); }
.bp-btn-danger { background: #fff; color: var(--bp-danger); border-color: var(--bp-border); }

/* Shared form styling (Tillbud, Dagbok etc.) */
.bp-card { background: var(--bp-surface); border: 1px solid var(--bp-border); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.bp-form-group { margin-bottom: 12px; }
.bp-inline-note {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #fff6e0; color: #7a5200;
    border: 1px solid #f0dcae; border-radius: 6px;
    font-size: 13px;
}
.bp-inline-note a { color: inherit; font-weight: 600; text-decoration: underline; }
.bp-form-group label { display: block; margin-bottom: 4px; font-weight: 500; }
.bp-form-group input[type="text"],
.bp-form-group input[type="datetime-local"],
.bp-form-group input[type="date"],
.bp-form-group input[type="file"],
.bp-form-group textarea,
.bp-form-group select {
    box-sizing: border-box;
    display: block;
    width: 100%; max-width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--bp-border); border-radius: 6px;
    font: inherit; background: #fff;
}
.bp-form-group textarea { resize: vertical; min-height: 72px; }
.bp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; }
.bp-form-row > * { min-width: 0; }
@media (max-width: 640px) { .bp-form-row { grid-template-columns: 1fr; } }
.bp-radio-row { display: flex; gap: 14px; }
.bp-radio-row input { margin-right: 4px; }

.bp-photo-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bp-photo-thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--bp-border); }
.bp-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bp-photo-thumb button { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.7); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; line-height: 1; font-weight: 700; }

.bp-signature-wrap { border: 1px dashed var(--bp-border); border-radius: 8px; padding: 8px; background: #fafbfd; overflow: hidden; }
.bp-signature-wrap canvas { width: 100% !important; max-width: 100%; height: 160px; display: block; background: #fff; border-radius: 6px; touch-action: none; }
.bp-signature-actions { display: flex; justify-content: flex-end; margin-top: 6px; }

/* Dagbok — workforce grid */
.bp-dagbok-grid { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; background: #fff; border: 1px solid var(--bp-border); border-radius: 8px; overflow: hidden; }
.bp-dagbok-grid thead th { background: #f4f6f9; color: var(--bp-text-muted); font-weight: 600; font-size: 11px; letter-spacing: .3px; text-transform: uppercase; padding: 8px 6px; border-bottom: 1px solid var(--bp-border); text-align: center; }
.bp-dagbok-grid thead th:first-child { text-align: left; padding-left: 12px; width: 200px; }
.bp-dagbok-grid thead th.bp-dg-anm-h { text-align: left; padding-left: 10px; }
.bp-dagbok-grid tbody td { padding: 0; border-top: 1px solid var(--bp-border); vertical-align: middle; }
.bp-dagbok-grid tbody tr:first-child td { border-top: 0; }
.bp-dagbok-grid td.bp-dg-label { padding: 10px 12px; font-weight: 600; border-right: 1px solid var(--bp-border); background: #fafbfc; }
.bp-dagbok-grid td.bp-dg-day { text-align: center; border-right: 1px solid var(--bp-border); }
.bp-dagbok-grid td.bp-dg-anm { padding: 0; border-left: 0; }
.bp-dagbok-grid td.bp-dg-day input[type="number"],
.bp-dagbok-grid td.bp-dg-anm input[type="text"] { width: 100%; height: 36px; box-sizing: border-box; padding: 0 6px; border: 0; background: transparent; font: inherit; color: inherit; }
.bp-dagbok-grid td.bp-dg-day input[type="number"] { text-align: center; padding: 0 2px; -moz-appearance: textfield; }
.bp-dagbok-grid td.bp-dg-day input::-webkit-outer-spin-button,
.bp-dagbok-grid td.bp-dg-day input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bp-dagbok-grid td.bp-dg-day input:focus,
.bp-dagbok-grid td.bp-dg-anm input:focus { outline: 0; background: #eef6fb; }
.bp-dagbok-grid td.bp-dg-day input:disabled,
.bp-dagbok-grid td.bp-dg-anm input:disabled { background: transparent; color: var(--bp-ink); }
/* Weather cell — captions live once in the "Väder" column; day cells show only
   the three checkboxes, stacked and aligned row-for-row with those captions. */
.bp-dagbok-grid td.bp-dg-weather { padding: 6px 6px; border-right: 1px solid var(--bp-border); font-size: 11px; }
.bp-dg-weather-grid { display: grid; grid-auto-rows: 16px; row-gap: 2px; justify-items: center; align-items: center; }
.bp-dg-weather-grid input[type="checkbox"] { margin: 0; }
.bp-dagbok-grid td.bp-dg-weather-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.bp-dg-weather-title { font-weight: 600; }
.bp-dg-weather-captions { display: grid; grid-auto-rows: 16px; row-gap: 2px; align-items: center; justify-items: end; text-align: right; font-size: 11px; }
.bp-dg-weather-captions span { white-space: nowrap; }

/* Dagbok workforce: day-tabs + per-day view on phones. Desktop keeps the full
   grid; the tabs and per-day view are hidden above 768px. */
.bp-dg-tabs { display: none; }
.bp-dg-dayview { display: none; }
.bp-dg-tab { border: 1px solid var(--bp-border); background: #fff; color: var(--bp-text); border-radius: 16px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.bp-dg-tab.active { background: var(--bp-teal); color: #fff; border-color: var(--bp-teal); }
.bp-dg-dayview-title { font-weight: 700; margin-bottom: 4px; }
.bp-dg-dayrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--bp-border); }
.bp-dg-dayrow:first-of-type { border-top: 0; }
.bp-dg-dayrow-label { flex: 1; font-weight: 600; font-size: 14px; }
.bp-dg-dayrow input[type="number"] { width: 84px; height: 40px; text-align: center; border: 1px solid var(--bp-border); border-radius: 8px; font: inherit; -moz-appearance: textfield; }
.bp-dg-dayrow input::-webkit-outer-spin-button, .bp-dg-dayrow input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bp-dg-dayweather { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--bp-border); }
.bp-dg-dayweather label { display: flex; align-items: center; gap: 5px; font-size: 14px; }
.bp-dg-dayweather-label { font-weight: 600; }

@media (max-width: 768px) {
    .bp-dg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
    .bp-dg-table-wrap.bp-dg-hide-mobile { display: none; }
    .bp-dg-dayview.bp-dg-show-mobile { display: block; }
}

/* Generic modal used by Dagbok dialogs */
.bp-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 900; }
.bp-modal { box-sizing: border-box; position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--bp-border); border-radius: 12px; padding: 20px; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 92vw); max-height: 88vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,0.2); }

/* Public sign page */
.bp-sign-shell { max-width: 960px; margin: 0 auto; padding: 16px; }
.bp-sign-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.bp-sign-logo { width: 42px; height: 42px; object-fit: contain; }
.bp-sign-brand { font-weight: 700; font-size: 16px; color: var(--bp-ink); }
.bp-sign-project { color: var(--bp-text-muted); font-size: 13px; }

/* Impersonation */
.bp-impersonation-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #fff7e6; border-bottom: 1px solid #f0c674; color: #7a5b00;
    padding: 8px 14px; font-size: 13px;
}
.bp-impersonation-banner .bi { margin-right: 4px; }
.bp-btn-sm { padding: 4px 12px; font-size: 12px; }

/* The environment banner. Anything but Production carries one, above the
   navbar, in a colour the navy never uses. */
.bp-env-banner {
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    padding: 7px 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.bp-env-banner.bp-env-test { background: #D9480F; }
.bp-env-banner.bp-env-utv { background: #7B3FBF; }
.bp-env-banner.bp-env-local { background: #5F6B7A; }
