/* ============================================================
   LRT Control Panel - shared design tokens & components
   ============================================================ */

:root{
  /* ============ ONYX & CHAMPAGNE - premium/expensive ============
     obsidian near-black + warm ivory + champagne-gold accent
     no purple/violet ever
     ================================================================ */
  --bg:            #0a0a0d;   /* obsidian */
  --bg-2:          #131318;
  --panel:         #16161c;
  --panel-2:       #1f1f26;
  --panel-3:       #292930;
  --line:          #2a2a32;
  --line-soft:     #1c1c23;
  
  --mgb:           #1e5194;
  --mgc:           #f8f8f8;
  --bmx:           #2c397e75;

  /* text - white body, warm mid, sober tertiary */
  --text:          #ffffff;
  --text-2:        #d0d0d8;
  --text-3:        #7c7c86;

  /* brand - champagne gold (the hero color) */
  --brand:         #1e5194;
  --brand-hi:      #2b61a9;
  --brand-dim:     #33270e;
  
  --foc:           #b0b3b8;
  --foc-hov:       #d8d8d8;

  --success:       #4cc38a;
  --success-dim:   #0f2a1e;
  --warning:       #d5a45c;
  --warning-dim:   #33260f;
  --danger:        #ffbabc;
  --danger-dim:    #341315;
  --info:          #6fc9b8;
  --info-dim:      #142823;

  --radius:        10px;
  --radius-sm:     7px;
  --mono:          'JetBrains Mono', ui-monospace, monospace;
  --sans:          'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --shadow-md:     0 4px 14px rgba(0,0,0,0.45);
  --shadow-lg:     0 14px 40px rgba(0,0,0,0.6);
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ background: var(--bg); overscroll-behavior: none; height:100%; }
body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100%;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  transition: background .18s, color .18s;
}

/* ============================================================
   LIGHT THEME (toggle via <html data-theme="light">)
   ============================================================ */
