* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Kanit', Tahoma, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  background: #eef3f9;
  color: #102044;
}

a {
  color: inherit;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #fff;
  padding: 26px 22px;
  border-right: 1px solid #e3eaf3;
}

.brand {
  font-weight: 600;
  font-size: 20px;
  margin-bottom: 34px;
  color: #0d2347;
}

.menu-title {
  font-size: 11px;
  color: #8290aa;
  margin: 22px 0 8px;
  letter-spacing: .3px;
}

.menu a {
  display: block;
  color: #102044;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 14px;
  transition: .18s ease;
}

.menu a.active,
.menu a:hover {
  background: #eaf8f2;
  color: #0aa96b;
  font-weight: 500;
}

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: #0d2347;
}

.page-subtitle {
  font-size: 13px;
  color: #73829f;
  margin-top: 3px;
}

.btn,
button {
  border: 0;
  background: #16bf78;
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(22, 191, 120, .18);
  transition: .18s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn-blue {
  background: #2e73ff;
  box-shadow: 0 8px 18px rgba(46, 115, 255, .18);
}

.btn-red {
  background: #ef476f;
  box-shadow: 0 8px 18px rgba(239, 71, 111, .16);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  border-top: 4px solid #2e73ff;
  box-shadow: 0 8px 24px rgba(30, 55, 95, .05);
}

.card.green {
  border-top-color: #16bf78;
}

.card.blue {
  border-top-color: #2e73ff;
}

.card.orange {
  border-top-color: #ff7a1a;
}

.card.purple {
  border-top-color: #865dff;
}

.card .label {
  color: #6b7a99;
  font-size: 13px;
}

.card .value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 600;
  color: #184cff;
}

.card .hint {
  margin-top: 4px;
  font-size: 12px;
  color: #8a98b3;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.panel {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(30, 55, 95, .05);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
}

.panel-head span,
.panel-head a {
  font-size: 13px;
  color: #6b7a99;
  text-decoration: none;
}

.graph-panel {
  min-height: 430px;
}

.latest-list {
  display: grid;
  gap: 10px;
}

.latest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #edf1f6;
}

.latest-item b {
  display: block;
  font-size: 13px;
  color: #069963;
  font-weight: 500;
}

.latest-item span {
  display: block;
  font-size: 12px;
  color: #73829f;
  margin-top: 2px;
}

.latest-item strong {
  font-size: 13px;
  color: #184cff;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #edf1f6;
  font-size: 13px;
}

th {
  color: #60708f;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 500;
}

.status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.status-valid {
  background: #e5fff2;
  color: #07945d;
}

.status-invalid {
  background: #fff0df;
  color: #d15f00;
}

.status-dup {
  background: #ffe8ec;
  color: #c91d42;
}

.key-box {
  background: #f5f8fc;
  border: 1px dashed #b9c7dc;
  border-radius: 8px;
  padding: 12px;
  word-break: break-all;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #eef3f9, #dfeafb);
}

.login-card {
  width: 380px;
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 18px 45px rgba(20, 45, 90, .12);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
}

.login-card p {
  margin: 0 0 20px;
  color: #6b7a99;
}

input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d4ddea;
  border-radius: 8px;
  margin: 8px 0 14px;
  font-size: 14px;
  font-family: inherit;
}

.error {
  background: #ffe7e7;
  color: #a51616;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.search-box input {
  margin: 0;
}

.check-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 999px;
  background: #f3f7fc;
  border: 1px solid #dce6f3;
  color: #60708f;
  font-size: 13px;
  cursor: pointer;
  transition: .18s ease;
}

.check-pill input {
  width: auto;
  margin: 0;
  accent-color: #16bf78;
}

.check-pill.active,
.check-pill:hover {
  background: #eaf8f2;
  color: #07945d;
  border-color: #bcebd6;
}

.table-wrap {
  overflow-x: auto;
}

.empty-row {
  text-align: center;
  color: #8290aa;
  padding: 26px 10px;
}

