/* Layout centrat, la fel ca site-ul principal */
body {
    background: #f5f7fa;
    color: #222;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
main.container {
    padding-top: 30px;
    padding-bottom: 60px;
}

/* Header */
.site-header {
    background: #1a4d5c;
    color: white;
    padding: 18px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-header h1 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 700;
}
.site-header h1 a {
    color: white;
    text-decoration: none;
}
.site-header nav {
    display: flex;
    gap: 15px;
    align-items: center;
}
.site-header nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 5px;
    transition: background 0.2s;
    font-size: 0.95em;
}
.site-header nav a:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}
.site-header nav a.active {
    background: rgba(255,255,255,0.25);
    color: white;
    font-weight: 600;
}
.site-header nav button {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}
.site-header nav button:hover {
    background: rgba(255,255,255,0.25);
}

/* Hero */
.hero-stats {
    padding: 30px 0 20px;
    text-align: center;
}
.hero-stats h2 {
    color: #1a4d5c;
    margin-bottom: 8px;
    font-size: 2em;
    font-weight: 700;
}
.hero-stats .subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.05em;
}

/* Statistici */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.stat-card .value {
    font-size: 2.5em;
    font-weight: 700;
    color: #1a4d5c;
    display: block;
    margin: 5px 0;
    line-height: 1;
}
.stat-card .label {
    color: #888;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.stat-card .sublabel {
    color: #999;
    font-size: 0.8em;
    margin-top: 8px;
    display: block;
}
.stat-card.highlight {
    background: linear-gradient(135deg, #1a4d5c 0%, #2a6d7c 100%);
    color: white;
    border: none;
}
.stat-card.highlight .value,
.stat-card.highlight .label {
    color: white;
}
.stat-card.highlight .sublabel {
    color: rgba(255,255,255,0.75);
}

/* Filters */
.filters {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    gap: 25px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 25px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85em;
    color: #444;
    font-weight: 600;
}
.filters select {
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: white;
    font-size: 0.95em;
    min-width: 200px;
    color: #222;
}
.filters button {
    padding: 11px 24px;
    background: #1a4d5c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    height: 42px;
}
.filters button:hover {
    background: #2a6d7c;
}

/* Tabel */
.leaduri-table {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.leaduri-table h3 {
    color: #1a4d5c;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3em;
}
.table-wrapper {
    overflow-x: auto;
}
#pipeline-table, #antreprenori-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
}
#pipeline-table thead th,
#antreprenori-table thead th {
    background: #f5f7fa;
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
    color: #444;
    font-weight: 700;
    white-space: nowrap;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
#pipeline-table thead th.right,
#antreprenori-table thead th.right {
    text-align: right;
}
#pipeline-table tbody td,
#antreprenori-table tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    color: #333;
}
#pipeline-table tbody td.right,
#antreprenori-table tbody td.right {
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #1a4d5c;
    font-weight: 600;
}
#pipeline-table tbody tr:hover,
#antreprenori-table tbody tr:hover {
    background: #f9fafb;
}
#pipeline-table .value-big,
#antreprenori-table .value-big {
    color: #d9534f;
    font-weight: 700;
}
#pipeline-table .btn-action,
#antreprenori-table .btn-action {
    padding: 6px 14px;
    background: #1a4d5c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    white-space: nowrap;
    font-weight: 600;
}
#pipeline-table .btn-action:hover,
#antreprenori-table .btn-action:hover {
    background: #2a6d7c;
}
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    background: #e0f0e0;
    color: #2e7d32;
    white-space: nowrap;
}
.badge-warning {
    background: #fff3cd;
    color: #856404;
}
.loading {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

/* Modală */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal.hidden {
    display: none;
}
.modal-content {
    background: white;
    border-radius: 12px;
    padding: 35px;
    max-width: 700px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 15px 50px rgba(0,0,0,0.25);
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
    padding: 5px 10px;
    line-height: 1;
}
.modal-close:hover {
    color: #333;
}
.modal-body h3 {
    color: #1a4d5c;
    margin-top: 0;
    font-size: 1.4em;
}
.modal-body .info-row {
    margin: 14px 0;
    padding: 14px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #1a4d5c;
}
.modal-body .info-row strong {
    display: block;
    color: #666;
    font-size: 0.78em;
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}
.modal-body .info-row .val {
    color: #222;
    font-size: 1em;
    word-break: break-word;
    line-height: 1.4;
}
.modal-body .actions {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.modal-body .actions button,
.modal-body .actions a {
    padding: 11px 18px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 600;
    border: none;
    display: inline-block;
}
.modal-body .btn-primary {
    background: #1a4d5c;
    color: white;
}
.modal-body .btn-primary:hover {
    background: #2a6d7c;
}
.modal-body .btn-secondary {
    background: #6c757d;
    color: white;
}
.modal-body .btn-secondary:hover {
    background: #5a6268;
}

/* Force uniformitate carduri statistici */
.stats-grid {
    grid-template-columns: repeat(5, 1fr) !important;
}
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    }
}
.stat-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.stat-card .label {
    font-size: 0.72em;
    line-height: 1.3;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tabel mai lat si mai lizibil */
#pipeline-table {
    min-width: 1150px;
    font-size: 0.88em;
}
#pipeline-table thead th {
    padding: 12px 8px;
    font-size: 0.75em;
    text-align: left;
    vertical-align: bottom;
}
#pipeline-table tbody td {
    padding: 14px 8px;
    vertical-align: middle;
    white-space: normal;
}

/* Column widths precise */
#pipeline-table th:nth-child(1), #pipeline-table td:nth-child(1) { width: 90px; }
#pipeline-table th:nth-child(2), #pipeline-table td:nth-child(2) { width: 130px; }
#pipeline-table th:nth-child(3), #pipeline-table td:nth-child(3) { width: 90px; }
#pipeline-table th:nth-child(4), #pipeline-table td:nth-child(4) { width: auto; min-width: 300px; }
#pipeline-table th:nth-child(5), #pipeline-table td:nth-child(5) { width: 130px; text-align: right; white-space: nowrap; }
#pipeline-table th:nth-child(6), #pipeline-table td:nth-child(6) { width: 210px; }
#pipeline-table th:nth-child(7), #pipeline-table td:nth-child(7) { width: 70px; }

/* Data pe un singur rand */
#pipeline-table td:nth-child(1) {
    white-space: nowrap;
    font-family: 'Consolas', monospace;
    color: #666;
    font-size: 0.92em;
}

/* Valoare RON - o singura linie mare + o mica */
#pipeline-table td:nth-child(5) {
    line-height: 1.4;
}
#pipeline-table td:nth-child(5) small {
    display: block;
    font-size: 0.8em;
    color: #999;
    font-weight: normal;
    margin-top: 2px;
}

/* Antreprenor nume nu se rupe pe mai multe randuri decat necesar */
#pipeline-table td:nth-child(6) {
    font-weight: 600;
    color: #222;
    line-height: 1.3;
}

/* Denumire lucrare - clip elegant */
#pipeline-table td:nth-child(4) {
    line-height: 1.4;
    color: #444;
}

/* Randuri alternante */
#pipeline-table tbody tr:nth-child(even) {
    background: #fafbfc;
}
#pipeline-table tbody tr:hover {
    background: #f0f4f7 !important;
}

/* Badge mai proeminent */
#pipeline-table .badge, #pipeline-table .badge-warning {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: normal;
    line-height: 1.3;
    text-align: center;
    max-width: 100%;
}

/* Buton actiune */
#pipeline-table .btn-action {
    padding: 7px 16px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
