/* ===== Administrare Cimitire — stylesheet ===== */

:root {
    --slate-950: #101512;
    --slate-900: #161d19;
    --slate-800: #202b25;
    --slate-700: #2c3a32;
    --green: #3f7d54;
    --green-light: #5fa876;
    --green-dark: #2d5c3e;
    --text-light: #f2f4f1;
    --text-muted: #a9b3ac;
    --text-dark: #1c1f1e;
    --red: #c14b4b;
    --amber: #c78d1f;
    --blue-grey: #6b7a8c;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0,0,0,.18);
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text-dark);
    background: #f2f1ec;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
p { line-height: 1.6; margin: 0 0 1em; }
table { font-family: var(--font-body); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: transparent; border-color: #d3d0c6; color: var(--text-dark); }
.btn-outline:hover { border-color: var(--green); color: var(--green-dark); }
.btn-danger { background: #fdecee; color: var(--red); border-color: #f3c1c8; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-link-danger { background: none; border: none; color: var(--red); cursor: pointer; font-size: .82rem; text-decoration: underline; padding: 0; }

.muted { color: #888; font-size: .88rem; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: .84rem; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid #dcd9cf;
    font-family: var(--font-body);
    font-size: .9rem;
    background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--green); }
.form-group textarea { resize: vertical; min-height: 70px; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.checkbox-label input { width: auto !important; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px 18px;
    align-items: start;
}
.form-group-wide { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 6px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.filter-bar select, .filter-bar input { padding: 9px 12px; border-radius: 8px; border: 1.5px solid #dcd9cf; font-size: .88rem; }

/* Grup vizual pentru DateRangePicker (assets/js/datepicker.js) — input + iconiță calendar +
   ștergere filtru, unite într-o singură "pastilă" cu bordură comună, ca în aplicația de trezorerie. */
.cfi-grup { display: inline-flex; align-items: stretch; border: 1.5px solid #dcd9cf; border-radius: 8px; overflow: hidden; background: #fff; }
.cfi-grup .cfi-input { border: none; border-radius: 0; padding: 9px 12px; font-size: .88rem; min-width: 170px; background: transparent; cursor: pointer; }
.cfi-grup .cfi-input:focus { outline: none; }
.cfi-btn { border: none; border-left: 1.5px solid #dcd9cf; background: transparent; padding: 0 12px; cursor: pointer; display: flex; align-items: center; color: var(--green); }
.cfi-btn:hover { background: #f4f5f2; }
.cfi-btn-clear { font-size: 1.1rem; line-height: 1; color: #8a6d1a; }

/* Grup de căutare (input + iconiță + buton), aceeași "pastilă" ca la calendar — flex:1 ca să
   ocupe spațiul rămas în bara de filtre, la fel ca în trezo. */
.cfi-search-grup { display: inline-flex; align-items: stretch; border: 1.5px solid #dcd9cf; border-radius: 8px; overflow: hidden; background: #fff; flex: 1; min-width: 220px; }
.cfi-search-icon { display: flex; align-items: center; padding-left: 12px; color: #9aa39c; }
.cfi-search-grup input { flex: 1; border: none; border-radius: 0; padding: 9px 10px; font-size: .88rem; background: transparent; min-width: 0; }
.cfi-search-grup input:focus { outline: none; }

.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: .9rem; font-weight: 500; }
.alert-success { background: #e5f6ee; color: #1c7c4f; border: 1px solid #b9e6d1; }
.alert-error { background: #fdecee; color: #b5303f; border: 1px solid #f3c1c8; }

/* ===== Login ===== */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--slate-950); padding: 20px; }
.login-card { background: var(--slate-800); border-radius: 16px; padding: 42px 36px; width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow); }
.login-card h1 { color: #fff; font-size: 1.3rem; margin-bottom: 4px; }
.login-sub { color: var(--text-muted); font-size: .85rem; margin-bottom: 24px; }
.login-card .form-group input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #fff; }
.login-card .form-group label { color: var(--text-muted); }

/* ===== Admin shell ===== */
.admin-body { background: #f2f1ec; min-height: 100vh; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: var(--slate-950); color: #fff; padding: 24px 16px; flex-shrink: 0; display: flex; flex-direction: column; }
.brand-title { color: var(--green-light); font-weight: 800; font-size: 1.05rem; line-height: 1.3; margin-bottom: 24px; }
.admin-sidebar a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text-muted); font-weight: 500; font-size: .88rem; margin-bottom: 3px; }
.admin-sidebar a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-sidebar a.active { background: rgba(95,168,118,.2); color: var(--green-light); }
.sidebar-user { margin-top: auto; padding: 14px 12px 6px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user-name { color: #fff; font-weight: 600; font-size: .86rem; }
.sidebar-user-role { color: var(--text-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-main { flex: 1; padding: 32px 38px; min-width: 0; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.admin-topbar h1 { font-size: 1.4rem; display: flex; align-items: center; gap: 8px; }

.admin-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 30px; }
.admin-stat-card { background: #fff; border-radius: 12px; padding: 20px; border: 1px solid #e6e3da; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05); transition: transform .2s ease, box-shadow .2s ease; }
.admin-stat-card:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(0,0,0,.10); }
.admin-stat-card .num { font-size: 1.7rem; font-weight: 800; }
.admin-stat-card .label { color: #777; font-size: .8rem; margin-top: 4px; }
.admin-stat-card.c-green .num { color: var(--green); }
.admin-stat-card.c-red .num { color: var(--red); }
.admin-stat-card.c-amber .num { color: var(--amber); }

.admin-card { background: #fff; border-radius: 12px; border: 1px solid #e6e3da; padding: 22px; margin-bottom: 22px; }
.card-title { font-size: 1.02rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-subtitle { font-size: .92rem; margin: 20px 0 12px; color: #555; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid #ecebe4; font-size: .87rem; vertical-align: top; }
.admin-table th { color: #888; font-weight: 600; text-transform: uppercase; font-size: .72rem; letter-spacing: .03em; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-liber td { background: #fafaf7; font-style: italic; text-align: center; }

.status-badge { display: inline-flex; padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.badge-liber { background: #e5f6ee; color: #1c7c4f; }
.badge-ocupat { background: #fdecee; color: #b5303f; }
.badge-rezervat { background: #fdf3df; color: #a37311; }
.badge-expirat { background: #f3d9d9; color: #8a2a2a; }
.badge-lucrari { background: #e6e9f5; color: #3d4a8a; }

.fisa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 20px; margin-bottom: 6px; }
.fisa-grid > div { font-size: .9rem; }
.fisa-label { display: block; color: #888; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }

/* ===== Fișă loc — sumar (stil "exemplu fișă loc de veci") ===== */
.fisa-summary-card { padding: 0; overflow: hidden; }
.fisa-summary { display: grid; grid-template-columns: 1.15fr 1.05fr 0.9fr; }
.fisa-summary-col { padding: 18px 20px; border-right: 1px solid #e6e3da; }
.fisa-summary-col:last-child { border-right: none; }
.fisa-summary-heading { font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-900); margin-bottom: 10px; }
.fisa-table { width: 100%; border-collapse: collapse; }
.fisa-table tr { border-bottom: 1px solid #f0efe8; }
.fisa-table tr:last-child { border-bottom: none; }
.fisa-table td { padding: 7px 4px; font-size: .83rem; vertical-align: top; }
.fisa-table td:first-child { color: #888; width: 48%; padding-right: 8px; }
.fisa-table td:last-child { font-weight: 600; color: var(--text-dark); }
.fisa-table td .id-loc-value { color: var(--red); }
.fisa-doc-list { list-style: none; padding: 0; margin: 0; }
.fisa-doc-list li { display: flex; align-items: center; gap: 6px; padding: 5px 0; font-size: .82rem; }
.fisa-doc-list li svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--green); }
.fisa-photos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fisa-photos-grid img { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid #e2e2e2; display: block; }
.fisa-qr { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.fisa-qr img { border: 1px solid #e2e2e2; border-radius: 6px; }
.fisa-mentiuni-separator { border-top: 2px solid var(--green); margin: 56px 0 14px; }
.fisa-mentiuni-form textarea { width: 100%; min-height: 150px; resize: vertical; font: inherit; padding: 8px; border: 2px solid var(--green); border-radius: 6px; }
.fisa-mentiuni-form textarea[readonly] { background: #f7f6f2; color: #6f7d72; }

@media (max-width: 800px) {
    .fisa-summary { grid-template-columns: 1fr; }
    .fisa-summary-col { border-right: none; border-bottom: 1px solid #e6e3da; }
}

.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0efe8; font-size: .88rem; }
.doc-list li svg { flex-shrink: 0; color: var(--green); }

/* ===== Hartă interactivă ===== */
.legend-item { display: flex; align-items: center; gap: 7px; font-size: .84rem; color: #444; font-weight: 500; }
.legend-dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex-shrink: 0; }
.dot-liber { background: #6fbf73; border: 1px solid #4c9950; }
.dot-ocupat { background: #d1495b; border: 1px solid #a3313f; }
.dot-rezervat { background: #e8c13a; border: 1px solid #b9950f; }
.dot-expirat { background: #a98fd2; border: 1px solid #7a5cb0; }
.dot-lucrari { background: #4f7fd6; border: 1px solid #33569e; }

.harta-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; align-items: start; }
.harta-canvas-outer { position: relative; }
.harta-canvas {
    display: flex;
    gap: 0;
    overflow-x: auto;
    background: linear-gradient(180deg, #dcefd4, #cde6c4);
    border: 1px solid #b7d4ab;
    border-radius: 10px;
    padding: 18px 10px;
}
.harta-col {
    flex-shrink: 0;
    min-width: 190px;
    padding: 0 10px;
    border-right: 14px solid #cbd0c6;
}
.harta-col:last-child { border-right: none; }
.harta-col-titlu {
    text-align: center;
    font-weight: 800;
    font-size: .84rem;
    color: var(--slate-950);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(20,30,20,.15);
}
.harta-col-titlu span { font-weight: 500; font-size: .72rem; color: #4a5c46; display: block; }
.harta-rand { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.harta-rand-label { font-size: .68rem; color: #4a5c46; width: 20px; flex-shrink: 0; font-weight: 700; text-align: right; }
.harta-rand-locuri { display: flex; gap: 3px; flex-wrap: wrap; }
.harta-loc {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    font-size: .62rem; font-weight: 700; color: rgba(0,0,0,.55);
    cursor: pointer;
    border: 1px solid rgba(0,0,0,.15);
    transition: transform .1s ease, opacity .15s ease;
}
.harta-loc:hover { transform: scale(1.18); z-index: 2; position: relative; }
.harta-loc.status-liber { background: #6fbf73; }
.harta-loc.status-ocupat { background: #d1495b; color: #fff; }
.harta-loc.status-rezervat { background: #e8c13a; }
.harta-loc.status-expirat { background: #a98fd2; color: #fff; }
.harta-loc.status-lucrari { background: #4f7fd6; color: #fff; }
.harta-loc.selected { border: 2px solid var(--slate-950); box-shadow: 0 0 0 2px #fff inset; }
.harta-loc.dimmed { opacity: .15; }
.harta-loc.match { transform: scale(1.2); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--green-dark); z-index: 2; position: relative; }

.harta-popup {
    position: absolute;
    z-index: 20;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,.22);
    padding: 16px 18px;
    min-width: 210px;
    border: 1px solid #e2e2e2;
}
.harta-popup .close-btn { position: absolute; top: 6px; right: 10px; cursor: pointer; border: none; background: none; font-size: 1rem; color: #999; }
.harta-popup h4 { margin: 0 0 6px; font-size: 1rem; }
.harta-popup .status-badge { margin-bottom: 8px; }
.harta-popup .popup-row { font-size: .84rem; color: #444; margin-bottom: 3px; }
.harta-popup .popup-row .label { color: #999; }
.harta-popup a.btn { margin-top: 10px; }

.harta-sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; }
.harta-panel-box { background: #fff; border: 1px solid #e6e3da; border-radius: 10px; padding: 16px; }
.harta-panel-box h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: #888; margin-bottom: 12px; }
.legend-list { display: flex; flex-direction: column; gap: 10px; }
.tool-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%; text-align: left;
    background: none; border: none; border-radius: 8px;
    padding: 8px 8px; font-size: .86rem; font-weight: 500;
    cursor: pointer; color: var(--slate-900);
    margin-bottom: 2px;
}
.tool-btn:hover { background: #f2f1ec; }
.tool-btn-soon { color: #aaa; cursor: default; }
.tool-btn-soon:hover { background: none; }
.tool-btn-soon em { font-style: normal; font-size: .74rem; }

@media (max-width: 900px) {
    .harta-wrap { grid-template-columns: 1fr; }
    .harta-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .harta-panel-box { flex: 1; min-width: 200px; }
}

@media (max-width: 900px) {
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; flex-direction: row; align-items: center; gap: 4px; overflow-x: auto; padding: 12px 16px; }
    .brand-title { display: none; }
    .sidebar-user { display: none; }
    .admin-main { padding: 20px 16px; }
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media print {
    .admin-sidebar, .form-actions, .row-actions, .filter-bar, .admin-topbar a { display: none !important; }
    .admin-main { padding: 0; }
    .admin-card { border: none; box-shadow: none; page-break-inside: avoid; }
}
