:root {
    --primary: #0e317d;
    --primary-dark: #0a255f;

    --sidebar-bg: #fef4ec;
    --sidebar-hover: #f7e6d7;

    --dark: #0e317d;
    --light: #f5f7fb;
    --white: #ffffff;

    --text: #0e317d;
    --muted: #64748b;
    --border: #e8e8e8;

    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;

    --sidebar-width: 280px;

    --font-main: "Poppins", sans-serif;
    /* --font-main: "League Spartan", sans-serif; */
}

/* =======================
   RESET
======================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--light);
    color: var(--text);

    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.6;

    overflow-x: hidden;
}

/* =======================
   TYPOGRAPHY
======================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.03em;
}

p {
    margin-bottom: 0;
}

small,
.text-muted {
    color: var(--muted) !important;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
}

/* =======================
   CARD
======================= */

.card {
    border: 1px solid var(--border);
    border-radius: 22px;

    background: var(--white);

    box-shadow: 0 2px 12px rgba(14, 49, 125, .04);
}

.card-header {
    background: var(--white);

    border-bottom: 1px solid var(--border);

    padding: 20px 24px;

    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* =======================
   BUTTON
======================= */

.btn {
    border-radius: 14px;

    padding: 10px 18px;

    font-size: 15px;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* =======================
   FORM
======================= */

.form-label {
    color: var(--primary);

    font-size: 17px;
    font-weight: 600;
}

.form-control,
.form-select {
    height: 48px;

    border: 1px solid var(--border);
    border-radius: 14px;

    font-size: 15px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 .2rem rgba(14, 49, 125, .08);
}

/* =======================
   TABLE
======================= */

.table {
    vertical-align: middle;
}

.table thead th {
    background: #f8fafc;

    color: var(--muted);

    font-size: 14px;
    font-weight: 600;

    border-bottom: 1px solid var(--border);
}

.table td {
    border-color: var(--border);
}

/* =======================
   BADGE
======================= */

.badge {
    border-radius: 999px;

    padding: 8px 12px;

    font-size: 12px;
    font-weight: 600;
}

/* =======================
   SIDEBAR
======================= */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;

    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;

    background: var(--sidebar-bg);

    border-right: 1px solid var(--border);

    padding: 24px;

    overflow-y: auto;

    transition: transform .25s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 32px;

    color: var(--primary);

    font-size: 22px;
    font-weight: 800;
}

.sidebar-logo {
    width: 75px;
    height: 75px;

    object-fit: contain;

    flex-shrink: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 15px 18px;
    margin-bottom: 8px;

    border-radius: 18px;

    color: var(--text);
    text-decoration: none;

    font-size: 16px;
    font-weight: 600;

    transition: .2s ease;
}

.sidebar-menu a i {
    width: 20px;

    text-align: center;

    font-size: 16px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--sidebar-hover);

    color: var(--primary);
}

.sidebar-menu hr {
    margin: 24px 0;

    border-color: rgba(14, 49, 125, .12);
}

.logout-link {
    color: var(--danger) !important;
}

.logout-link:hover {
    background: rgba(220, 53, 69, .08) !important;
}

/* =======================
   OVERLAY
======================= */

.sidebar-overlay {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, .35);

    z-index: 1040;

    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* =======================
   MAIN CONTENT
======================= */

.main-content {
    margin-left: var(--sidebar-width);

    min-height: 100vh;

    padding: 30px;

    transition: margin-left .25s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* =======================
   TOPBAR
======================= */

.topbar {
    background: var(--white);

    border: 1px solid var(--border);
    border-radius: 22px;

    padding: 22px 24px;
    margin-bottom: 24px;

    box-shadow: 0 2px 12px rgba(14, 49, 125, .04);
}

.topbar h4 {
    font-size: 28px;
    margin-bottom: 4px;
}

.sidebar-toggle {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 16px;

    background: var(--sidebar-hover);

    color: var(--primary);

    font-size: 20px;

    cursor: pointer;
}

.sidebar-toggle:hover {
    background: #f0dfd0;
}

.admin-avatar {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--primary);

    color: white;

    font-size: 18px;
}

