:root {
    --bg-color: #f5f7fa;
    --primary: #007bff;
    --primary-hover: #0056b3;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --text-main: #333;
    --text-muted: #666;
    --card-bg: #fff;
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #c3cfe2 100%);
    margin: 0; color: var(--text-main); min-height: 100vh;
}

.ascuns { display: none !important; }

/* --- LOGIN --- */
#ecran-autentificare { display: flex; justify-content: center; align-items: center; height: 100vh; }
.card-autentificare { background: var(--card-bg); padding: 2.5rem; border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 100%; max-width: 360px; text-align: center; margin: 20px; }
.btn-magazin { width: 100%; padding: 10px; margin-bottom: 10px; background: #fff; border: 1px solid var(--primary); color: var(--primary); border-radius: 6px; cursor: pointer; font-size: 1rem; transition: 0.2s; }
.btn-magazin:hover { background: #f0f7ff; }
.card-autentificare h1 { margin-top: 0; margin-bottom: 1.5rem; font-size: 1.5rem; }
.grup-formular { margin-bottom: 1rem; text-align: left; }
.grup-formular label { display: block; margin-bottom: 0.4rem; color: #555; font-weight: 600; font-size: 0.9rem; }
.grup-formular input { width: 100%; padding: 12px; border: 2px solid #e1e5eb; border-radius: 8px; box-sizing: border-box; font-size: 1rem; transition: border-color 0.2s; }
.grup-formular input:focus { border-color: var(--primary); outline: none; }
.btn-actiune { width: 100%; padding: 14px; background-color: var(--primary); color: white; border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; font-weight: bold; margin-top: 1.5rem; }
.eroare { color: var(--danger); background: #ffe6e6; padding: 10px; border-radius: 6px; font-size: 0.9rem; margin-top: 1rem; display: none; }

/* --- PANOU & HEADER --- */
.app-header { display: flex; justify-content: space-between; align-items: center; background: var(--card-bg); padding: 10px 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.brand { display: flex; align-items: center; gap: 10px; }
.logo-app { height: 40px; width: auto; object-fit: contain; }
.header-text { display: flex; flex-direction: column; font-weight: bold; font-size: 1.1rem; }
.header-controls { display: flex; align-items: center; gap: 10px; }
.btn-icon { background: #e1e5eb; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 1.1rem; }
.btn-logout { background: var(--danger); color: white; border: none; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; }
.btn-primar { background: var(--primary); color: white; border: none; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; }
.btn-secundar { background: var(--text-muted); color: white; border: none; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; }
.status-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.85rem; font-weight: bold;}
.status-online { background: #d4edda; color: #155724; }
.status-offline { background: #f8d7da; color: #721c24; }
.app-main { padding: 20px; max-width: 1400px; margin: 0 auto; }

/* --- TAB-URI --- */
.tab-container { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #ddd; padding-bottom: 10px; }
.tab { padding: 10px 20px; font-size: 1.2rem; font-weight: bold; color: var(--text-muted); cursor: pointer; border-radius: 8px 8px 0 0; transition: 0.3s; position: relative; background: #e9ecef; }
.tab.activ { color: var(--primary); background: white; box-shadow: 0 -3px 10px rgba(0,0,0,0.05); }
.badge-notificare { position: absolute; top: -8px; right: -8px; background: var(--danger); color: white; border-radius: 50%; width: 22px; height: 22px; font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

.zona-continut { display: none; }
.zona-continut.activ { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- UTILS COMENZI --- */
.header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.header-flex h2 { margin: 0; font-size: 1.5rem; }
.statistici-rapide { margin-bottom: 15px; font-weight: bold; font-size: 1.1rem; }
.text-primar { color: var(--primary); font-size: 1.3rem; margin-right: 20px; }
.text-succes { color: var(--success); font-size: 1.3rem; }
.filtre-comenzi { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.btn-filtru { padding: 8px 15px; border: 1px solid #ddd; background: white; border-radius: 20px; cursor: pointer; font-weight: bold; }
.btn-filtru.activ { background: var(--primary); color: white; border-color: var(--primary); }
.input-cautare { padding: 8px 15px; border: 1px solid #ddd; border-radius: 20px; flex-grow: 1; min-width: 200px; outline: none; }
.input-cautare:focus { border-color: var(--primary); }

/* --- GRID CARDURI --- */
.grid-comenzi { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; }
.card-bon { background: white; border-radius: var(--border-radius); padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-left: 5px solid #ddd; display: flex; flex-direction: column; justify-content: space-between; transition: 0.2s; cursor: pointer; }
.card-bon:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.istoric-flex { display: flex; flex-wrap: wrap; gap: 10px; }
.form-pult { background: white; padding: 15px; border-radius: var(--border-radius); display: flex; align-items: center; gap: 15px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.input-bon { font-size: 1.2rem; padding: 8px; width: 100px; border: 2px solid #ddd; border-radius: 6px; text-align: center; }

/* --- COMPONENTE EXTRA --- */
#screensaver { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.9); z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; color: white; cursor: pointer; }
.logo-screensaver { height: 100px; max-width: 80%; margin-bottom: 20px; opacity: 0.8; }
#ceas-screensaver { font-size: 6rem; font-weight: bold; margin: 20px 0; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); z-index: 1000; display: flex; justify-content: center; align-items: center; }
.modal-content { background: white; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; border-radius: 12px; padding: 20px; position: relative; }
.btn-close-modal { position: absolute; top: 15px; right: 15px; font-size: 1.5rem; background: transparent; border: none; cursor: pointer; color: #888; }
#alerta-vizuala { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; border: 8px solid var(--danger); pointer-events: none; z-index: 9998; box-sizing: border-box; animation: flash 1s infinite alternate; }
@keyframes flash { from { opacity: 0.5; } to { opacity: 1; } }

/* --- BADGES TIMP --- */
.badge-timp { padding: 4px 8px; border-radius: 6px; font-weight: bold; font-size: 0.85rem; color: white; display: inline-block; }
.badge-ok { background: var(--success); }
.badge-warn { background: var(--warning); color: #333; }
.badge-danger { background: var(--danger); animation: pulse-danger 2s infinite; }
@keyframes pulse-danger { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }