:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(51, 65, 85, 0.5);
    --success: #10b981;
    --danger: #ef4444;
    --glass: blur(10px);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--card-bg);
    backdrop-filter: var(--glass);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem 2.5rem 1rem;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #c084fc);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.sidebar h1 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: white;
    letter-spacing: -0.025em;
}

.nav-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 1.5rem 0 0.5rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.25rem;
}

.nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: color 0.2s;
}

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

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.4);
}

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

.sidebar-footer {
    margin-top: auto;
    padding: 1.25rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
}

.main-content {
    flex: 1;
    padding: 2rem;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
}

.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.25rem;
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border: 1px solid transparent;
    padding: 0.6rem 1.25rem;
    border-radius: 0.6rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
    text-decoration: none;
    line-height: 1.25;
    user-select: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

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

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
}

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

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

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control,
select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"] {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 0.75rem 1rem;
    color: white;
    outline: none;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    /* Reset standard styles */
}

.form-control:focus,
select:focus,
input:focus {
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Specific styling for select to add custom arrow */
select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    cursor: pointer;
}

input::placeholder {
    color: #475569;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

/* Readonly & Disabled States */
input[readonly],
input:disabled,
select:disabled,
textarea:disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
}

/* Print Styles for PDF Generation */
@media print {

    .sidebar,
    .btn,
    .nav-link,
    #add-product-modal {
        display: none !important;
    }

    .container {
        display: block;
    }

    .main-content {
        padding: 0;
        background: white;
        color: black;
    }

    .card {
        background: white !important;
        border: 1px solid #ccc;
        box-shadow: none;
        backdrop-filter: none;
        color: black;
        page-break-inside: avoid;
    }

    h2,
    h3 {
        color: black;
    }

    table {
        color: black;
        border: 1px solid #eee;
    }

    th,
    td {
        border-bottom: 1px solid #eee;
        color: black !important;
    }

    .stat-card .label {
        color: #666;
    }

    .value {
        color: black;
    }
}