/* ===================== ADMIN • VELRA THEME ===================== */
:root {
  /* Velra Brand Colors */
  --velra-gold: #D4A84B;
  --velra-gold-light: #E8C56D;
  --velra-green: #4A7C3F;
  --velra-green-dark: #1E3D1A;
  --velra-green-light: #6B9E23;
  --velra-gradient: linear-gradient(135deg, #D4A84B 0%, #8FB83A 50%, #4A7C3F 100%);
  
  --brand: var(--velra-gold);
  --bg: #0D1810;
  --panel: rgba(13, 24, 16, 0.9);
  --border: rgba(255, 255, 255, 0.15);
  --dark: #0D1810;
  --shadow: 0 4px 16px rgba(0, 0, 0, .3);
  --r: 12px;
  --font-sans: "Inter", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji",
    "Noto Color Emoji", sans-serif;
}

html,
body {
  margin: 0;
  height: 100%;
  font: 14px/1.45 var(--font-sans);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

/* -------------------- Topbar -------------------- */
.topbar {
  background: var(--brand);
  color: #fff;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-weight: 700;
}

/* -------------------- Layout -------------------- */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
}

/* Sidebar cố định (desktop), cuộn độc lập */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 220px;
  background: var(--dark);
  color: #fff;
  overflow: auto;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 10px 0;
}

.sidebar a {
  display: block;
  color: #fff;
  padding: 12px 18px;
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  background: #444;
}

.sidebar a.active {
  background: #444;
  border-left-color: #fff;
}

/* Main lệch phải 220px để không bị đè */
.main {
  padding: 20px;
  background: var(--bg);
}

/* Mobile / ≤1000px: sidebar thành khối thường, main full-width */
@media (max-width:1000px) {
  .layout {
    display: block;
    min-height: initial;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
  }

  .main {
    margin: 0;
    padding: 16px;
  }
}

/* -------------------- Common UI -------------------- */
.breadcrumb {
  color: #555;
  margin-bottom: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.toolbar {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.left,
.right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar input[type="text"] {
  width: min(100%, 180px);
}

input,
select,
textarea {
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .15);
}

/* Android: tránh zoom khi mở bàn phím */
@media (max-width:1000px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--border);
}

.btn.brand {
  background: #be1e2d;
  border-color: #be1e2d;
  color: #fff;
}

.btn.gray {
  background: #374151;
  border-color: #374151;
  color: #fff;
}

.btn.red {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.btn.green {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.btn.white {
  background: #fff;
}

.btn.orange {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

.muted {
  font-size: 12px;
  color: #6b7280;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f7f7f7;
  font-size: 12px;
}

.online {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.offline {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

/* -------------------- Grid helpers -------------------- */
.grid {
  display: grid;
  gap: 12px;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width:1000px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.card .num {
  font-size: 20px;
  font-weight: 700;
}

/* -------------------- Tables -------------------- */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

@supports (-webkit-overflow-scrolling: touch) {
  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #fafafa;
}

/* Buttons trong cell nhỏ gọn */
table td .btn {
  padding: 4px 8px;
  font-size: 12px;
}

/* -------------------- Pagination -------------------- */
.toolbar.toolbar--pager {
  justify-content: right;
}

.toolbar.toolbar--pager>* {
  flex: 0 0 auto;
}

.pagination {
  display: inline-flex;
  gap: 6px;
}

.pagination .page {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.pagination .page.active {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}

.pagination .page.disabled,
.pagination .page.ellipsis {
  opacity: .5;
  pointer-events: none;
}

/* ============================================================
   FROM FILE 2 - LOGIN PAGE STYLES
============================================================ */

*::before,
*::after {
  box-sizing: border-box;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* ===== A11y ===== */
.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;
}

/* ===== Layout auth ===== */
.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--bg);
  overflow: hidden;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial;
}

/* overlay với gradient xanh lá */
.auth-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(74, 124, 63, 0.2) 0%, transparent 70%);
  z-index: 0;
}

/* halo/spotlight ngay sau form */
.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  padding: 24px;
  display: grid;
  place-items: center;
}

.login-shell::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(760px, 90vw);
  height: 520px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 45%,
      rgba(212, 168, 75, .25) 0%,
      rgba(143, 184, 58, .15) 35%,
      rgba(74, 124, 63, .08) 60%,
      transparent 70%);
  filter: blur(28px) saturate(120%);
  z-index: -1;
  animation: haloFloat 7s ease-in-out infinite alternate;
}

@keyframes haloFloat {
  from {
    transform: translate(-50%, -50%) scale(1);
  }

  to {
    transform: translate(-50%, -50%) scale(1.04);
  }
}

/* ===== CARD LOGIN MỜ ===== */
.login-box {
  width: 100%;
  max-width: 560px;
  background: rgba(13, 24, 16, 0.8);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border-radius: 16px;
  padding: 32px;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, .45),
    0 1px 0 rgba(212, 168, 75, .2) inset;
  border: 1px solid rgba(212, 168, 75, .3);
  color: #fff;
}

/* ===== Typography ===== */
.h1,
.login-title {
  font-weight: 800;
  margin: 10px 0 20px;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .6);
}

.login-title {
  font-size: 36px;
}

.h1 {
  font-size: 22px;
}

/* ===== Labels & inputs ===== */
.form-label {
  display: block;
  font-weight: 700;
  color: #f0f0f0;
  margin: 0 0 6px;
  font-weight: 600;
}

.input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.input {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 16px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .25);
  font-size: 16px;
  outline: none;
  transition: box-shadow .15s, border-color .15s;
  color: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: rgba(255, 255, 255, .7);
}

.input:focus {
  box-shadow: 0 0 0 3px rgba(212, 168, 75, .25);
  border-color: var(--velra-gold);
}

/* (Tuỳ chọn) nút hiện/ẩn mật khẩu nếu bạn bật trong HTML */
.icon-eye,
.eye-btn,
#togglePw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-eye.on {
  filter: brightness(0.8);
}

#togglePw svg {
  display: none;
}

#togglePw .eye-open {
  display: block;
}

#togglePw.on .eye-open {
  display: none;
}

#togglePw.on .eye-closed {
  display: block;
}

/* ===== Buttons ===== */
.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--r);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
  width: 100%;
  height: 56px;
  margin-top: 16px;
  background: var(--velra-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(212, 168, 75, .35);
  transition: all 0.3s ease;
}

.login-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 12px 24px rgba(212, 168, 75, .45);
  transform: translateY(-2px);
}

.login-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
}

/* Màu nút phụ nếu cần dùng */
.btn.yellow {
  background: #fbbf24;
  color: #111827;
}

/* ===== Feedback ===== */
.form-error {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fdecec;
  color: #d92d20;
  border: 1px solid #ffd1d1;
  font-size: 14px;
}

.hint {
  font-size: 12px;
  color: rgba(255, 255, 255, .7);
  margin-top: 6px;
  text-align: center;
}

/* ===== Spinner nhỏ (dùng trong nút) ===== */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .55);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.small {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Utilities ===== */
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nowrap {
  white-space: nowrap;
}

/* ===== Focus visible (a11y) ===== */
:focus-visible {
  outline: 2px solid var(--velra-gold);
  outline-offset: 2px;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* Ẩn nút reveal mặc định của Edge/IE */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
}

/* Ẩn decoration container WebKit */
input[type="password"]::-webkit-textfield-decoration-container {
  display: none;
}

/* (Nếu autofill lỡ chui vào, bỏ highlight vàng/xanh) */
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.25) inset !important;
  -webkit-text-fill-color: #fff !important;
  transition: background-color 9999s ease-in-out 0s;
}