/* ===========================================================
 * Game Trade Platform — Theme
 *  Glassmorphism + Flat Design · 暖色乳白 (warm cream)
 *  Built on Bootstrap 5; only overrides + new utility classes.
 * =========================================================== */

:root {
  /* === Palette ============================================== */
  --bg:           #FAF5EC;
  --bg-2:         #FFF8EE;
  --bg-3:         #F2EADA;
  --surface:      rgba(255, 255, 255, 0.62);
  --surface-2:    rgba(255, 252, 245, 0.78);
  --surface-3:    rgba(255, 255, 255, 0.92);
  --border:       rgba(196, 162, 117, 0.22);
  --border-soft:  rgba(196, 162, 117, 0.12);
  --border-strong:rgba(168, 130, 80, 0.45);
  --shadow-sm:    0 2px 8px  rgba(120, 90, 50, 0.06);
  --shadow-md:    0 8px 24px rgba(120, 90, 50, 0.10);
  --shadow-lg:    0 18px 50px rgba(120, 90, 50, 0.14);
  --shadow-glow:  0 0 0 4px  rgba(200, 148, 93, 0.12);

  --text:         #3A2E20;
  --text-2:       #5C4D3B;
  --text-dim:     #8A7A66;
  --text-soft:    #B0A28C;

  --accent:        #C8945D;        /* warm gold */
  --accent-2:      #B17B43;        /* deeper gold */
  --accent-soft:   rgba(200, 148, 93, 0.14);
  --accent-tint:   rgba(200, 148, 93, 0.25);
  --coffee:        #8B6F47;
  --cream:         #F4E6CE;

  --success:       #6B8E5A;
  --success-soft:  rgba(107, 142, 90, 0.14);
  --danger:        #B85C50;
  --danger-soft:   rgba(184, 92, 80, 0.14);
  --warning:       #D4A574;
  --warning-soft:  rgba(212, 165, 116, 0.18);
  --info:          #6E91B5;
  --info-soft:     rgba(110, 145, 181, 0.16);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --header-h: 64px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --transition: cubic-bezier(.4, 0, .2, 1);
}

