:root {
    --brand-primary: #1b4ddb;
    --brand-primary-dark: #1238a5;
    --brand-primary-soft: rgba(27, 77, 219, 0.12);
    --brand-secondary: #0f172a;
    --brand-accent: #22c55e;
    --surface-0: #0f172a;
    --surface-1: #111e38;
    --surface-2: #142447;
    --surface-card: #ffffff;
    --surface-muted: #f5f7fb;
    --border-soft: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.16);
    --text-strong: #111827;
    --text-body: #1f2937;
    --text-muted: #6b7280;
    --text-on-dark: #f8fafc;
    --radius-lg: 1.2rem;
    --radius-md: 0.9rem;
    --radius-sm: 0.6rem;
    --shadow-soft: 0 10px 35px -18px rgba(15, 23, 42, 0.4);
    --shadow-strong: 0 28px 60px -24px rgba(15, 23, 42, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: 'Inter', 'Ubuntu', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #eef1f8 0%, #dbe2f3 45%, #f5f7fb 100%);
    color: var(--text-body);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--brand-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

main.content-wrapper {
    flex: 1 0 auto;
}

/* ===== Mobile-first Topbar ===== */
.topbar {
    background: linear-gradient(140deg, rgba(15, 23, 42, 0.98), rgba(27, 77, 219, 0.92));
    color: var(--text-on-dark);
    padding: 1rem 1.25rem 1.25rem;
    border-bottom-right-radius: 2rem;
    border-bottom-left-radius: 2rem;
    box-shadow: var(--shadow-soft);
}

.navbar-main {
    padding: 0;
}

.navbar-main .container-fluid {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-on-dark);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.brand-title {
    font-size: 1rem;
}

.brand-subtitle {
    font-size: 0.68rem;
    opacity: 0.75;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.navbar-main .nav-link {
    color: rgba(248, 250, 252, 0.8);
    padding: 0.4rem 0.2rem;
    font-size: 0.92rem;
    font-weight: 500;
}

.navbar-main .nav-link.active {
    color: #fff;
    font-weight: 600;
}

.navbar-toggler {
    border: none;
    color: rgba(248, 250, 252, 0.8);
}

.topbar-meta {
    margin-top: 1.1rem;
}

.topbar-meta h1 {
    font-size: 1.45rem;
    font-weight: 600;
    margin: 0 0 0.6rem;
}

.breadcrumb-nav .breadcrumb {
    background: transparent;
    margin: 0;
    padding: 0;
    color: rgba(248, 250, 252, 0.75);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-on-dark);
}

.role-pill {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.65rem;
    text-transform: uppercase;
}

/* ===== Layout Sections ===== */
main.content-wrapper.container-fluid {
    width: min(100%, 1080px);
    padding: 1.5rem 1.2rem 2.5rem;
}

section + section {
    margin-top: 1.4rem;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.section-header > h2 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-strong);
}

.section-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.section-actions .btn,
.section-actions form {
    width: 100%;
}

.section-actions .btn {
    min-height: 48px;
}

.section-actions form {
    display: flex;
    margin: 0;
    align-items: stretch;
}

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

.section-actions form .btn {
    flex: 1 1 auto;
}


.card {
    border: none;
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    padding: 1.3rem;
}

.card-metric {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fe 100%);
}

.card-metric header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-metric p {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.card-metric h3 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-strong);
}

.metric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}

.metric-icon.text-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--brand-accent);
}

.metric-icon.text-warning {
    background: rgba(234, 179, 8, 0.14);
    color: #eab308;
}

.metric-icon.text-info {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.chart-card {
    padding: 1.3rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, #ffffff 0%, #f1f4fb 100%);
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
}

/* ===== Buttons ===== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.7rem 1rem;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 77, 219, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 16px 32px -18px rgba(27, 77, 219, 0.6);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 1px solid rgba(27, 77, 219, 0.4);
    color: var(--brand-primary);
    background: rgba(27, 77, 219, 0.08);
}

.btn-outline-primary:hover {
    background: rgba(27, 77, 219, 0.15);
}

.btn-outline-success {
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #15803d;
    background: rgba(34, 197, 94, 0.08);
}

.btn-outline-success:hover {
    background: rgba(34, 197, 94, 0.16);
}

.btn-outline-secondary {
    border: 1px solid rgba(15, 23, 42, 0.18);
    color: var(--text-body);
    background: rgba(15, 23, 42, 0.04);
}

.btn-outline-secondary:hover {
    background: rgba(15, 23, 42, 0.08);
}

/* ===== Buttons ===== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.7rem 1rem;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 77, 219, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 16px 32px -18px rgba(27, 77, 219, 0.6);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 1px solid rgba(27, 77, 219, 0.4);
    color: var(--brand-primary);
    background: rgba(27, 77, 219, 0.08);
}

.btn-outline-primary:hover {
    background: rgba(27, 77, 219, 0.15);
}

.btn-outline-success {
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #15803d;
    background: rgba(34, 197, 94, 0.08);
}

.btn-outline-success:hover {
    background: rgba(34, 197, 94, 0.16);
}

.btn-outline-secondary {
    border: 1px solid rgba(15, 23, 42, 0.18);
    color: var(--text-body);
    background: rgba(15, 23, 42, 0.04);
}

.btn-outline-secondary:hover {
    background: rgba(15, 23, 42, 0.08);
}


/* ===== Tables ===== */
.table-responsive {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    background: var(--surface-card);
}

.table {
    margin: 0;
    color: var(--text-body);
}

.table thead {
    background: linear-gradient(180deg, rgba(27, 77, 219, 0.12) 0%, rgba(27, 77, 219, 0.05) 100%);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--brand-primary);
}

