/* ── Login ── */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 520px at 12% -10%, #fbe9ec 0%, rgba(251, 233, 236, 0) 60%),
    radial-gradient(760px 460px at 100% 100%, #f6e7ea 0%, rgba(246, 231, 234, 0) 62%),
    var(--bg);
  padding: 28px 16px;
}

.login-wrap { width: 100%; max-width: 400px; }

.login-card {
  background: var(--card);
  border: 1px solid var(--md-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
  text-align: center;
}

.login-logo { height: 46px; width: auto; margin-bottom: 18px; }

.login-card h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.login-sub { margin: 6px 0 22px; font-size: 13px; color: var(--muted); }

.login-field { display: block; text-align: left; margin-bottom: 14px; }

.login-field span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.login-field input,
.auth-modal input,
.auth-modal select {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--md-border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field input:focus,
.auth-modal input:focus,
.auth-modal select:focus {
  outline: none;
  border-color: var(--md-rose);
  box-shadow: 0 0 0 3px rgba(196, 92, 106, 0.14);
}

.login-error {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fdecec;
  border: 1px solid #f5c9c9;
  color: #a02a2a;
  font-size: 13px;
  text-align: left;
}

.login-submit { width: 100%; height: 44px; font-size: 14px; margin-top: 4px; }
.login-foot { text-align: center; margin: 16px 0 0; font-size: 12px; color: var(--muted); }

/* ── Thanh tài khoản trên topbar ── */
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--md-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.user-chip:hover { border-color: var(--md-rose); background: var(--md-rose-light); }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--md-rose);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.user-menu {
  position: absolute;
  right: 22px;
  top: 60px;
  min-width: 186px;
  background: #fff;
  border: 1px solid var(--md-border);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(42, 34, 36, 0.16);
  padding: 6px;
  z-index: 60;
}

.user-menu button,
.user-menu a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: none;
  cursor: pointer;
}

.user-menu button:hover,
.user-menu a:hover { background: var(--md-rose-light); color: var(--md-rose-dark); }
.user-menu hr { border: 0; border-top: 1px solid var(--md-border-soft); margin: 5px 0; }

/* ── Quản lý tài khoản ── */
.users-table td.col-actions { white-space: nowrap; text-align: right; }

.btn.tiny {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}

.btn.danger-ghost {
  background: #fff;
  border: 1px solid #f0cfcf;
  color: #a02a2a;
}

