/*
 * 24Ounce Account UI (Lightweight)
 * Goal: DashLite-like layout without loading DashLite.
 * Scope: /account/* only (enqueued conditionally by the plugin).
 */

:root{
  --tfo-bg:#f5f7fb;
  --tfo-card:#ffffff;
  --tfo-text:#1f2a37;
  --tfo-muted:#64748b;
  --tfo-border:rgba(15,23,42,.10);
  --tfo-shadow:0 10px 30px rgba(17,24,39,.07);
  --tfo-primary:#6d28d9;
  --tfo-primary-600:#5b21b6;
  --tfo-primary-50:rgba(109,40,217,.10);
  --tfo-success:#16a34a;
  --tfo-warning:#f59e0b;
  --tfo-danger:#ef4444;
  --tfo-radius:18px;
  --tfo-radius-sm:14px;
}

/* Ensure the page background matches the design screenshots */
body{background:var(--tfo-bg) !important;}

/* Trading table: keep design, add a compact "Total" column without changing existing layout */
.tfo-col-total{white-space:nowrap;}
.tfo-total-lines{display:flex;flex-direction:column;gap:4px;}
.tfo-total-label{color:var(--tfo-muted);font-size:12px;}
.tfo-total-line{font-weight:700;font-size:14px;}
/* Make qty input slightly narrower so the new column fits */
.tfo-qty-input{max-width:140px;}

/* Default table styling for plugin account tables (avoid theme overrides) */
.tfo-table{width:100%;border-collapse:separate;border-spacing:0;font-size:14px;}
.tfo-table thead th{color:var(--tfo-muted);font-weight:700;padding:12px 12px;border-bottom:1px solid var(--tfo-border);white-space:nowrap;}
.tfo-table tbody td{padding:14px 12px;border-bottom:1px solid rgba(15,23,42,.06);vertical-align:middle;}

/* Disable scroll when mobile sidebar is open */
html.tfo-no-scroll, html.tfo-no-scroll body{overflow:hidden;}

/* Layout */
.tfo-account{
  min-height:100vh;
  display:flex;
  background:var(--tfo-bg);
  color:var(--tfo-text);
}

.tfo-sidebar{
  width:290px;
  flex:0 0 290px;
  padding:22px 18px;
}

.tfo-sidebar-card{
  background:var(--tfo-card);
  border-radius:var(--tfo-radius);
  box-shadow:var(--tfo-shadow);
  border:1px solid var(--tfo-border);
  padding:18px;
  position:sticky;
  top:18px;
}

.tfo-brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:14px;
}

/* New account shell markup */
.tfo-sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;}
.tfo-brand-mark{width:36px;height:36px;border-radius:12px;background:var(--tfo-primary);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900;}
.tfo-brand-name{font-weight:800;letter-spacing:.2px;font-size:16px;}
.tfo-brand{color:inherit;text-decoration:none;}
.tfo-sidebar-close{display:none;border:1px solid var(--tfo-border);background:#fff;border-radius:12px;padding:6px 10px;line-height:1;font-size:18px;text-decoration:none;color:var(--tfo-muted);}

.tfo-sidebar-foot{margin-top:14px;padding-top:14px;border-top:1px solid rgba(15,23,42,.06);display:flex;flex-direction:column;gap:10px;}
.tfo-user-avatar{width:38px;height:38px;border-radius:999px;background:var(--tfo-primary);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900;}
.tfo-user-meta{display:flex;flex-direction:column;line-height:1.2;}
.tfo-user-sub{font-size:12px;color:var(--tfo-muted);margin-top:2px;}

.tfo-brand a{color:inherit;text-decoration:none;}

.tfo-brand-title{
  font-weight:700;
  letter-spacing:.2px;
  font-size:18px;
}

.tfo-sidebar-toggle{
  display:none;
  border:1px solid var(--tfo-border);
  background:var(--tfo-card);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}

.tfo-nav-title{
  margin:18px 0 8px;
  font-size:12px;
  letter-spacing:.12em;
  color:var(--tfo-muted);
  text-transform:uppercase;
}

.tfo-nav{list-style:none;margin:0;padding:0;}

.tfo-nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 12px;
  margin:4px 0;
  border-radius:14px;
  color:var(--tfo-text);
  text-decoration:none;
  border:1px solid transparent;
}

.tfo-nav a:hover{
  background:rgba(15,23,42,.03);
  border-color:var(--tfo-border);
}