.table thead th {
    border-bottom: 1px solid rgba(27, 77, 219, 0.25);
    padding: 0.85rem;
}

.table tbody td {
    padding: 0.75rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.table tbody tr:hover {
    background: rgba(27, 77, 219, 0.05);
}



.table-empty {
    padding: 2.2rem;
    text-align: center;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
}

.action-buttons > * {
    width: 100%;
}

.action-buttons form {
    display: flex;
    margin: 0;
}

.action-buttons .btn {
    width: 100%;
    min-height: 44px;
}

.action-buttons form .btn {
    flex: 1 1 auto;
}

.action-buttons .btn-sm {
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}


.badge-status {

    border-radius: 999px;
    padding: 0.32rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-status.active {
    background: rgba(27, 77, 219, 0.14);
    color: var(--brand-primary);
}

.badge-status.pending {
    background: rgba(59, 130, 246, 0.16);
    color: #1d4ed8;
}

.badge-status.paid {
    background: rgba(34, 197, 94, 0.18);
    color: #15803d;
}

.badge-status.suspended,
.badge-status.inactive {
    background: rgba(234, 179, 8, 0.18);
    color: #b45309;
}

.badge-status.terminated,
.badge-status.overdue {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
}

.alert {
    border-radius: var(--radius-sm);
    border: none;
    box-shadow: var(--shadow-soft);
}

.table-filter,
.filter-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
}

/* ===== Forms ===== */
.form-label {
    font-weight: 600;
    color: var(--text-body);
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(15, 23, 42, 0.16);
    padding: 0.7rem 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(27, 77, 219, 0.7);
    box-shadow: 0 0 0 3px rgba(27, 77, 219, 0.18);
}

.input-group-text {
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.16);
}

/* ===== Footer ===== */
.footer {
    padding: 1.8rem 1.2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer strong {
    color: var(--brand-primary);
}

/* ===== Toast & Modal ===== */
.toast-container .toast,
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-strong);
}

.modal-header,
.modal-footer {
    border: none;
    padding-left: 1.8rem;
    padding-right: 1.8rem;
}

/* ===== Auth Pages ===== */
body.auth-page {
    background: linear-gradient(160deg, #0f172a 0%, #1b4ddb 70%, #60a5fa 100%);
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
}

.auth-card {
    width: min(100%, 420px);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 35px 70px -24px rgba(15, 23, 42, 0.65);
    padding: clamp(2rem, 5vw, 2.7rem);
    backdrop-filter: blur(10px);
}

.auth-card .badge {
    border-radius: 999px;
    letter-spacing: 0.06em;
}

/* ===== Utilities ===== */
.shadow-soft {
    box-shadow: var(--shadow-soft);
}

.text-muted-soft {
    color: var(--text-muted) !important;
}

.divider {
    height: 1px;
    background: rgba(15, 23, 42, 0.08);
    margin: 1.5rem 0;
}

.btn-label-full {
    display: inline;
}

.btn-label-short {
    display: none;
}

body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85), rgba(27, 77, 219, 0.9));
    border-radius: 999px;
}

body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.1);
}

/* ====== Datatables tweaks ====== */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 999px;
    padding: 0.55rem 1.2rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 10px !important;
    border: none !important;
    color: var(--text-muted) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(27, 77, 219, 0.12) !important;
    color: var(--brand-primary) !important;
}

/* ====== Larger breakpoints ====== */
@media (min-width: 576px) {
    .section-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .section-actions .btn,
    .section-actions form {
        flex: 1 1 calc(50% - 0.5rem);
        width: auto;
    }
}

@media (min-width: 768px) {
    .topbar {
        padding: 1.2rem 2rem 1.5rem;
    }

    .navbar-main .container-fluid {
        gap: 1.2rem;
    }

    .topbar-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .topbar-meta h1 {
        font-size: 1.75rem;
    }

    .section-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .section-actions {
        width: auto;
        flex-direction: row;
        gap: 0.75rem;
    }

    .section-actions .btn,
    .section-actions form {
        flex: 0 0 auto;
        width: auto;
    }

    .card {
        padding: 1.5rem;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    main.content-wrapper.container-fluid {
        padding: 2.2rem 2.4rem 3rem;
    }

    .navbar-main .nav-link {
        padding: 0.55rem 1rem;
        border-radius: var(--radius-sm);
    }

    .navbar-main .nav-link.active {
        background: rgba(255, 255, 255, 0.16);
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.layout-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}



    .layout-split {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        gap: 1.4rem;
    }

    .card-metric {
        padding: 1.6rem;
    }
}

@media (min-width: 1200px) {
    .topbar {
        border-bottom-left-radius: 3rem;
        border-bottom-right-radius: 3rem;
        padding: 1.5rem 3rem 1.9rem;
    }

    .topbar-meta h1 {
        font-size: 2rem;
    }
}



























