:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1a1f2e;
    --sidebar-text: #a0aec0;
    --sidebar-active: #4299e1;
    --topbar-height: 60px;
    --primary: #4299e1;
    --success: #48bb78;
    --danger: #fc8181;
    --warning: #f6ad55;
}

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: #f7fafc; margin: 0; }

/* Wrapper */
.wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.collapsed { width: 60px; }

/* Fade out text labels when collapsing */
.sidebar-header .sidebar-label,
.sidebar-menu .nav-label,
.menu-header {
    opacity: 1;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar.collapsed .sidebar-header .sidebar-label,
.sidebar.collapsed .sidebar-menu .nav-label,
.sidebar.collapsed .menu-header {
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px;
    flex-shrink: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE / Edge */
}
.sidebar-menu::-webkit-scrollbar { display: none; } /* Chrome / Safari */
.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-menu li a:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-menu li a.active { background: rgba(66,153,225,0.2); color: var(--primary); border-right: 3px solid var(--primary); }
.sidebar-menu li a i {
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.collapsed .sidebar-menu li a i { transform: scale(1.1); }
.menu-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    padding: 12px 16px 4px;
    text-transform: uppercase;
}


/* Main Content */
#content {
    margin-left: var(--sidebar-width);
    flex: 1;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}
#content.expanded { margin-left: 60px; }

.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.topbar-title { font-weight: 600; font-size: 16px; color: #2d3748; }

.main-content { padding: 24px; }

/* KPI Cards */
.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.kpi-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.kpi-value { font-size: 28px; font-weight: 700; color: #2d3748; }
.kpi-label { font-size: 13px; color: #718096; }
.kpi-change { font-size: 12px; }

/* Cards */
.card { border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: none; }
.card-header { background: white; border-bottom: 1px solid #e2e8f0; font-weight: 600; }

/* Tables */
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #718096; font-weight: 600; }
.table td { font-size: 14px; vertical-align: middle; }

/* Badges */
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.status-active, .status-confirmed, .status-paid { background: #c6f6d5; color: #276749; }
.status-pending { background: #fefcbf; color: #744210; }
.status-inactive, .status-cancelled { background: #fed7d7; color: #742a2a; }
.status-in_transit, .status-sent { background: #bee3f8; color: #2a4365; }
.status-maintenance, .status-on_leave { background: #fbd38d; color: #744210; }
.status-delivered { background: #c6f6d5; color: #276749; }
.status-draft { background: #e2e8f0; color: #4a5568; }
.status-overdue { background: #fed7d7; color: #742a2a; }

/* Login Page */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
    display: flex; align-items: center; justify-content: center;
}
.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-header h4 { margin: 0; font-weight: 700; color: #2d3748; }

/* Form styling */
.form-label { font-size: 13px; font-weight: 600; color: #4a5568; }
.form-control, .form-select { font-size: 14px; border-color: #e2e8f0; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66,153,225,0.15); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar .sidebar-header .sidebar-label,
    .sidebar .sidebar-menu .nav-label,
    .sidebar .menu-header { opacity: 0; pointer-events: none; }
    #content { margin-left: 60px; }
}
