/* Damal - Styles */

/* ===== Marque Damal (wordmark "damal.") ===== */
.brand-damal {
    color: #000;
    font-weight: 700;
}
/* Le point est TOUJOURS bleu, quel que soit le fond */
.brand-damal .brand-dot {
    color: #0d6efd !important;
}
/* Sur fond sombre (navbar, etc.) : "damal" transparent, seul le point reste visible */
.navbar-dark .brand-damal,
.bg-dark .brand-damal {
    color: transparent;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    width: 250px;
    top: 56px;
    bottom: 0;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.3s ease;
    background: #fff;
    border-right: 1px solid #e2e8f0;
}

.sidebar .nav-link {
    color: #64748b;
    padding: 9px 16px;
    border-radius: 8px;
    margin-bottom: 2px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.sidebar .nav-link:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 8px;
}

/* Sidebar section labels */
.sidebar .text-muted {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #94a3b8 !important;
}

/* Main content */
.main-content {
    margin-left: 250px;
    margin-top: 56px;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* ===== Responsive: mobile < 992px ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

/* ===== Cards ===== */
.card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
}

/* Auth pages */
.min-vh-100 .card {
    border-radius: 16px;
}

/* ===== Navbar tweaks ===== */
.navbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ===== Tables ===== */
.table thead th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.88rem;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* ===== Buttons ===== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

/* ===== Alerts ===== */
.alert {
    border-radius: 10px;
}

/* ===== Badges ===== */
.badge {
    font-weight: 600;
    border-radius: 6px;
}

/* ===== Formset inline ===== */
/* Cacher la checkbox DELETE native, garder le label/bouton stylise */
.ligne-row input[type="checkbox"][name$="-DELETE"] {
    display: none;
}

/* Ligne marquee pour suppression */
.ligne-row.ligne-supprimee td {
    text-decoration: line-through;
    opacity: 0.5;
}

/* ===== UX6: Indicateur champs obligatoires ===== */
.required-field::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* ===== Tom Select overrides ===== */
.ts-wrapper .ts-control {
    font-size: 0.875rem;
    min-height: 31px;
    padding: 2px 8px;
    border-radius: 8px;
}

.ts-wrapper.form-select-sm .ts-control {
    font-size: 0.8rem;
}

/* ===== Form controls ===== */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #e2e8f0;
    font-size: 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== Scrollbar ===== */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Personnalisation par entreprise (CSS variables) ===== */

.btn-primary,
.bg-primary {
  background-color: var(--erp-primary) !important;
  border-color: var(--erp-primary) !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--erp-primary-hover) !important;
  border-color: var(--erp-primary-hover) !important;
}

.btn-outline-primary {
  color: var(--erp-primary) !important;
  border-color: var(--erp-primary) !important;
}
.btn-outline-primary:hover {
  background-color: var(--erp-primary) !important;
  color: #fff !important;
}

.btn-secondary,
.bg-secondary {
  background-color: var(--erp-secondary) !important;
  border-color: var(--erp-secondary) !important;
}

.text-primary {
  color: var(--erp-primary) !important;
}

.badge.bg-primary {
  background-color: var(--erp-primary) !important;
}

a {
  color: var(--erp-primary);
}
a:hover {
  color: var(--erp-primary-hover);
}

/* Sidebar si elle existe */
.sidebar,
.nav-sidebar {
  background-color: var(--erp-primary);
}

/* Breadcrumb accent DAMAL */
.breadcrumb-damal .breadcrumb-item.active {
  color: var(--erp-primary);
}
