/* =============================================
   TRISOURCE — Supervision inverseur tri-sources
   Design system : sobre, plat, professionnel.
   ============================================= */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-alt: #f8f9fb;
  --border: #e1e4e9;
  --border-strong: #c7ccd4;

  --text: #1a2332;
  --text-muted: #5b6577;
  --text-faint: #8990a0;

  --primary: #163a5f;
  --primary-hover: #0f2c49;
  --primary-tint: #e8edf3;

  --success: #1e7e42;
  --success-tint: #e6f4ea;
  --warning: #9a6400;
  --warning-tint: #fdf3dc;
  --danger: #b42318;
  --danger-tint: #fbe9e7;
  --neutral-tint: #eef0f3;

  --sidebar-w: 232px;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --transition: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.login-wrapper { width: 100%; display: flex; justify-content: center; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-sm);
}

.login-brand { text-align: center; margin-bottom: 32px; }

.brand-icon {
  width: 48px; height: 48px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: #fff;
  margin: 0 auto 16px;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.brand-name span { color: var(--primary); }
.brand-sub { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* =============================================
   FORM COMPONENTS
   ============================================= */
.form-group-custom { margin-bottom: 16px; }
.form-group-custom label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.required { color: var(--danger); }

.input-group-custom {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}
.input-group-custom:focus-within { border-color: var(--primary); }
.input-group-custom.disabled-input { background: var(--surface-alt); opacity: 0.75; }

.input-icon { padding: 0 12px; color: var(--text-faint); font-size: 13px; flex-shrink: 0; }

.form-input-custom {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  padding: 11px 12px 11px 0;
  font-size: 13.5px;
  font-family: inherit;
}
.form-input-custom::placeholder { color: var(--text-faint); }
.form-input-custom:disabled { cursor: not-allowed; color: var(--text-muted); }

.toggle-pwd {
  background: none; border: none;
  color: var(--text-faint);
  padding: 0 12px;
  cursor: pointer;
  font-size: 13px;
}
.toggle-pwd:hover { color: var(--primary); }

.input-hint { color: var(--text-faint); font-size: 11px; margin-top: 5px; display: block; }

.btn-login {
  width: 100%;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
  margin-top: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.btn-login:hover { background: var(--primary-hover); }

.login-footer { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 22px; }

/* =============================================
   ALERTS
   ============================================= */
.alert-custom {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
}
.alert-danger-custom  { background: var(--danger-tint);  border-color: #f2c7c0; color: var(--danger); }
.alert-success-custom { background: var(--success-tint); border-color: #c7e6cf; color: var(--success); }
.alert-info-custom    { background: var(--primary-tint); border-color: #cbd7e4; color: var(--primary); }

/* =============================================
   LAYOUT
   ============================================= */
.admin-layout, .user-layout { display: flex; min-height: 100vh; }

/* =============================================
   SIDEBAR
   ============================================= */
.admin-sidebar, .user-sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand i {
  color: var(--primary);
  font-size: 16px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-tint);
  border-radius: var(--radius-sm);
}
.sidebar-brand b { color: var(--primary); }

.sidebar-nav {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition);
}
.nav-item i { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-alt); color: var(--text); }
.nav-item.active {
  background: var(--primary-tint);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-profile { display: flex; align-items: center; gap: 10px; padding: 6px; }

.profile-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.profile-name { font-size: 13px; font-weight: 600; color: var(--text); }
.profile-role { font-size: 11px; color: var(--text-faint); }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.btn-logout:hover { background: var(--danger-tint); border-color: #f2c7c0; color: var(--danger); }

/* =============================================
   MAIN CONTENT
   ============================================= */
.admin-main, .user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-topbar, .user-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left { flex: 1; min-width: 0; }
.topbar-title { font-size: 18px; font-weight: 700; color: var(--text); }
.topbar-sub { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-alert-btn { position: relative; color: var(--text-muted); font-size: 17px; text-decoration: none; }
.topbar-alert-btn:hover { color: var(--primary); }
.alert-dot {
  position: absolute; top: -6px; right: -7px;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 10px;
  min-width: 15px; text-align: center;
}

.btn-hamburger {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 14px;
}

.page-content { flex: 1; padding: 26px 28px; }

/* =============================================
   BUTTONS
   ============================================= */
.btn-create {
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: background var(--transition);
}
.btn-create:hover { background: var(--primary-hover); color: #fff; }

.btn-cancel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel:hover { border-color: var(--border-strong); color: var(--text); }

.btn-view-all { color: var(--primary); font-size: 12px; font-weight: 600; text-decoration: none; }
.btn-view-all:hover { text-decoration: underline; }

/* Bootstrap overrides to match the palette */
.btn-primary {
  background-color: var(--primary); border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-hover); border-color: var(--primary-hover);
}
.btn-outline-secondary { color: var(--text-muted); border-color: var(--border-strong); }
.btn-outline-secondary:hover { background: var(--surface-alt); color: var(--text); border-color: var(--border-strong); }
.badge.bg-secondary { background-color: var(--neutral-tint) !important; color: var(--text-muted) !important; }
.badge.bg-success   { background-color: var(--success-tint) !important; color: var(--success) !important; }
.badge.bg-danger    { background-color: var(--danger-tint) !important; color: var(--danger) !important; }
.table-light { background: var(--surface-alt); }

/* =============================================
   STATS GRID
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.stat-blue .stat-icon   { background: var(--primary-tint); color: var(--primary); }
.stat-green .stat-icon  { background: var(--success-tint); color: var(--success); }
.stat-orange .stat-icon { background: var(--warning-tint); color: var(--warning); }

.stat-value { font-size: 24px; font-weight: 700; line-height: 1; color: var(--text); }
.stat-label { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* =============================================
   TABLE CARD
   ============================================= */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}
.table-header h3 { font-size: 13.5px; font-weight: 700; color: var(--text); }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 11px;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box i { color: var(--text-faint); font-size: 12px; }
.search-box input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 180px; font-family: inherit; }
.search-box input::placeholder { color: var(--text-faint); }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table tbody tr { border-bottom: 1px solid var(--border); }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface-alt); }
.admin-table td { padding: 11px 16px; font-size: 13px; color: var(--text); vertical-align: middle; }

.td-id { color: var(--text-faint); font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.td-email { color: var(--text-muted); }
.td-date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.td-details { color: var(--text-muted); max-width: 300px; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.user-name { font-weight: 600; }
.user-fullname { color: var(--text-faint); font-size: 11px; }

.pwd-cell { display: flex; align-items: center; gap: 8px; }
.pwd-masked { font-family: ui-monospace, Consolas, monospace; letter-spacing: 2px; color: var(--text-faint); }

.btn-eye {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  width: 25px; height: 25px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
}
.btn-eye:hover { border-color: var(--primary); color: var(--primary); }

/* Badges / tags — rectangular, flat (not glowing pills) */
.badge-status {
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  border: 1px solid transparent;
}
.badge-active   { background: var(--success-tint); color: var(--success); border-color: #c7e6cf; }
.badge-inactive { background: var(--danger-tint);  color: var(--danger);  border-color: #f2c7c0; }
.badge-present  { background: var(--primary-tint); color: var(--primary); border-color: #cbd7e4; }

.action-tag {
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid #cbd7e4;
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.action-btns { display: flex; gap: 6px; }
.btn-action {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
}
.btn-toggle { color: var(--success); }
.btn-toggle:hover { background: var(--success-tint); border-color: #c7e6cf; }
.btn-delete { color: var(--danger); }
.btn-delete:hover { background: var(--danger-tint); border-color: #f2c7c0; }

.btn-delete-confirm {
  background: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
  display: flex; align-items: center;
}
.btn-delete-confirm:hover { background: #962017; }

/* =============================================
   MODAL
   ============================================= */
.modal-custom { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.modal-header-custom {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 700;
}
.btn-close-custom {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 11px;
}
.btn-close-custom:hover { border-color: var(--danger); color: var(--danger); }
.modal-body-custom { padding: 18px; }
.modal-footer-custom { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state { text-align: center; padding: 46px 20px; color: var(--text-faint); }
.empty-state i { font-size: 36px; margin-bottom: 12px; display: block; opacity: 0.5; }
.empty-state p { font-size: 13.5px; }

/* =============================================
   ALERTS LIST
   ============================================= */
.alerts-list { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  border-left: 3px solid var(--border-strong);
}
.alert-item-info    { border-left-color: var(--primary); }
.alert-item-warning  { border-left-color: var(--warning); }
.alert-item-danger  { border-left-color: var(--danger); }
.alert-item-success { border-left-color: var(--success); }

.alert-item-icon { font-size: 16px; margin-top: 1px; flex-shrink: 0; width: 18px; text-align: center; }
.alert-item-info .alert-item-icon    { color: var(--primary); }
.alert-item-warning .alert-item-icon  { color: var(--warning); }
.alert-item-danger .alert-item-icon  { color: var(--danger); }
.alert-item-success .alert-item-icon { color: var(--success); }

.alert-item-body { flex: 1; min-width: 0; }
.alert-item-title { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; }
.alert-item-msg { color: var(--text-muted); font-size: 13px; }
.alert-item-date { color: var(--text-faint); font-size: 11px; margin-top: 6px; }

.badge-type {
  padding: 2px 9px; border-radius: var(--radius-sm);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap; flex-shrink: 0;
  border: 1px solid transparent;
}
.badge-type-info    { background: var(--primary-tint); color: var(--primary); border-color: #cbd7e4; }
.badge-type-warning  { background: var(--warning-tint); color: var(--warning); border-color: #f0dca3; }
.badge-type-danger  { background: var(--danger-tint); color: var(--danger); border-color: #f2c7c0; }
.badge-type-success { background: var(--success-tint); color: var(--success); border-color: #c7e6cf; }

/* =============================================
   SETTINGS PAGE
   ============================================= */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-body { padding: 18px; }

.profile-header-settings {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.profile-avatar-lg {
  width: 52px; height: 52px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.profile-name-lg { font-size: 15px; font-weight: 700; }
.profile-role-lg { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.strength-bar { height: 4px; background: var(--surface-alt); border-radius: 4px; overflow: hidden; }
.strength-fill { height: 100%; width: 0; border-radius: 4px; transition: all 0.25s ease; }
.strength-label { font-size: 11px; font-weight: 600; display: block; margin-top: 4px; }

.info-box {
  background: var(--primary-tint);
  border: 1px solid #cbd7e4;
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  display: flex; align-items: flex-start; gap: 10px;
  color: var(--text-muted); font-size: 13px;
}
.info-box i { color: var(--primary); margin-top: 1px; flex-shrink: 0; }
.security-tips { list-style: none; margin-top: 6px; }
.security-tips li { font-size: 12px; margin-bottom: 3px; }
.security-tips li::before { content: '— '; color: var(--primary); }

.account-info-grid { display: flex; gap: 30px; padding: 18px; flex-wrap: wrap; }
.account-info-item { display: flex; flex-direction: column; gap: 6px; }
.info-label { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.info-value { color: var(--text); font-size: 13px; font-weight: 600; }
.role-badge {
  background: var(--neutral-tint); color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 9px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 700; display: inline-block;
}

.ip-code {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
}

/* =============================================
   INVERTER DASHBOARD
   ============================================= */
.inv-sources-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.inv-source-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inv-source-card.inv-active { border-left-color: var(--primary); }
.inv-source-card.inv-idle { opacity: 0.9; }
.inv-card-top { display: flex; align-items: center; gap: 10px; }
.inv-icon-wrap {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary-tint);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--primary); flex-shrink: 0;
}
.inv-source-label { flex: 1; min-width: 0; }
.inv-src-num { display: block; font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.inv-src-name { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-status-pill { padding: 3px 9px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 700; white-space: nowrap; flex-shrink: 0; border: 1px solid transparent; }
.pill-active  { background: var(--primary-tint); color: var(--primary); border-color: #cbd7e4; }
.pill-present { background: var(--success-tint); color: var(--success); border-color: #c7e6cf; }
.pill-absent  { background: var(--neutral-tint); color: var(--text-faint); border-color: var(--border); }
.inv-voltage-row { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.inv-v-value { font-size: 32px; font-weight: 700; color: var(--text); font-family: ui-monospace, Consolas, monospace; }
.inv-active .inv-v-value { color: var(--primary); }
.inv-v-unit { font-size: 15px; font-weight: 600; color: var(--text-faint); }
.inv-freq-row { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-muted); }
.inv-freq-row i { color: var(--text-faint); font-size: 11px; }
.inv-no-data { color: var(--text-faint); }
.inv-active-bar { height: 3px; background: var(--surface-alt); border-radius: 3px; overflow: hidden; margin-top: 2px; }
.inv-active-fill { height: 100%; width: 100%; background: var(--primary); }

.inv-active-summary {
  background: var(--primary-tint);
  border: 1px solid #cbd7e4;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px; font-weight: 600; color: var(--primary);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.inv-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-left: auto; }

.inv-chart-card { margin-bottom: 0; }
.inv-chart-wrap { padding: 16px 18px 18px; height: 280px; position: relative; }
.inv-no-data-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-faint); gap: 10px;
}
.inv-no-data-overlay i { font-size: 28px; opacity: 0.4; }
.inv-no-data-overlay p { font-size: 13px; }
.inv-legend { display: flex; gap: 14px; align-items: center; }
.leg-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); }
.leg-item i { font-size: 8px; }
.leg-s1 i { color: var(--primary); }
.leg-s2 i { color: var(--success); }
.leg-s3 i { color: var(--warning); }
.inv-v-table { font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 600; }
.inv-v-ok { color: var(--success); }
.inv-v-bad { color: var(--text-faint); }
.inv-ts { color: var(--text-faint); font-size: 12px; }
.mt-4 { margin-top: 18px; }

/* ── Commande manuelle ESP32 — simple, sans effets ── */
.cmd-wrapper { margin-bottom: 18px; }
.cmd-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.cmd-info { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 200px; }
.cmd-icon-wrap {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-tint);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 16px;
}
.cmd-text-block { display: flex; flex-direction: column; gap: 2px; }
.cmd-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.cmd-subtitle { font-size: 12px; color: var(--text-muted); }

.cmd-btn-area { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.cmd-btn:hover:not(:disabled) { background: var(--primary-hover); }
.cmd-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.cmd-btn .spinner {
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cmd-feedback {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity var(--transition);
  white-space: nowrap;
}
.cmd-feedback.show { opacity: 1; }
.cmd-feedback.fb-ok  { background: var(--success-tint); border: 1px solid #c7e6cf; color: var(--success); }
.cmd-feedback.fb-err { background: var(--danger-tint);  border: 1px solid #f2c7c0; color: var(--danger); }

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(16,24,40,0.45); z-index: 40; }
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
  .user-sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 50; transform: translateX(-100%); transition: transform 0.2s ease; }
  .user-sidebar.open { transform: translateX(0); }
  .btn-hamburger { display: flex; }
  .settings-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-sidebar { display: none; }
  .page-content { padding: 16px; }
  .admin-topbar, .user-topbar { padding: 14px 16px; }
  .inv-sources-grid { grid-template-columns: 1fr; }
  .inv-legend { display: none; }
  .cmd-panel { flex-direction: column; align-items: stretch; }
  .cmd-btn-area { justify-content: space-between; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  .account-info-grid { gap: 16px; }
}