.muted {
  color: #8290aa;
  font-size: 12px;
  margin-top: 2px;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.pager-icon,
.pager-number {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: .18s ease;
}

.pager-number.active {
  background: #0f513d;
  color: #ffffff;
}

.pager-icon.disabled,
.pager-number.disabled {
  opacity: .35;
  pointer-events: none;
}

.pager-icon:hover,
.pager-number:hover {
  background: rgba(15, 81, 61, 0.12);
  color: #0f513d;
}

:root[data-theme="dark"] .pager-icon,
:root[data-theme="dark"] .pager-number {
  color: #cbd5e1 !important;
}

:root[data-theme="dark"] .pager-number.active {
  background: #0f513d !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] .pager-icon:hover,
:root[data-theme="dark"] .pager-number:hover {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #ffffff !important;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 14px;
}

.settings-grid label {
  display: block;
  margin-bottom: 6px;
  color: #60708f;
  font-size: 13px;
}

.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #102044;
  border: 1px solid #dce6f3;
  box-shadow: 0 8px 18px rgba(30, 55, 95, .06);
}

.user-menu-btn span {
  font-weight: 500;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 48px;
  width: 220px;
  background: #fff;
  border: 1px solid #e3eaf3;
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(20, 45, 90, .14);
  padding: 8px;
  z-index: 20;
}

.user-menu-dropdown.show {
  display: block;
}

.user-menu-dropdown a {
  display: block;
  text-decoration: none;
  color: #102044;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.user-menu-dropdown a:hover {
  background: #f3f7fc;
}

.user-menu-dropdown a.danger {
  color: #ef476f;
}

.user-menu-id {
  padding: 9px 12px;
  color: #8290aa;
  font-size: 12px;
  border-bottom: 1px solid #edf1f6;
  margin-bottom: 6px;
}

.success-box {
  background: #e5fff2;
  color: #07945d;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.copy-btn {
  background: #102044;
  color: #fff;
  box-shadow: 0 8px 18px rgba(16, 32, 68, .16);
  white-space: nowrap;
}

/* login */
.pc-login-page {
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(255, 207, 95, 0.22), transparent 32%),
    radial-gradient(circle at bottom right, rgba(255, 80, 80, 0.18), transparent 30%),
    linear-gradient(135deg, #121212 0%, #1c1713 45%, #0d0d0d 100%);
  color: #fff;
  font-family: "Kanit", Arial, sans-serif;
}

.pc-login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.pc-login-card {
  width: 100%;
  max-width: 420px;
  padding: 34px;
  border-radius: 18px;
  background: rgba(22, 22, 22, 0.86);
  border: 1px solid rgba(255, 200, 120, 0.18);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px);
}

.pc-login-logo {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffd36a, #ff7a3d);
  color: #211308;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 10px 28px rgba(255, 132, 55, 0.35);
}

.pc-login-title {
  margin: 0;
  text-align: center;
  font-size: 30px;
  font-weight: 700;
}

.pc-login-subtitle {
  margin: 8px 0 26px;
  text-align: center;
  color: #b8b2aa;
  font-size: 15px;
}

.pc-login-field {
  margin-bottom: 18px;
}

.pc-login-label {
  display: block;
  margin-bottom: 8px;
  color: #e8dccb;
  font-size: 14px;
  font-weight: 500;
}

.pc-login-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 214, 156, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.pc-login-input::placeholder {
  color: #77706a;
}

.pc-login-input:focus {
  border-color: #ffb95f;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(255, 185, 95, 0.12);
}

.pc-login-button {
  width: 100%;
  height: 50px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd36a, #ff7a3d);
  color: #211308;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(255, 122, 61, 0.28);
  transition: transform 0.16s, box-shadow 0.16s, filter 0.16s;
}

.pc-login-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 34px rgba(255, 122, 61, 0.36);
}

.pc-login-button:active {
  transform: translateY(0);
}

.pc-login-error {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 72, 72, 0.12);
  border: 1px solid rgba(255, 72, 72, 0.28);
  color: #ff9c9c;
  font-size: 14px;
}

