/* === KGB SVR DOSSIER THEME - v1.0.0 === */

:root {
    --kgb-black: #0a0a0a;
    --kgb-black-2: #131313;
    --kgb-red: #c8102e;
    --kgb-red-dark: #8b0a20;
    --kgb-gold: #d4a017;
    --kgb-gold-dim: #8b6a0f;
    --kgb-text-dim: #8a7a4a;
}

* { box-sizing: border-box; }

body {
    background: #0a0a0a !important;
    background-image: url('/bg.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    color: #d4a017 !important;
    font-family: 'Courier New', monospace !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10,10,10,0.30);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

.header {
    background: linear-gradient(180deg, #131313 0%, #0a0a0a 100%) !important;
    border-bottom: 3px solid #c8102e !important;
    padding: 15px 25px !important;
    box-shadow: 0 0 20px rgba(200,16,46,0.3) !important;
}

.header h1, .header h2 {
    color: #d4a017 !important;
    letter-spacing: 4px !important;
    margin: 0 !important;
}

.header h1::before, .header h2::before {
    content: '★ ';
    color: #c8102e;
    text-shadow: 0 0 15px #c8102e;
    margin-right: 8px;
}

.sidebar {
    background: #131313 !important;
    background-image: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%) !important;
    border-right: 2px solid #c8102e !important;
    min-height: 100vh;
    padding: 20px;
}

.sidebar h4 {
    color: #d4a017 !important;
    letter-spacing: 3px !important;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #8b6a0f;
    margin-bottom: 20px;
}

.sidebar .nav-link {
    color: #8a7a4a !important;
    border-left: 3px solid transparent !important;
    padding: 10px 15px !important;
    margin-bottom: 5px;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
}

.sidebar .nav-link:hover {
    background: rgba(200,16,46,0.15) !important;
    color: #d4a017 !important;
    border-left-color: #c8102e !important;
}

.sidebar .nav-link.active {
    background: rgba(200,16,46,0.3) !important;
    color: #d4a017 !important;
    border-left: 3px solid #c8102e !important;
    font-weight: bold !important;
}

.card {
    background: #131313 !important;
    border: 1px solid #8b6a0f !important;
    border-radius: 6px !important;
    color: #d4a017 !important;
    box-shadow: 0 0 15px rgba(0,0,0,0.5) !important;
    margin-bottom: 20px;
}

.card-body, .card-header, .card-footer {
    background: #131313 !important;
    color: #d4a017 !important;
    border-color: #8b6a0f !important;
}

.card-header {
    border-bottom: 1px solid #8b6a0f !important;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 12px 20px;
}

.btn, .btn-primary, .btn-success {
    background: #8b0a20 !important;
    border: 1px solid #c8102e !important;
    color: #d4a017 !important;
    font-weight: bold !important;
    letter-spacing: 1px !important;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    font-family: inherit;
}

.btn:hover, .btn-primary:hover, .btn-success:hover {
    background: #c8102e !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(200,16,46,0.5) !important;
}

.btn-danger {
    background: #0a0a0a !important;
    border: 1px solid #c8102e !important;
    color: #c8102e !important;
}

.btn-danger:hover {
    background: #c8102e !important;
    color: #ffffff !important;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.85em;
}

h1, h2, h3, h4, h5, h6 {
    color: #d4a017 !important;
}

.page-title {
    color: #d4a017 !important;
    letter-spacing: 3px !important;
    text-shadow: 0 0 10px rgba(212,160,23,0.3) !important;
    margin-bottom: 20px;
}

.page-title small {
    color: #8a7a4a !important;
    font-size: 0.5em;
    letter-spacing: 2px;
}

/* === TABELLE === */
.table {
    background: #0a0a0a !important;
    color: #d4a017 !important;
    border: 1px solid #8b6a0f !important;
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #131313 !important;
    color: #d4a017 !important;
    border: 1px solid #8b6a0f !important;
    padding: 10px;
    letter-spacing: 1px;
    text-align: left;
}

.table td {
    border: 1px solid #2a2a2a !important;
    padding: 10px;
    color: #d4a017 !important;
}

.table tbody tr:hover {
    background: rgba(200,16,46,0.1) !important;
}

/* === FORM === */
.form-control, .form-select, input, textarea, select {
    background: #0a0a0a !important;
    color: #d4a017 !important;
    border: 1px solid #8b6a0f !important;
    padding: 8px 12px;
    border-radius: 4px;
    width: 100%;
    font-family: inherit;
}

.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #c8102e !important;
    box-shadow: 0 0 10px rgba(200,16,46,0.5) !important;
}

.form-label {
    color: #d4a017 !important;
    letter-spacing: 1px;
    margin-bottom: 4px;
    display: block;
    font-weight: bold;
}

