/* ═══════════════════════════════════════════════════════════════
   Portail B2B Sandoz — Design System
   Palette: Sandoz Blue (#1D59B6) + Light Blue accents
   Fonts: Poppins (headings) · Mulish (body)
═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --brand-blue: #1D59B6;
    --brand-blue-dark: #164897;
    --brand-blue-light: #EBF0FB;
    --brand-blue-mid: #D0DEF5;
    --brand-accent: #E07B39;
    --brand-accent-dark: #C5612A;
    --brand-accent-light: #FEF3EB;

    /* Backward-compatibility aliases — keep for inline styles across pages */
    --brand-teal: #1D59B6;
    --brand-teal-dark: #164897;
    --brand-teal-light: #EBF0FB;
    --brand-amber: #E07B39;
    --brand-amber-dark: #C5612A;
    --brand-amber-light: #FEF3EB;

    --cream: #F7F9FC;
    --warm-gray: #F0F3F8;
    --border: #DDE4EF;
    --text-dark: #0F1A2E;
    --text-body: #3D4E6A;
    --text-muted: #8095B5;

    --shadow-sm: 0 1px 3px rgba(29, 89, 182, .07), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 16px rgba(29, 89, 182, .10), 0 2px 4px rgba(0, 0, 0, .04);
    --shadow-lg: 0 10px 40px rgba(29, 89, 182, .14), 0 4px 12px rgba(0, 0, 0, .06);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
}

/* ── Reset / Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Mulish', sans-serif;
    background: var(--cream);
    color: var(--text-body);
    line-height: 1.65;
    min-height: 100vh;
}

/* ── Typography ────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6,
.font-heading {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.2rem;
}

.text-brand-blue {
    color: var(--brand-blue);
}

.text-brand-accent {
    color: var(--brand-accent);
}

/* ── Navbar ────────────────────────────────────────────────── */
.sandoz-nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(29, 89, 182, .07);
}

.sandoz-nav .nav-logo img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.sandoz-nav .nav-link {
    font-family: 'Mulish', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-body);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    transition: background 0.18s, color 0.18s;
    text-decoration: none;
    white-space: nowrap;
}

.sandoz-nav .nav-link:hover,
.sandoz-nav .nav-link.active {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

.sandoz-nav .nav-link-admin {
    background: rgba(29, 89, 182, .08);
    color: var(--brand-blue);
}

.sandoz-nav .nav-link-admin.active,
.sandoz-nav .nav-link-admin:hover {
    background: var(--brand-blue);
    color: #fff;
}

/* Cart button */
.nav-cart-btn {
    position: relative;
    padding: 0.4rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: color 0.18s;
}

.nav-cart-btn:hover {
    color: var(--brand-blue);
}

.nav-cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    height: 16px;
    width: 16px;
    background: var(--brand-accent);
    border-radius: 50%;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Mulish', sans-serif;
}

/* Avatar */
.nav-avatar {
    height: 34px;
    width: 34px;
    border-radius: 50%;
    background: var(--brand-blue-light);
    color: var(--brand-blue);
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Page Layout ───────────────────────────────────────────── */
.page-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    background: var(--warm-gray);
    border-bottom: 1px solid var(--border);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.card-body {
    padding: 1.5rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-sm);
    font-family: 'Mulish', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.18s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(29, 89, 182, .25);
}

.btn-primary:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(29, 89, 182, .35);
}

.btn-amber {
    background: var(--brand-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(224, 123, 57, .25);
}

.btn-amber:hover {
    background: var(--brand-accent-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-body);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    background: var(--warm-gray);
    border-color: #ccc;
}

.btn-danger {
    background: #DC2626;
    color: #fff;
}

.btn-danger:hover {
    background: #B91C1C;
}

.btn-success {
    background: var(--brand-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(29, 89, 182, .25);
}

.btn-success:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(29, 89, 182, .35);
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ── Form Controls ──────────────────────────────────────────── */
.form-control {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Mulish', sans-serif;
    font-size: 0.9rem;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
}

.form-control:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(29, 89, 182, .12);
}

.form-label {
    display: block;
    font-family: 'Mulish', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-body);
    margin-bottom: 0.3rem;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Mulish', sans-serif;
    white-space: nowrap;
}