.pc-login-footer {
  margin-top: 18px;
  text-align: center;
  color: #7e7770;
  font-size: 12px;
}

@media (max-width: 480px) {
  .pc-login-card {
    padding: 28px 22px;
    border-radius: 16px;
  }

  .pc-login-title {
    font-size: 26px;
  }
}

/* light dark */
/* =========================
   Dark Mode Fix Override
   วางท้ายสุดของ app.css
========================= */

:root[data-theme="dark"] {
  --page-bg: #0b0f17;
  --card-bg: #121826;
  --card-bg-2: #161f31;
  --input-bg: #0d1320;
  --hover-bg: #1e293b;

  --text-main: #f8fafc;
  --text-soft: #e5e7eb;
  --text-muted: #94a3b8;

  --border-color: #273449;
  --primary-color: #60a5fa;
  --danger-color: #fb7185;
}

/* ทั้งหน้า */
:root[data-theme="dark"] body,
:root[data-theme="dark"] .layout,
:root[data-theme="dark"] .main,
:root[data-theme="dark"] .content,
:root[data-theme="dark"] .page,
:root[data-theme="dark"] .container {
  background: var(--page-bg) !important;
  color: var(--text-main) !important;
}

/* บังคับข้อความทั่วไปใน dark mode */
:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4,
:root[data-theme="dark"] h5,
:root[data-theme="dark"] h6,
:root[data-theme="dark"] p,
:root[data-theme="dark"] span,
:root[data-theme="dark"] label,
:root[data-theme="dark"] div,
:root[data-theme="dark"] th,
:root[data-theme="dark"] td,
:root[data-theme="dark"] strong,
:root[data-theme="dark"] b {
  color: var(--text-main);
}

/* ข้อความรอง */
:root[data-theme="dark"] small,
:root[data-theme="dark"] .muted,
:root[data-theme="dark"] .text-muted,
:root[data-theme="dark"] .subtitle,
:root[data-theme="dark"] .description,
:root[data-theme="dark"] .help-text {
  color: var(--text-muted) !important;
}

