/*
 * Shri Web Dashboard Stylesheet
 * Enterprise modern design system for distribution and collection operations
 * Note: No emojis in source code as per project standards.
 */

:root {
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Primary Emerald Palette */
    --color-primary: #056143;
    --color-primary-hover: #034832;
    --color-primary-active: #023625;
    --color-primary-light: #ecfdf5;
    --color-primary-border: #a7f3d0;
    --color-primary-glow: rgba(5, 97, 67, 0.15);

    /* Accent Sky Palette */
    --color-accent: #0284c7;
    --color-accent-hover: #0369a1;
    --color-accent-light: #f0f9ff;
    --color-accent-border: #bae6fd;

    /* Semantic Status Colors */
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-danger-light: #fef2f2;
    --color-danger-border: #fecaca;

    --color-warning: #d97706;
    --color-warning-hover: #b45309;
    --color-warning-light: #fffbeb;
    --color-warning-border: #fde68a;

    --color-success: #16a34a;
    --color-success-hover: #15803d;
    --color-success-light: #f0fdf4;
    --color-success-border: #bbf7d0;

    /* Neutrals & Surfaces */
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-subtle: #fafbfc;
    --color-border: #e2e8f0;
    --color-border-subtle: #f1f5f9;
    --color-border-strong: #cbd5e1;

    /* Typography Colors */
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-text-dim: #94a3b8;

    /* Border Radius Tokens */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Layered Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 6px 12px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 30px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);

    --sidebar-width: 260px;
    --header-height: 68px;
    --transition-fast: 0.16s ease;
    --transition-base: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-text);
    letter-spacing: -0.02em;
    font-weight: 700;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* ── App Layout ────────────────────────────────────────────── */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.02);
}

.brand-box {
    padding: 22px 20px;
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon-sm {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--color-primary), #078059);
    color: #ffffff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--color-primary-glow);
}

.nav-list {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: 0.92rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-icon {
    flex-shrink: 0;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.nav-item a:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    transform: translateX(2px);
}

.nav-item a:hover .nav-icon {
    color: var(--color-primary);
    transform: scale(1.05);
}

.nav-item.active a {
    background: linear-gradient(135deg, var(--color-primary), #078059);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 10px var(--color-primary-glow);
}

.nav-item.active a .nav-icon {
    color: #ffffff;
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.02);
}

.topbar-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.time-badge {
    background: #ffffff;
    border: 1px solid var(--color-border);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-family: 'JetBrains Mono', monospace, Consolas;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--color-text);
    box-shadow: var(--shadow-xs);
}

/* ── Topbar User Dropdown ─────────────────────────────────── */
.user-dropdown-container {
    position: relative;
    display: inline-block;
}

.topbar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 6px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all var(--transition-fast);
}

.topbar-user-card:hover,
.user-dropdown-container.is-open .topbar-user-card {
    border-color: #cbd5e1;
    background-color: var(--color-surface-hover);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #059669);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    position: relative;
    box-shadow: 0 2px 5px var(--color-primary-glow);
    flex-shrink: 0;
}

.topbar-user-avatar .status-indicator {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    background-color: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.topbar-user-info {
    display: flex;
    align-items: center;
}

.topbar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.2;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-chevron {
    color: var(--color-text-muted);
    transition: transform var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
    margin-left: 2px;
}

.user-dropdown-container.is-open .dropdown-chevron {
    transform: rotate(180deg);
    color: var(--color-primary);
}

/* Dropdown Menu Popup */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 210px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    pointer-events: none;
    z-index: 100;
    padding: 6px;
}

.user-dropdown-container.is-open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-header {
    padding: 8px 10px 6px;
}

.dropdown-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-role {
    font-size: 0.725rem;
    color: var(--color-text-muted);
    margin-top: 1px;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--color-border);
    margin: 4px 0;
}

