/* ============================================================
   Gml_taxe — CSS Principal
   Gestion de Taxes Municipales
   ============================================================ */

/* ── Variables ── */
:root {
  --gml-primary:    #2563eb;
  --gml-secondary:  #1e3a5f;
  --gml-success:    #16a34a;
  --gml-warning:    #d97706;
  --gml-danger:     #dc2626;
  --gml-sidebar-w:  260px;
  --gml-font:       'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Base ── */
body {
  font-family: var(--gml-font);
  font-size: 0.92rem;
  color: #374151;
}

.has-fixed-footer {
  padding-bottom: 48px;
}

.app-footer-fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
}

/* ── Navbar ── */
.navbar-brand { font-size: 1.1rem; letter-spacing: 0.5px; }

/* ── Cards ── */
.card { transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important; }

/* ── Tables ── */
.table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7280;
  font-weight: 600;
}
.table td { vertical-align: middle; }

.item-title {
  font-weight: 700;
  color: #1f2937;
  line-height: 1.1;
}

.item-meta {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.2;
  margin-top: 0.15rem;
}

.item-chip {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #eef2ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

.chip-marche { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.chip-table { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.chip-public { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.chip-maison { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.chip-autre { background: #f8fafc; color: #334155; border-color: #cbd5e1; }

.item-code {
  font-size: 0.8rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
}

/* ── Badges ── */
.badge { font-size: 0.72rem; font-weight: 600; padding: 0.3em 0.65em; }

/* ── Boutons ── */
.btn { font-weight: 500; }
.btn-primary { background-color: var(--gml-primary); border-color: var(--gml-primary); }

/* ── Stat cards dashboard ── */
.stats-card { border-left: 4px solid var(--gml-primary); }

/* ── DataTables ── */
.dataTables_wrapper .dataTables_filter input { border-radius: 8px; }
.dataTables_wrapper .dataTables_length select { border-radius: 8px; }

/* ── Select2 ── */
.select2-container--default .select2-selection--single {
  height: 38px;
  border-color: #d1d5db;
  border-radius: 6px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
  color: #374151;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
}

/* ── Formulaires ── */
.form-control:focus, .form-select:focus {
  border-color: var(--gml-primary);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.card-form {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

.card-form .card-header {
  background: linear-gradient(120deg, #f8fafc 0%, #eef2ff 100%);
  border-bottom: 1px solid #e5e7eb;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.2px;
}

.form-control,
.form-select {
  border-radius: 10px;
  min-height: 42px;
  border: 1px solid #d1d5db;
  background-color: #fff;
}

textarea.form-control {
  min-height: 96px;
}

.form-help {
  color: #64748b;
  font-size: 0.78rem;
}

.form-section-title {
  margin-top: 0.25rem;
  margin-bottom: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: #1e3a5f;
}

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
  letter-spacing: 0.2px;
}

.status-pill-success {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.status-pill-warning {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.status-pill-muted {
  color: #334155;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.form-actions-sticky {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,0.95);
  border-top: 1px solid #e5e7eb;
  padding: 0.85rem;
  backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
  .card-form .card-body {
    padding: 1rem;
  }
  .form-actions-sticky {
    padding: 0.7rem;
  }

  .mobile-cards table,
  .mobile-cards thead,
  .mobile-cards tbody,
  .mobile-cards th,
  .mobile-cards td,
  .mobile-cards tr {
    display: block;
    width: 100%;
  }

  .mobile-cards thead {
    display: none;
  }

  .mobile-cards tbody tr {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 0.6rem 0.7rem;
    padding: 0.35rem 0;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  }

  .mobile-cards tbody td {
    border: none;
    position: relative;
    padding: 0.45rem 0.75rem 0.45rem 8.2rem;
    min-height: 2rem;
    text-align: left !important;
  }

  .mobile-cards tbody td::before {
    content: attr(data-label);
    position: absolute;
    left: 0.75rem;
    top: 0.47rem;
    width: 7rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #64748b;
    font-weight: 700;
  }
}

/* ── Page de login ── */
.login-card { box-shadow: 0 20px 60px rgba(0,0,0,0.25); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }

/* ── Detail / Item pages ── */
.detail-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  border-radius: 16px 16px 0 0;
  padding: 1.5rem 2rem;
}
.detail-hero .hero-code {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.75;
}
.detail-hero .hero-title {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.2rem 0 0.35rem;
}
.detail-hero .hero-sub {
  font-size: 0.85rem;
  opacity: 0.82;
}
.detail-hero .hero-pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
}
.detail-section-title {
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2563eb;
  border-bottom: 2px solid #dbeafe;
  padding-bottom: 0.35rem;
  margin-bottom: 0.85rem;
}
.detail-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.9rem;
}
.detail-field-label {
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: #94a3b8;
  margin-bottom: 0.1rem;
}
.detail-field-value {
  font-size: 0.92rem;
  color: #1e293b;
  font-weight: 500;
}
.detail-field-value.empty {
  color: #cbd5e1;
  font-style: italic;
}
.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.detail-photo {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.detail-photo-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  border: 2px dashed rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(255,255,255,0.6);
}
.mini-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: #94a3b8;
  font-weight: 700;
  border: none;
  background: #f8fafc;
}
.mini-table td {
  font-size: 0.84rem;
  vertical-align: middle;
  border-color: #f1f5f9;
}
.mini-table tbody tr:hover { background: #f8fafc; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f0f9ff; }

/* ── Print ── */
@media print {
  .navbar, .footer, .btn, .no-print { display: none !important; }
  .card { border: 1px solid #ddd; box-shadow: none !important; }
}