.tfo-nav a.is-active{
  background:var(--tfo-primary-50);
  border-color:rgba(109,40,217,.22);
  color:var(--tfo-primary-600);
  font-weight:600;
}

.tfo-sidebar-foot{margin-top:18px;padding-top:16px;border-top:1px solid rgba(15,23,42,.06);}
.tfo-user-meta{min-width:0;}
.tfo-user-sub{color:var(--tfo-muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px;}

.tfo-main{
  flex:1 1 auto;
  padding:18px 18px 32px;
}

.tfo-topbar{
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:6px 4px 18px;
}

.tfo-topbar-left{
  display:flex;
  align-items:center;
  gap:10px;
}

.tfo-mobile-toggle{
  display:none;
  border:1px solid var(--tfo-border);
  background:var(--tfo-card);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}

.tfo-breadcrumb{
  color:var(--tfo-muted);
  font-size:14px;
}

.tfo-page-title{font-size:18px;font-weight:800;line-height:1.2;}
.tfo-page-sub{font-size:12px;color:var(--tfo-muted);margin-top:2px;}

.tfo-pill{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(109,40,217,.10);
  color:var(--tfo-primary-600);
  border:1px solid rgba(109,40,217,.18);
  font-weight:700;
  font-size:13px;
}

.tfo-topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.tfo-user{
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--tfo-card);
  border:1px solid var(--tfo-border);
  box-shadow:var(--tfo-shadow);
  border-radius:999px;
  padding:8px 10px;
}

.tfo-user-avatar{
  width:36px;
  height:36px;
  border-radius:999px;
  background:var(--tfo-primary);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:12px;
  text-transform:uppercase;
}
.tfo-user-meta{min-width:0;}
.tfo-user-sub{color:var(--tfo-muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:170px;}

.tfo-avatar{
  width:34px;
  height:34px;
  border-radius:999px;
  background:var(--tfo-primary);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:12px;
}

.tfo-user-name{font-weight:600;font-size:14px;}

.tfo-container{max-width:1180px; margin:0 auto;}

.tfo-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin:0 0 14px;}
.tfo-section{margin-bottom:16px;}
.tfo-section-title{font-weight:800;color:var(--tfo-text);margin:0 0 12px;}

/* Cards */
.card{
  background:var(--tfo-card);
  border-radius:var(--tfo-radius);
  box-shadow:var(--tfo-shadow);
  border:1px solid var(--tfo-border);
}

.card-bordered{border:1px solid var(--tfo-border);}

.card-inner{padding:18px;}

/* Additional lightweight card utility (used by wallet templates) */
.tfo-card{background:var(--tfo-card);border:1px solid var(--tfo-border);border-radius:var(--tfo-radius);box-shadow:var(--tfo-shadow);} 
.tfo-card-inner{padding:18px;}
.tfo-card-header{padding:16px 18px;border-bottom:1px solid rgba(15,23,42,.06);display:flex;align-items:center;justify-content:space-between;gap:12px;}
.tfo-card-body{padding:18px;}
.tfo-empty{color:var(--tfo-muted);padding:12px 0;}
.tfo-title{font-size:16px;font-weight:700;margin:0;}
.tfo-subtitle{margin:6px 0 0;color:var(--tfo-muted);font-size:12px;}
.tfo-muted{color:var(--tfo-muted);}

.tfo-pill{display:inline-flex;align-items:center;border:1px solid var(--tfo-border);background:var(--tfo-card);border-radius:999px;padding:8px 10px;font-weight:700;font-size:12px;color:var(--tfo-muted);}

.tfo-page-title{font-size:20px;font-weight:800;line-height:1.2;}
.tfo-page-sub{color:var(--tfo-muted);font-size:12px;margin-top:2px;}