.dropdown-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.dropdown-item svg {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.dropdown-item:hover {
    background-color: var(--color-surface-hover);
    color: var(--color-primary);
}

.dropdown-item:hover svg {
    color: var(--color-primary);
}

.dropdown-item.active {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

.dropdown-item.active svg {
    color: var(--color-primary);
}

.dropdown-item-danger:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

.dropdown-item-danger:hover svg {
    color: #dc2626;
}

.content-area {
    padding: 32px 36px;
    flex: 1;
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
}

/* ── Flash Messages ────────────────────────────────────────── */
.flash-container {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert {
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
    box-shadow: var(--shadow-xs);
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

.alert-success {
    background: var(--color-success-light);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

.alert-error {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

.alert-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
    border-color: var(--color-warning-border);
}

.alert-info {
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-color: var(--color-accent-border);
}

/* ── Grid & Metric Cards ───────────────────────────────────── */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-strong);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.metric-label {
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.metric-sub {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Metric color accents */
.metric-card.due {
    border-top: 3px solid var(--color-warning);
}

.metric-card.overdue {
    border-top: 3px solid var(--color-danger);
}

.metric-card.collected {
    border-top: 3px solid var(--color-success);
}

.metric-card.retailers {
    border-top: 3px solid var(--color-primary);
}

/* ── Section Cards ─────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 26px;
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 24px;
}

/* ── Tables ────────────────────────────────────────────────── */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    text-align: left;
}

.table th {
    background: #f8fafc;
    color: var(--color-text-muted);
    font-weight: 700;
    font-size: 0.725rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 13px 18px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text);
    vertical-align: middle;
    background: #ffffff;
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover td {
    background-color: #f8fafc;
}

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

/* ── Status Badges ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.badge-pending {
    background: #fde68a;
    color: #78350f;
    border: 1.5px solid #d97706;
}

.badge-partially_paid {
    background: #bfdbfe;
    color: #1e3a8a;
    border: 1.5px solid #2563eb;
}

.badge-paid {
    background: #a7f3d0;
    color: #064e3b;
    border: 1.5px solid #059669;
}

.badge-overdue {
    background: #fecaca;
    color: #7f1d1d;
    border: 1.5px solid #dc2626;
}

.badge-active {
    background: #ccfbf1;
    color: #0f766e;
    border: 1.5px solid #0d9488;
}

.badge-cleared {
    background: #e2e8f0;
    color: #334155;
    border: 1.5px solid #94a3b8;
}

/* ── Promised Date High-Visibility Badges ─────────────────── */
.promise-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    transition: transform var(--transition-fast);
}

.promise-date-badge:hover {
    transform: translateY(-1px);
}

.promise-date-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.promise-date-upcoming {
    background: #c7d2fe;
    color: #1e1b4b;
    border: 1.5px solid #4f46e5;
}

.promise-date-pending,
.promise-date-today {
    background: #fde68a;
    color: #78350f;
    border: 1.5px solid #d97706;
}

.promise-date-partially_paid {
    background: #bfdbfe;
    color: #1e3a8a;
    border: 1.5px solid #2563eb;
}

.promise-date-overdue {
    background: #fecaca;
    color: #7f1d1d;
    border: 1.5px solid #dc2626;
}

.promise-date-paid {
    background: #a7f3d0;
    color: #064e3b;
    border: 1.5px solid #059669;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.35;
    box-shadow: var(--shadow-xs);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #06724f);
    color: #ffffff;
    box-shadow: 0 2px 6px var(--color-primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-hover), var(--color-primary));
    color: #ffffff;
    box-shadow: 0 4px 12px var(--color-primary-glow);
}

.btn-secondary {
    background: #ffffff;
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger), #b91c1c);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    background: #b91c1c;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-outline-danger {
    background: #ffffff;
    border-color: var(--color-danger-border);
    color: var(--color-danger);
}

.btn-outline-danger:hover {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(5, 97, 67, 0.12);
    background-color: #ffffff;
}

.form-control::placeholder {
    color: var(--color-text-dim);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-help {
    font-size: 0.775rem;
    color: var(--color-text-muted);
    margin-top: 5px;
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    animation: slideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
}

.modal-close {
    background: #f1f5f9;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #fafbfc;
}

/* ── Timeline (Follow-up history) ──────────────────────────── */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 8px;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 22px;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--color-primary);
    box-shadow: 0 0 0 3px #ffffff;
}

.timeline-dot.collected {
    border-color: var(--color-success);
}

.timeline-dot.promise {
    border-color: var(--color-warning);
}

.timeline-content {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--shadow-xs);
    transition: border-color var(--transition-fast);
}

.timeline-content:hover {
    border-color: var(--color-border-strong);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.775rem;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.timeline-body {
    font-size: 0.875rem;
    color: var(--color-text);
    line-height: 1.5;
}

/* ── Retailer Avatar ───────────────────────────────────────── */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid var(--color-primary-border);
    box-shadow: var(--shadow-xs);
}

.avatar-lg {
    width: 68px;
    height: 68px;
    font-size: 1.35rem;
    border-radius: var(--radius-md);
}

/* ── Search & Filters Bar ──────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Login Page ────────────────────────────────────────────── */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(at 15% 20%, rgba(5, 97, 67, 0.08) 0px, transparent 50%),
        radial-gradient(at 85% 80%, rgba(2, 132, 199, 0.08) 0px, transparent 50%),
        #f8fafc;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px -8px rgba(15, 23, 42, 0.08), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
    width: 100%;
    padding: 42px 36px;
}

.login-brand {
    text-align: center;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 6px 18px rgba(6, 95, 70, 0.18);
    border: 1px solid rgba(6, 95, 70, 0.15);
}

.brand-icon-img {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    box-shadow: 0 2px 8px var(--color-primary-glow);
}

.brand-logo-badge {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--color-primary), #078059);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px var(--color-primary-glow);
}

.login-brand h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.03em;
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.btn-login {
    width: 100%;
    margin-top: 14px;
    padding: 12px 18px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
}

@media (max-width: 820px) {
    .sidebar {
        display: none;
    }

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

    .content-area {
        padding: 20px;
    }

    .topbar {
        padding: 0 20px;
    }
}