:root {
    --wa-primary: #5156be;
    --wa-primary-soft: rgba(81, 86, 190, 0.12);
    --wa-success: #2ab57d;
    --wa-info: #4ba6ef;
    --wa-warning: #ffbf53;
    --wa-danger: #fd625e;
    --wa-dark: #343a40;
    --wa-body-bg: #f3f3f9;
    --wa-sidebar-width: 260px;
    --wa-topbar-height: 70px;
    --wa-card-shadow: 0 0.75rem 1.5rem rgba(18, 38, 63, 0.03);
    --wa-border: #eff2f7;
}

* { box-sizing: border-box; }

body.admin-body {
    margin: 0;
    font-family: "Poppins", sans-serif;
    background: var(--wa-body-bg);
    color: #495057;
    font-size: 0.875rem;
}

a { text-decoration: none; }

#layout-wrapper {
    min-height: 100vh;
}

.vertical-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--wa-sidebar-width);
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--wa-border);
    z-index: 1001;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.navbar-brand-box {
    padding: 1rem 1.25rem;
    min-height: var(--wa-topbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--wa-border);
}

.navbar-brand-box .logo {
    display: block;
    line-height: 0;
}

.brand-logo {
    height: 52px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.navbar-brand-box .logo span {
    color: var(--wa-primary);
}

#sidebar-menu {
    padding: 1rem 0 2rem;
}

.menu-title {
    padding: 0.75rem 1.5rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #878a99;
}

#sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.5rem;
    color: #545a6d;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

#sidebar-menu .nav-link i {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
    color: #7f8387;
}

#sidebar-menu .nav-link:hover,
#sidebar-menu .nav-link.active {
    color: var(--wa-primary);
    background: var(--wa-primary-soft);
    border-left-color: var(--wa-primary);
}

#sidebar-menu .nav-link:hover i,
#sidebar-menu .nav-link.active i {
    color: var(--wa-primary);
}

.main-content {
    margin-left: var(--wa-sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

#page-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--wa-topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--wa-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.header-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-welcome h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--wa-dark);
}

.header-welcome p {
    margin: 0;
    font-size: 0.75rem;
    color: #878a99;
}

.btn-topbar {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #545a6d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.btn-topbar:hover {
    background: var(--wa-primary-soft);
    color: var(--wa-primary);
}

.btn-topbar .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.6rem;
    padding: 0.2rem 0.35rem;
}

.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: none;
    background: transparent;
    padding: 0;
}

.user-dropdown .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wa-primary), #7c83db);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-dropdown .user-name {
    font-weight: 600;
    color: var(--wa-dark);
    font-size: 0.85rem;
    text-align: left;
}

.page-content {
    padding: 1.5rem;
}

.page-title-box {
    margin-bottom: 1.5rem;
}

.page-title-box h4 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--wa-dark);
}

.breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: 0.8rem;
}

.breadcrumb-item a {
    color: var(--wa-primary);
}

.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--wa-card-shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--wa-border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--wa-dark);
}

.card-body {
    padding: 1.25rem;
}

.mini-stats-wid {
    overflow: hidden;
}

.mini-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bg-primary-subtle { background: rgba(81, 86, 190, 0.15); color: var(--wa-primary); }
.bg-success-subtle { background: rgba(42, 181, 125, 0.15); color: var(--wa-success); }
.bg-info-subtle { background: rgba(75, 166, 239, 0.15); color: var(--wa-info); }
.bg-warning-subtle { background: rgba(255, 191, 83, 0.18); color: #c98a00; }

.mini-stats-wid .fw-medium {
    font-size: 0.8rem;
    color: #878a99;
}

.mini-stats-wid h4 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--wa-dark);
    margin: 0.35rem 0;
}

.badge-soft-success {
    background: rgba(42, 181, 125, 0.15);
    color: var(--wa-success);
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
}

.badge-soft-danger {
    background: rgba(253, 98, 94, 0.15);
    color: var(--wa-danger);
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
}

.table-card .table {
    margin: 0;
}

.table-card .table thead th {
    background: #f8f9fa;
    border-bottom: 1px solid var(--wa-border);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #878a99;
    padding: 0.85rem 1.25rem;
    white-space: nowrap;
}

.table-card .table tbody td {
    padding: 0.85rem 1.25rem;
    vertical-align: middle;
    border-color: var(--wa-border);
}

/* Pagination — keep icons/links compact (Tailwind SVG fallback safety) */
.admin-pagination,
.card-body.border-top,
.card-footer {
    overflow: hidden;
}

.admin-pagination nav,
.card-body.border-top nav,
.card-footer nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.admin-pagination .pagination,
.card-body.border-top .pagination,
.card-footer .pagination {
    margin-bottom: 0;
    flex-wrap: wrap;
}

.admin-pagination .page-link,
.card-body.border-top .page-link,
.card-footer .page-link {
    font-size: 0.82rem;
    padding: 0.4rem 0.7rem;
    color: #545a6d;
    border-color: var(--wa-border);
}

.admin-pagination .page-item.active .page-link,
.card-body.border-top .page-item.active .page-link,
.card-footer .page-item.active .page-link {
    background: var(--wa-primary);
    border-color: var(--wa-primary);
}

.admin-pagination .page-link:hover,
.card-body.border-top .page-link:hover,
.card-footer .page-link:hover {
    color: var(--wa-primary);
    background: var(--wa-primary-soft);
}