.tfo-alert{border:1px solid var(--tfo-border);background:#fff;border-radius:14px;padding:10px 12px;}

.title{font-size:16px;font-weight:700;margin:0 0 12px;}

/* Typography helpers used in templates */
.nk-block{margin-bottom:18px;}
.nk-block-lg{margin-bottom:22px;}
.nk-block-head{margin-bottom:18px;}
.nk-block-head-sub{color:var(--tfo-muted);font-size:13px;margin-bottom:6px;}
.nk-block-title{font-size:28px;line-height:1.15;margin:0;letter-spacing:-.02em;}
.nk-block-des p{margin:6px 0 0;color:var(--tfo-muted);}

/* Tables */
.table-responsive{overflow:auto;}

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

.table thead th{
  text-align:left;
  color:var(--tfo-muted);
  font-weight:600;
  padding:12px 12px;
  border-bottom:1px solid var(--tfo-border);
  white-space:nowrap;
}

.table tbody td{
  padding:14px 12px;
  border-bottom:1px solid rgba(15,23,42,.06);
  vertical-align:middle;
}

.table-sm thead th{padding:10px 12px;}
.table-sm tbody td{padding:12px 12px;}

.table-striped tbody tr:nth-child(even){background:rgba(15,23,42,.02);}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:12px;
  padding:10px 14px;
  border:1px solid transparent;
  background:transparent;
  color:var(--tfo-text);
  cursor:pointer;
  text-decoration:none;
  font-weight:600;
  line-height:1;
}

.btn-sm{padding:8px 12px;border-radius:10px;font-size:13px;}

