:root {
    --bg-soft: #f8f6ff;
    --card-bg: #ffffff;
    --text-main: #20253a;
    --sidebar-start: #b6d7ff;
    --sidebar-end: #f9c9e1;
}

body {
    background: linear-gradient(180deg, #fbfcff, var(--store-primary, #f1f8ff));
    color: var(--text-main);
}

body.login-page {
    background: linear-gradient(180deg, #f8fbff, #eef5ff);
    color: #1f2937;
}

#layout {
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--sidebar-start), var(--sidebar-end));
    color: #1f2937;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
}

.topbar {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid #e5e7eb;
    backdrop-filter: blur(8px);
}

.card-stat {
    border: 0;
    border-radius: 1rem;
    background: var(--card-bg);
    box-shadow: 0 14px 30px rgba(148, 163, 184, 0.18);
}

.brand-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #7dd3fc;
}

.brand-logo {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 8px;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.login-card {
    width: 100%;
    max-width: 460px;
    border: 0;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(2, 6, 23, 0.1);
}

.login-logo {
    width: 88px !important;
    height: 88px !important;
    max-width: 88px !important;
    max-height: 88px !important;
    display: block;
    margin: 0 auto 0.5rem;
    border-radius: 14px;
    object-fit: contain;
    background: #fff;
    padding: 0.25rem;
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.35);
}

.sidebar .nav-link {
    color: #111827 !important;
    border-radius: 0.7rem;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.35);
}

body.dark-mode {
    --bg-soft: #111827;
    --card-bg: #1f2937;
    --text-main: #e5e7eb;
    --sidebar-start: #2a3346;
    --sidebar-end: #1f2937;
    background: linear-gradient(180deg, #0f172a, #131c30);
    color: #e5e7eb;
}

body.dark-mode {
    --bs-body-bg: transparent;
    --bs-body-color: #e5e7eb;
}

body.dark-mode .topbar,
body.dark-mode .card-stat,
body.dark-mode .table,
body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #334155;
}

body.dark-mode .sidebar {
    border-right: 1px solid #334155;
}

body.dark-mode .sidebar .nav-link {
    color: #e5e7eb !important;
}

body.dark-mode .sidebar .nav-link:hover {
    background: rgba(148, 163, 184, 0.2);
}

body.dark-mode .topbar {
    background: rgba(31, 41, 55, 0.75);
    border-bottom: 1px solid #334155;
}

body.dark-mode .btn-outline-secondary {
    color: #e5e7eb;
    border-color: #64748b;
}

body.dark-mode .table {
    --bs-table-bg: #1f2937;
    --bs-table-color: #e5e7eb;
    --bs-table-border-color: #334155;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode label,
body.dark-mode p,
body.dark-mode span,
body.dark-mode small,
body.dark-mode strong,
body.dark-mode td,
body.dark-mode th,
body.dark-mode li,
body.dark-mode .form-label,
body.dark-mode .dataTables_wrapper,
body.dark-mode .dataTables_wrapper label,
body.dark-mode .dataTables_wrapper th,
body.dark-mode .dataTables_wrapper td,
body.dark-mode .dataTables_info,
body.dark-mode .dataTables_length,
body.dark-mode .dataTables_filter,
body.dark-mode .btn,
body.dark-mode .badge,
body.dark-mode .nav-link,
body.dark-mode .dropdown-item {
    color: #e5e7eb !important;
}

body.dark-mode a {
    color: #93c5fd;
}

body.dark-mode a:hover {
    color: #bfdbfe;
}

body.dark-mode .dataTables_wrapper .dataTables_filter input,
body.dark-mode .dataTables_wrapper .dataTables_length select {
    background: #111827;
    color: #e5e7eb;
    border: 1px solid #334155;
}

body.dark-mode .dataTables_wrapper .paginate_button,
body.dark-mode .dataTables_wrapper .paginate_button a,
body.dark-mode .page-link {
    color: #e5e7eb !important;
}

body.dark-mode .page-item:not(.active) .page-link {
    background: #111827;
    border-color: #334155;
}

body.dark-mode .list-group-item {
    color: #e5e7eb;
    border-color: #334155;
}

body.dark-mode .badge.text-bg-primary {
    background-color: #0284c7 !important;
}

body.dark-mode .badge.text-bg-info {
    background-color: #0ea5e9 !important;
    color: #082f49 !important;
}

body.dark-mode .badge.text-bg-secondary {
    background-color: #475569 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .table > :not(caption) > * > * {
    color: #e5e7eb !important;
    background-color: transparent;
}

body.dark-mode .text-muted {
    color: #9ca3af !important;
}

body.login-page.dark-mode {
    background: linear-gradient(180deg, #0f172a, #1e293b);
}

body.login-page.dark-mode .login-card {
    background: #1f2937;
    color: #e5e7eb;
}

@media (max-width: 992px) {
    .sidebar {
        width: 90px;
    }
    .sidebar .nav-link {
        font-size: 0.8rem;
        padding-left: 0;
    }
}
