

:root {
    --brand-0: #a21caf;
    --brand-10: #9221b0;
    --brand-20: #7e22ce;
    --brand-30: #6d28d9;
    --brand-40: #5b21b6;
    --brand-50: #4c1d95;
    --brand-60: #3b0764;
    --brand-70: #2e0b4f;
    --brand-80: #1f102f;
    --brand-90: #0b0b12;
    --brand-100: #000000;
    --brand-solid: #ead1ff;
    --brand-solid-dark: #4c1d95;
    --brand-text-on: #ffffff;
    --ring: rgba(126, 34, 206, .35);
    --brand-gradient: linear-gradient(90deg, var(--brand-30), var(--brand-60));

    /* Primary brand palette (35 % steps) */
    --primary-10: var(--brand-0);
    --primary-20: var(--brand-10);
    --primary-30: var(--brand-20);
    --primary-40: var(--brand-30);
    --primary-50: var(--brand-40);
    --primary-60: var(--brand-50);
    --primary-70: var(--brand-60);
    --primary-80: var(--brand-70);
    --primary-90: var(--brand-80);
    --primary-100: var(--brand-100);

    --app-bg: #F6F7FB;
    --text-primary: #111827;
    --bg-card: #ffffff;
    --text-secondary: #4b5563;
    --border-color: #E6E8F0;

    /* Convenience aliases (existing code relies on these) */
    --primary:       var(--brand-solid);
    --primary-dark:  var(--brand-solid-dark);
    --primary-light: var(--brand-10);
    --primary-rgb:   126, 34, 206; /* rgb of --primary */
}

[data-theme="dark"] {
  --app-bg: #1a202c;
  --text-primary: #f7fafc;
  --bg-card: #2d3748;
  --text-secondary: #cbd5e0;
  --border-color: #4a5568;
}

body {
  background-color: var(--app-bg);
  color: var(--text-primary);
  transition: background-color 0.2s, color 0.2s;
  font-size: 15px;
  line-height: 1.5;
}

.brand-header {
  background: var(--brand-gradient);
  color: var(--brand-text-on);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(6px);
}

.brand-header .iconify {
  color: rgba(255, 255, 255, 0.85);
}

