/* Initiotech Ops — composants de base (v1.0)
 * Minimal, tokens-driven. Les vues peuvent étendre librement.
 */

/* Container central */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* sr-only — contenu visuellement caché mais lu par les lecteurs d'écran */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Cards */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: var(--space-6);
}

/* Form */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-2);
  color: var(--ink-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  font-family: inherit;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.form-control:focus {
  outline: 0;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(30, 123, 61, 0.25);
}
.form-control::placeholder { color: var(--ink-4); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-500); color: #fff; }
.btn-primary:hover { background: var(--brand-600); text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink-1); text-decoration: none; }
.btn-block { width: 100%; }

/* Alerts */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: var(--fs-sm);
}
.alert-danger { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.5); color: #FCA5A5; }
.alert-warning { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.5); color: #FCD34D; }
.alert-success { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.5); color: #86EFAC; }
[data-theme="light"] .alert-danger { color: #B91C1C; }
[data-theme="light"] .alert-warning { color: #B45309; }
[data-theme="light"] .alert-success { color: #047857; }

/* Header global */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-1) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  max-width: 1440px;
  margin-inline: auto;
}
.app-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink-1);
  font-weight: 700;
  text-decoration: none;
}
.app-header__brand:hover { text-decoration: none; color: var(--ink-1); }
.app-header__brand img { height: 28px; width: auto; display: block; }
.app-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.app-header__nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
}
.app-header__nav a:hover { background: var(--bg-2); color: var(--ink-1); text-decoration: none; }
.app-header__nav a[aria-current="page"] {
  color: var(--brand-500);
  background: color-mix(in srgb, var(--brand-500) 12%, transparent);
}
.app-header__actions { display: flex; align-items: center; gap: var(--space-2); }
.app-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--brand-500);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-2);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.theme-toggle:hover { background: var(--bg-2); color: var(--ink-1); }
.theme-toggle[aria-pressed="true"] { color: var(--brand-500); border-color: var(--brand-500); }

/* Burger menu (mobile) */
.app-header__burger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-2);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
@media (max-width: 720px) {
  .app-header__burger { display: inline-flex; align-items: center; justify-content: center; }
  .app-header__nav { display: none; }
  .app-header__nav.is-open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg-1);
    flex-direction: column;
    gap: 0;
    padding: var(--space-2);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--card-shadow);
  }
  .app-header__nav.is-open a {
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    width: 100%;
  }
}
