:root {
    --cp-primary: #1e3a5f;
    --cp-primary-dark: #152b45;
    --cp-primary-soft: #eef3f9;
    --cp-accent: #f59e0b;
    --cp-accent-dark: #d97706;
    --cp-accent-soft: #fff6e6;
    --cp-bg: #f5f7fa;
    --cp-surface: #ffffff;
    --cp-border: #e4e9f0;
    --cp-border-strong: #d5dce6;
    --cp-text: #23303f;
    --cp-muted: #64748b;
    --cp-green: #16a34a;
    --cp-amber: #b45309;
    --cp-red: #dc2626;
    --cp-blue: #2563eb;
    --cp-purple: #7c3aed;
    --cp-card-radius: 14px;
    --cp-shadow: 0 1px 2px rgba(21, 43, 69, 0.04), 0 4px 16px rgba(21, 43, 69, 0.05);
    --cp-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
    font-size: 16px;
}

body {
    background-color: var(--cp-bg);
    color: var(--cp-text);
    font-family: var(--cp-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: rgba(245, 158, 11, 0.25);
}

/* ---------- Navbar ---------- */
.crane-navbar {
    background-color: var(--cp-surface);
    border-bottom: 1px solid var(--cp-border);
    box-shadow: 0 1px 3px rgba(21, 43, 69, 0.06);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-right: 0.55rem;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--cp-primary) 0%, var(--cp-primary-dark) 100%);
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.35);
}

.crane-navbar .navbar-brand {
    display: inline-flex;
    align-items: center;
    color: var(--cp-primary-dark);
    font-weight: 800;
    font-size: 1.12rem;
    letter-spacing: -0.2px;
}

.crane-navbar .navbar-brand .brand-pro {
    color: var(--cp-accent);
}

.brand-crane {
    display: none;
}

.crane-navbar .navbar-toggler {
    border-color: #d3dbe6;
}

.crane-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2869, 82, 99, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.platform-pill {
    margin-left: 0.55rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    background-color: var(--cp-accent-soft);
    color: var(--cp-accent-dark);
    border: 1px solid #f5dba7;
    vertical-align: middle;
}

.crane-navbar .nav-link {
    color: #455263;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    margin: 0 0.1rem;
}

.crane-navbar .nav-link:hover {
    color: var(--cp-primary);
    background-color: var(--cp-primary-soft);
}

.crane-navbar .nav-link.active {
    color: var(--cp-primary);
    background-color: var(--cp-primary-soft);
}

.nav-add-job {
    display: inline-flex;
    align-items: center;
    background-color: var(--cp-accent);
    border: 1px solid var(--cp-accent);
    color: #fff !important;
    font-weight: 700;
    border-radius: 8px;
    padding: 0.42rem 0.9rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
    text-decoration: none;
}

.nav-add-job:hover {
    background-color: var(--cp-accent-dark);
    border-color: var(--cp-accent-dark);
    color: #fff;
}

.nav-user {
    color: var(--cp-muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding-right: 0.75rem;
    white-space: nowrap;
}

.nav-user .nav-user-name {
    color: var(--cp-primary-dark);
    font-weight: 700;
}

.nav-logout {
    color: #455263;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.nav-logout:hover {
    color: var(--cp-red);
    background-color: #fdefef;
}

.crane-navbar .dropdown-menu {
    background-color: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(21, 43, 69, 0.14);
    padding: 0.35rem;
}

.crane-navbar .dropdown-item {
    border-radius: 7px;
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--cp-text);
    padding: 0.5rem 0.75rem;
}

.crane-navbar .dropdown-item:hover {
    background-color: var(--cp-primary-soft);
    color: var(--cp-primary);
}

/* ---------- Cards & containers ---------- */
.card {
    background-color: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-card-radius);
    box-shadow: var(--cp-shadow);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--cp-border);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--cp-primary-dark);
    padding: 0.9rem 1.15rem;
    border-radius: var(--cp-card-radius) var(--cp-card-radius) 0 0 !important;
}

.card-body {
    padding: 1.15rem;
}

.card-footer {
    background-color: #fff;
    border-top: 1px solid var(--cp-border);
    padding: 1rem 1.25rem;
}

.business-heading {
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--cp-primary-dark);
    margin-bottom: 0.2rem;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: 9px;
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--cp-primary-dark);
    border-color: var(--cp-primary-dark);
    box-shadow: 0 3px 10px rgba(30, 58, 95, 0.25);
}

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

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

.btn-accent {
    background-color: var(--cp-accent);
    border-color: var(--cp-accent);
    color: #fff;
}

