/* Enterprise Backoffice Template */

.eb-root {
  display: flex;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
  font-size: 13px;
  color: #0f172a;
  background: #f8fafc;
  overflow: hidden;
}

/* ── Sidebar ── */
.eb-sidebar {
  width: 220px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  transition: width 0.2s ease, min-width 0.2s ease;
  overflow: hidden;
}

.eb-sidebar.collapsed { width: 52px; min-width: 52px; }

.eb-sidebar-header {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.eb-brand { display: flex; align-items: center; gap: 8px; overflow: hidden; }

.eb-brand-abbr {
  width: 28px; height: 28px; border-radius: 6px;
  background: #1d4ed8; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.eb-brand-name { font-size: 12px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; }
.eb-sidebar.collapsed .eb-brand-name { display: none; }

.eb-collapse-btn {
  width: 28px; height: 28px; border: 1px solid #e2e8f0; border-radius: 6px;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; flex-shrink: 0; transition: background 0.15s;
}
.eb-collapse-btn:hover { background: #f1f5f9; }

.eb-nav {
  flex: 1; padding: 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto; overflow-x: hidden;
}

.eb-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  text-decoration: none; color: #475569;
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.eb-nav-item:hover { background: #f1f5f9; color: #0f172a; }
.eb-nav-item.active { background: #eff6ff; color: #1d4ed8; font-weight: 600; }

.eb-nav-icon { width: 16px; height: 16px; flex-shrink: 0; }
.eb-nav-label { overflow: hidden; }

.eb-sidebar.collapsed .eb-nav-label { display: none; }
.eb-sidebar.collapsed .eb-nav-item { justify-content: center; padding: 8px; }

.eb-sidebar-footer {
  padding: 10px 8px; border-top: 1px solid #e2e8f0; flex-shrink: 0;
}

.eb-user-row { display: flex; align-items: center; gap: 10px; overflow: hidden; }

.eb-avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: #1d4ed8; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.eb-avatar.sm { width: 28px; height: 28px; border-radius: 6px; font-size: 10px; }

.eb-user-info { overflow: hidden; }
.eb-user-name { font-size: 12px; font-weight: 600; white-space: nowrap; }
.eb-user-role { font-size: 11px; color: #94a3b8; white-space: nowrap; }

.eb-sidebar.collapsed .eb-user-info { display: none; }
.eb-sidebar.collapsed .eb-user-row { justify-content: center; }

/* ── Main ── */
.eb-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.eb-topbar {
  min-height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: #fff; border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

.eb-topbar-left { display: flex; align-items: center; gap: 10px; }
.eb-page-title { font-size: 13px; font-weight: 600; color: #0f172a; }
.eb-topbar-right { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #64748b; flex-wrap: wrap; justify-content: flex-end; }
.eb-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.eb-topbar-sep { width: 1px; height: 16px; background: #e2e8f0; margin: 0 4px; }
.eb-datetime { font-size: 12px; color: #94a3b8; }

/* ── Sections ── */
.eb-section {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.eb-section.hidden { display: none; }

/* ── Metrics ── */
.eb-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.eb-metric { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px 16px; }
.eb-metric-label { font-size: 11px; color: #64748b; font-weight: 500; margin-bottom: 6px; }
.eb-metric-value { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.eb-metric-delta { font-size: 11px; margin-top: 4px; }
.eb-metric-delta.up   { color: #16a34a; }
.eb-metric-delta.warn { color: #d97706; }

/* ── Grid ── */
.eb-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* ── Card ── */
.eb-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; }
.eb-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.eb-card-title { font-size: 12.5px; font-weight: 600; color: #0f172a; }

.eb-badge { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 20px; background: #f1f5f9; color: #475569; }
.eb-badge.green { background: #dcfce7; color: #16a34a; }

.eb-divider { height: 1px; background: #f1f5f9; margin: 14px 0; }

/* ── Activity ── */
.eb-activity-list { display: flex; flex-direction: column; gap: 12px; }
.eb-activity-item { display: flex; gap: 10px; align-items: flex-start; }
.eb-activity-icon { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.eb-activity-icon.blue   { background: #eff6ff; color: #1d4ed8; }
.eb-activity-icon.green  { background: #f0fdf4; color: #16a34a; }
.eb-activity-icon.yellow { background: #fffbeb; color: #d97706; }
.eb-activity-icon.red    { background: #fef2f2; color: #dc2626; }
.eb-activity-title { font-size: 12px; font-weight: 600; color: #0f172a; }
.eb-activity-desc  { font-size: 11px; color: #64748b; margin-top: 2px; }

/* ── Status ── */
.eb-status-list { display: flex; flex-direction: column; gap: 8px; }
.eb-status-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #334155; }
.eb-status-right { display: flex; align-items: center; gap: 6px; }
.eb-dot { width: 7px; height: 7px; border-radius: 50%; }
.eb-dot.green  { background: #22c55e; }
.eb-dot.yellow { background: #f59e0b; }
.eb-dot.red    { background: #ef4444; }
.eb-latency { font-size: 11px; color: #94a3b8; min-width: 36px; text-align: right; }

/* ── Quick actions ── */
.eb-quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.eb-quick-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 6px;
  background: #f8fafc; font-size: 11.5px; font-weight: 500; color: #334155;
  cursor: pointer; transition: background 0.12s;
}
.eb-quick-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }

/* ── Table ── */
.eb-table-wrap { overflow-x: auto; }
.eb-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.eb-table th {
  text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600;
  color: #64748b; background: #f8fafc; border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
.eb-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.eb-table tr:last-child td { border-bottom: none; }
.eb-table tr:hover td { background: #f8fafc; }

.eb-user-cell { display: flex; align-items: center; gap: 8px; }
.eb-cell-name  { font-size: 12px; font-weight: 600; color: #0f172a; }
.eb-cell-email { font-size: 11px; color: #94a3b8; }

.eb-role-tag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: #f1f5f9; color: #475569; white-space: nowrap; }
.eb-role-tag.admin  { background: #eff6ff; color: #1d4ed8; }
.eb-role-tag.viewer { background: #f0fdf4; color: #16a34a; }

.eb-status-tag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.eb-status-tag.active   { background: #dcfce7; color: #16a34a; }
.eb-status-tag.inactive { background: #fef2f2; color: #dc2626; }

.eb-code { font-family: "SF Mono","Cascadia Code","Courier New",monospace; font-size: 11px; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; color: #334155; }

/* ── Role bars ── */
.eb-role-rows { display: flex; flex-direction: column; gap: 10px; }
.eb-role-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #334155; }
.eb-role-row > span:first-child { width: 80px; flex-shrink: 0; }
.eb-role-bar-wrap { flex: 1; height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.eb-role-bar { height: 100%; background: #1d4ed8; border-radius: 3px; }
.eb-role-count { font-size: 11px; color: #94a3b8; width: 24px; text-align: right; }

/* ── Org ── */
.eb-org-list { display: flex; flex-direction: column; gap: 10px; }
.eb-org-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #334155; }
.eb-org-row > span:nth-child(2) { flex: 1; }
.eb-org-count { font-size: 11px; color: #94a3b8; font-weight: 600; }

/* ── Settings ── */
.eb-setting-list { display: flex; flex-direction: column; gap: 14px; }
.eb-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eb-setting-label { font-size: 12px; font-weight: 600; color: #0f172a; }
.eb-setting-desc  { font-size: 11px; color: #64748b; margin-top: 2px; }

.eb-toggle { width: 36px; height: 20px; border-radius: 10px; background: #e2e8f0; flex-shrink: 0; position: relative; cursor: pointer; transition: background 0.2s; }
.eb-toggle::after { content:''; position:absolute; top:3px; left:3px; width:14px; height:14px; border-radius:50%; background:#fff; transition:transform 0.2s; box-shadow:0 1px 3px rgba(0,0,0,.15); }
.eb-toggle.active { background: #1d4ed8; }
.eb-toggle.active::after { transform: translateX(16px); }

/* ── Info ── */
.eb-info-list { display: flex; flex-direction: column; gap: 10px; }
.eb-info-row { display: flex; justify-content: space-between; font-size: 12px; color: #475569; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.eb-info-row:last-child { border-bottom: none; padding-bottom: 0; }
.eb-info-val { font-weight: 600; color: #0f172a; }

/* ── Backup ── */
.eb-backup-list { display: flex; flex-direction: column; gap: 12px; }
.eb-backup-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ── Buttons ── */
.eb-btn-primary {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: #1d4ed8; color: #fff; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.12s;
}
.eb-btn-primary:hover { background: #1e40af; }

.eb-btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  background: transparent; color: #64748b; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; cursor: pointer; transition: background 0.12s;
}
.eb-btn-ghost:hover { background: #f8fafc; }

/* ── Order / Inventory specific ── */
.eb-mono { font-family: "SF Mono","Cascadia Code","Courier New",monospace; font-size: 11px; }

.eb-status-tag.shipped { background: #eff6ff; color: #1d4ed8; }
.eb-status-tag.pending { background: #fffbeb; color: #d97706; }
.eb-status-tag.unpaid  { background: #fef2f2; color: #dc2626; }

.eb-qty.warn { color: #dc2626; font-weight: 700; }

/* ── Toolbar ── */
.eb-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.eb-filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eb-toolbar-right { display: flex; align-items: center; gap: 8px; }

.eb-select {
  height: 32px; padding: 0 10px;
  border: 1px solid #e2e8f0; border-radius: 6px;
  background: #fff; font-size: 12px; color: #334155; cursor: pointer;
}

.eb-input {
  height: 32px; padding: 0 10px; width: 220px;
  border: 1px solid #e2e8f0; border-radius: 6px;
  background: #fff; font-size: 12px; color: #334155;
  outline: none;
}
.eb-input:focus { border-color: #1d4ed8; }

/* ── Payment summary ── */
.eb-payment-summary { display: flex; flex-direction: column; gap: 10px; }
.eb-payment-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.eb-payment-label { display: flex; align-items: center; gap: 6px; width: 60px; flex-shrink: 0; }
.eb-payment-bar-wrap { flex: 1; height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.eb-payment-bar { height: 100%; border-radius: 3px; }
.eb-payment-val { font-size: 12px; font-weight: 600; color: #0f172a; min-width: 90px; text-align: right; }

/* ── Alert list ── */
.eb-alert-list { display: flex; flex-direction: column; gap: 8px; }
.eb-alert-item { display: flex; align-items: flex-start; gap: 7px; font-size: 11.5px; color: #d97706; }
.eb-alert-item strong { color: #dc2626; }

.eb-badge.warn { background: #fffbeb; color: #d97706; }

/* ── Dashboard quick link ── */
.eb-link { font-size: 11.5px; color: #1d4ed8; text-decoration: none; font-weight: 500; }
.eb-link:hover { text-decoration: underline; }

/* ── Export list ── */
.eb-export-list { display: flex; flex-direction: column; gap: 14px; }
.eb-export-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ── Contrib list ── */
.eb-contrib-list { display: flex; flex-direction: column; gap: 12px; }
.eb-contrib-row { display: flex; align-items: center; gap: 10px; font-size: 12px; min-width: 0; }
.eb-contrib-name { width: 90px; flex-shrink: 0; color: #334155; word-break: break-word; }
.eb-contrib-val { font-size: 12px; font-weight: 600; color: #0f172a; min-width: 80px; text-align: right; }

/* ── Vaeron Brand Overlay ── */

/* Sidebar — 換成 Vaeron 深色 */
.eb-sidebar {
  background: #0f1014;
  border-right: 1px solid rgba(212, 168, 85, 0.12);
}

.eb-sidebar-header {
  border-bottom: 1px solid rgba(212, 168, 85, 0.1);
}

.eb-brand-abbr {
  background: transparent;
  border: 1px solid rgba(212, 168, 85, 0.4);
  color: #D4A855;
  font-family: "IBM Plex Mono", monospace;
}

.eb-brand-name {
  color: #FAFAF8;
  font-family: "Inter", sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.3px;
}

.eb-collapse-btn {
  border-color: rgba(212, 168, 85, 0.15);
  color: rgba(250, 250, 248, 0.4);
  background: transparent;
}
.eb-collapse-btn:hover {
  background: rgba(212, 168, 85, 0.06);
  border-color: rgba(212, 168, 85, 0.25);
}

/* Nav items */
.eb-nav-item {
  color: rgba(250, 250, 248, 0.5);
  font-size: 12px;
}
.eb-nav-item:hover {
  background: rgba(212, 168, 85, 0.06);
  color: rgba(250, 250, 248, 0.85);
}
.eb-nav-item.active {
  background: rgba(212, 168, 85, 0.1);
  color: #D4A855;
  font-weight: 600;
}

/* Sidebar footer */
.eb-sidebar-footer {
  border-top: 1px solid rgba(212, 168, 85, 0.1);
}

.eb-avatar {
  background: rgba(212, 168, 85, 0.15);
  color: #D4A855;
  border: 1px solid rgba(212, 168, 85, 0.25);
  font-family: "IBM Plex Mono", monospace;
}
.eb-avatar.sm {
  background: rgba(212, 168, 85, 0.1);
  color: #D4A855;
  border: 1px solid rgba(212, 168, 85, 0.2);
}

.eb-user-name { color: rgba(250, 250, 248, 0.85); }
.eb-user-role { color: rgba(250, 250, 248, 0.3); }

/* Topbar — 細節融入 */
.eb-topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.eb-page-title {
  font-family: "Inter", sans-serif;
  color: #0f172a;
  font-size: 13px;
  letter-spacing: 0.1px;
}

/* Primary button — 換成金色 */
.eb-btn-primary {
  background: #D4A855;
  color: #0A0A0B;
  font-weight: 700;
}
.eb-btn-primary:hover { background: #E8C47E; }

/* Role bar — 換成金色 */
.eb-role-bar { background: #D4A855; }

/* Contrib bar — 換成金色 */
.eb-contrib-list .eb-role-bar { background: #D4A855; }

/* Active status dot */
.eb-status-dot { background: #D4A855; }

/* Metric value font */
.eb-metric-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
}

/* Table header subtle gold tint */
.eb-table th {
  background: #f8fafc;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

/* ── Animation ── */

@keyframes eb-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes eb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.eb-animate {
  opacity: 0;
  animation: eb-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.eb-animate-delay-1 { animation-delay: 0.05s; }
.eb-animate-delay-2 { animation-delay: 0.10s; }
.eb-animate-delay-3 { animation-delay: 0.15s; }
.eb-animate-delay-4 { animation-delay: 0.20s; }

/* Bar 初始從 0 開始，JS 觸發後再帶入 */
.eb-role-bar,
.eb-payment-bar,
.eb-contrib-list .eb-role-bar {
  width: 0 !important;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Metric value */
.eb-metric-value {
  transition: opacity 0.3s;
}

/* Typewriter cursor */
.eb-typewriter::after {
  content: '|';
  color: #D4A855;
  animation: eb-blink 0.8s step-end infinite;
  margin-left: 1px;
}

@keyframes eb-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.preview-wrapper.tablet .eb-root,
.preview-wrapper.mobile .eb-root{overflow:auto;flex-direction:column;}

.preview-wrapper.tablet .eb-sidebar,
.preview-wrapper.mobile .eb-sidebar{
  width:100%;
  min-width:0;
  border-right:none;
  border-bottom:1px solid rgba(212, 168, 85, 0.12);
}

.preview-wrapper.tablet .eb-sidebar.collapsed,
.preview-wrapper.mobile .eb-sidebar.collapsed{width:100%;min-width:0;}

.preview-wrapper.tablet .eb-sidebar.collapsed .eb-brand-name,
.preview-wrapper.tablet .eb-sidebar.collapsed .eb-nav-label,
.preview-wrapper.tablet .eb-sidebar.collapsed .eb-user-info,
.preview-wrapper.mobile .eb-sidebar.collapsed .eb-brand-name,
.preview-wrapper.mobile .eb-sidebar.collapsed .eb-nav-label,
.preview-wrapper.mobile .eb-sidebar.collapsed .eb-user-info{display:block;}

.preview-wrapper.tablet .eb-sidebar.collapsed .eb-nav-item,
.preview-wrapper.mobile .eb-sidebar.collapsed .eb-nav-item{justify-content:flex-start;padding:8px 10px;}

.preview-wrapper.tablet .eb-sidebar.collapsed .eb-user-row,
.preview-wrapper.mobile .eb-sidebar.collapsed .eb-user-row{justify-content:flex-start;}

.preview-wrapper.tablet .eb-nav,
.preview-wrapper.mobile .eb-nav{
  flex-direction:row;
  flex-wrap:wrap;
  gap:8px;
}

.preview-wrapper.tablet .eb-nav-item{flex:1 1 180px;}
.preview-wrapper.tablet .eb-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}
.preview-wrapper.tablet .eb-grid-2{grid-template-columns:1fr;}
.preview-wrapper.tablet .eb-topbar-right{justify-content:flex-start;}
.preview-wrapper.tablet .eb-export-row,
.preview-wrapper.tablet .eb-backup-row,
.preview-wrapper.tablet .eb-setting-row,
.preview-wrapper.tablet .eb-info-row{flex-wrap:wrap;}

.preview-wrapper.mobile .eb-sidebar{padding:12px 0 0;}
.preview-wrapper.mobile .eb-sidebar-header,
.preview-wrapper.mobile .eb-topbar,
.preview-wrapper.mobile .eb-section{padding-left:16px;padding-right:16px;}
.preview-wrapper.mobile .eb-sidebar-footer{padding-left:16px;padding-right:16px;display:none;}
.preview-wrapper.mobile .eb-sidebar-header{align-items:flex-start;}
.preview-wrapper.mobile .eb-brand{min-width:0;}
.preview-wrapper.mobile .eb-brand-name{white-space:normal;}
.preview-wrapper.mobile .eb-nav{padding:10px 16px 16px;}
.preview-wrapper.mobile .eb-nav-item{flex:1 1 calc(50% - 8px);}
.preview-wrapper.mobile .eb-main{overflow:visible;}
.preview-wrapper.mobile .eb-section{padding:14px 12px;gap:10px;}
.preview-wrapper.mobile .eb-metrics,
.preview-wrapper.mobile .eb-grid-2{grid-template-columns:1fr;}
.preview-wrapper.mobile .eb-card,
.preview-wrapper.mobile .eb-metric{padding:14px;}
.preview-wrapper.mobile .eb-card-head{flex-wrap:wrap;gap:8px;}
.preview-wrapper.mobile .eb-toolbar{align-items:stretch;}
.preview-wrapper.mobile .eb-filter-group,
.preview-wrapper.mobile .eb-toolbar-right{width:100%;}
.preview-wrapper.mobile .eb-select,
.preview-wrapper.mobile .eb-input,
.preview-wrapper.mobile .eb-btn-primary,
.preview-wrapper.mobile .eb-btn-ghost{width:100%;justify-content:center;}
.preview-wrapper.mobile .eb-topbar-right{justify-content:flex-start;}
.preview-wrapper.mobile .eb-topbar-right .eb-topbar-sep,
.preview-wrapper.mobile .eb-datetime{display:none;}
.preview-wrapper.mobile .eb-payment-row,
.preview-wrapper.mobile .eb-contrib-row,
.preview-wrapper.mobile .eb-role-row,
.preview-wrapper.mobile .eb-status-row{flex-wrap:wrap;align-items:flex-start;}
.preview-wrapper.mobile .eb-payment-label,
.preview-wrapper.mobile .eb-contrib-name,
.preview-wrapper.mobile .eb-role-row > span:first-child{width:100%;}
.preview-wrapper.mobile .eb-payment-val,
.preview-wrapper.mobile .eb-contrib-val,
.preview-wrapper.mobile .eb-role-count,
.preview-wrapper.mobile .eb-latency{min-width:0;text-align:left;}
.preview-wrapper.mobile .eb-table th,
.preview-wrapper.mobile .eb-table td{padding-left:8px;padding-right:8px;}

@media (max-width: 1200px){
  .eb-root{overflow:auto;flex-direction:column;}
  .eb-sidebar{
    width:100%;
    min-width:0;
    border-right:none;
    border-bottom:1px solid rgba(212, 168, 85, 0.12);
  }
  .eb-sidebar.collapsed{width:100%;min-width:0;}
  .eb-sidebar.collapsed .eb-brand-name,
  .eb-sidebar.collapsed .eb-nav-label,
  .eb-sidebar.collapsed .eb-user-info{display:block;}
  .eb-sidebar.collapsed .eb-nav-item{justify-content:flex-start;padding:8px 10px;}
  .eb-sidebar.collapsed .eb-user-row{justify-content:flex-start;}
  .eb-nav{
    flex-direction:row;
    flex-wrap:wrap;
    gap:8px;
  }
  .eb-nav-item{flex:1 1 180px;}
  .eb-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}
  .eb-grid-2{grid-template-columns:1fr;}
}

@media (max-width: 900px){
  .eb-sidebar-header,
  .eb-topbar,
  .eb-section{padding-left:16px;padding-right:16px;}
  .eb-sidebar-footer{padding-left:16px;padding-right:16px;}
  .eb-topbar-right{justify-content:flex-start;}
  .eb-payment-label{width:84px;}
  .eb-export-row,
  .eb-backup-row,
  .eb-setting-row,
  .eb-info-row{flex-wrap:wrap;}
  .eb-toolbar-right{width:100%;justify-content:flex-start;}
  .eb-input{width:min(320px,100%);}
}

@media (max-width: 640px){
  .eb-sidebar{padding:12px 0 0;}
  .eb-sidebar-header{align-items:flex-start;}
  .eb-brand{min-width:0;}
  .eb-brand-name{white-space:normal;}
  .eb-nav{padding:10px 16px 16px;}
  .eb-nav-item{flex:1 1 100%;}
  .eb-sidebar-footer{display:none;}
  .eb-main{overflow:visible;}
  .eb-section{padding:14px 12px;gap:10px;}
  .eb-metrics{grid-template-columns:1fr;}
  .eb-card,
  .eb-metric{padding:14px;}
  .eb-card-head{flex-wrap:wrap;gap:8px;}
  .eb-toolbar{align-items:stretch;}
  .eb-filter-group,
  .eb-toolbar-right{width:100%;}
  .eb-select,
  .eb-input,
  .eb-btn-primary,
  .eb-btn-ghost{width:100%;justify-content:center;}
  .eb-topbar-right .eb-topbar-sep,
  .eb-datetime{display:none;}
  .eb-payment-row,
  .eb-contrib-row,
  .eb-role-row,
  .eb-status-row{flex-wrap:wrap;align-items:flex-start;}
  .eb-payment-label,
  .eb-contrib-name,
  .eb-role-row > span:first-child{width:100%;}
  .eb-payment-val,
  .eb-contrib-val,
  .eb-role-count,
  .eb-latency{min-width:0;text-align:left;}
  .eb-table th,
  .eb-table td{padding-left:8px;padding-right:8px;}
}
