/* =========================================
   1. RESET & GLOBALE
   ========================================= */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;       /* Albastru foarte închis (Slate-900) */
    --sidebar-hover: #334155;    /* Slate-700 */
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #e67e22;
    --danger-color: #c0392b;
    --bg-color: #f1f5f9;         /* Gri deschis */
    --text-color: #334155;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex; /* LAYOUT FLEX PENTRU SIDEBAR */
    min-height: 100vh;
}

/* =========================================
   2. SIDEBAR (NAVBAR STANGA)
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.sidebar-header .subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 5px;
    margin-left: 5px;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-menu ul { list-style: none; }

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.3s;
    border-left: 4px solid transparent;
}

.sidebar-menu a:hover, .sidebar-menu li.active a {
    background-color: var(--sidebar-hover);
    color: white;
    border-left-color: var(--accent-color);
}

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

.user-profile { display: flex; align-items: center; gap: 10px; }
.avatar { width: 35px; height: 35px; background: var(--accent-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.user-info strong { display: block; font-size: 0.85rem; }
.user-info span { font-size: 0.75rem; color: #94a3b8; }
.logout-btn { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 1.1rem; }

/* =========================================
   3. MAIN CONTENT (DREAPTA)
   ========================================= */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
    width: calc(100% - var(--sidebar-width));
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.page-title { font-size: 1.4rem; color: var(--primary-color); }

.search-wrapper {
    position: relative;
    width: 350px;
}
.search-wrapper i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.search-wrapper input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    outline: none;
}
.search-wrapper input:focus { border-color: var(--accent-color); background: white; }

.top-actions { display: flex; gap: 15px; }
.icon-btn {
    width: 40px; height: 40px;
    border-radius: 50%; border: 1px solid #e2e8f0;
    background: white; cursor: pointer; color: #64748b;
    position: relative;
    transition: 0.3s;
}
.icon-btn:hover { background-color: #f1f5f9; color: var(--accent-color); }
.dot { position: absolute; top: 8px; right: 10px; width: 8px; height: 8px; background: red; border-radius: 50%; border: 2px solid white; }

/* Stats Bar */
.stats-bar { display: flex; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.stat-box {
    background: white; padding: 20px; border-radius: 12px;
    box-shadow: var(--card-shadow); flex: 1; min-width: 200px;
    display: flex; align-items: center; gap: 15px;
}
.stat-icon {
    width: 50px; height: 50px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.color-blue { background: #e0f2fe; color: var(--accent-color); }
.color-orange { background: #ffedd5; color: var(--warning-color); }
.color-green { background: #dcfce7; color: var(--success-color); }

.stat-box strong { font-size: 0.9rem; color: #64748b; display: block; }
.stat-box span { font-size: 1.3rem; font-weight: bold; color: var(--primary-color); }

/* Content Section & Grid */
.content-section { margin-top: 20px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-header h3 { font-size: 1.2rem; color: var(--primary-color); }
.btn-primary { background: var(--accent-color); color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 500; }
.btn-primary:hover { background: #2980b9; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }
.card {
    background: white; border-radius: 12px; padding: 25px;
    box-shadow: var(--card-shadow); cursor: pointer;
    transition: 0.3s; border: 1px solid transparent;
    position: relative;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); border-color: #cbd5e1; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; color: white; margin-bottom: 10px; }
.badge.srl { background-color: #3b82f6; } .badge.pfa { background-color: #f97316; } .badge.pf { background-color: #22c55e; }

/* MODAL - aceleasi stiluri, doar ajustate culorile */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); }
.modal-content { background-color: #fff; margin: 3% auto; width: 90%; max-width: 900px; border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); overflow: hidden; animation: slideDown 0.3s; }
.modal-header { padding: 25px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; gap: 20px; }
.icon-box { width: 50px; height: 50px; background: #f1f5f9; border-radius: 10px; display: flex; justify-content: center; align-items: center; color: var(--accent-color); font-size: 1.5rem; }
.close-btn { position: absolute; right: 25px; top: 25px; font-size: 24px; color: #94a3b8; cursor: pointer; }

/* Tabs Modal */
.modal-tabs { padding: 0 25px; border-bottom: 1px solid #e2e8f0; display: flex; gap: 20px; }
.tab-btn { background: none; border: none; padding: 15px 5px; color: #64748b; cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500; transition: 0.3s; }
.tab-btn.active { color: var(--accent-color); border-bottom-color: var(--accent-color); }
.tab-content { padding: 25px; display: none; }
.tab-content.active { display: block; }
.tab-header-actions { display: flex; justify-content: space-between; margin-bottom: 15px; }

/* Tabel & Alte elemente */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 12px; color: #64748b; font-size: 0.85rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
tbody td { padding: 14px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; font-size: 0.9rem; }
.btn-small { background: #10b981; color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.modal-footer { padding: 20px 25px; background: #f8fafc; border-top: 1px solid #e2e8f0; text-align: right; }
.btn-secondary { background: #94a3b8; color: white; padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; }

/* Upload Area */
.upload-area { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 30px; text-align: center; background: #f8fafc; cursor: pointer; transition: 0.3s; }
.upload-area:hover { border-color: var(--accent-color); background: #f0f9ff; }
.doc-list li { display: flex; align-items: center; gap: 15px; padding: 10px; border-bottom: 1px solid #f1f5f9; }
.doc-icon { font-size: 1.5rem; color: #e74c3c; }

@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Responsive Mobile */
@media (max-width: 900px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; align-items: center; padding: 10px; }
    .sidebar-menu { display: none; /* Ascundem meniul pe mobil momentan pt simplitate */ }
    .sidebar-footer { display: none; }
    .main-content { margin-left: 0; width: 100%; }
    .stats-bar { flex-direction: column; }
}