.btn-accent:hover,
.btn-accent:focus {
    background-color: var(--cp-accent-dark);
    border-color: var(--cp-accent-dark);
    color: #fff;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

.btn-add-job {
    padding: 0.7rem 1.15rem;
    font-size: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-add-expense {
    padding: 0.7rem 1.15rem;
    font-size: 1rem;
    border-radius: 10px;
    background-color: rgba(245, 158, 11, 0.08);
    border: 1px solid var(--cp-accent);
    color: var(--cp-accent-dark);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.btn-add-expense:hover,
.btn-add-expense:active {
    background-color: var(--cp-accent);
    border-color: var(--cp-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-add-advance {
    font-size: 0.85rem;
    border-radius: 8px;
    background-color: rgba(245, 158, 11, 0.08);
    border: 1px solid var(--cp-accent);
    color: var(--cp-accent-dark);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.btn-add-advance:hover,
.btn-add-advance:active {
    background-color: var(--cp-accent);
    border-color: var(--cp-accent);
    color: #fff;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

.btn-outline-secondary {
    color: #475569;
    border-color: var(--cp-border-strong);
}

.btn-outline-secondary:hover {
    background-color: #f1f5f9;
    border-color: var(--cp-border-strong);
    color: var(--cp-primary-dark);
}

.btn-outline-danger:hover,
.btn-outline-success:hover {
    box-shadow: none;
}

.btn-delete {
    background-color: var(--cp-red);
    border-color: var(--cp-red);
    color: #fff;
}

.btn-delete:hover,
.btn-delete:focus {
    background-color: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.35);
}

.btn-delete:disabled {
    background-color: #f5b5b5;
    border-color: #f5b5b5;
    color: #fff;
    cursor: not-allowed;
    box-shadow: none;
}

.text-primary {
    color: var(--cp-primary) !important;
}

/* ---------- Page header ---------- */
.page-title {
    color: var(--cp-primary-dark);
    font-weight: 800;
    letter-spacing: -0.3px;
}

.page-subtitle {
    color: var(--cp-muted);
    font-size: 0.92rem;
}

/* ---------- KPI / stat cards ---------- */
.stat-card {
    border-radius: var(--cp-card-radius);
    padding: 1rem 1.15rem;
    height: 100%;
    background-color: var(--cp-surface);
    border: 1px solid var(--cp-border);
    box-shadow: var(--cp-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 43, 69, 0.1);
}

.stat-card .stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--cp-muted);
}

.stat-card .stat-value {
    font-size: clamp(1.3rem, 4vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--cp-primary-dark);
    margin-top: 0.25rem;
    word-break: break-word;
}

.stat-card.blue {
    border-top: 3px solid var(--cp-blue);
}

.stat-card.blue .stat-value {
    color: var(--cp-blue);
}

.stat-card.purple {
    border-top: 3px solid var(--cp-purple);
}

.stat-card.purple .stat-value {
    color: var(--cp-purple);
}

.stat-card.green {
    border-top: 3px solid var(--cp-green);
}

.stat-card.green .stat-value {
    color: var(--cp-green);
}

.stat-card.warm {
    border-top: 3px solid var(--cp-amber);
}

.stat-card.warm .stat-value {
    color: var(--cp-amber);
}

.stat-card.red {
    border-top: 3px solid var(--cp-red);
}

.stat-card.red .stat-value {
    color: var(--cp-red);
}

.stat-card.accent {
    border-top: 3px solid var(--cp-accent);
}

.stat-card.accent .stat-value {
    color: var(--cp-accent-dark);
}

.stat-card.small .stat-value {
    font-size: clamp(1.05rem, 3vw, 1.35rem);
}

/* ---------- KPI rich cards (dashboards) ---------- */
.kpi-link {
    display: block;
    text-decoration: none;
    height: 100%;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    height: 100%;
    padding: 1rem 1.15rem;
    border-radius: var(--cp-card-radius);
    background-color: var(--cp-surface);
    border: 1px solid var(--cp-border);
    box-shadow: var(--cp-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 43, 69, 0.1);
    border-color: var(--cp-border-strong);
}

.kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 1.2rem;
}

.kpi-ico-blue { background-color: #eff5ff; }
.kpi-ico-purple { background-color: #f4effe; }
.kpi-ico-green { background-color: #ecfdf3; }
.kpi-ico-amber { background-color: #fef6e7; }
.kpi-ico-red { background-color: #fdefef; }
.kpi-ico-gold { background-color: var(--cp-accent-soft); }

.kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--cp-muted);
    line-height: 1.3;
}

.kpi-value {
    font-size: clamp(1.3rem, 4vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--cp-primary-dark);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.kpi-note {
    font-size: 0.72rem;
    color: var(--cp-muted);
    margin-top: 0.15rem;
}

.kpi-val-green { color: var(--cp-green); }
.kpi-val-red { color: var(--cp-red); }
.kpi-val-amber { color: var(--cp-amber); }
.kpi-val-blue { color: var(--cp-blue); }
.kpi-val-gold { color: var(--cp-accent-dark); }

/* ---------- Tables ---------- */
.table {
    --bs-table-bg: transparent;
    color: var(--cp-text);
    font-size: 0.92rem;
    margin-bottom: 0;
}

.table thead th {
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #5a6b7d;
    background-color: #f7f9fc;
    white-space: nowrap;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--cp-border);
}

.table tbody td {
    vertical-align: middle;
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid #eef2f7;
}

.table > :not(:last-child) > :last-child > * {
    border-bottom-color: #eef2f7;
}

.table-hover tbody tr {
    transition: background-color 0.12s ease;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

.table-sm tbody td {
    padding: 0.55rem 0.9rem;
}

.table-responsive {
    border-radius: 10px;
}

/* ---------- Badges ---------- */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    border-radius: 999px;
    padding: 0.35em 0.7em;
    letter-spacing: 0.2px;
}

.badge-paid,
.badge-active,
.badge-working {
    background-color: #ecfdf3;
    color: #15803d;
    border: 1px solid #b7ecd0;
}

.badge-pending {
    background-color: #fef6e7;
    color: var(--cp-amber);
    border: 1px solid #f5dba7;
}

.badge-maintenance {
    background-color: #fef6e7;
    color: #b45309;
    border: 1px solid #f5dba7;
}

.badge-available {
    background-color: #eff5ff;
    color: #1d4ed8;
    border: 1px solid #c8dcff;
}

.badge-inactive {
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid var(--cp-border);
}

.badge-danger {
    background-color: #fdefef;
    color: var(--cp-red);
    border: 1px solid #f5c6c6;
}

.badge-neutral,
.badge-fuel,
.bg-secondary.badge,
.badge.bg-secondary {
    background-color: #f1f5f9;
    color: #55637a;
    border: 1px solid var(--cp-border);
}

.badge-paid::before,
.badge-active::before,
.badge-working::before,
.badge-available::before,
.badge-pending::before,
.badge-maintenance::before,
.badge-danger::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 0.4em;
    vertical-align: baseline;
    opacity: 0.85;
}

/* ---------- Forms ---------- */
.form-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: #3d4c5e;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border-radius: 9px;
    border-color: #d3dbe6;
    padding: 0.55rem 0.8rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cp-primary);
    box-shadow: 0 0 0 0.22rem rgba(30, 58, 95, 0.12);
}

.form-control-lg,
.form-select-lg {
    border-radius: 10px;
    padding: 0.65rem 0.95rem;
}

.input-group-text {
    border-radius: 9px 0 0 9px;
    border-color: #d3dbe6;
    background-color: #f7f9fc;
    color: #40506b;
    font-weight: 600;
}

.input-group > .form-control,
.input-group > .form-select {
    border-radius: 0 9px 9px 0;
}

.input-group-text:has(+ .form-control),
.input-group-text:has(+ .form-select) {
    border-right: 0;
}

.form-text {
    font-size: 0.78rem;
    color: var(--cp-muted);
}

.form-check-input:checked {
    background-color: var(--cp-primary);
    border-color: var(--cp-primary);
}

.btn-check + .btn {
    border-radius: 9px;
    font-weight: 600;
}

.btn-check + .btn-outline-success:hover,
.btn-check + .btn-outline-warning:hover {
    box-shadow: none;
}

.btn-check:checked + .btn-outline-success {
    background-color: #ecfdf3;
    border-color: var(--cp-green);
    color: #15803d;
}

.btn-check:checked + .btn-outline-warning {
    background-color: #fef6e7;
    border-color: var(--cp-amber);
    color: var(--cp-amber);
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 0.93rem;
    padding: 0.85rem 1.1rem;
}

.alert-success {
    background-color: #ecfdf3;
    border-color: #b7ecd0;
    color: #15803d;
}

.alert-warning {
    background-color: #fef6e7;
    border-color: #f5dba7;
    color: var(--cp-amber);
}

.alert-danger {
    background-color: #fdefef;
    border-color: #f5c6c6;
    color: #b91c1c;
}

.alert-info {
    background-color: #eff5ff;
    border-color: #c8dcff;
    color: #1d4ed8;
}

/* ---------- Empty states ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.75rem 1.5rem;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background-color: #f0f4fa;
    border: 1px solid var(--cp-border);
    font-size: 1.8rem;
}

.empty-title {
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--cp-primary-dark);
    margin-top: 0.9rem;
}

.empty-text {
    font-size: 0.9rem;
    color: var(--cp-muted);
    max-width: 420px;
    margin: 0.25rem auto 0;
}

.empty-action {
    margin-top: 1.15rem;
}

.empty-note {
    padding: 1.4rem;
    text-align: center;
    color: var(--cp-muted);
    font-size: 0.9rem;
}

/* ---------- Job create / form sections ---------- */
.job-form-card .section-divider {
    border-top: 1px solid var(--cp-border);
    margin: 1.4rem 0 1.2rem;
}

.form-section-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--cp-primary);
    margin-bottom: 0.9rem;
}

.form-section-heading .sec-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background-color: var(--cp-primary);
    color: #fff;
    font-size: 0.68rem;
}