/* =======================
   CUSTOMER
======================= */

.navbar-customer {
    background: var(--white);

    border-bottom: 1px solid var(--border);

    box-shadow: 0 2px 12px rgba(14, 49, 125, .04);
}

.navbar-brand {
    color: var(--primary) !important;

    font-size: 22px;
    font-weight: 800;
}

.navbar-nav .nav-link {
    color: var(--text);

    font-size: 15px;
    font-weight: 600;
}

.product-card {
    overflow: hidden;
}

.product-card img {
    width: 100%;
    height: 220px;

    object-fit: cover;
}

.product-price {
    color: var(--primary);

    font-size: 24px;
    font-weight: 800;
}

/* =======================
   LOGIN
======================= */

.login-wrapper {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background:
        radial-gradient(circle at top left, rgba(254, 244, 236, .95), transparent 35%),
        linear-gradient(135deg, #0e317d, #0b5ed7);
}

.login-card {
    width: 100%;
    max-width: 720px;

    background: var(--white);

    border-radius: 32px;

    padding: 56px 48px;

    box-shadow: 0 24px 70px rgba(14, 49, 125, .22);
}

.login-logo {
    width: 120px;
    height: 120px;

    object-fit: contain;

    margin-bottom: 18px;
}

.login-card h2 {
    font-size: 40px;
    font-weight: 800;

    margin-bottom: 8px;
}

.login-card p {
    font-size: 18px;
}

.login-card .form-control {
    height: 56px;
    font-size: 16px;
}

.login-card .btn {
    height: 56px;
    font-size: 17px;
}

.login-card .mb-3,
.login-card .mb-4 {
    margin-bottom: 24px !important;
}

@media (max-width: 768px) {

    .login-card {
        max-width: 100%;
        padding: 36px 28px;
        border-radius: 24px;
    }

    .login-card h2 {
        font-size: 32px;
    }

    .login-logo {
        width: 80px;
        height: 80px;
    }

}

/* =======================
   RESPONSIVE
======================= */

@media (max-width: 768px) {

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .main-content.expanded {
        margin-left: 0;
    }

    .topbar {
        padding: 18px;
    }

    .topbar h4 {
        font-size: 24px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 18px;
    }

    .topbar > div {
        width: 100%;
    }

    .sidebar-brand {
        font-size: 20px;
    }

    .sidebar-menu a {
        font-size: 15px;
    }
}

/* =======================
   PRELOADER
======================= */

.preloader {
    position: fixed;
    inset: 0;

    background: rgba(255, 255, 255, .98);

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    z-index: 99999;

    opacity: 0;
    visibility: hidden;

    transition: all .35s ease;
}

.preloader.show {
    opacity: 1;
    visibility: visible;
}

.preloader-logo {
    width: 90px;
    height: 90px;

    object-fit: contain;

    animation: pulseLogo 1.8s infinite ease-in-out;
}

.preloader-spinner {
    width: 42px;
    height: 42px;

    margin-top: 24px;

    border: 4px solid rgba(14, 49, 125, .15);
    border-top-color: var(--primary);

    border-radius: 50%;

    animation: spin 1s linear infinite;
}

.preloader-text {
    margin-top: 18px;

    color: var(--primary);

    font-size: 15px;
    font-weight: 600;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseLogo {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.08);
        opacity: .85;
    }
}
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 16px;

    transform: translateY(-50%);

    width: 32px;
    height: 32px;

    border: none;
    background: transparent;

    color: var(--muted);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    transition: .2s ease;
}

.password-toggle:hover {
    color: var(--primary);
}

.password-toggle:focus {
    outline: none;
    box-shadow: none;
}

.password-toggle i {
    font-size: 18px;
}

.product-thumb {
    width: 64px;
    height: 64px;

    object-fit: cover;

    border-radius: 16px;

    border: 1px solid var(--border);

    background: #fff;
}

.product-preview {
    width: 100%;
    max-width: 260px;
    height: 220px;

    object-fit: cover;

    border-radius: 22px;
    border: 1px solid var(--border);

    background: white;
}

.info-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 18px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.summary-row span {
    color: var(--muted);
}

