/* LOGIMS - Style principal */
:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #0dcaf0;
  --dark: #212529;
  --light: #f8f9fa;
  --sidebar-bg: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #333;
  margin: 0;
  min-height: 100vh;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: #fff;
  flex-shrink: 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand span { color: #4fc3f7; }

.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.5rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-nav a.active {
  background: rgba(79,195,247,0.15);
  color: #4fc3f7;
  border-left-color: #4fc3f7;
}

.sidebar-nav .icon { margin-right: 0.75rem; font-size: 1.2rem; }
.sidebar-nav .nav-lock { margin-left: auto; font-size: 0.85rem; opacity: 0.8; }

/* Sidebar admin lock (en bas du menu) */
.sidebar-admin-lock {
  padding: 0.5rem 1rem;
  margin: 0 1rem;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.sidebar-lock-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-decoration: none;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.sidebar-lock-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.sidebar-lock-btn.locked { color: #ffa726; border-color: rgba(255,167,38,0.4); }
.sidebar-lock-btn.locked:hover { background: rgba(255,167,38,0.15); }
.sidebar-lock-btn.unlocked { color: #66bb6a; border-color: rgba(102,187,106,0.4); }
.sidebar-lock-btn.unlocked:hover { background: rgba(102,187,106,0.15); }
.sidebar-lock-btn .lock-icon { font-size: 1.1rem; }

/* Main content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 1.5rem;
  min-height: 100vh;
}

/* Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  color: var(--dark);
}

/* Cards */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: none;
}

.card-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}

.card-body { padding: 1.25rem; }

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--primary);
  transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.info { border-left-color: var(--info); }

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
}

.stat-card .label {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #000; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* Tables */
.table-responsive { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.table th {
  background: #f8f9fa;
  font-weight: 600;
  color: var(--dark);
}

.table tr:hover { background: #f8f9fa; }

.table .actions { white-space: nowrap; }
.table .actions .btn { margin-right: 0.25rem; }

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: #495057;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-success { background: #d1e7dd; color: #0f5132; }
.alert-danger { background: #f8d7da; color: #842029; }
.alert-warning { background: #fff3cd; color: #664d03; }
.alert-info { background: #cff4fc; color: #055160; }

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 1rem;
}

.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.login-box h1 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.login-box .subtitle {
  text-align: center;
  color: #6c757d;
  margin-bottom: 1.5rem;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
}

.text-muted { color: #6c757d; }
.badge-success { background: #d1e7dd; color: #0f5132; }
.badge-warning { background: #fff3cd; color: #664d03; }
.badge-danger { background: #f8d7da; color: #842029; }

/* User menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.05);
  margin: 1rem;
  border-radius: var(--radius-sm);
}

.user-menu .avatar {
  width: 36px;
  height: 36px;
  background: #4fc3f7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-menu .info { flex: 1; }
.user-menu .name { font-weight: 500; font-size: 0.9rem; }
.user-menu .role { font-size: 0.75rem; opacity: 0.8; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eee;
  font-weight: 600;
}

.modal-body { padding: 1.25rem; }
.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 70px;
    padding: 0.5rem 0;
  }
  .sidebar-brand span,
  .sidebar-nav a span:not(.icon) { display: none; }
  .sidebar-nav a { justify-content: center; padding: 1rem; }
  .sidebar-nav .icon { margin-right: 0; }
  .main-content { margin-left: 70px; }
}