/* legacy boxed sections kept working */
.job-form-section {
    background-color: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-card-radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--cp-shadow);
}

.job-form-section h5 {
    color: var(--cp-primary-dark);
    font-weight: 700;
}

/* ---------- Detail lists ---------- */
.dt-item {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #eef2f7;
}

.dt-item .dt-label {
    flex: 0 0 120px;
    color: var(--cp-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.dt-item .dt-value {
    flex: 1 1 auto;
    font-weight: 600;
    color: var(--cp-text);
    word-break: break-word;
}

/* ---------- Financial summary (report / details) ---------- */
.fin-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid #eef2f7;
    font-size: 0.93rem;
}

.fin-row .fin-label {
    color: var(--cp-muted);
    font-weight: 500;
}

.fin-row .fin-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.fin-row.fin-total {
    border-bottom: none;
    padding-top: 0.75rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--cp-border);
}

.report-net-card {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--cp-primary) 0%, var(--cp-primary-dark) 100%);
    color: #fff;
    border-radius: 11px;
    padding: 0.9rem 1.1rem;
    font-weight: 700;
}

.report-net-card strong {
    font-size: 1.25rem;
    letter-spacing: -0.4px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Amounts ---------- */
.price-positive {
    color: #15803d;
    font-weight: 700;
}

.price-negative {
    color: var(--cp-red);
    font-weight: 700;
}

.money {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* ---------- Footer ---------- */
.footer {
    position: relative;
    bottom: 0;
    width: 100%;
    padding: 1.1rem 0;
    background-color: var(--cp-surface);
    border-top: 1px solid var(--cp-border);
    color: var(--cp-muted);
    font-size: 0.85rem;
}

/* ---------- Login ---------- */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1400px 600px at 10% -10%, rgba(30, 58, 95, 0.14) 0%, transparent 60%),
        radial-gradient(1200px 500px at 110% 110%, rgba(245, 158, 11, 0.12) 0%, transparent 55%),
        linear-gradient(160deg, #eef3f9 0%, #f5f7fa 55%, #e9eff7 100%);
    padding: 1.5rem;
}

.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--cp-border);
    box-shadow: 0 12px 40px rgba(21, 43, 69, 0.14);
    overflow: hidden;
}