/* === Reset / base ========================================== */
* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 100% -10%, rgba(212, 165, 116, 0.18), transparent 55%),
    radial-gradient(900px 700px at -10% 110%, rgba(184, 145, 92, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  background-attachment: fixed;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }

::-webkit-scrollbar         { width: 10px; height: 10px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: var(--accent-tint); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* === Glass card ============================================ */
.glass-card {
  background: var(--surface);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
          backdrop-filter: saturate(140%) blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.glass-card-strong {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.glass-card-soft {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin: 0 0 .75rem 0;
}

/* === Buttons (override bootstrap) ========================== */
.btn { border-radius: var(--radius-sm); font-weight: 600; transition: all .18s var(--transition); }
.btn-sm { border-radius: 8px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: none;
  color: #fff;
  box-shadow: 0 6px 16px rgba(177, 123, 67, 0.25);
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--coffee) 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(177, 123, 67, 0.32);
}
.btn-outline-primary {
  border: 1px solid var(--border-strong);
  color: var(--accent-2);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-2);
  color: var(--accent-2);
}
.btn-soft {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-soft:hover { border-color: var(--accent-2); color: var(--accent-2); }

.btn-success { background: var(--success); border: none; color: #fff; }
.btn-success:hover { background: #5a7a4b; color: #fff; }
.btn-danger { background: var(--danger); border: none; color: #fff; }
.btn-danger:hover { background: #a04d43; color: #fff; }
.btn-link { color: var(--accent-2); text-decoration: none; }

/* === Forms ================================================= */
.form-control, .form-select {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .55rem .85rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  color: var(--text);
}
.form-control::placeholder { color: var(--text-soft); }
.form-label { color: var(--text-2); font-weight: 600; font-size: 13px; }

/* === Badges & pills ======================================== */
.badge-soft           { padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 11px; }
.badge-soft-success   { background: var(--success-soft); color: var(--success); }
.badge-soft-danger    { background: var(--danger-soft);  color: var(--danger);  }
.badge-soft-warning   { background: var(--warning-soft); color: #9b6b2e;        }
.badge-soft-info      { background: var(--info-soft);    color: var(--info);    }
.badge-soft-accent    { background: var(--accent-soft);  color: var(--accent-2);}
.badge-soft-neutral   { background: rgba(0,0,0,.04);     color: var(--text-2);  }

/* === Tables ================================================ */
.table-glass {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-glass thead th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(244, 230, 206, 0.55);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-glass tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--text-2);
  vertical-align: middle;
}
.table-glass tbody tr:last-child td { border-bottom: none; }
.table-glass tbody tr { transition: background .12s; }
.table-glass tbody tr:hover { background: rgba(244, 230, 206, 0.40); }
.table-glass td.right, .table-glass th.right { text-align: right; font-variant-numeric: tabular-nums; }
.table-glass td.center, .table-glass th.center { text-align: center; }

/* === Modal (Bootstrap override) ============================ */
.modal-content {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--border-soft); }
.modal-footer { border-top: 1px solid var(--border-soft); }

/* === Toast container ======================================= */
.toast-rack {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast-item {
  pointer-events: all;
  min-width: 240px; max-width: 360px;
  padding: 12px 16px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text);
  animation: toastIn .25s ease;
}
.toast-item.success { border-left: 3px solid var(--success); }
.toast-item.error   { border-left: 3px solid var(--danger);  }
.toast-item.warning { border-left: 3px solid var(--warning); }
.toast-item.info    { border-left: 3px solid var(--info);    }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* === Auth screens ========================================== */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 36px 36px 32px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; inset: -2px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.5), transparent 40%);
  z-index: -1;
  filter: blur(12px);
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.auth-brand .logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--coffee) 100%);
  display: grid; place-items: center;
  color: #fff; font-weight: 800;
  box-shadow: 0 8px 18px rgba(177, 123, 67, 0.30);
}
.auth-brand h1 {
  margin: 0; font-size: 20px;
  letter-spacing: 0.04em; color: var(--text);
}
.auth-brand small { color: var(--text-dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }

/* === Portal layout ========================================= */
.portal-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-areas:
    "header header"
    "side   main";
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns .25s var(--transition);
}
.portal-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}

.portal-header {
  grid-area: header;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
  z-index: 30;
}
.portal-header .left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.portal-header .right { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.brand-mark .logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--coffee) 100%);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 8px 18px rgba(177, 123, 67, 0.28);
}

/* org switcher */
.org-switch {
  position: relative;
  margin-left: 8px;
}
.org-switch-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent-2);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background .15s;
}
.org-switch-btn:hover { background: var(--accent-tint); }
.org-switch-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 280px; max-height: 360px; overflow-y: auto;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  z-index: 80;
}
.org-switch-menu.show { display: block; }
.org-switch-menu a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 8px;
  color: var(--text); font-size: 13px; font-weight: 500;
}
.org-switch-menu a:hover { background: var(--accent-soft); }
.org-switch-menu .add {
  margin-top: 4px;
  border-top: 1px solid var(--border-soft);
  padding-top: 8px;
  color: var(--accent-2);
  font-weight: 600;
}

/* user menu */
.user-menu { position: relative; }
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--border);
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--accent-2);
  font-weight: 700;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 240px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 10px;
  display: none;
  z-index: 80;
}
.user-menu-panel.show { display: block; }
.user-menu-panel .item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.user-menu-panel .item:hover { background: var(--accent-soft); color: var(--accent-2); }
.user-menu-panel hr { margin: 6px 0; border-color: var(--border-soft); }