.summary-row.grand-total {
    font-size: 18px;
}

.tracking-link-box {
    background: #f8fafc;
    border: 1px dashed var(--primary);
    border-radius: 16px;
    padding: 14px;
    font-size: 13px;
    color: var(--primary);
    word-break: break-all;
}

.payment-box {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: #fff;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.timeline-item {
    display: flex;
    gap: 14px;
    position: relative;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.customer-avatar {
    width: 84px;
    height: 84px;

    border-radius: 50%;

    background: var(--primary);
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 34px;
}


/* =======================
   CUSTOMER LAYOUT
======================= */

.customer-navbar {
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(14, 49, 125, .04);
}

.customer-navbar .container,
.customer-main .container,
.customer-footer .container {
    max-width: 1180px;
}

.customer-navbar-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.customer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
}

.customer-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.customer-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-nav-actions .btn {
    padding: 10px 16px;
    font-size: 14px;
}

.customer-main {
    min-height: calc(100vh - 76px);
    padding: 28px 0 44px;
}

.customer-footer {
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border);
    padding: 26px 0;
}

.footer-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

/* =======================
   CUSTOMER HERO
======================= */

.hero-po {
    background:
        radial-gradient(circle at top right, rgba(255,255,255,.16), transparent 34%),
        linear-gradient(135deg, #0e317d 0%, #1f4bb5 100%);

    color: white;
    border-radius: 28px;
    padding: 34px;

    position: relative;
    overflow: hidden;
}

.hero-po::before {
    content: '';
    position: absolute;
    width: 340px;
    height: 340px;
    top: -150px;
    right: -120px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    filter: blur(40px);
}

.hero-po > * {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,.15);
    padding: 9px 15px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.hero-title,
.hero-section h1 {
    color: #ffffff !important;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.18;
    margin-bottom: 14px;
    text-shadow: 0 4px 16px rgba(0,0,0,.16);
}

.hero-description {
    color: rgba(255,255,255,.88);
    font-size: 15px;
    line-height: 1.7;
    max-width: 760px;
    margin-bottom: 22px;
}

.hero-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-info-item {
    background: rgba(255,255,255,.13);
    color: #fff;
    padding: 11px 15px;
    border-radius: 14px;
    font-size: 14px;
}

.countdown-card {
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: 0 12px 32px rgba(0,0,0,.08);
    color: var(--primary);
    border-radius: 24px;
    padding: 24px;
    text-align: center;
}

.countdown-value {
    font-size: 28px;
    font-weight: 800;
    margin: 12px 0;
}

/* =======================
   CUSTOMER PRODUCT GRID
======================= */

.customer-product-grid {
    margin-top: 28px;
}

.product-card-customer {
    background: white;
    border-radius: 22px;
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--border);
    transition: .22s ease;
}

.product-card-customer:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(14,49,125,.08);
}

.product-image-wrapper {
    position: relative;
    background: #f8fafc;
}