.login-card .card-body {
    padding: 2.25rem;
    background-color: var(--cp-surface);
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--cp-primary-dark);
    letter-spacing: -0.4px;
}

.login-brand .brand-pro {
    color: var(--cp-accent);
}

.login-sub {
    color: var(--cp-muted);
    font-size: 0.9rem;
}

.login-demos {
    background-color: #f7f9fc;
    border: 1px solid var(--cp-border);
    border-radius: 11px;
    padding: 0.8rem 1rem;
}

/* ---------- My Team ---------- */
.team-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 1.15rem;
    border-bottom: 1px solid var(--cp-border);
}

.team-row:last-child {
    border-bottom: 0;
}

.team-row-inactive {
    opacity: 0.55;
}

.team-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--cp-primary-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.team-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 0;
    flex: 1 1 auto;
}

.team-name {
    font-weight: 700;
    color: var(--cp-primary-dark);
}

.team-phone {
    color: var(--cp-muted);
    font-variant-numeric: tabular-nums;
    margin-right: 0.5rem;
}

.team-phone-missing {
    font-style: italic;
}

.team-call {
    flex: 0 0 auto;
}

.badge-driver {
    background-color: #eff5ff;
    color: #1d4ed8;
    border: 1px solid #c8dcff;
}

.badge-driver::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 0.4em;
    vertical-align: baseline;
    opacity: 0.85;
}

.badge-helper {
    background-color: #e6fffb;
    color: #0f766e;
    border: 1px solid #b3ece4;
}

.badge-helper::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 0.4em;
    vertical-align: baseline;
    opacity: 0.85;
}

@media (max-width: 575.98px) {
    .team-phone {
        display: none;
    }

    .team-row {
        gap: 0.7rem;
        padding: 0.7rem 0.9rem;
    }
}

/* ---------- Misc ---------- */
.text-muted {
    color: var(--cp-muted) !important;
}

hr {
    border-color: var(--cp-border);
    opacity: 1;
}

@media (max-width: 767.98px) {
    .crane-navbar .nav-user {
        display: none;
    }

    .nav-right {
        margin-top: 0.5rem;
    }
}

@media (max-width: 576px) {
    .stat-card {
        padding: 0.85rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .btn-add-job {
        font-size: 1rem;
        padding: 0.7rem 1rem;
    }
}

/* ---------- Driver (mobile-first touches) ---------- */
.greeting {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--cp-primary-dark);
    letter-spacing: -0.4px;
}

.driver .card-header,
.role-driver .card-header {
    font-weight: 600;
    color: var(--cp-primary-dark);
}

.min-w-0 {
    min-width: 0;
}

/* large thumb-friendly buttons in the driver app */
@media (max-width: 991.98px) {
    .greeting {
        font-size: 1.25rem;
    }
}

/* ---------- Track My Cranes (fleet operations center) ---------- */
.track-map {
    height: 620px;
    width: 100%;
    background: #eaf1ec;
    z-index: 0;
}

.map-shell {
    position: relative;
    border-radius: 0 0 var(--cp-radius, 14px) var(--cp-radius, 14px);
    overflow: hidden;
}

.track-map-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.88);
    z-index: 500;
    pointer-events: none;
    padding: 1.5rem;
}

.summary-tile {
    background: #fff;
    border: 1px solid var(--cp-border);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    text-align: center;
    min-height: 84px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.summary-num {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--cp-primary-dark);
    line-height: 1.1;
}

.summary-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #55637a;
    margin-top: 0.2rem;
}

.fleet-search {
    max-width: 380px;
}

.fleet-filters .btn {
    border-color: var(--cp-border);
    color: #334155;
}

.fleet-filters .btn.active {
    background: var(--cp-accent);
    border-color: var(--cp-accent);
    color: #fff;
}

