:root {
    --app-bg: #f4f7fb;
    --app-surface: #ffffff;
    --app-border: #d8e1ec;
    --app-text: #18212f;
    --app-muted: #657386;
    --app-primary: #14532d;
    --app-primary-strong: #0f3f23;
    --app-accent: #0f766e;
    --app-warning: #b45309;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, rgba(15, 118, 110, 0.20), transparent 28%),
        linear-gradient(135deg, #0d1f17, #143324 48%, #0f3f3a);
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 24px;
}

.login-logo,
.login-mark {
    width: 150px;
    height: 110px;
    border-radius: 8px;
    background: #fff;
}

.login-logo {
    object-fit: contain;
    display: block;
    margin: 0 auto 18px;
    padding: 6px;
}

.login-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-primary);
    font-size: 2.2rem;
    margin: 0 auto 18px;
}

.login-card {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    padding: 32px;
    width: 100%;
}

.login-card h2 {
    color: var(--app-text);
    font-size: 1.55rem;
    font-weight: 800;
    margin: 0;
    text-align: center;
}

.login-subtitle {
    color: var(--app-muted);
    margin: 6px 0 24px;
    text-align: center;
}

.login-help {
    border-top: 1px solid var(--app-border);
    color: var(--app-muted);
    font-size: 0.9rem;
    margin-top: 20px;
    padding-top: 14px;
}

.error-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 80% 15%, rgba(15, 118, 110, 0.16), transparent 28%),
        linear-gradient(135deg, #f4f7fb, #e8eef6);
}

.error-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.error-card {
    width: min(100%, 560px);
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(24, 33, 47, 0.14);
    padding: 34px;
    text-align: center;
}

.error-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    height: 46px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: #eef7f1;
    color: var(--app-primary);
    font-size: 1.25rem;
    font-weight: 800;
}

.error-card h1 {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.error-card p {
    color: var(--app-muted);
    margin: 0 auto 22px;
    max-width: 420px;
}

.app-navbar {
    background: linear-gradient(90deg, #102015, #123524 55%, #0f3f3a);
    box-shadow: 0 6px 18px rgba(16, 32, 21, 0.18);
}

.app-shell {
    max-width: 1440px;
    padding: 24px;
}

.nav-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 3px;
}

.brand-mark {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
}

.page-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.page-title h1 {
    font-size: 1.55rem;
    margin: 0;
}

.panel {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(27, 39, 54, 0.05);
}

.panel-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--app-border);
    font-weight: 700;
}

.panel-body {
    padding: 18px;
}

.metric {
    display: grid;
    gap: 6px;
    min-height: 116px;
}

.metric .label {
    color: var(--app-muted);
    font-size: 0.9rem;
}

.metric .value {
    font-size: 1.65rem;
    font-weight: 800;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.quick-link i {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--app-primary);
}

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-strong);
    --bs-btn-hover-border-color: var(--app-primary-strong);
}

.table thead th {
    color: var(--app-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.search-results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(27, 39, 54, 0.16);
}

.search-result-item {
    width: 100%;
    border: 0;
    background: #fff;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    text-align: left;
}

.search-result-item:hover,
.search-result-item:focus {
    background: #eef7f1;
}

.cart-table input {
    min-width: 88px;
}

.total-box {
    background: #eef7f1;
    border: 1px solid #c8e6d2;
    border-radius: 8px;
    padding: 14px;
}

.total-box .value {
    font-size: 1.4rem;
    font-weight: 800;
}

.badge-soft {
    border: 1px solid var(--app-border);
    background: #f8fafc;
    color: var(--app-text);
}

.logo-preview {
    max-height: 96px;
    max-width: 220px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 8px;
}

@media (max-width: 768px) {
    .login-shell {
        min-height: 100dvh;
        padding: 16px;
    }

    .login-logo,
    .login-mark {
        width: 132px;
        height: 96px;
    }

    .login-card {
        padding: 24px 18px;
    }

    .error-card {
        padding: 26px 18px;
    }

    .app-shell {
        padding: 16px 12px;
    }

    .page-title h1 {
        font-size: 1.25rem;
    }

    .panel-body {
        padding: 14px;
    }

    .table-responsive {
        border-radius: 8px;
    }
}
