/* style.css */

/* --- RESET & VARIABLES --- */
:root {
    --primary-color: #2c3e50;    /* Deep Navy */
    --accent-color: #e67e22;     /* Sawdust Orange */
    --bg-color: #f4f6f9;         /* Light Grey Background */
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #ddd;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- AUTH OVERLAY --- */
#auth-container {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(44, 62, 80, 0.95);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}
.login-box {
    background: white; padding: 3rem; border-radius: 8px;
    text-align: center; width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* --- LAYOUT GRID --- */
#app-container {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: white;
    position: fixed; height: 100%; left: 0; top: 0;
    display: flex; flex-direction: column;
    z-index: 100;
}

/* --- BRANDING SECTION (Option A: Light Slate) --- */
.sidebar .brand {
    display: flex;
    justify-content: center; /* Center the logo horizontally */
    align-items: center;
    padding: 1.5rem 1rem;

    /* Light Slate Background for Contrast */
    background-color: #dfe6e9;
    border-bottom: 1px solid #b2bec3; /* Subtle seam */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Slight shadow over menu */

    flex-shrink: 0;
    z-index: 10;
}

.sidebar .brand img {
    border: none;
    width: auto;
    max-width: 85%;
    height: auto;
    object-fit: contain;
}

/* --- NAVIGATION MENU --- */
.sidebar ul {
    list-style: none; padding: 0;
    display: flex; flex-direction: column;
    height: 100%; overflow-y: auto;
}

.sidebar li {
    padding: 1rem 1.5rem; cursor: pointer;
    border-left: 4px solid transparent;
    display: flex; align-items: center;
    transition: background 0.2s;
}
.sidebar li:not(.spacer):hover, .sidebar li.active {
    background-color: rgba(255,255,255,0.1);
    border-left-color: var(--accent-color);
}
.sidebar li i { width: 30px; text-align: center; margin-right: 10px; }
.sidebar hr { border: 0; border-top: 1px solid rgba(255,255,255,0.1); margin: 5px 0; }
.sidebar .spacer { flex-grow: 1; cursor: default; }
.sidebar .spacer:hover { background: none; border: none; }

/* --- MAIN CONTENT --- */
#main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

/* --- COMPONENTS --- */
h1 { color: var(--primary-color); border-bottom: 2px solid #ddd; padding-bottom: 0.5rem; margin-bottom: 1.5rem; }
h2, h3 { margin-bottom: 1rem; }

.card {
    background: var(--card-bg); padding: 1.5rem;
    border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.header-action { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.header-action h1 { margin-bottom: 0; border: none; }

/* --- BUTTONS --- */
button {
    cursor: pointer; border: none; padding: 0.6rem 1.2rem;
    border-radius: 4px; font-size: 0.9rem; transition: 0.2s;
}
.btn-primary { background-color: var(--accent-color); color: white; }
.btn-primary:hover { background-color: #d35400; }
.btn-delete { background-color: #e74c3c; color: white; padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-edit { background-color: #3498db; color: white; padding: 0.4rem 0.8rem; font-size: 0.8rem; margin-right: 5px; }

/* --- FORMS & TABLES --- */
input, select, textarea { width: 100%; padding: 0.6rem; margin-bottom: 1rem; border: 1px solid #ccc; border-radius: 4px; }
label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: #555; }

.inventory-table { width: 100%; border-collapse: collapse; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.inventory-table th, .inventory-table td { padding: 1rem; text-align: left; border-bottom: 1px solid #eee; }
.inventory-table th { background-color: #f8f9fa; font-weight: 600; color: var(--primary-color); }
.inventory-table tr:hover { background-color: #f1f1f1; }

.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }
.badge.Estimated { background: #f39c12; color: white; }
.badge.Ordered { background: #3498db; color: white; }
.badge.Finished { background: #27ae60; color: white; }

/* =========================================
   UTILITY & COMPONENT CLASSES
   ========================================= */

/* --- Layout & Flexbox --- */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; }
.flex-center { display: flex; justify-content: center; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.gap-5 { gap: 5px; }
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

/* --- Grid System --- */
.grid { display: grid; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 2fr 1fr 1.5fr; } /* Your standard order grid */
.span-2 { grid-column: span 2; }

/* --- Spacing (Margins & Padding) --- */
.w-100 { width: 100%; }
.m-0 { margin: 0; }
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }

/* --- Typography & Colors --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #666; }
.text-primary { color: var(--primary-color); }
.text-success { color: #27ae60; }
.text-danger { color: #e74c3c; }
.font-bold { font-weight: bold; }
.text-sm { font-size: 0.85rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.5rem; }

/* --- Standardized Modals --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: flex; justify-content: center;
    align-items: center; z-index: 9999;
}
.modal-card { width: 500px; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-card-lg { width: 700px; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-card-xl { width: 900px; position: relative; max-height: 90vh; overflow-y: auto; }

/* --- Reusable UI Elements --- */
.cancel-btn {
    background: #ddd; color: #333; border: none; padding: 10px;
    border-radius: 4px; cursor: pointer; transition: 0.2s; width: 100%;
}
.cancel-btn:hover { background: #ccc; }
.info-panel {
    background: #f4f6f9; padding: 15px; border-radius: 4px; border: 1px solid #ddd;
}
.dashed-input {
    border: 1px solid transparent; border-bottom: 1px dashed #ccc;
    background: transparent; padding: 6px; width: 100%;
}