.fleet-card {
    border: 1px solid var(--cp-border);
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.6rem;
    background: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.fleet-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
    cursor: pointer;
}

.fleet-card-live {
    border-left: 3px solid #22c55e;
}

.fleet-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.fleet-crane b {
    color: var(--cp-primary-dark);
}

.fleet-crane.big {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}

.fleet-card-driver {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin: 0.35rem 0 0.45rem;
}

.fleet-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #55637a;
    margin-bottom: 0.2rem;
}

.fleet-card-foot {
    margin-top: 0.5rem;
}

.fleet-time {
    color: #334155;
    font-weight: 600;
}

.fleet-detail .dt-value .badge {
    position: static;
}

/* leaflet crane markers */
.cp-crane-marker {
    background: transparent;
    border: none;
}

.cp-crane-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.cp-crane-live {
    background: #22c55e;
}

.cp-crane-stale {
    background: #f43f5e;
}

.crane-popup-title {
    font-weight: 700;
    color: var(--cp-primary-dark);
    margin-bottom: 0.4rem;
}

.cp-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: cp-pulse 1.4s ease-in-out infinite;
}

@keyframes cp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}

@media (max-width: 991.98px) {
    .track-map {
        height: 440px;
    }
}
/* ===============================================================
   Design system v2 — shared foundations
   One place for typography, focus, buttons, badges, tables, forms,
   cards, empty states, alerts, modals, responsive and print rules.
   =============================================================== */

/* ---------- Spacing & radius tokens ---------- */
:root {
    --cp-radius: var(--cp-card-radius);
    --cp-radius-sm: 9px;
    --cp-radius-lg: 18px;
    --cp-space-1: 0.35rem;
    --cp-space-2: 0.6rem;
    --cp-space-3: 0.9rem;
    --cp-space-4: 1.25rem;
    --cp-space-5: 1.75rem;
    --cp-space-6: 2.4rem;
    --cp-gap-1: 0.5rem;
    --cp-gap-2: 0.75rem;
    --cp-gap-3: 1.1rem;
    --cp-green-ink: #15803d;
    --cp-amber-ink: #b45309;
    --cp-red-ink: #b91c1c;
    --cp-blue-ink: #1d4ed8;
    --cp-font-kn: "Noto Sans Kannada", "Nirmala UI", "Tunga", system-ui, sans-serif;
    --cp-focus-ring: 0 0 0 3px rgba(30, 58, 95, 0.22);
    --cp-shadow-lg: 0 18px 40px rgba(21, 43, 69, 0.14);
    --cp-page-title-size: clamp(1.3rem, 1.05rem + 1vw, 1.6rem);
    --cp-section-title-size: 1.02rem;
}

/* ---------- Language-aware typography ---------- */
html[lang="kn"] body,
html[lang="kn"] .form-control,
html[lang="kn"] .form-select {
    font-family: var(--cp-font-kn);
    line-height: 1.65;
}

html[lang="kn"] .btn,
html[lang="kn"] .badge,
html[lang="kn"] .nav-link,
html[lang="kn"] .page-subtitle {
    letter-spacing: 0;
}

html[lang="kn"] .table thead th {
    letter-spacing: 0.2px;
}

/* ---------- Focus visibility (keyboard only) ---------- */
:focus-visible {
    outline: 2px solid var(--cp-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.form-control:focus-visible,
.form-select:focus-visible {
    outline: none;
    box-shadow: var(--cp-focus-ring);
    border-color: var(--cp-primary);
}

.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible {
    outline: 2px solid var(--cp-primary);
    outline-offset: 2px;
}

/* ---------- Skip link ---------- */
.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -100px;
    z-index: 2000;
    padding: 0.6rem 1rem;
    border-radius: 0 0 10px 10px;
    background: var(--cp-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: var(--cp-shadow-lg);
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

#main-content:focus {
    outline: none;
}

/* ---------- Page header system ---------- */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--cp-gap-2);
    margin-bottom: 1.15rem;
}

.page-head > :first-child {
    min-width: 0;
}

.page-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.page-title {
    font-size: var(--cp-page-title-size);
    line-height: 1.25;
    margin: 0;
    color: var(--cp-primary-dark);
    font-weight: 800;
    letter-spacing: -0.3px;
}

.page-subtitle {
    color: var(--cp-muted);
    font-size: 0.92rem;
    margin-top: 0.15rem;
}

.section-title {
    font-size: var(--cp-section-title-size);
    font-weight: 700;
    color: var(--cp-primary-dark);
    margin: 0;
}

.section-note {
    font-size: 0.82rem;
    color: var(--cp-muted);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: var(--cp-radius-sm);
    font-weight: 600;
    line-height: 1.3;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 0.75rem 1.2rem;
    font-size: 1.02rem;
    border-radius: 11px;
}

.btn-outline-accent {
    color: var(--cp-accent-dark);
    border-color: var(--cp-accent);
    background-color: transparent;
}

