:root {
    --brand-700: #0a4f80;
    --brand-600: #0f6ba8;
    --brand-500: #1787c8;
    --brand-100: #e8f4fb;
    --surface-0: #f3f7fb;
    --surface-1: #ffffff;
    --surface-2: #eef3f8;
    --text-900: #1f2937;
    --text-700: #475569;
    --text-500: #64748b;
    --border-200: #d9e2ec;
    --success-600: #1f9d64;
    --warning-600: #c48a10;
    --danger-600: #c63d3d;

    --bs-primary: #0f6ba8;
    --bs-primary-rgb: 15, 107, 168;
    --bs-link-color: #0f6ba8;
    --bs-link-hover-color: #0a4f80;
}

body {
    background:
        radial-gradient(circle at 10% 0%, #e7f3fb 0%, rgba(231, 243, 251, 0) 45%),
        radial-gradient(circle at 100% 20%, #eaf5ff 0%, rgba(234, 245, 255, 0) 40%),
        var(--surface-0);
    color: var(--text-900);
    font-family: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    transition: background-color 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-900);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.navbar {
    background: linear-gradient(120deg, var(--brand-700), var(--brand-600)) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 20px rgba(12, 48, 72, 0.22);
}

.navbar-brand {
    padding-top: .5rem;
    padding-bottom: .5rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1px;
}

.navbar-brand > img {
    height: 58px;
}

.app-brand {
    gap: 0.75rem;
    white-space: normal;
    min-height: 66px;
}

.brand-logo-wrap {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 12px rgba(8, 30, 48, 0.2);
    flex-shrink: 0;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    margin-right: 0;
    padding: 2px;
    background: transparent;
    box-shadow: none;
}

.brand-text {
    display: inline-block;
    line-height: 1;
    color: #ffffff;
}

.brand-title {
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: 0.15px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    background: linear-gradient(180deg, #0c5f97 0%, #0a4f80 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.08);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .75rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    padding: 0.62rem 0.9rem;
    border-radius: 10px;
    margin: 2px 10px;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    color: #fff !important;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.12));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.sidebar .nav-link i,
.sidebar .nav-link .feather {
    color: inherit;
}

.sidebar-heading {
    color: rgba(255, 255, 255, 0.66) !important;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.sidebar .collapse.show {
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin: 0 10px 4px 10px;
}

main {
    padding-top: 20px;
}

.card {
    border: 1px solid var(--border-200);
    border-radius: 14px;
    background: var(--surface-1);
    box-shadow: 0 8px 26px rgba(31, 49, 69, 0.08);
    margin-bottom: 1.1rem;
}

.card-header {
    border-bottom: 1px solid var(--border-200);
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
    background: linear-gradient(180deg, #fcfdff, #f7fbff);
    color: var(--text-900);
    font-weight: 700;
}

.btn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.btn-primary {
    background: linear-gradient(180deg, #1787c8, #0f6ba8);
    border-color: #0f6ba8;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(180deg, #0f76b4, #0a5f95);
    border-color: #0a5f95;
}

.btn-outline-primary {
    color: var(--brand-600);
    border-color: #7ab6d7;
}

.btn-outline-primary:hover {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}

.form-label {
    color: var(--text-700);
    font-weight: 600;
}

.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid #c8d6e5;
    min-height: 42px;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #69a8ce;
    box-shadow: 0 0 0 0.2rem rgba(23, 135, 200, 0.15) !important;
}

.table-responsive {
    border: 1px solid var(--border-200);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    background: linear-gradient(180deg, #eff7fc, #e7f2fa);
    color: #134a72;
    border-bottom: 1px solid #c8dced;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    --bs-table-accent-bg: #f9fbfd;
}

.table-hover>tbody>tr:hover>* {
    --bs-table-accent-bg: #eef6fb;
}

.badge {
    border-radius: 999px;
    padding: 0.42em 0.68em;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.alert {
    border-radius: 12px;
    border-width: 1px;
}

.status-success {
    border-left: 4px solid var(--success-600);
}

.status-error {
    border-left: 4px solid var(--danger-600);
}

.status-pending {
    border-left: 4px solid var(--warning-600);
}

.theme-toggle {
    cursor: pointer;
    color: #fff;
}

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .brand-logo-wrap {
        width: 46px;
        height: 46px;
    }

    .brand-logo {
        width: 100%;
        height: 100%;
    }

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

    main {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

[data-bs-theme="dark"] body {
    background:
        radial-gradient(circle at 5% 0%, rgba(13, 36, 53, 0.65) 0%, rgba(13, 36, 53, 0) 46%),
        #111722;
    color: #e4eaf0;
}

[data-bs-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #12304a 0%, #0d2235 100%);
    border-right-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .navbar {
    background: linear-gradient(120deg, #143d5e, #0f2f49) !important;
}

[data-bs-theme="dark"] .card {
    background: #172434;
    border-color: #2f4256;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .card-header {
    background: linear-gradient(180deg, #1d2f43, #19293a);
    border-bottom-color: #30465c;
    color: #edf3f8;
}

[data-bs-theme="dark"] .form-label {
    color: #b7c7d8;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #111f2d;
    color: #e8f0f6;
    border-color: #385169;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #88a2b9;
}

[data-bs-theme="dark"] .table-responsive {
    background: #152433;
    border-color: #2f465c;
}

[data-bs-theme="dark"] .table {
    color: #e6eef5;
}

[data-bs-theme="dark"] .table thead th {
    background: linear-gradient(180deg, #1a3145, #193044);
    color: #d7e8f5;
    border-bottom-color: #2b465f;
}

[data-bs-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>* {
    --bs-table-accent-bg: #162a3b;
}

[data-bs-theme="dark"] .table-hover>tbody>tr:hover>* {
    --bs-table-accent-bg: #1d3448;
}
