/* DUKAIO PREMIUM BRAND SYSTEM */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* DUKAIO Premium Design System */
    /* Primary Brand Colors - Deep Indigo/Violet */
    --primary: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --primary-light: #e0e7ff;
    /* Indigo 100 */
    --primary-dark: #3730a3;
    /* Indigo 800 */

    /* Secondary Colors - Vibrant Emerald */
    --secondary: #10b981;
    /* Emerald 500 */
    --secondary-hover: #059669;
    /* Emerald 600 */
    --secondary-light: #d1fae5;
    /* Emerald 100 */

    /* Accent Colors */
    --accent: #f59e0b;
    /* Amber 500 */
    --danger: #ef4444;
    /* Red 500 */
    --info: #3b82f6;
    /* Blue 500 */
    --warning: #f59e0b;
    /* Amber 500 */

    /* Neutral/Background Colors */
    --bg-body: #f3f4f6;
    /* Cool Gray 100 */
    --bg-surface: #ffffff;
    --bg-sidebar: #1e293b;
    /* Slate 800 - Dark Sidebar for Premium Feel */

    /* Text Colors */
    --text-primary: #111827;
    /* Gray 900 */
    --text-secondary: #4b5563;
    /* Gray 600 */
    --text-muted: #9ca3af;
    /* Gray 400 */
    --text-on-dark: #f8fafc;
    /* Slate 50 */
    --text-muted-dark: #cbd5e1;
    /* Slate 300 */

    /* Borders */
    --border-color: #e5e7eb;
    /* Gray 200 */
    --border-dark: #334155;
    /* Slate 700 */

    /* Metrics */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);

    /* Shadows - Smooth & Layered */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 15px rgba(79, 70, 229, 0.3);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;

    /* Animation */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-font-smoothing: antialiased;
    /* PURE FADE TRANSITION (No Flashing/Sliding) */
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- LAYOUT --- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.22s ease;
    margin-left: var(--sidebar-width);
    position: relative;
    z-index: 1;
}

.content {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* --- SIDEBAR (Premium Dark Theme) --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-dark);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 10000;
    pointer-events: auto;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    color: var(--text-on-dark);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-dark);
    background: rgba(0, 0, 0, 0.2);
    /* Slight darken for header */
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    text-transform: uppercase;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

/* FORCE REMOVE DOTS */
.sidebar ul,
.sidebar li,
.sidebar-menu,
.nav-item {
    list-style: none !important;
    list-style-type: none !important;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 8px;
    /* More spacing */
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted-dark);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    text-decoration: none;
    border: 1px solid transparent;
}