.btn-outline-accent:hover,
.btn-outline-accent:focus {
    background-color: var(--cp-accent);
    border-color: var(--cp-accent);
    color: #fff;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}

.btn-outline-success {
    color: var(--cp-green-ink);
    border-color: #9fdcb8;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background-color: #ecfdf3;
    border-color: var(--cp-green);
    color: var(--cp-green-ink);
}

.btn-outline-warning {
    color: var(--cp-amber-ink);
    border-color: #f0c98a;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus {
    background-color: #fef6e7;
    border-color: var(--cp-amber);
    color: var(--cp-amber-ink);
}

.btn-outline-dark {
    color: #334155;
    border-color: #cbd5e1;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
    background-color: #334155;
    border-color: #334155;
    color: #fff;
}

.btn-confirm-delete {
    background-color: var(--cp-red);
    border-color: var(--cp-red);
    color: #fff;
    font-weight: 600;
    border-radius: var(--cp-radius-sm);
}

.btn-confirm-delete:hover,
.btn-confirm-delete:focus {
    background-color: var(--cp-red-ink);
    border-color: var(--cp-red-ink);
    color: #fff;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3);
}

.btn-longterm {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    border-radius: var(--cp-radius-sm);
    border: 1px solid var(--cp-border-strong);
    background-color: var(--cp-surface);
    color: var(--cp-primary);
}

.btn-longterm:hover,
.btn-longterm:focus {
    background-color: var(--cp-primary-soft);
    border-color: var(--cp-primary);
    color: var(--cp-primary-dark);
}

.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-link {
    text-decoration: none;
}

.btn-add-job,
.btn-add-expense {
    padding: 0.6rem 1.05rem;
    font-size: 0.95rem;
    border-radius: 10px;
}

.btn-add-job {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.32);
}

/* ---------- Tables ---------- */
.table {
    font-variant-numeric: tabular-nums;
}

.table > thead > tr > th {
    vertical-align: middle;
}

.table tbody td.money,
.table tbody td .money {
    white-space: nowrap;
}

.table .text-end,
.table .text-end.money {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table a {
    font-weight: 600;
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
}

.table td > .btn + .btn,
.table td > .btn + form,
.table td > form + .btn {
    margin-left: 0.3rem;
}

.card > .table-responsive {
    border-bottom-left-radius: var(--cp-card-radius);
    border-bottom-right-radius: var(--cp-card-radius);
}

.card > .table-responsive > .table > thead > tr > th:first-child {
    padding-left: 1.15rem;
}

.card > .table-responsive > .table > tbody > tr > td:first-child {
    padding-left: 1.15rem;
}

.card > .table-responsive > .table > thead > tr > th:last-child,
.card > .table-responsive > .table > tbody > tr > td:last-child {
    padding-right: 1.15rem;
}

.table-caption {
    caption-side: top;
    padding: 0.85rem 1.15rem 0;
    font-size: 0.78rem;
    color: var(--cp-muted);
}

/* horizontal scroll affordance for data tables on small screens */
@media (max-width: 991.98px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background:
            linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left center,
            linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right center,
            radial-gradient(farthest-side at 0 50%, rgba(21, 43, 69, 0.14), rgba(21, 43, 69, 0)) left center,
            radial-gradient(farthest-side at 100% 50%, rgba(21, 43, 69, 0.14), rgba(21, 43, 69, 0)) right center;
        background-repeat: no-repeat;
        background-size: 34px 100%, 34px 100%, 13px 100%, 13px 100%;
        background-attachment: local, local, scroll, scroll;
    }
}

/* table -> stacked cards on phones */
@media (max-width: 575.98px) {
    .table-cards thead {
        display: none;
    }

    .table-cards,
    .table-cards tbody,
    .table-cards tr,
    .table-cards td {
        display: block;
        width: 100%;
    }

    .table-cards tr {
        border: 1px solid var(--cp-border);
        border-radius: 12px;
        background: var(--cp-surface);
        margin: 0 0 0.7rem;
        padding: 0.3rem 0.35rem;
    }

    .table-cards tr:last-child {
        margin-bottom: 0;
    }

    .table-cards td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.9rem;
        padding: 0.5rem 0.6rem;
        border: 0;
        text-align: right;
    }

    .table-cards td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        text-align: left;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.4px;
        text-transform: uppercase;
        color: var(--cp-muted);
    }

    .table-cards td[data-label=""] {
        padding-left: 0;
        padding-right: 0;
    }

    .table-cards td[data-label=""]::before {
        content: none;
    }

    .table-cards td > * {
        margin-left: auto;
    }
}

/* ---------- Badges ---------- */
.badge-ok,
.badge-muted,
.badge-neutral {
    background-color: #f1f5f9;
    color: #55637a;
    border: 1px solid var(--cp-border);
}

.badge-ok {
    background-color: #ecfdf3;
    color: var(--cp-green-ink);
    border-color: #b7ecd0;
}

.badge-warn,
.badge-warning,
.badge-pending,
.badge-maintenance {
    background-color: #fef6e7;
    color: var(--cp-amber-ink);
    border: 1px solid #f5dba7;
}

.badge-driver {
    background-color: #eff5ff;
    color: var(--cp-blue-ink);
    border: 1px solid #c8dcff;
}

.badge-helper {
    background-color: #f5f0ff;
    color: #5b21b6;
    border: 1px solid #ddd0fb;
}

