/* --- 1. CORE THEME VARIABLES --- */
:root {
    --primary-blue: #0056b3;
    --light-blue: #e7f1ff;
    --success-green: #28a745;
    --danger-red: #dc3545;
    --bg-gray: #f8f9fa;
    --text-dark: #333;
    --card-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* --- 2. GLOBAL STYLES --- */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    margin: 0;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.5;
}

/* --- 3. NAVIGATION RIBBON --- */
nav {
    background: var(--primary-blue);
    color: white;
    padding: 0 25px;
    display: flex;
    align-items: center;
    height: 60px;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

nav a:hover { color: white; }

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-right: 20px;
}

/* --- 4. LAYOUT CONTAINERS --- */
.container {
    max-width: 1100px;
    margin: 25px auto;
    padding: 0 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

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

/* --- 5. CARDS & FORMS --- */
.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
    border: 1px solid rgba(0,0,0,0.05);
}

label {
    display: block;
    margin-top: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

input, select {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

/* --- 6. TAB SYSTEM --- */
.tab-menu {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
    gap: 5px;
}

.tab-link {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    color: #555;
    transition: all 0.2s;
}

.tab-link.active {
    background: var(--primary-blue);
    color: white;
}

.tab-link:hover:not(.active) {
    background: var(--light-blue);
    color: var(--primary-blue);
}

/* --- 7. TABLES & INVENTORY --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
}

td {
    padding: 15px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.barcode-img {
    height: 50px;
    mix-blend-mode: multiply;
}

code {
    background: var(--light-blue);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* --- 8. BUTTONS & ACTIONS --- */
button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
}

button:active { transform: scale(0.98); }

.btn-export {
    background: white;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
}

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

.btn-edit-small {
    background: var(--light-blue);
    color: var(--primary-blue);
    padding: 6px 10px;
    font-size: 0.75rem;
    border: 1px solid var(--primary-blue);
}

.btn-edit-small:hover {
    background: var(--primary-blue);
    color: white;
}

/* --- 9. UTILITIES --- */
.flash-msg {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 5px solid var(--success-green);
    font-weight: 500;
}

.badge-green { background: #d4edda; color: #155724; padding: 4px 8px; border-radius: 4px; font-weight: bold; }
.badge-red { background: #f8d7da; color: #721c24; padding: 4px 8px; border-radius: 4px; font-weight: bold; }
.badge-orange { background: #fff3cd; color: #856404; padding: 4px 8px; border-radius: 4px; font-weight: bold; }

#reader {
    border: 1px solid #ddd;
    border-radius: 12px;
}