/* กล่อง/การ์ด/เมนู */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .box,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .section,
:root[data-theme="dark"] .content-card,
:root[data-theme="dark"] .table-card,
:root[data-theme="dark"] .form-card,
:root[data-theme="dark"] .user-menu-dropdown,
:root[data-theme="dark"] .header,
:root[data-theme="dark"] .sidebar {
  background: var(--card-bg) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

:root[data-theme="dark"] .topbar {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .check-pill {
  background: rgba(34, 197, 94, 0.14) !important;
  color: #86efac !important;
  border: 1px solid rgba(34, 197, 94, 0.35) !important;
}

/* input/select/textarea */
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: var(--input-bg) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: var(--text-muted) !important;
}

/* API Secret Key / code / token */
:root[data-theme="dark"] code,
:root[data-theme="dark"] pre,
:root[data-theme="dark"] .api-key,
:root[data-theme="dark"] .secret-key,
:root[data-theme="dark"] .api-secret,
:root[data-theme="dark"] .token-box,
:root[data-theme="dark"] .key-box,
:root[data-theme="dark"] .copy-box {
  background: #050914 !important;
  color: #f8fafc !important;
  border: 1px solid var(--border-color) !important;
}

/* ถ้า API Secret Key เป็น input readonly */
:root[data-theme="dark"] input[readonly],
:root[data-theme="dark"] textarea[readonly] {
  background: #050914 !important;
  color: #f8fafc !important;
  border-color: var(--border-color) !important;
}

/* table */
:root[data-theme="dark"] table,
:root[data-theme="dark"] thead,
:root[data-theme="dark"] tbody,
:root[data-theme="dark"] tr,
:root[data-theme="dark"] th,
:root[data-theme="dark"] td {
  background-color: var(--card-bg) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

:root[data-theme="dark"] tbody tr:hover {
  background-color: var(--hover-bg) !important;
}

/* ปุ่ม user menu */
:root[data-theme="dark"] .user-menu-btn,
:root[data-theme="dark"] .theme-icon-btn {
  background: var(--card-bg-2) !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

:root[data-theme="dark"] .user-menu-dropdown a,
:root[data-theme="dark"] .theme-toggle-btn {
  color: var(--text-main) !important;
}

:root[data-theme="dark"] .user-menu-dropdown a:hover,
:root[data-theme="dark"] .theme-toggle-btn:hover {
  background: var(--hover-bg) !important;
}

:root[data-theme="dark"] .danger {
  color: var(--danger-color) !important;
}

/* Login page dark tone */
:root[data-theme="dark"] .pc-login-page,
:root[data-theme="dark"] body.pc-login-page {
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(251, 113, 133, 0.14), transparent 32%),
    linear-gradient(135deg, #070b13 0%, #101827 48%, #05070d 100%) !important;
  color: var(--text-main) !important;
}

:root[data-theme="dark"] .pc-login-card {
  background: rgba(15, 23, 42, 0.88) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6) !important;
}

:root[data-theme="dark"] .pc-login-title {
  color: #f8fafc !important;
}

:root[data-theme="dark"] .pc-login-subtitle,
:root[data-theme="dark"] .pc-login-footer {
  color: #94a3b8 !important;
}

:root[data-theme="dark"] .pc-login-label {
  color: #e5e7eb !important;
}

:root[data-theme="dark"] .pc-login-input {
  background: rgba(2, 6, 23, 0.72) !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

:root[data-theme="dark"] .pc-login-input::placeholder {
  color: #64748b !important;
}

:root[data-theme="dark"] .pc-login-input:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16) !important;
}

:root[data-theme="dark"] .pc-login-logo,
:root[data-theme="dark"] .pc-login-button {
  background: linear-gradient(135deg, #93c5fd, #38bdf8) !important;
  color: #04111f !important;
}

/* Payment Center title dark mode */
:root[data-theme="dark"] .brand,
:root[data-theme="dark"] .brand-title,
:root[data-theme="dark"] .logo-title,
:root[data-theme="dark"] .sidebar-title,
:root[data-theme="dark"] .sidebar-brand,
:root[data-theme="dark"] .app-title,
:root[data-theme="dark"] .payment-center-title {
  color: #f8fafc !important;
}

:root[data-theme="dark"] .sidebar {
  background: #121826 !important;
  border-color: #273449 !important;
}

:root[data-theme="dark"] .sidebar .brand,
:root[data-theme="dark"] .sidebar .payment-center-title {
  color: #f8fafc !important;
}

:root[data-theme="dark"] .sidebar .menu-title {
  color: #94a3b8 !important;
}

:root[data-theme="dark"] .sidebar .menu a {
  color: #cbd5e1 !important;
}

:root[data-theme="dark"] .sidebar .menu a:hover {
  background: #1e293b !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] .sidebar .menu a.active {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* SweetAlert2 dark mode */
:root[data-theme="dark"] .swal2-popup {
  background: #111827 !important;
  color: #f8fafc !important;
  border: 1px solid #273449 !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55) !important;
}

:root[data-theme="dark"] .swal2-title {
  color: #f8fafc !important;
}

:root[data-theme="dark"] .swal2-html-container,
:root[data-theme="dark"] .swal2-content {
  color: #cbd5e1 !important;
}

:root[data-theme="dark"] .swal2-icon.swal2-warning {
  border-color: #fbbf24 !important;
  color: #fbbf24 !important;
}

:root[data-theme="dark"] .swal2-icon.swal2-success {
  border-color: #22c55e !important;
  color: #22c55e !important;
}

:root[data-theme="dark"] .swal2-icon.swal2-error {
  border-color: #fb7185 !important;
  color: #fb7185 !important;
}

:root[data-theme="dark"] .swal2-confirm {
  background: #2563eb !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] .swal2-cancel {
  background: #ef476f !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] .swal2-actions button {
  box-shadow: none !important;
}

:root[data-theme="dark"] .swal2-backdrop-show {
  background: rgba(0, 0, 0, 0.72) !important;
}

.status.status-valid {
  background: rgba(22, 191, 120, 0.12) !important;
  color: #16bf78 !important;
  border: 1px solid rgba(22, 191, 120, 0.28) !important;
}

.status.status-invalid {
  background: rgba(239, 71, 111, 0.12) !important;
  color: #ef476f !important;
  border: 1px solid rgba(239, 71, 111, 0.28) !important;
}

.status.status-dup {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.32) !important;
}

:root[data-theme="dark"] .status.status-valid {
  background: rgba(22, 191, 120, 0.18) !important;
  color: #4ade80 !important;
  border-color: rgba(74, 222, 128, 0.35) !important;
}

:root[data-theme="dark"] .status.status-invalid {
  background: rgba(239, 71, 111, 0.18) !important;
  color: #fb7185 !important;
  border-color: rgba(251, 113, 133, 0.35) !important;
}

:root[data-theme="dark"] .status.status-dup {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
}

.user-menu {
  position: relative;
}

.user-menu-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-main, #e5e7eb);
  border-radius: 10px;
  background: var(--bg-card, #ffffff);
  color: var(--text-main, #111827);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  transition: background 0.16s, border-color 0.16s, transform 0.16s;
}

.theme-icon-btn:hover {
  background: var(--bg-hover, #f3f4f6);
  transform: translateY(-1px);
}

.theme-icon-btn:active {
  transform: translateY(0);
}

.key-box-with-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px 0 14px;
}

.key-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.key-icon-btn {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(46, 115, 255, 0.12);
  color: #2e73ff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.key-icon-btn:hover {
  background: rgba(46, 115, 255, 0.2);
}

:root[data-theme="dark"] .key-icon-btn {
  background: #1e293b !important;
  color: #f8fafc !important;
}

:root[data-theme="dark"] .key-icon-btn:hover {
  background: #334155 !important;
}

.user-menu-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-icon {
  width: 16px;
  height: 16px;
  color: #7b8190;
  stroke-width: 2;
}

.user-menu-dropdown a.danger {
  color: #ff3b3b !important;
}

.user-menu-dropdown a.danger .dropdown-icon,
.user-menu-dropdown a.danger span {
  color: #ff3b3b !important;
}

.dropdown-divider {
  height: 1px;
  margin: 6px -8px;
  background: #2b303b;
}

:root[data-theme="light"] .dropdown-divider {
  background: #edf1f6;
}

.password-modal {
  background: #171719 !important;
  border: 1px solid #3a3a42 !important;
  border-radius: 10px !important;
  color: #f5f5f5 !important;
  padding: 22px 18px 18px !important;
}

.password-modal-title {
  text-align: left !important;
  color: #ffffff !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  padding: 0 !important;
  margin: 0 0 18px !important;
}

.password-modal-body {
  margin: 0 !important;
  padding: 0 !important;
}

.password-form {
  text-align: left;
}

.password-form label {
  display: block;
  margin: 14px 0 7px;
  color: #ffffff;
  font-size: 14px;
}

.field-error {
  margin-left: 6px;
  color: #ff4d5e;
  font-size: 13px;
  font-weight: 400;
}

.password-form input {
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid #565660;
  background: #101012 !important;
  color: #ffffff !important;
  outline: none;
}

.password-form input:focus {
  border-color: #2ea36a !important;
  box-shadow: 0 0 0 3px rgba(46, 163, 106, 0.16) !important;
}

.password-save-btn,
.password-cancel-btn {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  box-shadow: none !important;
}

.password-save-btn {
  background: #23855f !important;
  color: #ffffff !important;
}

.password-cancel-btn {
  background: #343438 !important;
  color: #e5e7eb !important;
}

.swal2-actions {
  justify-content: flex-end !important;
  gap: 10px !important;
  margin-top: 18px !important;
}

.swal2-popup .field-error {
  color: #ff4d5e !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}

:root[data-theme="dark"] .swal2-popup .field-error {
  color: #ff4d5e !important;
}