.badge-ob-complete {
    background-color: #ecfdf3;
    color: var(--cp-green-ink);
    border: 1px solid #b7ecd0;
}

.badge-ob-incomplete {
    background-color: #fdefef;
    color: var(--cp-red-ink);
    border: 1px solid #f5c6c6;
}

.badge-muted::before,
.badge-neutral::before,
.badge-ok::before,
.badge-warn::before,
.badge-warning::before,
.badge-driver::before,
.badge-helper::before,
.badge-ob-complete::before,
.badge-ob-incomplete::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 0.4em;
    vertical-align: baseline;
    opacity: 0.85;
}

.badge-lg {
    font-size: 0.8rem;
    padding: 0.45em 0.85em;
}

/* operator state pills (duty / location / subscription) */
.state-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.state-pill .state-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.state-pill-on {
    background-color: #ecfdf3;
    color: var(--cp-green-ink);
    border-color: #b7ecd0;
}

.state-pill-off {
    background-color: #f1f5f9;
    color: #55637a;
    border-color: var(--cp-border);
}

.state-pill-warn {
    background-color: #fef6e7;
    color: var(--cp-amber-ink);
    border-color: #f5dba7;
}

.state-pill-info {
    background-color: #eff5ff;
    color: var(--cp-blue-ink);
    border-color: #c8dcff;
}

.state-pill-on .state-dot {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.state-pill-warn .state-dot {
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.16);
}

.state-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* ---------- Cards ---------- */
.card-body > :last-child,
.card-header > :last-child,
.card-footer > :last-child {
    margin-bottom: 0;
}

.card-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
}

.card-header .btn {
    font-size: 0.82rem;
}

/* ---------- Forms ---------- */
.form-control::placeholder,
.form-select::placeholder {
    color: #9aa8ba;
}

.form-control[readonly],
.form-control:disabled,
.form-select:disabled {
    background-color: #f6f8fb;
    color: #55637a;
}

input[type="date"].form-control,
input[type="month"].form-control,
input[type="time"].form-control {
    min-height: 42px;
}

label.required-mark {
    position: relative;
}

label.required-mark::after {
    content: "*";
    color: var(--cp-red);
    margin-left: 0.2rem;
    font-weight: 700;
}

.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--cp-muted);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.4rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--cp-border);
}

.form-actions-end {
    justify-content: flex-end;
}

.field-invalid {
    border-color: var(--cp-red);
}

.validation-message {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--cp-red-ink);
    font-weight: 600;
}

.validation-summary-errors {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.validation-summary-errors li {
    padding: 0.2rem 0;
}

@media (max-width: 575.98px) {
    .form-control,
    .form-select,
    .form-control-lg,
    .form-select-lg,
    .input-group-text {
        font-size: 1rem;
    }

    .form-label {
        font-size: 0.85rem;
    }
}

/* ---------- Empty states ---------- */
.empty-state-compact {
    padding: 1.5rem 1rem;
}

.empty-state-compact .empty-icon {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
    border-radius: 14px;
}

.empty-state-compact .empty-title {
    font-size: 0.95rem;
    margin-top: 0.6rem;
}

.empty-state-plain {
    padding: 2.25rem 1.25rem;
    text-align: center;
    color: var(--cp-muted);
    font-size: 0.92rem;
}

.empty-state-plain .empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 15px;
    background-color: #f0f4fa;
    border: 1px solid var(--cp-border);
    font-size: 1.5rem;
    margin-bottom: 0.7rem;
}

.empty-state-plain .empty-action {
    margin-top: 0.9rem;
}

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.alert-symbol {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    background: currentColor;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.alert-text {
    flex: 1 1 auto;
    min-width: 0;
}

.alert-dismissible {
    padding-right: 2.75rem;
}

.alert .btn-close {
    flex: 0 0 auto;
    font-size: 0.7rem;
    opacity: 0.55;
}

.alert .btn-close:hover {
    opacity: 0.9;
}

/* ---------- Modals ---------- */
.modal-content {
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-lg);
    box-shadow: var(--cp-shadow-lg);
    overflow: hidden;
}

.modal-header,
.modal-footer {
    border-color: var(--cp-border);
    padding: 0.9rem 1.15rem;
}

.modal-header {
    align-items: center;
    gap: 0.6rem;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cp-primary-dark);
}

.modal-body {
    padding: 1.15rem;
    color: var(--cp-text);
    font-size: 0.94rem;
}

.modal-footer {
    gap: 0.5rem;
    justify-content: flex-end;
}

.cp-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 11px;
    font-weight: 800;
    font-size: 1rem;
}

.cp-confirm-icon-danger {
    background-color: #fdefef;
    color: var(--cp-red-ink);
    border: 1px solid #f5c6c6;
}

.cp-confirm-icon-info {
    background-color: #eff5ff;
    color: var(--cp-blue-ink);
    border: 1px solid #c8dcff;
}

.cp-confirm .modal-footer .btn {
    min-width: 108px;
}