.nav-link i,
.nav-link .icon {
    color: var(--text-muted-dark);
    transition: var(--transition-fast);
    width: 20px;
    text-align: center;
    margin-right: 12px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link:hover i {
    color: white;
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    /* Glow effect */
}

.nav-link.active i {
    color: white;
}

.nav-link svg {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    stroke-width: 2px;
}

/* --- TOPBAR --- */
.topbar {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: none;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-wrap: nowrap;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.topbar-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-timer {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    white-space: nowrap;
}

#session-timer {
    font-family: monospace;
    font-weight: 600;
    color: var(--primary);
}

/* Desktop layout: reserve space for the sidebar */
@media (min-width: 769px) {
    .main-wrapper {
        margin-left: var(--sidebar-width);
    }

    .topbar {
        padding-left: calc(var(--sidebar-width) + 32px);
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
    }

    .toggle-btn {
        display: none;
    }
}

/* Mobile topbar improvements */
@media (max-width: 768px) {
    .topbar {
        padding: 0 16px;
        height: 64px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }

    .topbar-left {
        gap: 16px;
        flex: 1;
        min-width: 0;
    }

    .topbar-title {
        font-size: 1.1rem;
        line-height: 1.2;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .session-timer {
        font-size: 0.7rem;
        display: none;
        /* Hide on mobile to save space */
    }

    .user-profile {
        gap: 12px;
        flex-shrink: 0;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
        border: 2px solid var(--primary);
    }

    .user-info {
        display: none;
        /* Hide user text on mobile */
    }
}

/* Icon sizing and consistent alignment */
.icon,
.fa,
.fas,
.far,
.fal,
.fab {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

/* Prevent sidebar content overflow and ensure smooth scrolling on touch devices */
.sidebar-menu {
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

/* Ensure header / topbar doesn't overlap content in tight spaces */
.topbar {
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}


/* --- DASHBOARD CARDS & GRID --- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Dashboard Stats Grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Mobile dashboard optimizations */
@media (max-width: 768px) {
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }

    .card {
        padding: 16px;
        margin-bottom: 12px;
    }

    .card-value {
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats-grid {
        gap: 8px;
    }

    .card {
        padding: 12px;
    }

    .card-value {
        font-size: 1.25rem;
    }
}

/* Stat Cards */
.stat-card {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

.stat-card-primary::before {
    background: linear-gradient(90deg, #4338ca, #6366f1);
}

.stat-card-success::before {
    background: linear-gradient(90deg, #10B981, #34d399);
}

.stat-card-info::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.stat-card-warning::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.stat-card-primary .stat-card-icon {
    background: linear-gradient(135deg, #4338ca, #6366f1);
}

.stat-card-success .stat-card-icon {
    background: linear-gradient(135deg, #10B981, #34d399);
}

.stat-card-info .stat-card-icon {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.stat-card-warning .stat-card-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary);
}

.stat-card-content {
    margin-top: 12px;
}

.stat-card-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

/* Dashboard Charts Grid */
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* Chart container responsive fixes */
.chart-container {
    height: 280px;
    position: relative;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .dashboard-charts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .chart-container {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .dashboard-charts-grid {
        gap: 16px;
        margin-bottom: 24px;
    }

    .chart-container {
        height: 200px;
    }

    .chart-card-header,
    .alert-card-header {
        padding: 16px 20px;
    }

    .chart-card-body,
    .alert-card-body {
        padding: 20px;
    }
}

/* Chart Cards */
.chart-card,
.alert-card {
    background: var(--bg-surface);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chart-card-header,
.alert-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-card-title,
.alert-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-card-title i,
.alert-card-title i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.chart-card-title h3,
.alert-card-title h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.chart-card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.alert-card-badge {
    background: var(--danger);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.chart-card-body,
.alert-card-body {
    padding: 24px;
}

.chart-container {
    height: 280px;
    position: relative;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    height: 100%;
    gap: 12px;
    padding: 20px 0;
}

/* Quick Actions Section */
.quick-actions-section {
    margin-bottom: 32px;
}

/* Sales Products List */
.sales-products-list {
    background: var(--bg-surface);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    max-height: 600px;
    overflow-y: auto;
}

.sales-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    background: var(--bg-body);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sales-list-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
    cursor: pointer;
}

.sales-list-item:hover {
    background: var(--bg-body);
}

.sales-list-item.selected {
    background: rgba(67, 56, 202, 0.1);
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 8px rgba(67, 56, 202, 0.15);
}

.sales-list-item.selected .product-name-cell strong {
    color: var(--primary);
}

.sales-list-item:last-child {
    border-bottom: none;
}

.sales-col {
    padding: 16px 12px;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border-color);
}

.sales-col:last-child {
    border-right: none;
}

/* Responsive for sales list */
@media (max-width: 768px) {

    .sales-list-header,
    .sales-list-item {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .sales-col {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 12px 16px;
    }

    .sales-list-header .sales-col {
        padding: 12px 16px;
        background: var(--bg-surface);
        border-bottom: 2px solid var(--border-color);
        font-size: 0.8rem;
    }

    .product-name-cell strong {
        font-size: 0.9rem;
    }
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.section-header p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

/* Action Cards */
.action-card {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.action-card-primary {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.05), rgba(67, 56, 202, 0.02));
}

.action-card-primary:hover {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.1), rgba(67, 56, 202, 0.05));
}

.action-card-secondary {
    border-color: var(--border-color);
}

.action-card-secondary:hover {
    border-color: var(--primary);
    background: rgba(67, 56, 202, 0.02);
}

.action-card-outline {
    border-color: var(--border-color);
    background: white;
}

.action-card-outline:hover {
    border-color: var(--primary);
    background: rgba(67, 56, 202, 0.02);
}

.action-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.action-card-primary .action-card-icon {
    background: linear-gradient(135deg, #4338ca, #6366f1);
}

.action-card-secondary .action-card-icon {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.action-card-outline .action-card-icon {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.action-card-content {
    flex: 1;
}

.action-card-content h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.action-card-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.action-card-arrow {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.action-card:hover .action-card-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .content {
        padding: 20px 16px;
    }

    .dashboard-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    .stat-card-value {
        font-size: 1.4rem;
    }

    .stat-card-title {
        font-size: 0.8rem;
    }

    .action-card {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
        border-radius: 12px;
    }

    .action-card-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .action-card-arrow {
        display: none;
    }

    .section-header h2 {
        font-size: 1.25rem;
        margin-bottom: 16px;
    }

    .section-header p {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }

    .dashboard-charts-grid {
        gap: 16px;
        margin-bottom: 24px;
    }

    .chart-container {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 16px 12px;
    }

    .dashboard-stats-grid {
        gap: 8px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 8px;
    }

    .stat-card-value {
        font-size: 1.25rem;
    }

    .stat-card-title {
        font-size: 0.75rem;
    }

    .action-card {
        padding: 12px;
        gap: 8px;
        border-radius: 8px;
    }

    .action-card-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .quick-actions-grid {
        gap: 8px;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    .section-header p {
        font-size: 0.85rem;
    }

    .dashboard-charts-grid {
        gap: 12px;
    }

    .chart-container {
        height: 180px;
    }
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-size: 0.95rem;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 4px rgba(67, 56, 202, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 4px 8px rgba(67, 56, 202, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-body);
    border-color: #cbd5e1;
}

.btn-success {
    background: var(--secondary);
    color: white;
}

.btn-success:hover {
    background: var(--secondary-hover);
}

/* --- FORMS & INPUTS --- */
.form-group {
    margin-bottom: 20px;

}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: #fff;
    box-sizing: border-box;
    /* Fix for overflow */
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* --- PRODUCT GRID (POS) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.product-item {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.product-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.product-item.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

/* --- UTILITIES & SKELETONS --- */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.text-center {
    text-align: center;
}

/* Skeleton */
.skeleton {
    background: #e2e8f0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* --- GLOBAL FIXES FOR RESPONSIVE LAYOUT --- */
/* Ensure predictable sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Make media scale gracefully */
img,
svg,
picture,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent accidental horizontal scroll */
html,
body {
    overflow-x: hidden;
    min-height: 100vh;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {

    button,
    .btn,
    a,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Fix for topbar inline style that attempted a media query inside the attribute.
   Hide the small-screen user info and show it on >=768px. Use !important to
   override the inline `display: none;` present in the markup. */
.topbar .user-profile>div {
    display: none;
}

@media (min-width: 768px) {
    .topbar .user-profile>div {
        display: block !important;
    }
}

/* Toggle (hamburger) button: enhanced for better mobile experience */
.toggle-btn {
    background: var(--primary);
    border: none;
    padding: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 48px;
    min-height: 48px;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(67, 56, 202, 0.3);
    display: none;
    position: relative;
    z-index: 200;
}

.toggle-btn:hover {
    background: var(--primary-hover, #3730a3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.4);
}

.toggle-btn:active {
    transform: scale(0.95);
}

.toggle-btn i {
    transition: transform 0.3s ease;
}

.toggle-btn:hover i {
    transform: scale(1.1);
}

/* Sidebar overlay and toggle consistency with footer.js which toggles `active` */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out;
    backdrop-filter: none;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Ensure small-screen sidebar toggle uses the same class (`active`) as the footer script */
@media (max-width: 768px) {
    .toggle-btn {
        display: flex;
        order: 3;
        margin-left: 12px;
    }

    .topbar {
        padding: 0 14px;
        height: 60px;
        position: relative;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .topbar-left {
        gap: 12px;
        justify-content: center;
        padding: 0 56px;
    }

    .topbar-title {
        font-size: 1rem;
    }

    .user-avatar {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
    }

    .toggle-btn {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        margin-left: 0;
    }

    .toggle-btn:hover,
    .toggle-btn:active {
        transform: translateY(-50%);
        box-shadow: 0 2px 8px rgba(67, 56, 202, 0.3);
    }

    .content {
        padding: 18px 14px 32px;
    }

    .dashboard-stats-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 20px;
    }

    .stat-card {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 18px;
        border-radius: 16px;
    }

    .stat-card-header {
        align-items: center;
    }

    .stat-card-value {
        font-size: 1.5rem;
    }

    .dashboard-charts-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .chart-card,
    .alert-card {
        border-radius: 16px;
        padding: 16px;
    }

    .chart-card-body,
    .alert-card-body {
        padding: 12px 0 0;
    }

    .quick-actions-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .action-card {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 16px;
        border-radius: 14px;
    }

    .action-card-content {
        flex: 1;
    }

    .action-card-arrow {
        margin-left: auto;
    }

    .products-table-container,
    .product-form-card,
    .sales-cart-section,
    .sales-products-section {
        border-radius: 14px;
        padding: 16px;
    }

    .list-header,
    .list-item,
    .sales-list-header,
    .sales-list-item {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .list-col,
    .sales-col {
        padding: 10px 12px;
        min-height: auto;
    }

    .section-header {
        text-align: left;
        margin-bottom: 16px;
    }
}

/* --- POLISHED UI RULES (React-like, clean, non-overlapping) --- */
.main-wrapper {
    transition: margin-left 0.22s ease;
}

.brand-logo .logo-img {
    max-height: 36px;
    width: auto;
}

.topbar-title {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile .user-info {
    display: none;
    text-align: right;
}

@media (min-width: 768px) {
    .user-profile .user-info {
        display: block !important;
    }
}

.user-profile .user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-profile .user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--bg-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.avatar-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    stroke: currentColor;
}

.nav-link span {
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(var(--sidebar-width) - 84px);
}

.sidebar-menu {
    -webkit-overflow-scrolling: touch;
}

.content {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Make cards and grids adapt better and avoid overflow */
.card {
    word-break: break-word;
    overflow-wrap: anywhere;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

/* Prevent overlapping sections */
.dashboard-stats-grid,
.dashboard-charts-grid,
.quick-actions-section,
.sales-layout,
.products-list-section {
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

/* Better spacing for sections */
.sales-products-section,
.sales-cart-section,
.add-product-section {
    margin-bottom: 32px;
}

/* Small tweak to prevent topbar overlapping on very small heights */
@media (max-height: 420px) {
    .topbar {
        position: relative;
    }
}

/* Better mobile spacing */
@media (max-width: 768px) {
    .content {
        padding: 16px 12px;
    }

    .dashboard-stats-grid,
    .dashboard-charts-grid {
        gap: 16px;
        margin-bottom: 20px;
    }

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

    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
        width: 280px;
        opacity: 1;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* Tablet responsiveness */
@media (min-width: 769px) and (max-width: 1024px) {
    .content {
        padding: 24px 20px;
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .dashboard-charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .sales-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 14px;
    }
}

/* Large desktop optimizations */
@media (min-width: 1400px) {
    .content {
        max-width: 1600px;
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}


/* CSS Chart - Updated for New Design */
.chart-container {
    display: flex;
    align-items: flex-end;
    height: 280px;
    gap: 12px;
    padding: 20px 0;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    width: 100%;
    height: 100%;
    gap: 12px;
}

.css-chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-height: 0;
    position: relative;
}

.css-chart-bar {
    width: 70%;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 12px;
    min-height: 8px;
    box-shadow: 0 2px 8px rgba(67, 56, 202, 0.2);
}

.css-chart-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.3);
}

.css-chart-value {
    position: absolute;
    top: -25px;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.css-chart-bar-group:hover .css-chart-value {
    opacity: 1;
    transform: translateY(0);
}

.css-chart-label {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart Animation */
@keyframes growBar {
    from {
        height: 0;
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.css-chart-bar {
    animation: growBar 0.8s ease-out forwards;
}

/* Stagger animation for bars */
.css-chart-bar-group:nth-child(1) .css-chart-bar {
    animation-delay: 0.1s;
}

.css-chart-bar-group:nth-child(2) .css-chart-bar {
    animation-delay: 0.2s;
}

.css-chart-bar-group:nth-child(3) .css-chart-bar {
    animation-delay: 0.3s;
}

.css-chart-bar-group:nth-child(4) .css-chart-bar {
    animation-delay: 0.4s;
}

.css-chart-bar-group:nth-child(5) .css-chart-bar {
    animation-delay: 0.5s;
}

.css-chart-bar-group:nth-child(6) .css-chart-bar {
    animation-delay: 0.6s;
}

.css-chart-bar-group:nth-child(7) .css-chart-bar {
    animation-delay: 0.7s;
}

/* --- RESPONSIVE FIXES --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1001;
    }

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

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* --- SALES PAGE LAYOUT --- */
.sales-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .sales-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .sales-cart-section {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .sales-layout {
        gap: 16px;
    }

    .search-container {
        margin-bottom: 16px;
    }

    .search-input-wrapper {
        max-width: 100%;
    }

    .products-grid-container {
        max-height: 400px;
        padding-right: 4px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .sales-layout {
        gap: 12px;
    }

    .products-grid-container {
        max-height: 300px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-item-card {
        padding: 10px;
        min-height: 90px;
        border-radius: 6px;
    }

    .product-item-name {
        font-size: 0.8rem;
        line-height: 1.1;
    }

    .product-item-price {
        font-size: 0.9rem;
        margin-top: 4px;
    }

    .search-input-wrapper input {
        font-size: 16px;
        /* Prevent zoom */
        padding: 12px 14px 12px 40px;
    }
}

.sales-products-section {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.search-container {
    margin-bottom: 24px;
}

.search-input-wrapper {
    position: relative;
    max-width: 400px;
}

.search-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-body);
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.1);
}

.products-grid-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

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

.product-item-card {
    background: var(--bg-body);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.product-item-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.15);
}

.product-item-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.1), rgba(67, 56, 202, 0.05));
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.2);
}

.product-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}

.product-item-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    text-align: left;
    line-height: 1.3;
}

.product-item-stock {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.stock-good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.stock-low {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.product-item-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 8px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.empty-state p {
    margin: 0 0 24px 0;
    font-size: 0.95rem;
}

/* Sales Cart Section */
.sales-cart-section {
    position: sticky;
    top: 24px;
    height: fit-content;
}

.cart-card {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary);
}

.cart-header {
    margin-bottom: 24px;
    text-align: center;
}

.cart-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.cart-title i {
    font-size: 1.5rem;
    color: var(--primary);
}

.cart-title h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

/* Hide form alerts - use toast notifications instead */
.alert-error,
.alert-card.alert-error {
    display: none !important;
}

/* Ensure toast container is visible */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
}

.toast {
    background: white;
    color: #333;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--danger);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: rgba(239, 68, 68, 0.05);
    transform: translateX(-100%);
    transition: transform 3s linear;
}

.toast.show::before {
    transform: translateX(0);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(400px);
    opacity: 0;
}

.toast.error {
    border-left-color: var(--danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.02), white);
}

.toast.success {
    border-left-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.02), white);
}

.toast.warning {
    border-left-color: var(--accent);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.02), white);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.toast.success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.toast.warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
}

.toast-message {
    flex: 1;
    word-break: break-word;
}

.toast-close {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.alert-error span {
    flex: 1;
    word-break: break-word;
}

.cart-item {
    background: var(--bg-body);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-empty {
    text-align: center;
    color: var(--text-secondary);
}

.cart-item-empty i {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.cart-item-empty p {
    margin: 0;
    font-size: 0.95rem;
}

.cart-item-details {
    width: 100%;
}

.cart-item-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    text-align: center;
}

.cart-item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    text-align: center;
}

.quantity-section {
    margin-bottom: 24px;
}

.quantity-section label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.quantity-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.quantity-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.quantity-btn-minus {
    color: var(--text-secondary);
}

.quantity-btn-plus {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.quantity-btn-plus:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.quantity-controls input {
    width: 80px;
    height: 48px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    color: var(--text-primary);
}

.cart-total {
    background: var(--bg-body);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-row span:first-child {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.total-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.btn-checkout {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--secondary), #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

/* --- PRODUCTS PAGE LAYOUT --- */
.add-product-section {
    margin-bottom: 32px;
}

.product-form-card {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.import-products-section {
    margin-bottom: 32px;
}

.import-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.import-help {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    background: var(--bg-body);
    border: 1px dashed var(--border-color);
}

.import-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.import-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.import-step .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.template-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.import-form input[type="file"] {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    background: var(--bg-body);
    font-size: 0.95rem;
}

.import-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/* Mobile form optimizations */
@media (max-width: 768px) {
    .product-form-card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }

    .input-wrapper input {
        padding: 14px 16px 14px 48px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .import-help {
        padding: 12px;
    }

    .import-steps {
        grid-template-columns: 1fr;
    }

    .template-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .product-form-card {
        padding: 16px;
    }

    .form-grid {
        gap: 12px;
    }
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-body);
    box-sizing: border-box;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 24px;
}

.products-list-section {
    margin-bottom: 32px;
}

.products-table-container {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.products-list {
    background: var(--bg-surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    background: var(--bg-body);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.list-header .list-col {
    padding: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid var(--border-color);
}

.list-header .list-col:last-child {
    border-right: none;
}

.list-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.list-item:hover {
    background: var(--bg-body);
}

.list-item:last-child {
    border-bottom: none;
}

.list-col {
    padding: 16px;
    display: flex;
    align-items: center;
    min-height: 60px;
}

/* Add data-label support for mobile tables */
.list-col[data-label] {
    position: relative;
}

.product-name-cell {
    font-size: 1rem;
    line-height: 1.4;
}

.category-cell {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.price-cell {
    font-weight: 600;
}

.price-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.stock-cell {
    justify-content: center;
}

.stock-value {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
    min-width: 60px;
    text-align: center;
}

.status-cell {
    justify-content: center;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive for list view */
@media (max-width: 768px) {

    .list-header,
    .list-item {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .list-header .list-col,
    .list-col {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 12px 16px;
        min-height: auto;
    }

    .list-header .list-col {
        background: var(--bg-surface);
        font-size: 0.85rem;
        font-weight: 700;
    }

    .list-col::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.75rem;
        display: block;
        margin-bottom: 4px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .product-name-cell strong {
        display: block;
        font-size: 0.9rem;
    }

    .products-table-container {
        padding: 16px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {

    .list-header .list-col,
    .list-col {
        padding: 10px 12px;
    }

    .products-table-container {
        padding: 12px;
    }
}

.stock-good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.stock-low {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-orange);
}

.stock-out {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.product-card-footer {
    text-align: center;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.status-low {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-orange);
}

.status-out {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* --- REPORTS PAGE LAYOUT --- */
.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    gap: 24px;
}

@media (max-width: 768px) {
    .reports-header {
        flex-direction: column;
        align-items: stretch;
    }
}

.reports-actions {
    display: flex;
    gap: 12px;
}

.reports-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 1024px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
}

.top-products-card {
    background: var(--bg-surface);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.top-products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-product-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-body);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.top-product-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.15);
}

.product-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.product-stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
}

.stat {
    color: var(--text-secondary);
}

.stat strong {
    color: var(--text-primary);
    font-weight: 600;
}

.stat.profit strong {
    color: var(--secondary);
}

.advice-card {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.05), rgba(16, 185, 129, 0.03));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    border-left: 4px solid var(--primary);
}

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

.advice-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.advice-title i {
    font-size: 1.25rem;
    color: var(--primary);
}

.advice-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.advice-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.advice-content li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.advice-content li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.advice-content li:last-child {
    margin-bottom: 0;
}

.advice-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Fix alert card layout */
.alert-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
    min-height: 300px;
}

.alert-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.alert-card-body {
    flex: 1;
    padding: 16px 24px 24px;
    overflow-y: auto;
    max-height: 400px;
}

.alert-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    flex: 1;
}

.alert-card-title h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.alert-card-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

#low-stock-list {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#low-stock-list p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- SETTINGS PAGE LAYOUT --- */
.settings-container {
    max-width: 1000px;
    margin: 0 auto;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .sales-layout {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 100%;
    }

    .sales-cart-section {
        position: relative;
        top: 0;
        margin-top: 20px;
    }

    .search-container {
        margin-bottom: 16px;
    }

    .search-input-wrapper {
        max-width: 100%;
    }

    .search-input-wrapper input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .products-grid-container {
        max-height: 350px;
        padding-right: 8px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .product-item-card {
        padding: 12px;
        min-height: 100px;
    }

    .product-item-name {
        font-size: 0.85rem;
        line-height: 1.2;
    }

    .product-item-price {
        font-size: 0.95rem;
        margin-top: 6px;
    }
}


.settings-section {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.settings-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-title i {
    width: 24px;
    height: 24px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.settings-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.settings-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
}

.settings-content {
    padding: 0 24px 24px 24px;
}

.settings-form-card {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    margin-top: 32px;
}

.current-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.logo-preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.logo-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.logo-upload-section {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.current-logo {
    text-align: center;
}

.current-logo img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    margin-bottom: 8px;
}

.current-logo span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.upload-area {
    flex: 1;
    min-width: 200px;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-body);
}

.upload-label:hover {
    border-color: var(--primary);
    background: rgba(67, 56, 202, 0.02);
}

.upload-label i {
    font-size: 2rem;
    color: var(--primary);
}

.upload-label span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* --- LOGIN / PUBLIC LAYOUT --- */
.public-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    width: 100%;
}

/* --- LOGIN PAGE --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-body), rgba(67, 56, 202, 0.02));
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.brand-logo-large {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.brand-logo-large span:first-child {
    color: var(--primary);
}

.brand-logo-large span:last-child {
    color: var(--secondary);
}

.tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

.login-card {
    background: var(--bg-surface);
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    max-width: 100%;
    overflow: hidden;
    width: 100%;
    max-width: 420px;
}

.welcome-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 600;
}

.welcome-badge i {
    font-size: 0.9rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin: 0 0 24px 0;
}

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

.login-form .form-group {
    margin-bottom: 0;
}

.login-form .form-group label {
    font-size: 0.85rem;
    margin-bottom: 6px;
    font-weight: 500;
}

.login-form .input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-body);
    box-sizing: border-box;
}

.login-form .input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.1);
}

.stepper {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.step {
    flex: 1;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    transition: var(--transition);
}

.step-index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step.active {
    border-color: var(--primary);
    color: var(--primary);
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(67, 56, 202, 0.12);
}

.step.active .step-index {
    background: var(--primary);
    color: white;
}

.step.complete {
    border-color: var(--secondary);
    color: var(--secondary);
}

.step.complete .step-index {
    background: var(--secondary);
    color: white;
}

.step-indicator {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 16px;
}

.form-step {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.form-step.active {
    display: flex;
    animation: fadeIn 0.2s ease-in-out;
}

.step-actions {
    display: flex;
    gap: 12px;
}

.step-actions .btn {
    flex: 1;
}

.btn-full {
    width: 100%;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    min-height: 48px;
}

.login-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Toast notification mobile responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        align-items: center;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
        width: 100%;
        padding: 14px 16px;
        font-size: 0.85rem;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }

    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }

    .toast-close {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
}

/* Toast notification mobile responsive */
@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        padding: 12px 14px;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .toast-icon {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }

    .toast-close {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
}

/* Mobile responsive login */
@media (max-width: 768px) {
    .login-container {
        padding: 12px 8px;
    }

    .login-wrapper {
        max-width: 100%;
    }

    .login-card {
        padding: 20px 16px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .login-header {
        margin-bottom: 16px;
    }

    .welcome-badge {
        padding: 6px 10px;
        margin-bottom: 12px;
        font-size: 0.75rem;
        gap: 6px;
    }

    .login-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .login-form {
        gap: 12px;
    }

    .login-form .form-group label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }

    .login-form .input-wrapper input {
        padding: 12px 14px 12px 40px;
        font-size: 16px;
        /* Prevent zoom on iOS */
        border-radius: 6px;
    }

    .stepper {
        gap: 6px;
    }

    .step {
        padding: 8px 6px;
        font-size: 0.7rem;
    }

    .step-index {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }

    .step-indicator {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .btn-full {
        padding: 14px 16px;
        font-size: 0.9rem;
    }

    .register-link {
        margin-top: 10px;
    }

    .register-link p {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }

    .login-card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .login-wrapper {
        max-width: 100%;
    }

    .login-card {
        padding: 24px 20px;
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .brand-logo-large {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .login-header {
        margin-bottom: 24px;
    }

    .welcome-badge {
        padding: 10px 14px;
        margin-bottom: 20px;
        font-size: 0.85rem;
    }

    .login-title {
        font-size: 1.25rem;
        margin-bottom: 20px;
    }

    .login-form {
        gap: 16px;
    }

    .login-form .input-wrapper input {
        padding: 16px 16px 16px 48px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .btn-full {
        padding: 16px 20px;
        font-size: 1rem;
        min-height: 48px;
    }

    .register-link {
        margin-top: 16px;
        text-align: center;
    }

    .register-link p {
        font-size: 0.85rem;
        margin-bottom: 10px;
        color: var(--text-secondary);
    }

    .register-link p {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }

    .login-footer {
        padding: 16px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 8px 6px;
    }

    .login-card {
        padding: 16px 12px;
        border-radius: 10px;
    }

    .login-header {
        margin-bottom: 12px;
    }

    .welcome-badge {
        padding: 4px 8px;
        margin-bottom: 10px;
        font-size: 0.7rem;
        gap: 4px;
        border-radius: 6px;
    }

    .login-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .login-form {
        gap: 10px;
    }

    .login-form .form-group label {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }

    .login-form .input-wrapper input {
        padding: 10px 12px 10px 36px;
        font-size: 16px;
        border-radius: 4px;
    }

    .step {
        padding: 6px 4px;
        font-size: 0.65rem;
    }

    .step-index {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    .btn-full {
        padding: 12px 14px;
        font-size: 0.85rem;
        min-height: 40px;
    }

    .register-link {
        margin-top: 8px;
    }

    .register-link p {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    .alert-error {
        padding: 2px 4px;
        font-size: 0.6rem;
        margin-bottom: 4px;
        gap: 2px;
        line-height: 1.0;
        border-radius: 2px;
        min-height: 20px;
        height: 20px;
    }

    .alert-error i {
        font-size: 0.6rem;
        width: 12px;
        height: 12px;
        min-width: 12px;
    }

    .brand-logo-large {
        font-size: 2rem;
    }

    .welcome-badge {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 12px 16px;
    }

    .login-title {
        font-size: 1.1rem;
    }

    .login-form {
        gap: 14px;
    }

    .btn-full {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
}

.login-footer p {
    margin: 0;
}

/* Alert styles */
.alert-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--secondary);
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.register-link {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.register-link p {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Print */
@media print {

    .sidebar,
    .topbar {
        display: none !important;
    }

    .main-wrapper {
        margin: 0 !important;
    }

    .card {
        break-inside: avoid;
        border: none;
        box-shadow: none;
    }
}

/* AI Suggestion Box */
.ai-suggestion-box {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.05), rgba(16, 185, 129, 0.03));
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary);
}

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

.ai-suggestion-header strong {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 700;
}

.ai-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(67, 56, 202, 0.3);
}

/* AI Badge Icon */
.ai-tag i {
    font-size: 0.8rem;
}

.ai-suggestion-box p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- MOBILE SIDEBAR & OVERLAY --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9990;
    /* Below sidebar (10000) */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
    pointer-events: none;
    /* Let clicks pass when hidden */
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Catch clicks when visible */
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
    }

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

/* =========================================
   LANDING PAGE MOBILE MENU & STYLES
   ========================================= */

/* Mobile Menu Styles */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-dark);
    cursor: pointer;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 2001;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-menu-sidebar.active {
    transform: translateX(0);
}

.mobile-menu-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.close-menu-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.mobile-menu-links {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav-link {
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 0;
    border-bottom: 1px solid transparent;
}

.mobile-nav-link:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* Reduced hero spacing for desktop closer-to-nav feel */
    .hero {
        padding-top: 140px;
    }
}

@media (min-width: 769px) {

    /* Move hero text up on desktop as requested */
    .hero {
        padding-top: 120px;
        padding-bottom: 60px;
    }
}