:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-soft: #1f2430;
  --text: #f3f5f9;
  --muted: #9aa4b2;
  --gold: #d4af37;
  --gold-dark: #8a6a12;
  --border: #2a303b;
  --success: #2ea86b;
  --danger: #dc5b55;
  --warning: #d99b1d;
  --info: #3a74d8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: radial-gradient(circle at top, #242a36 0, var(--bg) 45%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  background: rgba(23, 26, 33, 0.96);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.login-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  margin-bottom: 14px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0 0 10px;
  font-size: 30px;
}

.login-copy {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form span {
  color: #d7dbe3;
  font-size: 14px;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--border);
  background: #0f131a;
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
}

.primary-button,
.ghost-button,
.table-action {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(180deg, #e2c15a 0%, var(--gold-dark) 100%);
  color: #111;
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.form-error {
  margin: 0;
  color: #ff9a95;
  font-size: 14px;
}

.login-hint {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 14px;
}

.dashboard-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(13, 16, 22, 0.95);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(180deg, #f4d67e 0%, var(--gold-dark) 100%);
  color: #111;
  font-weight: 800;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-link[hidden] {
  display: none;
}

.nav-link {
  border: 0;
  background: transparent;
  color: #d8dde6;
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
}

.sidebar-footer {
  margin-top: auto;
}

.main-panel {
  padding: 28px;
}

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

.page-header h2 {
  margin: 0;
  font-size: 30px;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.header-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.role-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: #e8d8a0;
  font-size: 14px;
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.notice.info {
  background: rgba(58, 116, 216, 0.12);
  border-color: rgba(58, 116, 216, 0.28);
}

.notice.success {
  background: rgba(46, 168, 107, 0.12);
  border-color: rgba(46, 168, 107, 0.28);
}

.notice.warning {
  background: rgba(217, 155, 29, 0.12);
  border-color: rgba(217, 155, 29, 0.28);
}

.notice.error {
  background: rgba(220, 91, 85, 0.12);
  border-color: rgba(220, 91, 85, 0.28);
}

.content-section {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card,
.panel-card,
.table-card {
  background: rgba(23, 26, 33, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

.stat-card {
  padding: 20px;
}

.stat-label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card strong {
  font-size: 28px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel-card {
  padding: 20px;
}

.panel-card h3,
.section-heading h3 {
  margin: 0 0 8px;
}

.simple-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
  color: #d9dde5;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar input,
.toolbar select {
  border: 1px solid var(--border);
  background: #0f131a;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
}

.toolbar input {
  flex: 1;
}

.table-card {
  overflow: hidden;
}

.deposit-account-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-bottom: 16px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-form-grid label {
  display: grid;
  gap: 8px;
  color: #d7dbe3;
  font-size: 14px;
}

.account-form-grid input,
.account-form-grid textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #0f131a;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
}

.account-form-grid textarea {
  resize: vertical;
  min-height: 96px;
}

.account-form-span {
  grid-column: 1 / -1;
}

.account-toggle {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.account-toggle input {
  width: auto;
}

.account-form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.deposit-preview-card {
  display: grid;
  gap: 16px;
}

.deposit-preview-text strong,
.deposit-preview-text span {
  display: block;
}

.deposit-preview-text span {
  margin-top: 8px;
}

.deposit-qr-frame {
  min-height: 280px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.deposit-qr-frame img {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.chat-list-card,
.chat-panel-card {
  background: rgba(23, 26, 33, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

.chat-list-card {
  overflow: hidden;
}

.chat-list-header,
.chat-panel-top,
.chat-reply-form {
  padding: 16px 18px;
}

.chat-list-header,
.chat-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-list {
  display: grid;
}

.chat-list-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.chat-list-item:hover,
.chat-list-item.active {
  background: rgba(212, 175, 55, 0.08);
}

.chat-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chat-list-row strong {
  font-size: 15px;
}

.chat-preview {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.chat-panel-card {
  display: flex;
  flex-direction: column;
  min-height: 560px;
}

.chat-panel-top h4 {
  margin: 0 0 6px;
  font-size: 22px;
}

.chat-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-controls select,
.chat-reply-form textarea {
  border: 1px solid var(--border);
  background: #0f131a;
  color: var(--text);
  border-radius: 14px;
}

.chat-controls select {
  padding: 12px 14px;
}

.chat-messages {
  flex: 1;
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.02));
}

.chat-bubble {
  max-width: min(78%, 620px);
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.5;
}

.chat-bubble.user {
  background: rgba(58, 116, 216, 0.18);
  border: 1px solid rgba(58, 116, 216, 0.26);
}

.chat-bubble.staff {
  justify-self: end;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.22);
}

.chat-bubble-meta {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.chat-reply-form {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 12px;
}

.chat-reply-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 100px;
  padding: 14px 16px;
}

.chat-reply-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.empty-chat {
  color: var(--muted);
  padding: 32px 12px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 18px;
}

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

thead {
  background: rgba(255, 255, 255, 0.03);
}

th,
td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-action {
  padding: 9px 12px;
  border-radius: 12px;
  color: #111;
}

.table-action.add {
  background: #46c3dd;
}

.table-action.cut {
  background: #f1c04e;
}

.table-action.reset,
.table-action.reject {
  background: #eb776f;
  color: #fff;
}

.table-action.approve {
  background: #57c484;
}

.table-action.edit {
  background: #46c3dd;
}

.table-action.delete {
  background: #eb776f;
  color: #fff;
}

.status-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill.pending {
  background: rgba(217, 155, 29, 0.12);
  color: #efc352;
}

.status-pill.open {
  background: rgba(58, 116, 216, 0.12);
  color: #7fb0ff;
}

.status-pill.waiting {
  background: rgba(217, 155, 29, 0.12);
  color: #efc352;
}

.status-pill.approved {
  background: rgba(46, 168, 107, 0.12);
  color: #67d196;
}

.status-pill.rejected {
  background: rgba(220, 91, 85, 0.12);
  color: #f18d88;
}

.status-pill.resolved {
  background: rgba(46, 168, 107, 0.12);
  color: #67d196;
}

.status-pill.inactive {
  background: rgba(255, 255, 255, 0.08);
  color: #c3ccd8;
}

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

@media (max-width: 1024px) {
  .dashboard-screen {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .stats-grid,
  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .deposit-account-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-panel {
    padding: 18px;
  }

  .page-header,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .chat-list-header,
  .chat-panel-top,
  .chat-controls,
  .chat-reply-actions,
  .account-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .account-form-grid {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 12px;
  }
}