/* sidebar */
.portal-sidebar {
  grid-area: side;
  background: var(--surface-3);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px 12px 24px;
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
}
.nav-section { margin-bottom: 14px; }
.nav-section-label {
  padding: 6px 14px 4px;
  color: var(--text-soft);
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 700;
}
.nav-link-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
  white-space: nowrap;
  position: relative;
}
.nav-link-item .icon {
  width: 20px; height: 20px;
  display: inline-grid; place-items: center;
  font-size: 16px;
  color: var(--accent-2);
  flex-shrink: 0;
}
.nav-link-item:hover { background: var(--accent-soft); color: var(--accent-2); }
.nav-link-item.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 14px rgba(177, 123, 67, 0.25);
}
.nav-link-item.active .icon { color: #fff; }
.nav-link-item .badge {
  margin-left: auto;
  font-size: 10px;
  background: var(--danger);
  color: #fff;
  padding: 2px 7px; border-radius: 999px;
}
.nav-link-item .caret {
  margin-left: auto;
  font-size: 12px;
  transition: transform .15s;
}
.nav-link-item.expanded .caret { transform: rotate(90deg); }
.nav-children {
  margin-left: 12px;
  border-left: 1px dashed var(--border);
  padding-left: 6px;
  display: none;
}
.nav-children.show { display: block; }
.nav-children .nav-link-item { padding: 8px 12px; font-size: 12.5px; }

/* sidebar collapsed */
.sidebar-collapsed .portal-sidebar { padding: 14px 6px 24px; }
.sidebar-collapsed .nav-link-item { justify-content: center; padding: 10px; }
.sidebar-collapsed .nav-link-item .label,
.sidebar-collapsed .nav-link-item .badge,
.sidebar-collapsed .nav-link-item .caret,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .nav-children { display: none; }

/* main */
.portal-main {
  grid-area: main;
  overflow-y: auto;
  padding: 24px 28px 60px;
}
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.page-header h1 {
  margin: 0; font-size: 24px; font-weight: 700;
  color: var(--text);
}
.page-header .sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* stat cards */
.stat-card {
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; right: -18px; top: -18px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: var(--accent-soft);
  filter: blur(2px);
  opacity: .9;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.stat-card .value { font-size: 24px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-card .trend { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.stat-card .icon-bubble {
  position: absolute; right: 14px; top: 14px;
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-2);
  display: grid; place-items: center;
  font-size: 18px;
  z-index: 1;
}

/* compact responsive */
@media (max-width: 880px) {
  .portal-shell { grid-template-columns: 0 1fr; }
  .portal-shell.mobile-open { grid-template-columns: var(--sidebar-w) 1fr; }
  .portal-sidebar { box-shadow: var(--shadow-lg); }
}

/* spinner */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--accent-tint);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* misc */
.text-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent-2); }
.divider { height: 1px; background: var(--border-soft); margin: 16px 0; }

.empty {
  padding: 40px 20px; text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.empty .icon { font-size: 38px; margin-bottom: 8px; opacity: .7; }

/* ===========================================================
 * Dashboard widget grid (gridstack)
 * =========================================================== */
.gs-shell { position: relative; }
.gs-shell .grid-stack { background: transparent; }
.gs-shell .grid-stack-item-content {
  inset: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
}
.gs-shell .grid-stack-item-content > * {
  height: 100%;
  margin: 0 !important;
}

.gs-shell.editing .grid-stack-item-content {
  outline: 2px dashed var(--accent-tint);
  outline-offset: -4px;
  cursor: move;
  transition: outline-color .15s var(--transition);
}
.gs-shell.editing .grid-stack-item-content:hover {
  outline-color: var(--accent);
}
.gs-shell:not(.editing) .ui-resizable-handle { display: none !important; }

.gs-shell .ui-resizable-se {
  width: 14px; height: 14px;
  right: 6px; bottom: 6px;
  background: none;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  border-bottom-right-radius: 4px;
  opacity: .7;
}
.gs-shell .grid-stack > .grid-stack-placeholder > .placeholder-content {
  background: var(--accent-soft);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
}

.gs-toolbar {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.gs-toolbar .btn { border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; }

/* widget hide menu (kebab) */
.widget-menu-btn {
  position: absolute;
  top: 8px; right: 10px;
  width: 26px; height: 26px;
  border: none; background: transparent;
  color: var(--text-dim);
  border-radius: 6px;
  z-index: 5;
  display: none;
  align-items: center; justify-content: center;
}
.gs-shell.editing .widget-menu-btn { display: inline-flex; }
.widget-menu-btn:hover { background: var(--accent-soft); color: var(--accent-2); }

/* Account-records table — fixed-layout cell content truncation */
#acct-table.table-glass {
  /* Sticky thead needs the table itself NOT to be the scrolling ancestor.
     The base .table-glass uses overflow:hidden (for rounded corners), but
     that breaks sticky inside — override here. */
  overflow: visible;
}
/* In Safari / older Chrome, a single `position:sticky` on `thead` is ignored
   because table-row groups aren't a containing block. We apply it on the
   `th` cells AND wrap the table with a sticky `thead` for double-safety. */
#acct-table.table-glass thead {
  position: sticky;
  top: 0;
  z-index: 5;
}
#acct-table.table-glass thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-3);
  box-shadow: inset 0 -1px 0 var(--border);
  padding: 10px 8px;
}
#acct-table.table-glass td,
#acct-table.table-glass th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 8px;
}
/* 玩家暱稱 cell (col 3) needs overflow:visible so the autocomplete
   dropdown can extend beyond the cell width. */
