/* ===== J.S.Electric Studio — Global Styles ===== */
:root {
    --primary: #27ae60;
    --secondary: #ffb300;
    --dark: #2c3e50;
    --bg: #f4f6f9;
    --so-color: #8e44ad;
}

body { font-family: 'Helvetica', 'Tahoma', sans-serif; background-color: var(--bg); margin: 0; padding: 0; }

/* ---- Login ---- */
#loginScreen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; background-color: var(--primary); }
.login-box { background: white; padding: 40px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); text-align: center; width: 90%; max-width: 400px; }
.login-box input { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ccc; border-radius: 8px; font-size: 16px; box-sizing: border-box; }
.login-box button { width: 100%; padding: 12px; background-color: var(--secondary); border: none; border-radius: 8px; font-size: 18px; font-weight: bold; cursor: pointer; margin-top: 10px; }

/* ---- Main App ---- */
#mainApp { display: none; max-width: 1200px; margin: auto; padding-bottom: 50px; }

/* ---- Navbar ---- */
.navbar { background-color: var(--dark); padding: 15px 20px; display: flex; flex-direction: column; gap: 8px; color: white; }
.nav-top-row { display: flex; align-items: center; gap: 8px; }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.nav-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.nav-tabs button { background: none; border: none; color: white; font-size: 16px; cursor: pointer; padding: 10px 15px; border-radius: 5px; opacity: 0.7; transition: 0.3s; }
.nav-tabs button:hover, .nav-tabs button.active { opacity: 1; background: rgba(255,255,255,0.1); }
.nav-tabs button.active { background-color: var(--primary); font-weight: bold; }
.nav-tabs button#tabSO.active { background-color: var(--so-color); }
/* Hamburger — hidden on desktop */
.hamburger-btn { display: none; background: none; border: 2px solid rgba(255,255,255,0.4); color: white; font-size: 22px; line-height: 1; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.nav-current-label { display: none; color: white; font-weight: bold; font-size: 15px; flex: 1; }
.logout-btn { background: #e74c3c; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; font-weight: bold; }

/* ---- Layout ---- */
.search-box { background-color: #fff9c4; padding: 20px; border-radius: 8px; text-align: center; margin: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.search-box input { font-size: 20px; padding: 12px; width: 100%; max-width: 300px; text-align: center; border: 2px solid #ccc; border-radius: 5px; }
.search-box button { font-size: 20px; padding: 12px 25px; background-color: var(--secondary); border: none; border-radius: 5px; cursor: pointer; font-weight: bold; }
.content-container { display: flex; flex-wrap: wrap; gap: 20px; margin: 0 20px; }
.panel { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.img-panel { flex: 1 1 300px; text-align: center; }
.img-panel img { max-width: 100%; height: auto; max-height: 400px; border-radius: 8px; object-fit: contain; }
.info-panel { flex: 2 1 400px; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th, td { border: 1px solid #ddd; padding: 10px; text-align: left; }
th { background-color: var(--primary); color: white; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background-color: #219a52; }
.th-so { background-color: var(--so-color); }
tr:nth-child(even) { background-color: #f9f9f9; }
tr.clickable:hover { background-color: #e3f2fd; cursor: pointer; }
tr.row-pending { background-color: #fffde7 !important; }
tr.row-pending:hover { background-color: #fff9c4 !important; }

/* ---- SO Tabs ---- */
.so-tab-bar { display: flex; border-bottom: 2px solid #ddd; margin: 0; }
.so-tab { padding: 10px 20px; border: none; background: #f0f0f0; cursor: pointer; font-size: 15px; font-weight: bold; border-radius: 8px 8px 0 0; margin-right: 4px; color: #555; transition: 0.2s; }
.so-tab:hover { background: #e0e0e0; }
.so-tab.active { background: var(--so-color); color: white; }

/* ---- Buttons ---- */
.btn-green  { background-color: var(--primary); color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.btn-blue   { background-color: #2196F3; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.btn-red    { background-color: #e74c3c; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; }
.btn-orange { background-color: #ff9800; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.btn-purple { background-color: var(--so-color); color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-weight: bold; }

/* ---- Forms ---- */
.input-group { margin: 10px 0; font-size: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.input-group input, .input-group select { font-size: 16px; padding: 8px; border: 1px solid #ccc; border-radius: 5px; }
.control-bar { display: flex; flex-wrap: wrap; gap: 15px; background: #e3f2fd; padding: 15px; border-radius: 8px; margin-top: 15px; align-items: center; }
.control-bar-so { background: #f5eef8; }

/* ---- Product Grid ---- */
.lamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; padding: 20px; }
.lamp-card { background: white; padding: 15px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); text-align: center; cursor: pointer; }
.lamp-card:hover { transform: translateY(-5px); box-shadow: 0 6px 15px rgba(0,0,0,0.2); border: 2px solid var(--primary); }
.lamp-card img { width: 100%; height: 180px; object-fit: contain; border-radius: 8px; margin-bottom: 10px; background-color: #f9f9f9; }
.lamp-card h3 { font-size: 16px; margin: 10px 0 5px 0; color: var(--dark); word-break: break-word; }
.lamp-card p.price { font-size: 18px; color: #2196F3; font-weight: bold; margin: 0; }

/* ---- Badges ---- */
.badge { padding: 5px 10px; border-radius: 15px; font-size: 14px; font-weight: bold; color: white; }
.bg-red    { background: #e74c3c; }
.bg-yellow { background: #f1c40f; color: #333; }
.bg-green  { background: #2ecc71; }
.bg-blue   { background: #3498db; }

/* ---- History Table ---- */
.history-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.history-table th, .history-table td { border: 1px solid #ddd; padding: 8px; text-align: center; }
.history-table th { background-color: #eee; color: #333; }
.btn-print-small { background: #7f8c8d; color: white; border: none; padding: 5px 10px; border-radius: 3px; cursor: pointer; font-size: 12px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .navbar { padding: 10px 14px; gap: 0; }
    /* Show hamburger + current tab label */
    .hamburger-btn { display: block; }
    .nav-current-label { display: block; }
    /* Hide display button on mobile (saves space) */
    .nav-display-btn { display: none !important; }
    /* Nav tabs hidden by default — shown as dropdown when open */
    .nav-tabs {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(0,0,0,0.25);
        border-radius: 8px;
        padding: 6px;
        gap: 2px;
        margin-top: 8px;
    }
    .nav-tabs.nav-open { display: flex; }
    .nav-tabs button {
        text-align: left;
        padding: 12px 16px;
        font-size: 15px;
        opacity: 1;
        border-radius: 6px;
    }
    .nav-tabs button.active { opacity: 1; }
}
