/* ============================================================
   Wicker Furniture Workshop - Main Stylesheet
   ============================================================ */

:root {
    --wicker-brown:  #7C4A1E;
    --wicker-tan:    #C8955A;
    --wicker-light:  #F5EFE6;
    --wicker-dark:   #3E2006;
    --wicker-accent: #D4812A;
}

body {
    background-color: #F0EAE0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2d2d2d;
}

/* ---- Sidebar ---- */
.sidebar {
    background: var(--wicker-dark);
    min-height: 100vh;
    width: 240px;
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}
.sidebar .brand {
    background: var(--wicker-brown);
    padding: 20px 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 3px solid var(--wicker-tan);
}
.sidebar .brand small {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.7;
    text-transform: none;
    letter-spacing: 0;
}
.sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 12px 20px;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: var(--wicker-tan);
}
.sidebar .nav-link i { width: 20px; margin-right: 8px; }

/* ---- Main content ---- */
.main-content {
    margin-left: 240px;
    padding: 30px 24px;
    min-height: 100vh;
}
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--wicker-dark);
    margin-bottom: 4px;
}
.page-subtitle {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 24px;
}

/* ---- Stat cards ---- */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    border-left: 4px solid var(--wicker-tan);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--wicker-brown);
}
.stat-card .stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-top: 2px;
}
.stat-card.green  { border-left-color: #28a745; }
.stat-card.green  .stat-number { color: #28a745; }
.stat-card.red    { border-left-color: #dc3545; }
.stat-card.red    .stat-number { color: #dc3545; }
.stat-card.orange { border-left-color: var(--wicker-accent); }
.stat-card.orange .stat-number { color: var(--wicker-accent); }
.stat-card.blue   { border-left-color: #007bff; }
.stat-card.blue   .stat-number { color: #007bff; }

/* ---- Cards ---- */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.card-header {
    background: var(--wicker-brown);
    color: #fff;
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
    padding: 14px 20px;
    font-size: 0.95rem;
}
.card-header.light {
    background: var(--wicker-light);
    color: var(--wicker-dark);
    border-bottom: 1px solid #ddd;
}

/* ---- Tables ---- */
.table th {
    background: var(--wicker-light);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wicker-dark);
    border-bottom: 2px solid #ddd;
}
.table td { vertical-align: middle; font-size: 0.9rem; }
.table-hover tbody tr:hover { background: #fdf7f0; }

/* ---- Buttons ---- */
.btn-wicker {
    background: var(--wicker-brown);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
}
.btn-wicker:hover { background: var(--wicker-dark); color: #fff; }
.btn-wicker-outline {
    border: 2px solid var(--wicker-brown);
    color: var(--wicker-brown);
    background: transparent;
    border-radius: 6px;
    font-weight: 600;
}
.btn-wicker-outline:hover { background: var(--wicker-brown); color: #fff; }

/* ---- Login page ---- */
.login-page {
    min-height: 100vh;
    background: var(--wicker-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: #fff;
    border-radius: 14px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.login-logo {
    width: 64px; height: 64px;
    background: var(--wicker-brown);
    border-radius: 14px;
    margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: #fff; font-weight: 900;
}
.login-title { font-size: 1.5rem; font-weight: 800; color: var(--wicker-dark); }
.login-subtitle { font-size: 0.85rem; color: #999; }

/* ---- Worker dashboard big buttons ---- */
.worker-action-btn {
    border-radius: 12px;
    padding: 24px 16px;
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.worker-action-btn:active { transform: scale(0.97); }
.worker-action-btn.start  { background: var(--wicker-brown); color: #fff; }
.worker-action-btn.finish { background: #28a745; color: #fff; }

/* ---- Alerts ---- */
.alert-fixed {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
    min-width: 280px;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ---- Mobile responsiveness ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 220px;
    }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .mobile-toggle {
        position: fixed; top: 12px; left: 12px; z-index: 1100;
        background: var(--wicker-brown); color: #fff;
        border: none; border-radius: 8px;
        padding: 8px 12px; font-size: 1.2rem;
    }
    .mobile-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.5); z-index: 999;
    }
    .mobile-overlay.show { display: block; }
}

/* ---- Low stock warning ---- */
.low-stock { color: #dc3545; font-weight: 600; }

/* ---- Profit/loss colours ---- */
.text-profit { color: #28a745; font-weight: 700; }
.text-loss   { color: #dc3545; font-weight: 700; }

/* ---- Material stock bar ---- */
.stock-bar { height: 6px; border-radius: 3px; background: #e9ecef; margin-top: 4px; }
.stock-bar-fill { height: 100%; border-radius: 3px; background: var(--wicker-tan); }
.stock-bar-fill.low  { background: #dc3545; }
.stock-bar-fill.good { background: #28a745; }
