:root {
    --primary-color: #4F46E5; /* Indigo */
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --sidebar-bg: #1f2937; /* Dark Gray */
    --sidebar-text: #e5e7eb;
    --text-color: #111827;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background-color: rgba(255,255,255,0.05);
    color: #fff;
    border-right: 3px solid var(--primary-color);
}

.sidebar-nav i {
    width: 24px;
    margin-right: 10px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.logout-btn {
    display: block;
    text-align: center;
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    transition: 0.2s;
}

.logout-btn:hover {
    background-color: var(--danger);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Components */
.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background dot 2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.btn-success {
    background-color: var(--success);
    color: white;
}
.btn-success:hover { filter: brightness(90%); }

.btn-danger {
    background-color: var(--danger);
    color: white;
}
.btn-danger:hover { filter: brightness(90%); }

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f9fafb;
    font-weight: 600;
}

/* Status Colors */
.status-active { color: var(--success); font-weight: bold; }
.status-warning { color: var(--warning); font-weight: bold; }
.status-danger { color: var(--danger); font-weight: bold; }

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #f3f4f6;
}

.login-box {
    width: 100%;
    max-width: 400px;
}

/* --- Mobile Responsiveness --- */

/* Mobile Toggle Button (Hidden on Desktop) */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* Overlay (Hidden by default) */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    /* Layout */
    .app-container {
        flex-direction: column;
    }

    /* Sidebar - Off canvas */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 250px;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .mobile-overlay.active {
        display: block;
    }

    .mobile-toggle {
        display: block;
    }

    /* Main Content */
    .main-content {
        padding: 4rem 1rem 1rem 1rem; /* Top padding for toggle button */
        width: 100%;
    }

    /* Tables */
    .card {
        padding: 1rem;
        overflow-x: auto; /* Allow horizontal scroll for tables */
    }

    .table-inventory {
        min-width: 600px; /* Force scroll on small screens */
    }

    /* Adjust font sizes for inputs to prevent zoom */
    input[type="text"], 
    input[type="number"], 
    input[type="email"], 
    input[type="password"], 
    select {
        font-size: 16px; 
    }

    /* Better touch targets */
    .btn {
        padding: 0.75rem 1.25rem;
    }

    /* Force rows to stack */
    .row {
        flex-direction: column !important;
    }
}