.btn.danger-ghost:hover { background: #fdecec; }

.role-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.role-badge.admin { background: #fdecef; color: var(--md-rose-deep); }
.role-badge.staff { background: #eef2f7; color: #4a5a6a; }
.role-badge.off { background: #f1efef; color: var(--muted); }

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 24, 26, 0.5);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 20px;
}

.auth-modal {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(30, 24, 26, 0.3);
  padding: 22px;
}

.auth-modal h3 { margin: 0 0 16px; font-size: 16px; }
.auth-modal label { display: block; margin-bottom: 13px; }

.auth-modal label span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.auth-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.auth-modal .hint { font-size: 12px; color: var(--muted); margin: -6px 0 13px; }

@media (max-width: 640px) {
  .user-meta { display: none; }
  .user-chip { padding: 5px; }
}

/* ===== MAIN NAV ===== */
.main-nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex-wrap: nowrap;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--md-bg, #faf8f8);
  border-radius: 10px;
  padding: 3px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #888);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.13s, color 0.13s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.nav-item:hover {
  background: rgba(214, 69, 79, 0.09);
  color: var(--md-rose-dark, #b63040);
}

.nav-item.is-active {
  background: var(--md-rose, #d6454f);
  color: #fff;
  box-shadow: 0 2px 8px rgba(214, 69, 79, 0.28);
}

.nav-item.is-active:hover {
  background: var(--md-rose-deep, #b63040);
  color: #fff;
}

.nav-sep {
  width: 1px;
  height: 20px;
  background: var(--md-border, #e8dfe0);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Sub-breadcrumb for detail views */
.sub-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted, #888);
  padding: 6px 22px;
  background: var(--md-bg, #faf8f8);
  border-bottom: 1px solid var(--md-border-soft, #f0e8ea);
}

.sub-breadcrumb a {
  color: var(--md-rose-dark, #b63040);
  text-decoration: none;
  font-weight: 600;
}

.sub-breadcrumb a:hover { text-decoration: underline; }
.sub-bc-sep { color: #d0c4c6; }

@media (max-width: 860px) {
  .nav-group { padding: 2px; }
  .nav-item { padding: 6px 9px; font-size: 12px; }
  .nav-sep { margin: 0 2px; }
}

@media (max-width: 720px) {
  .main-nav { flex-wrap: wrap; gap: 4px; }
  .nav-group { flex: 1 1 auto; min-width: 0; }
}

@media (max-width: 620px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex !important; }
}

/* Hamburger button (hidden by default, shown at ≤620px) */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: var(--md-bg, #faf8f8);
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-soft);
  margin-left: auto;
  margin-right: 8px;
  transition: background .15s, color .15s;
}
.mobile-menu-btn:hover { background: var(--md-rose-light); color: var(--md-rose); }

/* Mobile menu drawer */
.mobile-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(280px, 80vw);
  background: #fff;
  box-shadow: 4px 0 20px rgba(0,0,0,.15);
  z-index: 10000;
  transform: translateX(-100%);
  transition: transform .25s ease-in-out;
  display: flex;
  flex-direction: column;
}
.mobile-menu-drawer.open { transform: translateX(0); }

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--md-border);
}
.mobile-menu-header .brand-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--md-rose-dark);
}
.mobile-menu-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-close:hover { background: var(--md-rose-light); color: var(--md-rose); }

.mobile-menu-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.mobile-menu-section {
  padding: 0 12px;
  margin-bottom: 16px;
}
.mobile-menu-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  padding: 0 8px 6px;
}
.mobile-menu-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s;
  margin-bottom: 2px;
}
.mobile-menu-item:hover { background: var(--md-rose-light); }
.mobile-menu-item.is-active {
  background: var(--md-rose);
  color: #fff;
  font-weight: 600;
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.mobile-menu-backdrop.open { opacity: 1; pointer-events: auto; }

/* ── Chuông thông báo (dùng chung mọi trang) ── */
.notif-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-soft, #4a4043);
  padding: 4px 6px;
  border-radius: 8px;
  transition: color .15s;
  line-height: 1;
}

.notif-bell:hover { color: var(--md-rose, #c45c6a); }

.notif-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--md-rose, #c45c6a);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.notif-panel {
  position: fixed;
  top: 52px;
  right: 12px;
  width: 340px;
  max-height: min(480px, calc(100vh - 80px));
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--md-border, #e8e4e5);
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(42, 34, 36, 0.18);
  z-index: 1200;
  display: flex;
  flex-direction: column;
}

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--md-border, #e8e4e5);
  font-weight: 700;
  font-size: 13px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.notif-panel-head button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--md-rose, #c45c6a);
  font-family: inherit;
  white-space: nowrap;
}

.notif-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--md-border-soft, #f3f0f1);
  cursor: pointer;
  transition: background .1s;
}

.notif-item:hover { background: var(--md-rose-light, #fdf5f6); }
.notif-item.unread { background: #fef2f2; }
.notif-item:last-child { border-bottom: none; }

.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #2a2224);
  line-height: 1.35;
}

.notif-item-body {
  font-size: 12px;
  color: var(--text-soft, #4a4043);
  margin-top: 2px;
}

.notif-item-time {
  font-size: 11px;
  color: var(--muted, #8a7e82);
  margin-top: 3px;
}

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-soft, #4a4043);
  font-size: 13px;
}

@media (max-width: 620px) {
  .notif-panel {
    width: auto;
    left: 12px;
    right: 12px;
  }
}