.btn-primary{background:var(--tfo-primary);color:#fff;}
.btn-primary:hover{background:var(--tfo-primary-600);}

.btn-outline-primary{border-color:rgba(109,40,217,.35);color:var(--tfo-primary-600);background:#fff;}
.btn-outline-primary:hover{background:var(--tfo-primary-50);}

.btn-light{background:#f8fafc;border-color:var(--tfo-border);}
.btn-white{background:#fff;border-color:var(--tfo-border);}

.btn-danger{background:var(--tfo-danger);color:#fff;}
.btn-danger:hover{filter:brightness(.95);}

/* Badges */
.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  text-transform:capitalize;
  border:1px solid transparent;
}

.bg-success{background:rgba(22,163,74,.12);color:var(--tfo-success);border-color:rgba(22,163,74,.22);}
.bg-warning{background:rgba(245,158,11,.12);color:var(--tfo-warning);border-color:rgba(245,158,11,.22);}
.bg-danger{background:rgba(239,68,68,.12);color:var(--tfo-danger);border-color:rgba(239,68,68,.22);}
.bg-secondary{background:rgba(100,116,139,.12);color:var(--tfo-muted);border-color:rgba(100,116,139,.22);}

/* Alerts (used by trading-ui.js and wallet-ui.js messages) */
.alert{border-radius:14px;padding:12px 14px;margin:0 0 12px;border:1px solid var(--tfo-border);background:#fff;}
.alert-success{border-color:rgba(22,163,74,.25);background:rgba(22,163,74,.08);color:var(--tfo-success);}
.alert-danger{border-color:rgba(239,68,68,.25);background:rgba(239,68,68,.08);color:var(--tfo-danger);}

.tfo-alert{border-radius:14px;padding:12px 14px;border:1px solid var(--tfo-border);background:#ee5727;color:var(--tfo-text);}

/* Forms */
.form-label{display:block;font-weight:600;margin:0 0 8px;}
.form-control{
  width:100%;
  border:1px solid var(--tfo-border);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
  outline:none;
}
.form-control:focus{border-color:rgba(109,40,217,.35);box-shadow:0 0 0 4px rgba(109,40,217,.10);}

/* Utility */
.d-flex{display:flex;}
.gap-2{gap:8px;}
.mb-0{margin-bottom:0;}
.mb-2{margin-bottom:8px;}
.mb-3{margin-bottom:12px;}
.text-muted{color:var(--tfo-muted);}
.tfo-muted{color:var(--tfo-muted);}

/* Dashboard helpers */
.tfo-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin-bottom:14px;}
.tfo-actions{display:flex;gap:10px;flex-wrap:wrap;}
.tfo-h2{margin:0 0 6px;font-size:22px;line-height:1.25;}
.tfo-h3{margin:0 0 10px;font-size:16px;line-height:1.3;}
.tfo-p{margin:0;color:var(--tfo-muted);}

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

.tfo-stat-card{
  border-radius:var(--tfo-radius);
  padding:18px;
  margin-bottom:18px;
  color:#fff;
  box-shadow:var(--tfo-shadow);
  position:relative;
  overflow:hidden;
}
.tfo-stat-card:after{
  content:"";
  position:absolute;
  left:-40px;
  bottom:-50px;
  width:220px;
  height:120px;
  border-radius:120px;
  background:rgba(255,255,255,.18);
  transform:rotate(-8deg);
}
.tfo-stat-value{font-size:28px;font-weight:900;letter-spacing:.2px;position:relative;z-index:1;}
.tfo-stat-label{font-size:13px;font-weight:700;opacity:.95;position:relative;z-index:1;}
.tfo-stat-card.is-purple{background:linear-gradient(135deg,#7c3aed,#5b21b6);}
.tfo-stat-card.is-blue{background:linear-gradient(135deg,#2563eb,#0284c7);}
.tfo-stat-card.is-orange{background:linear-gradient(135deg,#fb923c,#f59e0b);}
.tfo-stat-card.is-pink{background:linear-gradient(135deg,#f43f5e,#ec4899);}

.tfo-list{display:flex;flex-direction:column;gap:10px;margin-top:10px;}
.tfo-list-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--tfo-border);border-radius:14px;background:#fff;}
.tfo-list-title{font-weight:800;color:var(--tfo-text);font-size:13px;}
.tfo-list-sub{font-size:12px;color:var(--tfo-muted);margin-top:2px;}
.tfo-list-amount{font-weight:900;color:var(--tfo-text);}

.tfo-quick{display:flex;flex-direction:column;gap:10px;margin-top:10px;}
.tfo-quick-item{display:flex;flex-direction:column;gap:4px;padding:12px 14px;border:1px solid var(--tfo-border);border-radius:14px;background:#fff;color:var(--tfo-text);text-decoration:none;}
.tfo-quick-item:hover{border-color:rgba(109,40,217,.25);box-shadow:0 14px 34px rgba(17,24,39,.08);}
.tfo-quick-sub{color:var(--tfo-muted);font-size:12px;}

/* Trade modal (if template inline style is removed later) */
.twentyfourounce-modal{position:fixed;inset:0;z-index:99999;}
.twentyfourounce-modal-backdrop{position:absolute;inset:0;background:rgba(2,6,23,.55);}
.twentyfourounce-modal-card{
  position:relative;
  max-width:520px;
  margin:10vh auto;
  background:#fff;
  border-radius:var(--tfo-radius);
  overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  border:1px solid var(--tfo-border);
}
.twentyfourounce-modal-header,.twentyfourounce-modal-footer{
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.twentyfourounce-modal-header{border-bottom:1px solid rgba(15,23,42,.08);}
.twentyfourounce-modal-body{padding:16px;}
.twentyfourounce-modal-footer{border-top:1px solid rgba(15,23,42,.08);}

/* Responsive */
@media (max-width: 1024px){
  .tfo-sidebar{width:260px;flex-basis:260px;}
  .tfo-grid-4{grid-template-columns:repeat(2,minmax(0,1fr));}
}

@media (max-width: 920px){
  .tfo-sidebar{position:fixed;left:0;top:0;bottom:0;z-index:99990;background:rgba(2,6,23,.35);width:100%;padding:0;display:none;}
  .tfo-sidebar.is-open{display:block;}
  .tfo-sidebar-card{height:100%;width:290px;border-radius:0;top:0;box-shadow:0 20px 60px rgba(0,0,0,.25);}
  .tfo-sidebar-close{display:inline-flex;}
  .tfo-main{padding:12px 12px 26px;}
  .tfo-mobile-toggle{display:inline-flex;}
  .tfo-grid-2{grid-template-columns:1fr;}
}

@media (max-width: 560px){
  .tfo-grid-4{grid-template-columns:1fr;}
}

/* Mobile: reduce excessive borders/lines and make totals side-by-side */
@media (max-width: 782px){
  /* Convert product table rows to compact cards (single outer border) */
  .tfo-table thead{display:none;}
  .tfo-table, .tfo-table tbody, .tfo-table tr{display:block;width:100%;}
  .tfo-table tr{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:16px;margin:0 0 14px;overflow:hidden;}
  .tfo-table tbody td{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:0 !important;}
  .tfo-table tbody td:before{content:attr(data-label);font-weight:800;color:var(--tfo-muted);}

  /* Quantity cell: keep input readable */
  .tfo-qty-input{max-width:120px;}
  .tfo-qty-hint{margin-top:6px;}

  /* Totals cell: buy/sell next to each other */
  .tfo-total-lines{flex-direction:row;gap:18px;justify-content:flex-start;}
  .tfo-total-line{display:flex;flex-direction:column;gap:2px;}
}


/* Trade inline messages */
.js-trade-msg{margin-top:6px;font-size:12px;line-height:1.3;}
.tfo-msg-error{color:#c00;}
.tfo-msg-ok{color:#0a0;}