:root {
    --clm-primary: #315bd8;
    --clm-primary-dark: #203d9c;
    --clm-primary-soft: #edf2ff;
    --clm-success: #12805c;
    --clm-danger: #c53d4b;
    --clm-warning: #a76a08;
    --clm-ink: #14213a;
    --clm-muted: #66748f;
    --clm-line: #e3e9f3;
    --clm-canvas: #f4f7fc;
    --clm-surface: #ffffff;
    --clm-shadow: 0 14px 38px rgba(26, 49, 91, .09);
}

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% -10%, rgba(74, 112, 226, .14), transparent 32rem),
        radial-gradient(circle at 95% 12%, rgba(34, 197, 148, .08), transparent 28rem),
        var(--clm-canvas);
    color: var(--clm-ink);
    line-height: 1.75;
}

.shell { min-height: 100vh; }
.container { max-width: 1180px; }

h1, h2, h3, h4, h5, h6 {
    color: var(--clm-ink);
    letter-spacing: -.025em;
    font-weight: 750;
}

h1 { margin-top: .2rem; }
h1:focus, h1:focus-visible { outline: none !important; }
a { color: var(--clm-primary); }

.card {
    border: 1px solid rgba(221, 228, 241, .9) !important;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--clm-shadow) !important;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

a.card:hover {
    transform: translateY(-4px);
    border-color: rgba(49, 91, 216, .28) !important;
    box-shadow: 0 20px 48px rgba(26, 49, 91, .14) !important;
}

a.card .card-body::after {
    content: "←";
    display: inline-flex;
    margin-top: 1rem;
    color: var(--clm-primary);
    font-size: 1.15rem;
    font-weight: 800;
}

.card-body { padding: 1.6rem; }
.rounded-4 { border-radius: 1.4rem !important; }

.btn {
    border-radius: .7rem;
    padding: .58rem 1rem;
    font-weight: 650;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary {
    border-color: var(--clm-primary);
    background: linear-gradient(135deg, #3d6aee, var(--clm-primary-dark));
    box-shadow: 0 8px 20px rgba(49, 91, 216, .22);
}
.btn-primary:hover { border-color: #1e3a94; background: linear-gradient(135deg, #315bd8, #1b347f); }
.btn-outline-primary { border-color: #9bb1ee; color: var(--clm-primary-dark); }
.btn-outline-primary:hover { border-color: var(--clm-primary); background: var(--clm-primary-soft); color: var(--clm-primary-dark); }

.form-control, .form-select {
    min-height: 46px;
    border-color: #d8e0ee;
    border-radius: .7rem;
    background-color: #fbfcff;
    padding-inline: .9rem;
}

.form-control:focus, .form-select:focus {
    border-color: #7694e8;
    background-color: #fff;
    box-shadow: 0 0 0 .23rem rgba(49, 91, 216, .12);
}

.form-label { color: #384861; font-weight: 650; margin-bottom: .45rem; }
.form-text, .text-secondary { color: var(--clm-muted) !important; }

.alert {
    border: 1px solid transparent;
    border-radius: .9rem;
    padding: 1rem 1.15rem;
}
.alert-success { border-color: #bfe9d8; background: #ecfbf5; color: #126349; }
.alert-warning { border-color: #f2daa9; background: #fff8e8; color: #81520b; }
.alert-danger { border-color: #f1c4ca; background: #fff1f2; color: #99303c; }
.alert-light { border-color: var(--clm-line); background: rgba(255,255,255,.76); }

.badge { border-radius: 999px; padding: .48em .75em; font-weight: 700; }
.text-bg-primary { background: var(--clm-primary) !important; }
.text-bg-dark { background: #1b2942 !important; }

.table-responsive {
    overflow: auto;
    border: 1px solid var(--clm-line);
    border-radius: 1rem;
    background: #fff;
}
.table { margin-bottom: 0; vertical-align: middle; }
.table > :not(caption) > * > * { padding: .9rem .85rem; border-color: #edf0f6; }
.table thead th { background: #f0f4fb; color: #41506a; font-size: .88rem; white-space: nowrap; }
.table tbody tr { transition: background-color .15s ease; }
.table tbody tr:hover { background: #f8faff; }

.bg-dark {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    background:
        radial-gradient(circle at 5% 25%, rgba(80, 126, 255, .46), transparent 21rem),
        linear-gradient(135deg, #0f1e38 0%, #172d56 58%, #223d78 100%) !important;
}
.bg-dark::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    inset: auto auto -150px -90px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
}
.bg-dark > * { position: relative; z-index: 1; }
.bg-dark h1, .bg-dark h2, .bg-dark h3 { color: #fff; }

.brand-mark {
    box-shadow: 0 8px 20px rgba(49, 91, 216, .28);
    transform: rotate(-3deg);
}

.clm-public-header {
    padding: .8rem 1rem;
    border: 1px solid rgba(225, 232, 243, .9);
    border-radius: 1rem;
    background: rgba(255,255,255,.84);
    box-shadow: 0 8px 28px rgba(26,49,91,.06);
    backdrop-filter: blur(12px);
}

.clm-public-nav > a:not(.btn) { color: #44516a; font-weight: 650; }

.invoice-sheet {
    background: #fff;
    box-shadow: var(--clm-shadow);
}

@media (max-width: 767.98px) {
    body { line-height: 1.65; }
    .container { padding-inline: 1rem; }
    .py-5 { padding-top: 1.75rem !important; padding-bottom: 1.75rem !important; }
    .p-5 { padding: 1.6rem !important; }
    .display-5 { font-size: clamp(1.8rem, 8vw, 2.35rem); }
    .card-body { padding: 1.2rem; }
    .clm-public-header { padding: .8rem; }
}

@media print {
    body { background: #fff !important; }
    .card, .invoice-sheet { box-shadow: none !important; }
}