.form-group {
    margin-bottom: 15px;
}

/* === BADGE LIVELLO === */
.badge {
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.8em;
    letter-spacing: 1px;
    border: 1px solid #8b6a0f;
    display: inline-block;
}

.badge-amico { background: #4a5d23 !important; color: #d4a017 !important; border-color: #6b8f2e !important; }
.badge-neutro { background: #131313 !important; color: #8a7a4a !important; }
.badge-sospetto { background: #8b6a0f !important; color: #d4a017 !important; }
.badge-target { background: #c8102e !important; color: #ffffff !important; border-color: #ffffff !important; }

/* === FOTO === */
.foto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.foto-item {
    background: #0a0a0a;
    border: 1px solid #8b6a0f;
    padding: 8px;
    text-align: center;
    position: relative;
}

.foto-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border: 1px solid #2a2a2a;
}

.foto-item .didascalia {
    color: #8a7a4a;
    font-size: 0.85em;
    margin-top: 5px;
    letter-spacing: 1px;
}

.foto-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #c8102e;
    color: #fff;
    border: none;
    padding: 2px 8px;
    cursor: pointer;
    font-weight: bold;
}

/* === LOGIN === */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: #131313;
    border: 3px solid #c8102e;
    border-radius: 8px;
    padding: 0;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0 40px rgba(200,16,46,0.5);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(90deg, #8b0a20, #c8102e);
    padding: 25px;
    text-align: center;
    border-bottom: 2px solid #d4a017;
}

.login-header h2 {
    color: #d4a017 !important;
    letter-spacing: 6px;
    margin: 0;
    text-shadow: 0 0 15px rgba(212,160,23,0.8);
    font-size: 1.8em;
}

.login-header h2::before {
    content: '★ ';
    color: #ffffff;
    text-shadow: 0 0 20px #ffffff;
}

.login-header .sottotitolo {
    color: #ffffff;
    letter-spacing: 3px;
    font-size: 0.75em;
    margin-top: 8px;
}

.login-body {
    padding: 25px;
}

/* === TIMELINE EVENTI === */
.timeline {
    position: relative;
    padding-left: 30px;
    margin-top: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #c8102e;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding: 15px;
    background: #131313;
    border: 1px solid #8b6a0f;
    border-left: 3px solid #c8102e;
}

.timeline-item::before {
    content: '◆';
    position: absolute;
    left: -28px;
    top: 15px;
    color: #c8102e;
    font-size: 1.2em;
    text-shadow: 0 0 10px #c8102e;
}

.timeline-item .data {
    color: #8a7a4a;
    font-size: 0.85em;
    letter-spacing: 1px;
}

.timeline-item .titolo {
    color: #d4a017;
    font-weight: bold;
    font-size: 1.1em;
    margin: 5px 0;
}

.timeline-item .luogo {
    color: #8b6a0f;
    font-size: 0.9em;
}

/* === LINK E UTILITY === */
a {
    color: #d4a017 !important;
    text-decoration: none;
}

a:hover {
    color: #c8102e !important;
}

::-webkit-scrollbar { width: 10px; background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #8b0a20; border: 1px solid #c8102e; }
::-webkit-scrollbar-thumb:hover { background: #c8102e; }

.text-muted { color: #8a7a4a !important; }
.text-danger { color: #c8102e !important; }
.text-gold { color: #d4a017 !important; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.row { display: flex; gap: 20px; flex-wrap: wrap; }
.col { flex: 1; min-width: 300px; }

/* === ALLERT === */
.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid;
}

.alert-danger {
    background: rgba(200,16,46,0.15);
    border-left-color: #c8102e;
    color: #d4a017;
}

.alert-success {
    background: rgba(74,93,35,0.3);
    border-left-color: #6b8f2e;
    color: #d4a017;
}

/* === TUTTO MAIUSCOLO (anche gli inserimenti) === */
body,
body * {
    text-transform: uppercase !important;
}

input,
textarea,
select,
::placeholder {
    text-transform: uppercase !important;
}

/* === PULSANTI SOTTO FOTO (affiancati) === */
.foto-buttons {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: stretch;
}

.foto-buttons form {
    display: flex;
    margin: 0;
}

.foto-buttons .btn {
    font-size: 0.75em;
    padding: 6px 10px;
    letter-spacing: 1px;
}


/* === TABELLE: TUTTE LE CELLE CENTRATE === */
.table th,
.table td {
    text-align: center !important;
    vertical-align: middle !important;
}

/* Eccezione: se serve testo lungo su più righe in una cella, rimane leggibile */
.table td.long-text,
.table td p {
    text-align: left !important;
}
