/* ==========================================================================
   PREMIUM GLASSMORPHISM DESIGN SYSTEM FOR TILE FACTORY ERP
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --font-head: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Harmonious Color Palette */
    --bg-app: #f8fafc;
    --primary: #0f172a;       /* Slate Dark Primary */
    --primary-light: #1e293b;
    --accent: #e11d48;        /* Crimson Red Accent */
    --accent-glow: rgba(225, 29, 72, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --info: #06b6d4;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(226, 232, 240, 0.8);
    --sidebar-width: 280px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ==========================================================================
   LAYOUT & SIDEBAR
   ========================================================================== */

#app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

#sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #f1f5f9;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .logo-icon {
    background: linear-gradient(135deg, var(--accent), #f43f5e);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.sidebar-brand span {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 19px;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu li a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-menu li.active a {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.1), rgba(225, 29, 72, 0.03));
    border-left: 3px solid var(--accent);
    color: #fff;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.user-info span {
    display: block;
    font-size: 12px;
}

.user-info .name {
    font-weight: 600;
    color: #f1f5f9;
}

.user-info .role {
    color: #64748b;
    font-size: 10px;
}

.logout-btn {
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s ease;
}

.logout-btn:hover {
    color: var(--accent);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================= */

#main-content {
    margin-left: var(--sidebar-width);
    width: calc(100vw - var(--sidebar-width));
    padding: 40px;
    min-height: 100vh;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.page-title h1 {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 32px;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.page-title p {
    color: #64748b;
    font-size: 14px;
    margin-top: 4px;
}

/* ==========================================================================
   GLASSMORPHISM CONTAINERS & CARDS
   ========================================================================== */

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02),
                0 1px 3px rgba(0, 0, 0, 0.01);
    margin-bottom: 30px;
}

/* Stat Cards Container */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 35px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.01);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
}

.stat-info p {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info h2 {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 6px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.primary { background: rgba(15, 23, 42, 0.06); color: var(--primary); }
.stat-icon.accent { background: rgba(225, 29, 72, 0.06); color: var(--accent); }
.stat-icon.success { background: rgba(16, 185, 129, 0.06); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.06); color: var(--warning); }

/* ==========================================================================
   FORMS & CONTROLS
   ========================================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.form-control-premium {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #0f172a;
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

.form-control-premium:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.btn-premium:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.btn-premium-accent {
    background: linear-gradient(135deg, var(--accent), #f43f5e);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.table-premium {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 14px;
}

.table-premium th {
    background: #f8fafc;
    padding: 16px 20px;
    font-weight: 600;
    color: #475569;
    text-align: left;
    border-bottom: 1px solid #edf2f7;
}

.table-premium td {
    padding: 16px 20px;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
}

.table-premium tr:hover td {
    background-color: #f8fafc;
}

/* ==========================================================================
   PRODUCTION PHASE STEPPER
   ========================================================================== */

.stepper-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 20px 0 40px 0;
    padding: 0 40px;
}

.stepper-line {
    position: absolute;
    top: 50%;
    left: 80px;
    right: 80px;
    height: 4px;
    background: #e2e8f0;
    transform: translateY(-50%);
    z-index: 1;
}

.stepper-line-progress {
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--success));
    width: 0%;
    transition: width 0.4s ease;
}

.step-node {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border: 3px solid #cbd5e1;
    color: #64748b;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
}

.step-node.active {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-glow);
}

.step-node.completed {
    border-color: var(--success);
    background: var(--success);
    color: #ffffff;
}

.step-node .step-label {
    position: absolute;
    top: 55px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.step-node.active .step-label {
    color: var(--accent);
    font-weight: 700;
}

.step-node.completed .step-label {
    color: var(--success);
}