.page-content svg.w-5,
.page-content svg.h-5,
.page-content .pagination svg,
.admin-pagination svg,
.card-body.border-top svg,
.card-footer svg {
    width: 1rem !important;
    height: 1rem !important;
    max-width: 1rem;
    max-height: 1rem;
    display: inline-block;
    vertical-align: middle;
}

.page-content .w-5,
.page-content .h-5 {
    width: 1rem !important;
    height: 1rem !important;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border-radius: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-paid, .status-delivered { background: rgba(42, 181, 125, 0.15); color: var(--wa-success); }
.status-pending, .status-placed { background: rgba(255, 191, 83, 0.18); color: #c98a00; }
.status-cancelled, .status-failed { background: rgba(253, 98, 94, 0.15); color: var(--wa-danger); }
.status-shipped { background: rgba(75, 166, 239, 0.15); color: var(--wa-info); }

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

.btn-primary:hover {
    background: #4348a8;
    border-color: #4348a8;
}

.btn-soft-primary {
    background: var(--wa-primary-soft);
    color: var(--wa-primary);
    border: none;
}

.btn-soft-primary:hover {
    background: var(--wa-primary);
    color: #fff;
}

.btn-soft-success {
    background: rgba(42, 181, 125, 0.15);
    color: var(--wa-success);
    border: none;
}

.btn-soft-warning {
    background: rgba(255, 191, 83, 0.18);
    color: #c98a00;
    border: none;
}

.btn-soft-danger {
    background: rgba(253, 98, 94, 0.15);
    color: var(--wa-danger);
    border: none;
}

.footer {
    padding: 1rem 1.5rem;
    color: #878a99;
    font-size: 0.8rem;
    border-top: 1px solid var(--wa-border);
    background: #fff;
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

.form-control, .form-select {
    border: 1px solid #c5cbd6;
    border-color: #c5cbd6;
    background-color: #fff;
    font-size: 0.875rem;
    min-height: 42px;
    color: #343a40;
    box-shadow: none;
}

.form-control::placeholder {
    color: #9aa3b2;
}

textarea.form-control {
    min-height: 110px;
}

.form-control:hover, .form-select:hover {
    border-color: #9aa3b2;
}

.form-control:focus, .form-select:focus {
    border-color: var(--wa-primary);
    background-color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(81, 86, 190, 0.15);
}

.form-control[type="file"] {
    padding: 0.45rem 0.75rem;
    line-height: 1.5;
}

.form-label {
    font-weight: 600;
    color: var(--wa-dark);
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
}

.form-text {
    color: #878a99;
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

.form-check-input {
    border: 1.5px solid #9aa3b2;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.15rem;
}

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

.form-switch .form-check-input {
    width: 2.4rem;
    height: 1.25rem;
    border: 1.5px solid #9aa3b2;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-color: #adb5bd;
}

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

.form-check-label {
    color: #545a6d;
    font-weight: 500;
}

.admin-field-box {
    border: 1px solid #c5cbd6;
    border-radius: 0.5rem;
    padding: 1rem;
    background: #fafbff;
}

.btn-light {
    border: 1px solid #c5cbd6;
    background: #fff;
    color: #545a6d;
}

.btn-light:hover {
    border-color: #9aa3b2;
    background: #f3f3f9;
    color: var(--wa-dark);
}

.card .border {
    border-color: #c5cbd6 !important;
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    background: #f8f9fc;
}

.auth-left {
    flex: 1.1;
    display: none;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #111827 100%);
    color: #fff;
    padding: 3rem;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(193, 154, 107, 0.12), transparent 45%),
                radial-gradient(circle at 80% 80%, rgba(81, 86, 190, 0.1), transparent 40%);
    pointer-events: none;
}

.auth-left-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 380px;
}

.auth-logo {
    width: min(280px, 80vw);
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}

.auth-logo-sm {
    height: 72px;
    width: auto;
    margin: 0 auto 1rem;
    display: block;
}

.auth-tagline {
    font-size: 0.75rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #c19a6b;
    margin-bottom: 1rem;
    font-weight: 600;
}

.auth-desc {
    opacity: 0.78;
    line-height: 1.75;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.auth-features {
    display: grid;
    gap: 0.75rem;
    text-align: left;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
}

.auth-feature i {
    color: #c19a6b;
    font-size: 1.1rem;
}

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(180deg, #fff 0%, #f8f9fc 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(15, 23, 42, 0.08);
    border: 1px solid var(--wa-border);
    padding: 2.25rem 2rem;
}

.auth-card-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-card h4 {
    font-weight: 700;
    color: var(--wa-dark);
    margin-bottom: 0.35rem;
    font-size: 1.35rem;
}

.auth-card .subtitle {
    color: #878a99;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.input-group-auth {
    position: relative;
}

.input-group-auth i {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #878a99;
    z-index: 2;
}

.input-group-auth .form-control {
    padding-left: 2.65rem;
    min-height: 46px;
    border-radius: 0.5rem;
}

.btn-auth {
    min-height: 46px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #c19a6b 0%, #a8845f 100%);
    border: none;
    margin-top: 0.5rem;
}

.btn-auth:hover {
    background: linear-gradient(135deg, #b0885a 0%, #96744f 100%);
    border: none;
}

.auth-footer-note {
    text-align: center;
    margin: 1.5rem 0 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #878a99;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

@media (min-width: 992px) {
    .auth-left { display: flex; }
}

@media (max-width: 991.98px) {
    .vertical-menu {
        transform: translateX(-100%);
    }

    body.sidebar-enable .vertical-menu {
        transform: translateX(0);
    }

    body.sidebar-enable .sidebar-overlay {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .header-welcome {
        display: none;
    }
}
