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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #eef2f7;
  color: #111827;
}

.hidden { display: none !important; }

/* ========== LOGIN ========== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #1e3a5f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 45px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.login-logo {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.login-logo i {
  font-size: 2rem;
  color: #fff;
}

.login-card h2 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}

.login-sub {
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.login-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 7px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap i:first-child {
  position: absolute;
  left: 13px;
  color: #9ca3af;
  font-size: 1rem;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 12px 42px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  color: #111827;
}

.input-wrap input:focus {
  border-color: #3b82f6;
}

.toggle-pw {
  position: absolute !important;
  right: 13px !important;
  left: auto !important;
  cursor: pointer !important;
  pointer-events: all !important;
  color: #9ca3af;
}

.toggle-pw:hover { color: #374151; }

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 6px;
}

.btn-login:hover { opacity: 0.9; }
.btn-login:active { transform: scale(0.98); }

.login-hint {
  text-align: center;
  font-size: 0.82rem;
  color: #9ca3af;
  margin-top: 16px;
}

/* ========== SIDEBAR ========== */
.sidebar {
  height: 100vh;
  width: 230px;
  background: #1f2937;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding-top: 0;
  z-index: 50;
}

.sidebar-title {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 1px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid #374151;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-title i { font-size: 1.3rem; color: #60a5fa; }

.nav-link {
  color: #cbd5e1;
  display: flex;
  align-items: center;
  padding: 13px 20px;
  text-decoration: none;
  font-size: 0.97rem;
  transition: background 0.2s, color 0.2s;
  border-radius: 8px;
  margin: 2px 10px;
  gap: 12px;
}

.nav-link i { font-size: 1.15rem; }
.nav-link:hover { background: #374151; color: #fff; }
.nav-link.active { background: #3b82f6; color: #fff; }
.nav-link.logout { margin-top: auto; color: #f87171; }
.nav-link.logout:hover { background: #374151; color: #ff6b6b; }

/* ========== MAIN CONTENT ========== */
.content {
  margin-left: 230px;
  padding: 32px;
  min-height: 100vh;
}

/* ========== PAGES ========== */
.page { display: none; }
.page.active { display: block; }

.page h2 {
  font-weight: 700;
  font-size: 1.8rem;
  color: #111827;
  margin-bottom: 24px;
}

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

.page-header h2 { margin-bottom: 0; }

/* ========== STAT CARDS ========== */
.stat-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.stat-card {
  flex: 1;
  min-width: 180px;
  border-radius: 16px;
  padding: 28px 24px;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 35px rgba(0,0,0,0.16);
}

.stat-card h4 {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.95;
}

.stat-card .stat-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.card-blue  { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.card-green { background: linear-gradient(135deg, #10b981, #34d399); }
.card-amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

/* ========== DASHBOARD TABLES ========== */
.dashboard-tables {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.dash-table-box {
  flex: 1;
  min-width: 300px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  overflow: hidden;
}

.dash-table-header {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #374151;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

/* ========== TABLES ========== */
.table-wrapper {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

table thead { background: #1f2937; color: #fff; }

table thead th {
  padding: 13px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.4px;
}

table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

table tbody tr:last-child { border-bottom: none; }
table tbody tr:hover { background: #f8fafc; }

table tbody td {
  padding: 12px 16px;
  font-size: 0.93rem;
  color: #374151;
}

/* ========== BADGE ========== */
.badge-lang {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
}

/* ========== SEARCH ========== */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1rem;
}

.search-bar input {
  width: 100%;
  max-width: 360px;
  padding: 10px 14px 10px 40px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.93rem;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}

.search-bar input:focus { border-color: #3b82f6; }

/* ========== BUTTONS ========== */
.btn-add {
  padding: 10px 18px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.2s, transform 0.1s;
}

.btn-add:hover { background: #2563eb; }
.btn-add:active { transform: scale(0.97); }

.btn-edit {
  padding: 5px 12px;
  background: #e0f2fe;
  color: #0369a1;
  border: none;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-right: 6px;
}

.btn-edit:hover { background: #bae6fd; }

.btn-delete {
  padding: 5px 12px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-delete:hover { background: #fecaca; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #6b7280;
  padding: 4px;
}

.modal-close:hover { color: #111827; }

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body .form-group { margin-bottom: 0; }

.modal-body input,
.modal-body select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  color: #111827;
}

.modal-body input:focus,
.modal-body select:focus { border-color: #3b82f6; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
}

.btn-cancel {
  padding: 10px 20px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 10px;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-cancel:hover { background: #e5e7eb; }

.btn-save {
  padding: 10px 20px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-save:hover { background: #2563eb; }

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #1f2937;
  color: #fff;
  padding: 13px 22px;
  border-radius: 12px;
  font-size: 0.93rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 999;
  animation: slideUp 0.3s ease;
}

.toast.success { background: #059669; }
.toast.error   { background: #dc2626; }

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

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
    gap: 4px;
  }
  .sidebar-title { width: 100%; border-bottom: none; padding: 10px; }
  .nav-link { padding: 8px 12px; font-size: 0.85rem; margin: 0; }
  .nav-link.logout { margin-top: 0; }
  .content { margin-left: 0; padding: 16px; }
  .stat-cards { flex-direction: column; }
  .dashboard-tables { flex-direction: column; }
}