/* ---------- Navbar refinements ---------- */
.nav-user {
    color: var(--cp-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-user-name {
    color: var(--cp-primary-dark);
    font-weight: 700;
}

.dropdown-item {
    font-size: 0.92rem;
    border-radius: 8px;
}

.dropdown-item:active {
    background-color: var(--cp-primary);
}

.nav-link.active .nav-link-icon {
    transform: none;
}

/* ---------- Footer ---------- */
.footer {
    margin-top: auto;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
    text-align: center;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--cp-primary-dark);
}

.footer-logo {
    font-size: 1rem;
}

.footer-text {
    color: var(--cp-muted);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

/* ---------- Print ---------- */
@media print {
    .crane-navbar,
    .footer,
    .cp-ambient,
    .skip-link,
    .page-head-actions,
    .btn,
    .form-actions,
    .no-print,
    .cp-confirm {
        display: none !important;
    }

    body {
        background: #fff;
        font-size: 11pt;
    }

    .card {
        box-shadow: none;
        border: 1px solid #cbd5e1;
        break-inside: avoid;
    }

    .table thead th {
        background: #f1f5f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #64748b;
    }

    .cp-reveal,
    .cp-stagger > * {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ---------- Form / content width + inline-style replacements ---------- */
.card-narrow {
    max-width: 720px;
    width: 100%;
}

.strong-dark {
    color: var(--cp-primary-dark);
    font-weight: 600;
}

.heading-dark {
    color: var(--cp-primary-dark);
    font-weight: 700;
}

.ink-green {
    color: var(--cp-green-ink);
}

.ink-red {
    color: var(--cp-red-ink);
}

.ink-muted {
    color: var(--cp-muted);
}

.row-inactive > td {
    background-color: #f8fafc;
    color: var(--cp-muted);
}

.alert-critical {
    border-left: 4px solid var(--cp-red);
    align-items: flex-start;
}

.alert-critical .alert-symbol {
    background-color: transparent;
    color: var(--cp-red-ink);
    font-size: 1.1rem;
    width: auto;
    height: auto;
}

.success-panel {
    border-color: #b7ecd0;
}

.tenant-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.6rem 0.85rem;
    border: 1px dashed var(--cp-border-strong);
    border-radius: 10px;
    background-color: #fbfcfe;
    font-size: 0.85rem;
    color: var(--cp-muted);
}

.card-narrow-md {
    max-width: 620px;
    width: 100%;
}

.card-narrow-sm {
    max-width: 560px;
    width: 100%;
}

.card-narrow-lg {
    max-width: 780px;
    width: 100%;
}

.measure-sm {
    max-width: 640px;
}

.dot-green {
    background: var(--cp-green);
}

.brand-logo-lg {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
}

.lang-select {
    width: 104px;
}

.receipt-preview {
    max-height: 280px;
    object-fit: contain;
}

.state-icon {
    font-size: 4.5rem;
    line-height: 1;
}

.state-icon-sm {
    font-size: 1.4rem;
    line-height: 1;
}

/* ==========================================================================
   Narrow-viewport overflow guards
   Flex items default to `min-width: auto`, so a nowrap badge or a long
   currency value can force the whole page to scroll sideways. These rules let
   the two flex-row components (fleet cards, KPI cards) shrink and wrap.
   ========================================================================== */

/* Global safety net: a badge must never widen its container. */
.badge {
    max-width: 100%;
}

.fleet-card-row,
.fleet-card-head {
    flex-wrap: wrap;
}

.fleet-card-row > *,
.fleet-card-head > * {
    min-width: 0;
}

/* Status text inside a fleet row can be a full sentence - let it wrap
   instead of being pinned to one line. */
.fleet-card-row .badge,
.fleet-card-head .badge {
    white-space: normal;
    text-align: left;
}

/* KPI cards: let the label/value/note column shrink and wrap. */
.kpi-card > * {
    min-width: 0;
}

.kpi-value {
    overflow-wrap: anywhere;
}

/* Localised labels can be a single unbreakable token (Kannada conjuncts
   and compounds have no space to break at). Without this the token keeps
   its intrinsic width and widens its container, which scrolls the whole
   page sideways. `anywhere` is required on the flex-based controls: it is
   the only value that also lowers the *min-content* size, so a flex item
   is allowed to shrink to the box instead of overflowing it. */
.btn,
.badge {
    overflow-wrap: anywhere;
}

/* Block-level headings and empty states have real spaces to break at, so
   the gentler value is enough and avoids mid-word breaks. */
.empty-title,
.empty-text,
.page-title,
.page-subtitle {
    overflow-wrap: break-word;
}

.kpi-note {
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- notifications */

/* Bell in the navigation. The badge is positioned against the anchor rather than
   inline, so it does not shift the icon when the count changes width. */
.nav-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-size: 1.05rem;
    line-height: 1;
}

.nav-bell-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.55rem;
    min-width: 1.15rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

/* Unread rows in the inbox: a left accent bar plus a tinted background. Both convey
   the state without relying on colour alone - the "New" badge carries it too. */
.list-group-item.unread-notification {
    background: #f2f7ff;
    border-left: 3px solid var(--cp-primary, #1e3a5f);
}

@media (prefers-color-scheme: dark) {
    .list-group-item.unread-notification {
        background: rgba(30, 58, 95, 0.18);
    }
}
