html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* safe area padding for notch devices */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0"idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC42NzgyIDI5MSA5Ny4wN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
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Modern enhancements */
:root {
  --accent:#2563eb;
  --accent-gradient:linear-gradient(135deg,#1e3a8a,#2563eb,#3b82f6);
  --danger-gradient:linear-gradient(135deg,#991b1b,#dc2626,#ef4444);
  --card-bg:rgba(255,255,255,0.85);
  --glass-border:rgba(255,255,255,0.3);
  --soft-shadow:0 4px 16px rgba(0,0,0,.08);
  --pwa-toast-width: 280px;
}

.mod-header {
  background:var(--accent-gradient);
  color:#fff;
  position:relative;
  overflow:hidden;
  z-index:10;
}
.mod-header h4,.mod-header h5,.mod-header span { color:#fff; }
.mod-header::after { content:""; position:absolute; inset:0; background:radial-gradient(circle at 80% 20%,rgba(255,255,255,.25),transparent 60%); opacity:.5; }
.mod-header .btn, .mod-header a.btn { position:relative; z-index:15; pointer-events:auto; }
/* global fix for floating action buttons layering */
.fab-add { position:fixed; right:1.25rem; bottom:1.25rem; z-index:100; }

.card-glass { background:var(--card-bg); backdrop-filter:blur(10px); border:1px solid var(--glass-border); box-shadow:var(--soft-shadow); }

.table-modern thead { background:#f8fafc; }
.table-modern th { font-weight:600; border-bottom:2px solid #e2e8f0; }
.table-modern td, .table-modern th { vertical-align:middle; }
.table-modern tbody tr:hover { background:#f1f5f9; transition:.2s; }

.badge-soft { background:#eef2ff; color:#1e3a8a; font-weight:500; }
.cost-chip { display:inline-block; padding:.35rem .7rem; border-radius:999px; font-size:.75rem; font-weight:600; background:#1e3a8a; color:#fff; box-shadow:0 2px 6px rgba(30,58,138,.35); }
.cost-chip.zero { background:#64748b; }

.action-bar-sticky { position:sticky; bottom:0; background:#fff; border-top:1px solid #e2e8f0; padding:.75rem 1rem; display:flex; justify-content:flex-end; gap:.5rem; backdrop-filter:blur(6px); }

.fab-add { position:fixed; right:1.25rem; bottom:1.25rem; z-index:50; background:var(--accent-gradient); color:#fff; width:54px; height:54px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:1.4rem; box-shadow:0 6px 18px rgba(0,0,0,.25); border:none; }
.fab-add:hover { transform:translateY(-3px); box-shadow:0 10px 22px rgba(0,0,0,.3); }

.section-title { font-weight:600; letter-spacing:.5px; display:flex; align-items:center; gap:.5rem; }
.section-title i { opacity:.7; }

.summary-bar { display:flex; flex-wrap:wrap; gap:.5rem .75rem; margin-bottom:1rem; }
.summary-bar .item { background:#f1f5f9; padding:.4rem .75rem; border-radius:.5rem; font-size:.75rem; font-weight:500; color:#334155; }
.summary-bar .item strong { color:#0f172a; }

.inline-edit-buttons { display:flex; gap:.35rem; }
.inline-edit-buttons .btn { padding:.35rem .6rem; }

/* Form separation */
.form-section { background:#f8fafc; padding:1rem 1.25rem; border-radius:.75rem; border:1px solid #e2e8f0; margin-bottom:1rem; }
.form-floating>label { font-weight:500; }

.gradient-btn { background:var(--accent-gradient); color:#fff; border:none; }
.gradient-btn:disabled { opacity:.6; }

.header-sub { font-size:.75rem; opacity:.85; margin-top:-.25rem; }

.offline-indicator {
    position:fixed; left:50%; top:0; transform:translateX(-50%);
    background:#dc2626; color:#fff; padding:.35rem .9rem; font-size:.8rem; z-index:2000;
    border-bottom-left-radius:.5rem; border-bottom-right-radius:.5rem;
    box-shadow:0 2px 6px rgba(0,0,0,.25);
    animation:slideDown .4s ease;
}
@keyframes slideDown { from { transform:translate(-50%, -100%);} to { transform:translate(-50%,0);} }

/* PWA install toast */
.pwa-install-toast {
  position:fixed; right:1rem; bottom:1rem; width:var(--pwa-toast-width);
  background:var(--card-bg); backdrop-filter:blur(8px); border:1px solid var(--glass-border);
  box-shadow:0 4px 14px rgba(0,0,0,.18); border-radius:.75rem; padding:.75rem .85rem; z-index:1200;
  animation:fadeInScale .35s ease;
}
@keyframes fadeInScale { from { opacity:0; transform:translateY(10px) scale(.95);} to { opacity:1; transform:translateY(0) scale(1);} }

/* Responsive improvements */
@media (max-width: 768px){
  .table-responsive-wrap { overflow-x:auto; }
  .fab-add { right:.85rem; bottom:.85rem; }
}