:root {
    --dark: #1f1f1f;
    --dark-alt: #161616;
    --gold: #b38e44;
    --gold-hover: #c9a358;
    --bg: #f8f9fa;
    --border: #e2e8f0;
    --text-muted: #6c757d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: #333; line-height: 1.5; }

.app-header {
    background: var(--dark-alt);
    color: #fff;
    height: 56px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 1px; color: var(--gold); font-size: 1.15rem; }
.badge-filiale { background: #2a2a2a; border: 1px solid #444; border-radius: 14px; padding: 3px 10px; font-size: 0.8rem; color: #fff; font-weight: normal; }

.sidebar-toggle-btn { background: transparent; border: 1px solid #444; color: var(--gold); font-size: 1.1rem; padding: 4px 10px; border-radius: 4px; cursor: pointer; }
.header-actions { display: flex; align-items: center; gap: 15px; font-size: 0.9rem; }
.header-actions a { color: var(--gold); text-decoration: none; }

.layout-wrapper { display: flex; min-height: calc(100vh - 56px - 45px); }
.app-sidebar { width: 250px; background: var(--dark); color: #ccc; border-right: 1px solid #333; transition: width 0.25s ease; overflow-x: hidden; white-space: nowrap; }
body.sidebar-collapsed .app-sidebar { width: 0 !important; border-right: none !important; }

.sidebar-menu { list-style: none; padding: 15px 0; }
.sidebar-heading { font-size: 0.72rem; color: #777; font-weight: 700; padding: 12px 20px 4px 20px; letter-spacing: 1px; }
.sidebar-menu li a { display: block; padding: 8px 20px; color: #ccc; text-decoration: none; font-size: 0.92rem; border-left: 3px solid transparent; }
.sidebar-menu li a:hover, .sidebar-menu li a.active { background: #262626; color: #fff; border-left-color: var(--gold); }

.main-content { flex: 1; padding: 25px; overflow-y: auto; }
.card { background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid var(--border); padding: 20px; margin-bottom: 20px; }
.card-header-gold { font-weight: 700; color: var(--dark); border-bottom: 2px solid var(--gold); padding-bottom: 8px; margin-bottom: 15px; }

.form-group { margin-bottom: 15px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 5px; color: #444; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.95rem; }
.form-control:focus { outline: none; border-color: var(--gold); }

.btn { display: inline-block; padding: 7px 16px; border-radius: 4px; font-weight: 600; text-decoration: none; cursor: pointer; border: none; font-size: 0.9rem; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-hover); }
.btn-secondary { background: #e2e8f0; color: #333; }
.btn-danger { background: #dc3545; color: #fff; }

.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; }
.data-table th { background: #fdfdfd; font-weight: 600; color: #444; }

.alert-success { background: #d4edda; color: #155724; padding: 12px; border-radius: 4px; margin-bottom: 15px; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; padding: 12px; border-radius: 4px; margin-bottom: 15px; border: 1px solid #f5c6cb; }

.app-footer { background: var(--dark-alt); color: #888; height: 45px; display: flex; justify-content: center; align-items: center; font-size: 0.82rem; border-top: 1px solid #333; }

/* --- MODAL POPUP STYLES --- */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}
.modal-backdrop.show {
    display: flex;
    opacity: 1;
}
.modal-dialog {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 580px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.2s ease-in-out;
}
.modal-backdrop.show .modal-dialog {
    transform: translateY(0);
}
.modal-header {
    background: var(--dark-alt);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--gold);
}
.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
}
.modal-close {
    background: transparent;
    border: none;
    color: #bbb;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover {
    color: #fff;
}
.modal-body {
    padding: 20px;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
}
.modal-footer {
    padding: 14px 20px;
    background: #f8f9fa;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