.product-image {
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.badge-product {
    position: absolute;
    top: 12px;
    padding: 7px 11px;
    border-radius: 999px;
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.badge-best {
    left: 12px;
    background: #ef4444;
}

.badge-recommended {
    right: 12px;
    background: #0ea5e9;
}

.product-content {
    padding: 18px;
}

.product-title {
    color: var(--primary);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 8px;
}

.product-description {
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.6;
    min-height: 44px;
    margin: 0 0 14px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.product-meta small {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
    margin-bottom: 2px;
}

.product-meta strong {
    display: block;
    font-size: 12.5px;
    line-height: 1.35;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.product-footer .btn {
    padding: 9px 14px;
    font-size: 13px;
    border-radius: 12px;
}

.product-price {
    color: var(--primary);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.product-price + small {
    font-size: 12px;
}

/* =======================
   CUSTOMER EMPTY STATE
======================= */

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state i {
    font-size: 70px;
    color: var(--primary);
    margin-bottom: 22px;
}

/* =======================
   CUSTOMER DETAIL / CART / CHECKOUT
======================= */

.product-detail-image {
    width: 100%;
    height: 480px;
    object-fit: cover;
    border-radius: 22px;
}

.cart-image {
    width: 100%;
    height: 86px;
    object-fit: cover;
    border-radius: 16px;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.countdown-edit {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

/* =======================
   RESPONSIVE CUSTOMER
======================= */

@media (max-width: 992px) {
    .hero-po {
        padding: 28px;
    }

    .hero-title,
    .hero-section h1 {
        font-size: 30px;
    }

    .product-image {
        height: 180px;
    }
}

@media (max-width: 768px) {
    .customer-navbar-inner {
        min-height: auto;
        padding: 14px 0;
        flex-direction: column;
        align-items: flex-start;
    }

    .customer-brand {
        font-size: 19px;
    }

    .customer-logo {
        width: 48px;
        height: 48px;
    }

    .customer-nav-actions {
        width: 100%;
    }

    .customer-nav-actions .btn {
        flex: 1;
        padding-left: 10px;
        padding-right: 10px;
    }

    .customer-main {
        padding: 20px 0 34px;
    }

    .hero-po {
        border-radius: 22px;
        padding: 24px;
    }

    .hero-title,
    .hero-section h1 {
        font-size: 26px;
    }

    .hero-description {
        font-size: 14px;
    }

    .hero-info-item {
        width: 100%;
        font-size: 13px;
    }

    .countdown-card {
        padding: 20px;
    }

    .countdown-value {
        font-size: 24px;
    }

    .product-image {
        height: 190px;
    }

    .product-content {
        padding: 16px;
    }

    .product-title {
        font-size: 17px;
    }

    .product-price {
        font-size: 21px;
    }

    .product-detail-image {
        height: 320px;
    }
}

.dashboard-hero {
    background: linear-gradient(135deg, var(--primary), #1947a8);
    color: white;

    border-radius: 32px;

    padding: 34px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    overflow: hidden;
}

.dashboard-hero h1,
.dashboard-hero p {
    color: white;
}

.dashboard-hero p {
    opacity: .9;
    max-width: 700px;
}

.hero-badge-admin {
    display: inline-block;

    background: rgba(255,255,255,.15);

    padding: 10px 16px;

    border-radius: 999px;

    font-size: 13px;
    font-weight: 700;
}

.dashboard-hero-icon {
    width: 120px;
    height: 120px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 32px;

    background: rgba(255,255,255,.14);

    font-size: 56px;
}

.stat-card {
    background: white;

    border: 1px solid var(--border);
    border-radius: 26px;

    padding: 24px;

    display: flex;
    align-items: center;
    gap: 18px;

    box-shadow: 0 2px 12px rgba(14, 49, 125, .04);
}

.stat-icon {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 20px;

    background: var(--sidebar-bg);

    color: var(--primary);

    font-size: 24px;
}

.stat-card small {
    color: var(--muted);
    font-weight: 600;
}

.stat-card h3 {
    margin: 4px 0;
    font-size: 26px;
    font-weight: 800;
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

.action-card {
    min-height: 190px;

    border-radius: 28px;

    padding: 26px;

    color: white;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.action-card h3,
.action-card p {
    color: white;
}

.action-card small {
    color: rgba(255,255,255,.8) !important;
    font-weight: 700;
}

.action-card.primary {
    background: linear-gradient(135deg, #0e317d, #2563eb);
}

.action-card.warning {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.action-card.danger {
    background: linear-gradient(135deg, #dc2626, #fb7185);
}

.best-product {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 14px 0;

    border-bottom: 1px solid var(--border);
}

.best-product:last-child {
    border-bottom: none;
}

.best-rank {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: var(--sidebar-bg);

    color: var(--primary);

    font-weight: 800;
}

@media (max-width: 768px) {
    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 26px;
    }

    .dashboard-hero-icon {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }

    .stat-card {
        padding: 20px;
    }
}

.setting-image-preview {
    width: 220px;
    max-width: 100%;

    background: #fff;
    padding: 10px;

    border-radius: 18px;
    border: 1px solid var(--border);
}

.setting-image-preview img {
    width: 100%;
    max-height: 260px;

    object-fit: contain;

    display: block;
}