/* ========================================= */
/* SYSTÈME DE THÈME - Variables CSS         */
/* ========================================= */

:root {
  /* Thème clair (par défaut) */
  --color-bg-primary: #ffffff;
  --color-bg-secondary: #f9fafb;
  --color-bg-tertiary: #f3f4f6;
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-text-tertiary: #9ca3af;
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;
  --color-accent: #2BD3C6;
  --color-accent-dark: #22bfb3;
  --color-accent-light: #f0fdfa;
  --color-accent-text: #0f766e;
  --color-sidebar-bg: #166A63;
  --color-main-bg: #f1f5fb;
  --color-warning: #b45309;
  --color-warning-light: #fde68a;
  --color-warning-bg: #fffbeb;
  --color-danger: #ef4444;
  --color-danger-light: #fecaca;
  --color-danger-bg: #fef2f2;
  --color-info-bg: #f0f9ff;
  --color-info-border: #bae6fd;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --transition: all 0.2s ease;
}

/* Thème sombre */
html[data-theme="dark"],
html.dark {
  --color-bg-primary: #1f2937;
  --color-bg-secondary: #111827;
  --color-bg-tertiary: #374151;
  --color-text-primary: #f9fafb;
  --color-text-secondary: #d1d5db;
  --color-text-tertiary: #9ca3af;
  --color-border: #4b5563;
  --color-border-light: #374151;
  --color-accent: #2BD3C6;
  --color-accent-dark: #22bfb3;
  --color-accent-light: #0d4d48;
  --color-accent-text: #99f6e4;
  --color-sidebar-bg: #0f3f3a;
  --color-main-bg: #111827;
  --color-warning: #f59e0b;
  --color-warning-light: #fbbf24;
  --color-warning-bg: #78350f;
  --color-danger: #ef4444;
  --color-danger-light: #fca5a5;
  --color-danger-bg: #7f1d1d;
  --color-info-bg: #082f49;
  --color-info-border: #0369a1;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* Application des variables aux éléments principaux */
html {
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  color-scheme: light;
  transition: var(--transition);
}

html[data-theme="dark"],
html.dark {
  color-scheme: dark;
}

body {
  min-height: 100%;
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  transition: var(--transition);
}

html[data-theme="dark"] body,
html.dark body {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

html[data-theme="dark"] header,
html.dark header {
  background-color: var(--color-bg-primary);
  border-color: var(--color-border);
}

html[data-theme="dark"] main,
html.dark main {
  background-color: var(--color-main-bg);
  color: var(--color-text-primary);
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

h1, h2, h3, .font-black {
  font-weight: 800;
  letter-spacing: -0.025em;
}

main {
  background-color: var(--color-main-bg);
  color: var(--color-text-primary);
}

/* Sidebar */
aside {
  background-color: var(--color-sidebar-bg);
}

/* Header */
header {
  background-color: var(--color-bg-primary);
  border-color: var(--color-border);
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border-color: var(--color-border);
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  border-color: var(--color-accent);
  outline: none;
}

/* Tables */
table {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
}

tbody tr {
  border-color: var(--color-border-light);
}

tbody tr:hover {
  background-color: var(--color-bg-secondary);
}

th {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

/* Cards */
.card,
[class*="card"] {
  background-color: var(--color-bg-primary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

/* Buttons */
button,
.btn,
[class*="btn"] {
  transition: var(--transition);
}

/* Badges */
.badge,
[class*="badge"] {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

/* Text adjustments for dark mode */
input::placeholder {
  color: var(--color-text-tertiary);
}

/* Modal/Dialog */
.modal,
.dialog,
[class*="modal"],
[class*="dialog"] {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

/* Links */
a {
  color: var(--color-accent);
}

a:hover {
  color: var(--color-accent-dark);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-text-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

/* Helpers pour formulaires et composants partagés */
.bg-white.rounded-2xl {
  overflow: visible !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="number"],
textarea,
select,
.ts-control,
.ts-control input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus,
.ts-wrapper.focus .ts-control {
  outline: none;
  border-color: var(--color-accent);
  background-color: var(--color-bg-primary);
  box-shadow: 0 0 0 4px rgba(34, 191, 179, 0.1);
}

select {
  background-image: none !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.animate-fadeInUp {
  animation: fadeInUp 0.4s ease-out forwards;
}

.animate-slideIn {
  animation: slideIn 0.3s ease-out forwards;
}

.target-card:hover {
  z-index: 40;
}

.prospect-item:hover {
  z-index: 50;
}

input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  background-color: var(--color-accent);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  cursor: pointer;
  font-weight: 700;
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 8px;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch {
  border-radius: 6px;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--color-border);
}

input[type="checkbox"][name$="-DELETE"] {
  display: none;
}

.input-title-style {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text-primary);
  outline: none;
}

.label-saas-lite {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.has-error input {
  border-color: var(--color-danger) !important;
}

.custom-checkbox-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.custom-checkbox-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: 5px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.custom-checkbox-list li:hover {
  background-color: #f0fdf4;
  border-color: #10b981;
}

.custom-checkbox-list input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}

.mynetwork {
  background-color: #ffffff;
  background-image: radial-gradient(#e2e8f0 1.2px, transparent 1.2px);
  background-size: 30px 30px;
}

.vis-network:focus {
  outline: none;
}

.ticket-row {
  user-select: none;
  -webkit-user-select: none;
}

.ipam-subnet-page {
  font-family: Arial, sans-serif;
  text-align: center;
}

.ipam-subnet-page .grid {
  display: grid;
  grid-template-columns: repeat(16, 50px);
  gap: 5px;
  justify-content: center;
}

.ipam-subnet-page .subnet {
  width: 50px;
  height: 50px;
  text-align: center;
  font-size: 12px;
  border: 1px solid black;
  line-height: 50px;
  color: white;
}

.ipam-subnet-page .available {
  background-color: green;
}

.ipam-subnet-page .allocated {
  background-color: red;
}

.contract-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contract-card:hover {
  transform: translateY(-2px);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
}

.service-row:hover {
  background-color: var(--color-bg-secondary);
}

.service-row select,
.service-row input[type="number"],
.service-row input[type="text"] {
  width: 100%;
  background-color: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-primary);
  transition: all 0.2s ease;
}

.service-row select:focus,
.service-row input:focus {
  border-color: var(--color-accent);
  background-color: var(--color-bg-primary);
  outline: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]),
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 120px;
  resize: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus,
.ts-wrapper.focus .ts-control {
  outline: none;
  border-color: var(--color-accent);
  background-color: var(--color-bg-primary);
  box-shadow: 0 0 0 4px rgba(34, 191, 179, 0.1);
}

.ts-wrapper {
  z-index: 50 !important;
}

.ts-dropdown {
  z-index: 100 !important;
  border-radius: 0.85rem !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid var(--color-border) !important;
  margin-top: 5px !important;
  background-color: var(--color-bg-primary) !important;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.custom-scrollbar:hover::-webkit-scrollbar-thumb {
  background: #e5e7eb;
}

.animate-fadeIn,
.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-modal {
  animation: modalIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Tailwind Utilities pour le thème */
html[data-theme="dark"].bg-white,
html.dark.bg-white,
html[data-theme="dark"] .bg-white,
html.dark .bg-white {
  background-color: #1f2937 !important;
}

html[data-theme="dark"].bg-gray-100,
html.dark.bg-gray-100,
html[data-theme="dark"] .bg-gray-100,
html.dark .bg-gray-100,
html[data-theme="dark"].bg-gray-50,
html.dark.bg-gray-50,
html[data-theme="dark"] .bg-gray-50,
html.dark .bg-gray-50 {
  background-color: #111827 !important;
}

html[data-theme="dark"] .bg-gray-200,
html.dark .bg-gray-200,
html[data-theme="dark"] .bg-slate-100,
html.dark .bg-slate-100,
html[data-theme="dark"] .bg-slate-50,
html.dark .bg-slate-50,
html[data-theme="dark"] .bg-gray-50,
html.dark .bg-gray-50,
html[data-theme="dark"] .bg-blue-50,
html.dark .bg-blue-50,
html[data-theme="dark"] .bg-red-50,
html.dark .bg-red-50,
html[data-theme="dark"] .bg-green-50,
html.dark .bg-green-50,
html[data-theme="dark"] .bg-orange-50,
html.dark .bg-orange-50,
html[data-theme="dark"] .bg-amber-50,
html.dark .bg-amber-50,
html[data-theme="dark"] .bg-teal-50,
html.dark .bg-teal-50 {
  background-color: #111827 !important;
}

html[data-theme="dark"] .bg-white,
html.dark .bg-white,
html[data-theme="dark"] .bg-gray-50,
html.dark .bg-gray-50 {
  background-color: #1f2937 !important;
}

html[data-theme="dark"] .bg-teal-50,
html.dark .bg-teal-50 {
  background-color: #0d4d48 !important;
}

html[data-theme="dark"] .text-gray-900,
html.dark .text-gray-900,
html[data-theme="dark"] .text-gray-800,
html.dark .text-gray-800,
html[data-theme="dark"] .text-gray-700,
html.dark .text-gray-700 {
  color: #f9fafb !important;
}

html[data-theme="dark"] .text-gray-600,
html.dark .text-gray-600,
html[data-theme="dark"] .text-gray-500,
html.dark .text-gray-500 {
  color: #d1d5db !important;
}

html[data-theme="dark"] .text-gray-400,
html.dark .text-gray-400,
html[data-theme="dark"] .text-gray-300,
html.dark .text-gray-300 {
  color: #9ca3af !important;
}

html[data-theme="dark"] .border-gray-200,
html.dark .border-gray-200,
html[data-theme="dark"] .border-gray-100,
html.dark .border-gray-100,
html[data-theme="dark"] .border-gray-300,
html.dark .border-gray-300,
html[data-theme="dark"] .border-gray-400,
html.dark .border-gray-400 {
  border-color: #4b5563 !important;
}

html[data-theme="dark"] .bg-slate-800,
html.dark .bg-slate-800,
html[data-theme="dark"] .bg-slate-900,
html.dark .bg-slate-900 {
  background-color: #111827 !important;
}

html[data-theme="dark"] .text-gray-50,
html.dark .text-gray-50 {
  color: #f9fafb !important;
}

html[data-theme="dark"] .bg-white input::placeholder,
html.dark .bg-white input::placeholder,
html[data-theme="dark"] input::placeholder,
html.dark input::placeholder {
  color: #9ca3af !important;
}

/* Smooth transitions pour tous les éléments de couleur */
* {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}

/* Eviter les transitions sur les animations */
*:not(animated),
*:not([class*="animate"]) {
  transition-property: background-color, border-color, color, box-shadow;
}