.header-inner {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.header-title-image {
  height: 40px;
  width: auto;
  display: block;
}

.header-title .subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-avatar-fallback {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 13px;
}

.header-btn {
  min-height: 33px;
  padding: 0 0.6rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 639px) {
  .header-inner {
    padding: 0 0.25rem;
  }
  .header-title .subtitle {
    display: none;
  }
  .user-chip {
    display: none;
  }
}

.btn-primary {
  color: #fff;
  background: #7d2fc271;
  border: 1px solid rgba(187, 138, 228, 0.7);
  border-radius: 0.75rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.05s ease;
}

.btn-primary:hover {
  background: var(--brand-solid-dark);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
  border-radius: 0.75rem;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

.nav-tab {
  position: relative;
  padding: 0.5rem 0.85rem;
  border-radius: 9999px;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-tab-active {
  color: var(--brand-solid);
  background: rgba(126, 34, 206, 0.1);
  box-shadow: inset 0 -2px 0 var(--brand-solid);
}

.nav-tab-inactive {
  color: #6b7280;
}

.iconify {
  color: currentColor;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand-solid) !important;
  box-shadow: 0 0 0 3px var(--ring);
}

.page {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1rem;
}

.login-page {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 640px) {
  .page {
    max-width: 64rem;
    padding: 1.5rem;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.card-soft {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
}

.settings-section {
  gap: 1rem;
  background: transparent;
  border: none;
  box-shadow: none;
  width: 100%;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.settings-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #fff;
  background: #c39ae62f;
  border: 1px solid rgba(187, 138, 228, 0.7);
}

.settings-card {
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.settings-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #c39ae62f;
  border: 1px solid rgba(187, 138, 228, 0.7);
  flex-shrink: 0;
}

.settings-row-content {
  flex: 1;
  min-width: 160px;
}

.settings-select {
  min-width: 120px;
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.settings-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.settings-field label {
  color: var(--text-secondary);
}

.login-card {
  width: 35rem;
  max-width: 42rem;
  padding: 3rem 2.5rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.login-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.9rem;
  margin-bottom: 4rem;
  text-align: left;
}

.login-field {
  margin: 1rem 0 1.2rem;
}

.login-icon {
  width: 50px;
  height: 50px;
  border-radius: .5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(199, 137, 253, 0.12);
  color: var(--brand-solid);
  font-size: 31px;
  flex-shrink: 0;
}

.pin-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-start;
  align-self: flex-start;
}

.pin-center-icon {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 2.2rem;
}

.pin-center-icon .iconify {
  font-size: 25px;
  color: #ffffffe8;
  width: 44px;
  height: 44px;
  display: inline-flex;
  margin-top: 2rem;
  align-items: center;
  justify-content: center;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  padding: 1rem 0 4.3rem;
}

.pin-dot {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
}

.pin-dot.filled {
  background: #ead1ff;
  border-color: rgba(234, 209, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(195, 154, 230, 0.2);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.08rem;
}

.pin-key {
  min-height: 35px;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pin-key:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pin-key-ghost {
  color: var(--text-secondary);
  font-size: 1.14rem;
}

.logs-view {
  max-width: 36rem;
  margin: 0 auto;
}

.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.logs-card {
  padding: 0.75rem;
  border-radius: 1rem;
}

.logs-list {
  display: grid;
  gap: 0.75rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.log-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.log-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.log-content {
  flex: 1;
  min-width: 0;
}

.log-message {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.log-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.log-actor {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.log-dot {
  opacity: 0.6;
}

.log-empty {
  text-align: center;
  padding: 1rem 0.5rem;
  color: var(--text-secondary);
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.log-empty .iconify {
  font-size: 1.6rem;
}

.log-add .log-icon {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}

.log-edit .log-icon {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.log-delete .log-icon {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.log-auth .log-icon {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
}

.log-system .log-icon {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5f5;
}

.dash-cats {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dash-cats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dash-cats-list {
  display: grid;
  gap: 0.8rem;
}

.dash-cat-item {
  padding: 0.85rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.dash-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dash-cat-title {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.dash-cat-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dash-cat-items {
  display: grid;
  gap: 0.5rem;
}

.dash-cat-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 40px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-cat-item-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-cat-item-qty {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.dash-cat-empty {
  padding: 0.5rem 0.6rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.dash-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.2s;
  border-radius: 999px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  top: 2px;
  background: #fff;
  transition: 0.2s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background: rgba(126, 34, 206, 0.35);
  border-color: rgba(126, 34, 206, 0.6);
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(20, 20, 20, 0.664);
  border: 1px solid rgba(236, 236, 236, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-fallback {
  font-weight: 600;
  font-size: 1.25rem;
  color: #f9f2ff;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.profile-name {
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.btn-soft {
  min-height: 40px;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #ead1ff;
  background: linear-gradient(180deg, #a547f73a, #4d1d953f);
  border: .1px solid #a547f765;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.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;
}

.settings-card .btn-primary {
  color: #fff;
  background: #c39ae62f;
  border: 1px solid rgba(187, 138, 228, 0.7);
}

.settings-card .btn-primary:hover {
  background: rgba(195, 154, 230, 0.32);
}

.inv-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 0.9rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.inv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.inv-title {
  font-weight: 400;
  color: var(--text-primary);
}

.inv-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.inv-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.025);
}

.inv-item-main {
  flex: 1;
  min-width: 0;
}

.inv-item-title {
  font-weight: 300;
  color: var(--text-primary);
}

.inv-item-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.inv-item-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.inv-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.inv-item-meta-right {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: right;
  line-height: 1.3;
  margin-top: 1em;
}

.inv-qty {
  width: 96px;
  text-align: right;
}

.inv-icon {
  width: 20px;
  height: 20px;
}

.inv-add {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem;
  border: 1px dashed var(--border-color);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}

.table-card {
  background: transparent;
  border: none;
  border-radius: 1rem;
  overflow: visible;
  max-width: 720px;
  margin: 0 auto;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  font-size: 0.82rem;
}

.table thead th {
  text-align: center;
  color: var(--text-secondary);
  font-weight: 300;
  padding: 0.55rem 0.8rem;
  background: transparent;
  white-space: nowrap;
}

.table thead th.col-username {
  text-align: left;
}

.table tbody td {
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table tbody td.action-cell {
  overflow: visible;
  white-space: normal;
}

.table tbody td.col-username {
  text-transform: capitalize;
}

.table tbody td:first-child {
  border-top-left-radius: 0.9rem;
  border-bottom-left-radius: 0.9rem;
}

.table tbody td:last-child {
  border-top-right-radius: 0.9rem;
  border-bottom-right-radius: 0.9rem;
}

.table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-actions {
  display: flex;
  flex-direction: row;
  gap: 0.6rem;
  align-items: flex-start;
  white-space: nowrap;
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.action-cell {
  position: relative;
  overflow: visible;
  white-space: normal;
  text-align: center;
}

.action-cell .icon-btn {
  width: 38px;
  height: 38px;
  margin: 0 auto;
}

.action-cell .iconify {
  font-size: 18px;
}

.action-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.action-menu {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 0.5rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 0.35rem 0.7rem;
  width: max-content;
  max-width: 220px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.action-menu .action-link {
  padding: 0.25rem 0.35rem;
  border-radius: 0.5rem;
}

.action-menu .action-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.action-tag {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: left;
}

.action-title {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.action-modal {
  width: 90vw;
  max-width: 26rem;
  border-radius: 1em;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  padding:  .5em 1em;
  overflow: hidden;
}

.action-modal-header {
  padding: 0.9rem .7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.action-modal-title {
  font-weight: 400;
  color: var(--text-primary);
}

.action-modal-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.action-modal-body {
  padding: 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.action-modal-info {
  display: grid;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
}

.action-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.action-modal-row .label {
  color: var(--text-secondary);
}

.action-modal-row .value {
  color: var(--text-primary);
  font-weight: 600;
}

.action-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.action-modal-footer {
  padding: 0.9rem 1.25rem 1.1rem;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
}

.action-modal-actions .btn-primary {
  min-height: 44px;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #a547f73a, #4d1d953f);
  border: .1px solid #a547f765;
}

.action-modal-footer .btn-primary {
  min-height: 40px;
  border-radius: 0.85rem;
  padding: 0 1rem;
}

.action-link.primary {
  color: var(--brand-solid);
}

.action-link.danger {
  color: #ef4444;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: transparent;
}

.table-fixed {
  table-layout: fixed;
}

.col-username {
  width: 30%;
  text-align: left;
}

.col-role {
  width: 25%;
}

.col-actions {
  width: 45%;
}

.input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  font-size: 16px;
  color: var(--text-primary);
}

.input-compact {
  padding: 0.5rem 0.6rem;
  font-size: 15px;
}

.input-pin {
  font-size: 16px;
  letter-spacing: 0.08em;
}

.segmented {
  max-width: 36rem;
  margin: 0 auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  background: #f2f3f7;
  border: 1px solid #e5e7ef;
  border-radius: 1.1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.segment {
  border-radius: 0.95rem;
  padding: 0.4rem 0.7rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 300;
  border: 1px solid transparent;
  min-height: 44px;
  font-size: 14px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.segment:hover {
  background: rgba(255, 255, 255, 0.05);
}

.segment-active {
  background: rgba(126, 34, 206, 0.12);
  color: var(--brand-solid);
  border-color: rgba(126, 34, 206, 0.35);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  font-weight: 300;
}

.segment .iconify {
  color: var(--text-secondary);
}

.segment-active .iconify {
  color: var(--brand-solid);
}

.nav-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

[data-theme="dark"] .segmented {
  background: rgba(45, 55, 72, 0.6);
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .segment-active {
  border-color: #a8acbd27;
}

[data-theme="dark"] .segment {
  color: #ddddddc4;
}

[data-theme="dark"] .segment:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .segment-active {
  background: #4b5563;
  color: #e0e0e0c0;
}

[data-theme="dark"] .segment .iconify {
  color: #7e8194;
}

[data-theme="dark"] .segment-active .iconify {
  color: #e0e0e0c0;
}

[data-theme="dark"] .sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
}

.sidebar-item {
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 44px;
}

.sidebar-item-active {
  background: rgba(126, 34, 206, 0.08);
  color: var(--brand-solid);
}

.sidebar-item:hover {
  background: rgba(17, 24, 39, 0.04);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

@media (max-width: 639px) {
  .icon-btn {
    width: 44px;
    height: 44px;
  }
}

.icon-btn.btn-primary {
  background: var(--brand-solid);
  color: var(--brand-text-on);
  border: none;
}

.icon-btn.btn-primary:hover {
  background: var(--brand-solid-dark);
}

.icon-btn.inv-save {
  background: #16a34a79;
  border: 1px solid #24bb5cb9;
  color: #ffffff;
}

.icon-btn.inv-save:hover  {
  background: #16a34a00;
  border: 1px solid #24bb5b00;
  color: #ffffff;
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-btn-ghost {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.icon-btn-danger {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.18);
}

.qty-input {
  width: 6.5rem;
  text-align: right;
}

.muted {
  color: var(--text-secondary);
}

.unsaved {
  color: #f59e0b;
  font-size: 12px;
}

.toast {
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  max-width: 85vw;
  min-height: 36px;
  padding: 0.45rem 0.65rem;
  gap: 0.4rem;
  font-size: 0.85rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(6px);
  background: rgba(20, 22, 32, 0.6);
  color: #eef1ff;
}

.toast.toast-success {
  background: rgba(22, 163, 74, 0.18) !important;
  color: #e8ffe9 !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
}

.toast.toast-success .iconify {
  color: #ffffff;
}

.toast .iconify:first-child {
  font-size: 1rem;
}

.toast .icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 0.55rem;
}

.toast.toast-error {
  background: rgba(239, 68, 68, 0.18);
  color: #ffecec;
  border-color: rgba(248, 113, 113, 0.5);
}

.toast.toast-info {
  background: rgba(30, 41, 59, 0.6);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.45);
}

.toast.toast-brand {
  background: rgba(126, 34, 206, 0.18);
  color: #f5eaff;
  border-color: rgba(187, 138, 228, 0.5);
}

.footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.9rem 1rem 1.25rem;
  opacity: 0.9;
}

.announce-overlay {
  background: rgba(8, 10, 20, 0.7);
  backdrop-filter: blur(6px);
}

.announce-card {
  width: 92vw;
  max-width: 26rem;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-card);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.announce-top {
  background: transparent;
  color: var(--text-primary);
  padding: 1rem 1rem 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.announce-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.announce-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c39ae62f;
  color: #ead1ff;
  font-size: 18px;
  flex-shrink: 0;
}

.announce-type {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.announce-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.announce-close {
  width: 36px;
  height: 36px;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.announce-body {
  padding: 0.75rem 1rem 1rem;
  background: var(--bg-card);
}

.announce-image {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 0.9rem;
  border: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.announce-text {
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.5;
}

.announce-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.announce-check input {
  width: 16px;
  height: 16px;
  appearance: none;
  border-radius: 4px;
  border: 1px solid rgba(187, 138, 228, 0.6);
  background: rgba(255, 255, 255, 0.06);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}

.announce-check input::after {
  content: '';
  width: 8px;
  height: 8px;
  transform: scale(0);
  transition: transform 0.15s ease;
  border-radius: 2px;
  background: #ead1ff;
}

.announce-check input:checked {
  border-color: rgba(187, 138, 228, 0.9);
  background: rgba(195, 154, 230, 0.25);
}

.announce-check input:checked::after {
  transform: scale(1);
}

.announce-check input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(126, 34, 206, 0.25);
}

.announce-footer {
  padding: 0.9rem 1rem 1rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

[data-theme="dark"] .announce-card {
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .announce-image {
  border-color: rgba(255, 255, 255, 0.08);
}
.announce-header {
  background-color: var(--primary-20);
  color: #fff;
}

/* Form fields dark-mode adjustments */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-secondary) !important;
}

.bg-white,
.bg-gray-100,
.bg-gray-200 {
  background-color: var(--bg-card) !important;
}

.text-gray-600,
.text-gray-700,
.text-gray-500,
.text-gray-400 {
  color: var(--text-secondary) !important;
}

.text-gray-800,
.text-gray-900,
.text-black {
  color: var(--text-primary) !important;
}

.border,
.border-b,
.border-t,
.border-l,
.border-r {
  border-color: var(--border-color) !important;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity .2s;
}

.fade-enter,
.fade-leave-to {
  opacity: 0;
}

.page-loader {
  background: rgba(8, 10, 20, 0.72);
  backdrop-filter: blur(6px);
}

.page-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.4rem 1.6rem;
  border-radius: 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.page-loader-spinner {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 3px solid rgba(234, 209, 255, 0.35);
  border-top-color: var(--brand-solid);
  animation: spin 0.8s linear infinite;
}

.page-loader-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scaleIn {
  from {
    transform: scale(.7);
  }

  to {
    transform: scale(1);
  }
}

.animate-scaleIn {
  animation: scaleIn .15s ease-out;
}

body {
  font-family: "Noto Sans Thai", Sarabun, ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter,
.fade-leave-to {
  opacity: 0;
}

.fade-enter-active, .fade-leave-active {
  transition: opacity 0.3s ease;
}
.fade-enter, .fade-leave-to {
  opacity: 0;
}
