:root {
  --navy: #1a365d;
  --gold: #c9a84c;
  --bg: #f8f6f1;
  --card: #ffffff;
  --text: #2d3748;
  --text-light: #718096;
  --success: #38a169;
  --error: #e53e3e;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ═══════════════════════════════════════════
   PORTAIL CAPTIF
   ═══════════════════════════════════════════ */

.portal-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, var(--navy) 0%, #2d4a7a 100%);
}

.portal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.portal-card .hotel-logo {
  font-size: 48px;
  margin-bottom: 8px;
}

.portal-card h1 {
  color: var(--navy);
  font-size: 28px;
  margin-bottom: 8px;
}

.portal-card .subtitle {
  color: var(--text-light);
  margin-bottom: 32px;
  font-size: 14px;
}

/* ═══════════════════════════════════════════
   FORMULAIRES
   ═══════════════════════════════════════════ */

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
  font-family: inherit;
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--gold);
}

.error-message {
  background: #fff5f5;
  color: var(--error);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  display: none;
}

/* ═══════════════════════════════════════════
   BOUTONS
   ═══════════════════════════════════════════ */

.btn {
  display: inline-block;
  padding: 12px 32px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--navy);
  color: white;
  width: 100%;
}
.btn-primary:hover { background: #2d4a7a; }

.btn-gold {
  background: var(--gold);
  color: white;
}
.btn-gold:hover { background: #b8933e; }

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
}
.btn-secondary:hover { background: #cbd5e0; }

.btn-danger {
  background: var(--error);
  color: white;
  padding: 8px 16px;
  font-size: 13px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════
   PAGE BIENVENUE
   ═══════════════════════════════════════════ */

.welcome-hero {
  background: linear-gradient(rgba(26, 54, 93, 0.6), rgba(45, 74, 122, 0.6)), url('/assets/images/1.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  padding: 60px 20px 40px;
  text-align: center;
}

.welcome-hero h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.welcome-hero .room-info {
  color: var(--gold);
  font-size: 16px;
}

.welcome-content {
  max-width: 900px;
  margin: -20px auto 40px;
  padding: 0 20px;
}

/* Carte WiFi */
.wifi-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 40px;
  border-left: 4px solid var(--gold);
}

.wifi-card h2 {
  color: var(--navy);
  margin-bottom: 20px;
  font-size: 20px;
}

.wifi-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
}

.wifi-detail:last-child {
  border-bottom: none;
}

.wifi-detail .label {
  color: var(--text-light);
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
  width: 20%;
}

.wifi-detail .value {
  font-weight: 700;
  font-size: 16px;
  font-family: 'Courier New', monospace;
  color: var(--navy);
  user-select: all;
}

/* Services */
.services-section h2 {
  color: var(--navy);
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.service-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  transition: transform 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.service-card:hover {
  transform: translateY(-4px);
}

.service-card .icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.service-card h3 {
  color: var(--navy);
  font-size: 16px;
  margin-bottom: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
}

.service-card p {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════
   ADMIN
   ═══════════════════════════════════════════ */

.admin-login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg);
}

.admin-login .portal-card {
  max-width: 380px;
}

.admin-header {
  background: var(--navy);
  color: white;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: 22px;
}

.logout-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}
.logout-btn:hover { background: rgba(255, 255, 255, 0.1); }

.admin-content {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--navy);
}

.stat-card .stat-label {
  color: var(--text-light);
  font-size: 13px;
  margin-top: 4px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
}

.tab {
  padding: 12px 24px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  font-family: inherit;
}

.tab.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  color: var(--navy);
  font-size: 22px;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
}

th {
  background: var(--navy);
  color: white;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:nth-child(even) {
  background: #f7fafc;
}

td code {
  background: #edf2f7;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
}

td .actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  padding: 8px 12px;
  font-size: 18px;
  min-width: auto;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  transform: scale(1.15);
  opacity: 0.8;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 20px 0;
}

.pagination button {
  padding: 8px 12px;
  min-width: 36px;
  border: 2px solid #e2e8f0;
  background: white;
  color: var(--navy);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--gold);
  background: #fffbf0;
}

.pagination button.active {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .page-info {
  padding: 0 12px;
  color: var(--text-light);
  font-size: 14px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active {
  background: #c6f6d5;
  color: #22543d;
}

.badge-inactive {
  background: #fed7d7;
  color: #822727;
}

.badge-expired {
  background: #fefcbf;
  color: #744210;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  display: none;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  color: var(--navy);
  margin-bottom: 24px;
  font-size: 22px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 600px) {
  .portal-card {
    padding: 32px 24px;
  }

  .welcome-hero {
    padding: 40px 20px 30px;
  }

  .welcome-hero h1 {
    font-size: 24px;
  }

  .wifi-detail {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .services-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-header {
    padding: 16px;
  }

  .admin-header h1 {
    font-size: 18px;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 10px 8px;
  }

  td .actions {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}