#acct-table.table-glass tbody td:nth-child(3),
#acct-table.table-glass tfoot td:nth-child(3) {
  overflow: visible;
}
/* Hide native number-input spinners inside the records table — they
   eat horizontal space and make tight columns unreadable. */
#acct-table input[type="number"]::-webkit-inner-spin-button,
#acct-table input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#acct-table input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Match book selected row */
.table-row-sel { background: var(--accent-soft) !important; }
.table-row-sel:hover { background: var(--accent-tint) !important; }

/* Copy-on-click affordance */
.copyable {
  cursor: copy;
  position: relative;
  transition: background .1s;
}
.copyable:hover { background: var(--accent-soft); }
.copyable:active { background: var(--accent-tint); }
.copyable::after {
  content: '\F32D'; /* bi-clipboard */
  font-family: 'bootstrap-icons';
  font-size: 10px;
  color: var(--text-soft);
  opacity: 0;
  margin-left: 4px;
  transition: opacity .1s;
}
.copyable:hover::after { opacity: 0.6; }

/* PLAYER_BUY 出幣 active bucket — highlight which one auto-fills */
input.buy-bucket-active {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  font-weight: 700;
}
.e-out-guild, .e-out-nonguild { cursor: pointer; }

/* Inline-edit copy icon — small absolute pin */
.copy-pin {
  position: absolute;
  right: 4px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); cursor: pointer; font-size: 10px;
  opacity: 0; transition: opacity .15s;
  z-index: 4;
}
.copy-pin-wrap:hover .copy-pin { opacity: 1; }
.copy-pin:hover { background: var(--accent-soft); color: var(--accent-2); }

/* Bank-flow mini table — used at top of records page */
.bank-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.bank-mini th,
.bank-mini td {
  padding: 4px 8px;
  white-space: nowrap;
  text-align: right;
}
.bank-mini thead th {
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-soft);
}
.bank-mini tbody th {
  text-align: left;
  font-weight: 500;
  border-right: 1px solid var(--border-soft);
}
.bank-mini tbody tr:not(:last-child) td,
.bank-mini tbody tr:not(:last-child) th { border-bottom: 1px dashed var(--border-soft); }
#acct-table.table-glass td .form-control,
#acct-table.table-glass td .form-select {
  width: 100%;
  min-width: 0;       /* allow shrinking inside narrow cells */
}
/* Allow the 備註/憑證 column (which has stacked inputs) to wrap */
#acct-table.table-glass td:nth-child(13) { white-space: normal; }
#acct-table.table-glass td:nth-child(13) > .small,
#acct-table.table-glass td:nth-child(13) {
  word-break: break-word;
}
/* Date / select inside cells should not blow up min-width */
#acct-table.table-glass input[type="date"] { padding-left:6px; padding-right:4px; }