.badge-blue {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

.badge-teal {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

.badge-amber {
    background: var(--brand-accent-light);
    color: var(--brand-accent-dark);
}

.badge-red {
    background: #FEE2E2;
    color: #B91C1C;
}

.badge-green {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

.badge-yellow {
    background: #FEF3C7;
    color: #92400E;
}

.badge-gray {
    background: #F3F4F6;
    color: #4B5563;
}

/* ── KPI Cards ──────────────────────────────────────────────── */
.kpi-card {
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    border: 1px solid transparent;
}

.kpi-blue {
    background: var(--brand-blue-light);
    border-color: var(--brand-blue-mid);
}

.kpi-teal {
    background: var(--brand-blue-light);
    border-color: var(--brand-blue-mid);
}

.kpi-amber {
    background: var(--brand-accent-light);
    border-color: #F5C9A7;
}

.kpi-red {
    background: #FEE2E2;
    border-color: #FECACA;
}

.kpi-gray {
    background: var(--warm-gray);
    border-color: var(--border);
}

.kpi-value {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-link {
    font-family: 'Mulish', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.7rem 1.1rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.18s, border-color 0.18s;
}

.tab-link:hover {
    color: var(--brand-blue);
}

.tab-link.active {
    color: var(--brand-blue);
    border-color: var(--brand-blue);
}

/* ── Product Card (Shop) ────────────────────────────────────── */
.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card-img {
    height: 200px;
    background: linear-gradient(135deg, var(--warm-gray) 0%, var(--brand-blue-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-card-img img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-img img {
    transform: scale(1.06);
}

.product-placeholder-icon {
    height: 4rem;
    width: 4rem;
    color: var(--brand-blue-mid);
    transition: transform 0.3s;
}

.product-card:hover .product-placeholder-icon {
    transform: scale(1.1);
}

.product-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-cat {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--brand-blue);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

.product-card-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.product-card-ref {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Mulish', sans-serif;
}

.product-card-desc {
    font-size: 0.82rem;
    color: var(--text-body);
    margin: 0.4rem 0 0.6rem;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.qty-input {
    width: 64px;
    text-align: center;
    padding: 0.35rem 0.4rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: 'Mulish', sans-serif;
    font-weight: 700;
    outline: none;
    transition: border-color 0.18s;
}

.qty-input:focus {
    border-color: var(--brand-blue);
}

/* ── Alerts / Notices ───────────────────────────────────────── */
.alert {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.alert-danger {
    background: #FEE2E2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.alert-success {
    background: var(--brand-blue-light);
    border: 1px solid var(--brand-blue-mid);
    color: var(--brand-blue-dark);
}

.alert-warning {
    background: var(--brand-accent-light);
    border: 1px solid #F5C9A7;
    color: #92400E;
}

.alert-info {
    background: var(--brand-blue-light);
    border: 1px solid var(--brand-blue-mid);
    color: var(--brand-blue-dark);
}

/* ── Table ──────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--warm-gray);
    font-family: 'Mulish', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.data-table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--warm-gray);
    vertical-align: middle;
    color: var(--text-body);
}

.data-table tbody tr:hover {
    background: var(--cream);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Stock Dot ──────────────────────────────────────────────── */
.stock-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stock-dot-ok {
    background: var(--brand-blue);
}

.stock-dot-low {
    background: #F59E0B;
    animation: pulse-amber 1.5s ease-in-out infinite;
}

.stock-dot-out {
    background: #EF4444;
}

@keyframes pulse-amber {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, .6);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(245, 158, 11, 0);
    }
}

/* ── Quota Bar ──────────────────────────────────────────────── */
.quota-bar-track {
    width: 100%;
    height: 8px;
    background: #E5E7EB;
    border-radius: 100px;
    overflow: hidden;
}

.quota-bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.6s ease;
}

.quota-bar-ok {
    background: var(--brand-blue);
}

.quota-bar-warn {
    background: var(--brand-accent);
}

.quota-bar-danger {
    background: #EF4444;
}

/* ── Timeline (Tracking) ────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2.55rem;
    top: 0.1rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--border);
}

.timeline-dot-done {
    background: var(--brand-blue);
    box-shadow: 0 0 0 3px var(--brand-blue-light);
}

.timeline-dot-pending {
    background: #E5E7EB;
}

.timeline-label {
    font-family: 'Mulish', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.timeline-label-pending {
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Login Page ─────────────────────────────────────────────── */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(160deg, #1D59B6 0%, #164897 40%, #0E3170 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease both;
}

.fade-delay-1 {
    animation-delay: 0.08s;
}

.fade-delay-2 {
    animation-delay: 0.16s;
}

.fade-delay-3 {
    animation-delay: 0.24s;
}

/* ── Utilities ─────────────────────────────────────────────── */
.divider {
    border-top: 1px solid var(--border);
    margin: 1.25rem 0;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.mono {
    font-family: 'Courier New', monospace;
    font-weight: 700;
}

.text-muted {
    color: var(--text-muted);
}

.w-full {
    width: 100%;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 1rem;
    }

    .sandoz-nav .nav-links {
        display: none;
    }
}