html[data-theme="light"]{
  /* ONYX light: warm ivory cream + deep champagne */
  --bg:            #e9e9e9;
  --bg-2:          #ffffff;
  --panel:         #ffffff;
  --panel-2:       #d0d1da8c;
  --panel-3:       #a8acb882;
  --line:          #676767;
  --line-soft:     #676767;
  
  --mgb:           #1e5194;
  --mgc:           #f8f8f8;
  --bmx:           #d0d1da8c;

  --text:          #0a0a0d;
  --text-2:        #45454f;
  --text-3:        #7a7a84;

  --brand:         #1e5194;
  --brand-hi:      #2b61a9;
  --brand-dim:     #f2e6c6;
  
  --foc:           #343a41;
  --foc-hov:       #367ad3;

  --success:       #0f8551;
  --success-dim:   #d4eddf;
  --warning:       #8a6520;
  --warning-dim:   #f2e6c6;
  --danger:        #b8343a;
  --danger-dim:    #f8d9db;
  --info:          #0d6e60;
  --info-dim:      #d4eae5;

  --shadow-md:     0 4px 14px rgba(20,15,5,0.08);
  --shadow-lg:     0 14px 40px rgba(20,15,5,0.14);
}
html[data-theme="light"] .btn-primary{ color:#fff; }
html[data-theme="light"] .pill.success{ color:#0a5f3a; }
html[data-theme="light"] .pill.danger{ color:#8a232a; }
html[data-theme="light"] .pill.warning{ color:#5e4413; }
html[data-theme="light"] .pill.info{ color:#0a4f45; }
html[data-theme="light"] .pill.brand{ color:#5e4413; }
*:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; border-radius:4px; }
@media (prefers-reduced-motion: reduce){ *{ animation:none !important; transition:none !important; } }

a {
    color: var(--foc);
    text-decoration: none;
}

a:hover {
    color: var(--foc-hov);
	text-decoration: none;
}


/* ============================================================
   LAYOUT - sidebar shell
   ============================================================ */

.shell{ display:flex; min-height:100vh; }

/* ---------- RAIL (sidebar) ---------- */
.rail{
  width: 240px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 14px 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.rail-brand{
  display:flex; align-items:center; gap:10px;
  padding: 4px 10px 20px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}
.rail-brand .logo{
  width:32px; height:32px; border-radius:8px;
  background: linear-gradient(135deg, #e7b14c);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--mono); font-weight:700; font-size:14px; color:#0a0a0d;
  flex-shrink:0;
}
.rail-brand .wordmark{ font-family:var(--mono); font-weight:700; font-size:15px; color:var(--text); letter-spacing:-0.01em; }
.rail-brand .wordmark span{ color:var(--brand-hi); }
.rail-brand .env{ font-family:var(--mono); font-size:10px; color:var(--text-3); text-transform:uppercase; letter-spacing:0.08em; margin-top:2px; }

.rail-nav{ flex:1; overflow-y:auto; }
.rail-section{ font-family:var(--mono); font-size:10px; text-transform:uppercase; letter-spacing:0.1em; color:var(--text-3); font-weight:700; padding: 14px 10px 8px; }
.rail-section:first-child{ padding-top: 4px; }

.nav-item{
  display:flex; align-items:center; gap:11px;
  padding: 9px 10px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px; font-weight:500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
}
.nav-item svg{ width:17px; height:17px; flex-shrink:0; stroke:currentColor; fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.nav-item:hover{ background: var(--bg-2); color: var(--text); }
.nav-item.on{
  background: var(--mgb);
  color: var(--mgc);
  font-weight: 600;
}
.nav-item .badge{
  margin-left:auto; background: var(--bmx); color: var(--text-2);
  font-family:var(--mono); font-size:10.5px; font-weight:700;
  padding: 2px 7px; border-radius: 20px;
}
.nav-item.on .badge{ background: var(--brand); color:#fff; }

/* theme toggle button */
.theme-toggle{
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px;
  cursor: pointer;
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.theme-toggle:hover{ color: var(--text); background: var(--bg-2); }
.theme-toggle svg{ width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail .theme-row{ display: flex; gap: 8px; margin-bottom: 10px; padding: 0 4px; }
.rail .theme-row .theme-toggle{ flex: 1; padding: 8px; font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em; gap: 8px; }

/* account chip at bottom */
.rail-foot{ border-top:1px solid var(--line-soft); padding-top:10px; margin-top:8px; }
.acct-row{
  display:flex; align-items:center; gap:11px;
  padding: 9px 8px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text);
  text-decoration:none;
}
.acct-row:hover{ background: var(--bg-2); }
.acct-row .avatar-lg{ width:40px; height:40px; font-size:15px; }
.acct-row .acct-meta{ flex:1; min-width:0; }
.acct-row .nm{ font-size:13.5px; font-weight:600; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.acct-row .rl{ font-size:11.5px; color:var(--text-3); font-family:var(--mono); }
.acct-row .chev{ color: var(--text-3); }
.acct-row .chev svg{ width:14px; height:14px; }

.avatar-lg,.avatar-xl,.avatar{
  border-radius: 50%;
  background: #2c397e75;
  color: #fff;
  display:flex; align-items:center; justify-content:center;
  font-family: var(--mono); font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.avatar{ width:28px; height:28px; font-size:12px; }
.avatar-lg{ width:44px; height:44px; font-size:16px; }
.avatar-xl{ width:64px; height:64px; font-size:22px; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

.main{ flex:1; min-width:0; padding: 26px 34px 60px; overflow-x:hidden; }
@media (max-width:960px){ .main{ padding: 22px; } }

.page-head{
  display:flex; justify-content:space-between; align-items:flex-end;
  margin-bottom: 22px; gap:16px; flex-wrap:wrap;
}
.page-head h1{ font-size: 22px; font-weight: 700; letter-spacing:-0.01em; color:var(--text); }
.page-head .sub{ font-family: var(--mono); font-size: 12px; color: var(--text-3); text-transform:uppercase; letter-spacing:0.06em; margin-top:4px; }
.page-head .actions{ display:flex; gap:8px; flex-wrap:wrap; }

.crumbs{ font-family:var(--mono); font-size:11.5px; color:var(--text-3); margin-bottom:10px; text-transform:uppercase; letter-spacing:0.06em; }
.crumbs a{ color:var(--text-2); }
.crumbs a:hover{ color:var(--text); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn{
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 9px 16px; cursor: pointer;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line);
  white-space: nowrap;
  display: inline-flex; align-items:center; justify-content:center; gap:7px;
  text-align: center; text-decoration: none;
  line-height: 1.2;
  transition: background .12s, border-color .12s, color .12s;
}
a.btn, a.btn:hover, a.btn:visited{ text-decoration: none; }
.btn:hover{ background: var(--panel-3); border-color: var(--text-3); }
.btn svg{ width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.btn-primary{ background: var(--brand); color:#fff; border-color: var(--brand); }
.btn-primary:hover{ background: var(--brand-hi); border-color: var(--brand-hi); }
.btn-ghost{ background: transparent; }
.btn-danger{ background: transparent; color: var(--danger); }
.btn-danger:hover{ background: var(--danger-dim); border-color: var(--danger); }
.btn-danger-solid{ background: var(--danger); color:#fff; border-color: var(--danger); }
.btn-danger-solid:hover{ filter: brightness(1.08); }
.btn-success-solid{ background: var(--success); color:#052617; border-color: var(--success); }
.btn-sm{ padding: 6px 11px; font-size: 12px; }
.btn-lg{ padding: 12px 18px; font-size: 14px; }
.btn-block{ width:100%; justify-content:center; }
.btn-icon{ padding:8px; }
.btn-icon svg{ width:15px; height:15px; }

/* ============================================================
   FORM CONTROLS
   ============================================================ */

label.f{
  font-size: 12px; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: block; margin-bottom: 6px; font-weight: 600;
}
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], input[type=tel], input[type=url], select, textarea{
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 14px;
  margin-bottom: 14px;
  outline: none;
}
textarea{ resize: vertical; min-height: 68px; line-height:1.5; }
input::placeholder, textarea::placeholder{ color: var(--text-3); }
input:focus, select:focus, textarea:focus{ border-color: var(--brand); }
select{ appearance:none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238891a4' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat:no-repeat; background-position: right 10px center; padding-right:32px; }

.field-group{ display:grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width:640px){ .field-group{ grid-template-columns:1fr; } }

.pw-wrap{ position: relative; }
.pw-wrap input{ padding-right: 54px; }
.pw-toggle{
  position: absolute; right: 10px; top: 9px;
  background: none; border: none;
  color: var(--text-2); font-size: 11px; font-family: var(--mono); font-weight: 600;
  cursor: pointer; padding: 4px 6px;
}
.pw-toggle:hover{ color: var(--text); }

.toggle-pair{
  display: flex; background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 3px; margin-bottom: 14px;
}
.toggle-pair button{
  flex: 1; background: transparent; border: none;
  color: var(--text-2);
  font-size: 12.5px; font-family: var(--sans); font-weight: 600;
  padding: 8px; border-radius: 5px; cursor: pointer;
}
.toggle-pair button.on{ background: var(--brand); color: #fff; }

.check-row{ display:flex; align-items:center; gap:10px; font-size:13.5px; color:var(--text); cursor:pointer; margin-bottom:10px; }
.check-row input{ width:16px; height:16px; margin:0; }

/* ============================================================
   CARDS / PANELS / TABLES
   ============================================================ */

.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.card-head{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom: 16px; gap: 10px; flex-wrap:wrap;
}
.card-title{ font-size: 14px; font-weight: 700; color: var(--text); }
.card-sub{ font-family: var(--mono); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; }

.stat-row{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width:1100px){ .stat-row{ grid-template-columns: 1fr 1fr; } }
@media (max-width:520px){ .stat-row{ grid-template-columns: 1fr; } }
.stat{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .lbl{ font-size:11.5px; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-2); font-weight:600; }
.stat .val{ font-family:var(--mono); font-size:24px; font-weight:700; margin-top:8px; color:var(--text); letter-spacing:-0.01em; }
.stat .delta{ font-family:var(--mono); font-size:12px; margin-top:6px; color:var(--text-3); }
.stat .delta.up{ color: var(--success); }
.stat .delta.dn{ color: var(--danger); }
.stat.accent .val{ color: var(--brand-hi); }
.stat.warning .val{ color: var(--warning); }
.stat.danger .val{ color: var(--danger); }
.stat.success .val{ color: var(--success); }

table{
  width: 100%; border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
th{
  text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-2); font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
td{
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid var(--line-soft);
}
tr:last-child td{ border-bottom: none; }
tbody tr:hover td{ background: var(--panel-2); }
td.mono{ font-family: var(--mono); font-size: 13px; }
td.muted{ color: var(--text-3); }
td .row-actions{ display: flex; gap: 6px; justify-content: flex-end; }
th.right, td.right{ text-align: right; }

.pill{
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 20px;
}
.pill::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.pill.success{ background: var(--success-dim); color: var(--success); }
.pill.danger{ background: var(--danger-dim); color: var(--danger); }
.pill.warning{ background: var(--warning-dim); color: var(--warning); }
.pill.info{ background: var(--info-dim); color: var(--info); }
.pill.neutral{ background: var(--panel-2); color: var(--text-2); }
.pill.brand{ background: var(--brand-dim); color: var(--brand-hi); }

/* ============================================================
   FILTER TOOLBAR (for lists)
   ============================================================ */

.filter-bar{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
/* search sits on its own full-width row above other filters */
.filter-search{ margin-bottom: 12px; }
.filter-search .search-wrap{ position: relative; width: 100%; }
.filter-search .search-wrap svg{ position:absolute; left:14px; top:50%; transform:translateY(-50%); width:16px; height:16px; stroke:var(--text-3); fill:none; stroke-width:1.8; }
.filter-search .search-wrap input{ width:100%; padding: 11px 14px 11px 42px; margin:0; font-size:14px; }

.filter-row{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }
.filter-field{ flex: 1 1 160px; min-width:130px; }
.filter-field label{ font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-2); margin-bottom:5px; display:block; }
.filter-field input, .filter-field select{ width:100%; margin:0; padding:9px 12px; font-size:13px; }
.filter-field .search-wrap{ position:relative; width:100%; }
.filter-field .search-wrap svg{ position:absolute; left:11px; top:50%; transform:translateY(-50%); width:14px; height:14px; stroke:var(--text-3); fill:none; stroke-width:1.8; }
.filter-field .search-wrap input{ padding-left:34px; }
.filter-actions{ display:flex; gap:8px; flex-shrink:0; }

/* ============================================================
   TABLES - responsive scroll wrapper
   ============================================================ */
.table-wrap{ width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius: var(--radius); }
.table-wrap table{ min-width: 720px; }
@media (max-width: 900px){
  .card table, .main > table{
    display: block; overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .card table thead, .main > table thead{ display: table-header-group; }
  .card table tbody, .main > table tbody{ display: table-row-group; }
  .card table tr, .main > table tr{ display: table-row; }
  .card table td, .main > table td, .card table th, .main > table th{ display: table-cell; }
}

.results-meta{ display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; font-size:13px; color:var(--text-2); }
.pagination{ display:flex; align-items:center; gap:6px; }
.pagination button{ background:var(--panel); border:1px solid var(--line); color:var(--text); padding:6px 10px; border-radius:6px; font-family:var(--mono); font-size:12px; cursor:pointer; }
.pagination button:hover{ background: var(--panel-2); }
.pagination button.on{ background: var(--brand); border-color: var(--brand); color:#fff; }
.pagination button:disabled{ opacity:0.4; cursor:not-allowed; }

/* ============================================================
   CHART CARD (stacked bar & svg bar)
   ============================================================ */

.chart-card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.chart-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:16px; gap:14px; flex-wrap:wrap; }
.chart-title{ font-size: 14px; font-weight: 700; color: var(--text); }
.chart-sub{ font-family: var(--mono); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; }
.chart-value{ font-family:var(--mono); font-size:22px; font-weight:700; color:var(--text); }
.chart-value + .chart-value-sub{ font-family:var(--mono); font-size:11.5px; color:var(--text-3); margin-top:2px; }

.stackbar{ display:flex; height:16px; border-radius:5px; overflow:hidden; margin-bottom:14px; background:var(--bg-2); border:1px solid var(--line-soft); }
.stackbar .seg{ height:100%; }
.chart-legend{ display:flex; gap:20px; flex-wrap:wrap; font-size:12.5px; color:var(--text-2); }
.legend-item{ display:flex; align-items:center; gap:8px; }
.legend-item .sw{ width:10px; height:10px; border-radius:2px; }
.legend-item b{ color:var(--text); font-family:var(--mono); font-weight:700; margin-left:4px; }

.usage-bar{ height:8px; background: var(--bg-2); border-radius:4px; overflow:hidden; margin-top:6px; }
.usage-bar .fill{ height:100%; background: linear-gradient(180deg, #36d49a 0%, #059669 100%); border-radius:4px; }
.usage-bar .fill.warning{ background: #ffd700; }
.usage-bar .fill.danger{ background: #c32525; }

/* ============================================================
   PRESET TAGS (for quick-edit / packages)
   ============================================================ */

.tags{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.tag{
  display:inline-flex; align-items:center; gap:9px;
  background: var(--bg-2); border: 1px solid var(--line-soft);
  padding: 7px 13px; border-radius: 20px;
  font-size: 13px; color: var(--text);
}
.tag .x{ color: var(--text-3); cursor:pointer; font-weight:700; background:none; border:none; font-size:14px; padding:0; line-height:1; }
.tag .x:hover{ color: var(--danger); }

/* ============================================================
   AUTH CARD (login screen)
   ============================================================ */

.auth-shell{
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.auth-card{
  width: 400px; max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px 36px 32px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.auth-card::before{
  content:""; position:absolute; top:0; left:0; right:0; height:2px;
  background: linear-gradient(90deg, transparent, var(--brand) 50%, transparent);
  border-radius: 14px 14px 0 0;
}
.auth-brand{ display:flex; align-items:center; gap:12px; margin-bottom: 28px; }
.auth-brand .logo{
  width:30px; height:30px; border-radius:10px;
  background: linear-gradient(135deg, #e7b14c);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--mono); font-weight:700; font-size:16px; color:#0a0a0d;
}
.auth-brand .title{ font-family:var(--mono); font-weight:700; font-size:18px; color:var(--text); }
.auth-brand .sub{ font-family:var(--mono); font-size:11px; color:var(--text-3); text-transform:uppercase; letter-spacing:0.08em; margin-top:2px; }

.auth-foot{ text-align:center; margin-top:18px; font-size:13px; color:var(--text-2); }

/* ============================================================
   MODALS
   ============================================================ */

.overlay{
  display: none;
  position: fixed; inset: 0;
  background: rgba(4,6,10,0.72);
  backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.overlay.show{ display: flex; }
.modal{
  width: 440px; max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 26px;
  max-height: 90vh; overflow: auto;
  box-shadow: var(--shadow-lg);
}
.modal.narrow{ width: 380px; }
.modal.wide{ width: 680px; }

.modal-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; }
.modal-head h3{ font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close{
  background: none; border: none; color: var(--text-3);
  font-size: 20px; cursor: pointer; padding: 4px; line-height: 1;
}
.modal-close:hover{ color: var(--text); }

.modal-foot{
  display: flex; justify-content: center; gap: 12px;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-soft);
}
.modal-foot .btn{ min-width: 130px; }

.warn-box{
  background: var(--danger-dim);
  font-size: 13px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  line-height: 1.55;
  border: 1px solid rgba(239,68,68,0.25);
}
.warn-box b{ color: var(--danger); }
.info-box{
  background: var(--info-dim);
  color: #c7e8fb;
  font-size: 13px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  line-height: 1.55;
  border: 1px solid rgba(56,189,248,0.25);
}

.segment{ display: flex; border-bottom: 1px solid var(--line-soft); margin-bottom: 20px; gap: 22px; }
.segment button{
  background: none; border: none; color: var(--text-2);
  font-size: 13.5px; font-family: var(--sans); font-weight: 600;
  padding: 10px 2px; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.segment button:hover{ color: var(--text); }
.segment button.on{ color: var(--text); border-color: var(--brand); }
.seg-pane{ display: none; }
.seg-pane.on{ display: block; }

/* ============================================================
   TOASTS
   ============================================================ */

.toast-wrap{
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200;
}
.toast{
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px; color: var(--text);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  animation: toast-in .2s ease;
}
.toast.success{ border-left-color: var(--success); }
.toast.danger{ border-left-color: var(--danger); }
@keyframes toast-in{ from{ transform: translateX(30px); opacity: 0; } to{ transform: translateX(0); opacity: 1; } }

/* helpers */
.mono{ font-family: var(--mono); }
.muted{ color: var(--text-3); }
.text-success{ color: var(--success); }
.text-warning{ color: var(--warning); }
.text-danger{ color: var(--danger); }
.mt-0{ margin-top:0; } .mb-0{ margin-bottom:0; }
.hint{ font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.divider{ height: 1px; background: var(--line-soft); margin: 18px 0; }
