/* ============================================================
   components.css — Buttons, Cards, Tables, Badges, Modals
   ============================================================ */

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             6px;
  height:          var(--h-btn);
  padding:         0 var(--px-btn);
  font-family:     var(--font-sans);
  font-size:       var(--text-sm);
  font-weight:     var(--fw-medium);
  border-radius:   var(--radius-md);
  border:          1px solid transparent;
  cursor:          pointer;
  transition:      all var(--t-fast);
  white-space:     nowrap;
  line-height:     1;
  box-sizing:      border-box;
}

.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color:      var(--text-inv);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(var(--accent-rgb),.3); }

.btn-secondary {
  background: var(--surface2);
  border-color: var(--border2);
  color:  var(--text);
}
.btn-secondary:hover { background: var(--surface3); border-color: var(--border2); }

.btn-danger {
  background: var(--red-bg);
  border-color: rgba(244,63,94,.3);
  color: var(--red);
}
.btn-danger:hover { background: rgba(244,63,94,.15); }

.btn-ghost {
  background: transparent;
  color:      var(--text2);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-sm  { height: var(--h-btn-sm); padding: 0 var(--px-btn-sm); font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-lg  { height: var(--h-btn-lg); padding: 0 var(--px-btn-lg); font-size: var(--text-base); }
.btn-full{ width: 100%; }

.btn-connect {
  width:       100%;
  background:  linear-gradient(135deg, var(--accent), var(--accent2));
  color:       var(--text-inv);
  font-weight: var(--fw-semi);
  letter-spacing: 0.04em;
  padding:     10px 16px;
  border-radius: var(--radius-md);
  border:      none;
  cursor:      pointer;
  font-family: var(--font-sans);
  font-size:   var(--text-sm);
  transition:  all var(--t-normal);
  display:     flex;
  align-items: center;
  justify-content: center;
  gap:         8px;
}
.btn-connect:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(var(--accent-rgb),.35); }
.btn-connect.connected { background: var(--green); color: #fff; }
.btn-connect:disabled  { opacity: .5; transform: none; box-shadow: none; cursor: not-allowed; }

/* ── Form inputs ──────────────────────────────────────────── */
.input {
  width:         100%;
  background:    var(--surface2);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  padding:       8px 12px;
  color:         var(--text);
  font-family:   var(--font-sans);
  font-size:     var(--text-sm);
  outline:       none;
  transition:    border-color var(--t-fast), box-shadow var(--t-fast);
  line-height:   1.4;
}
.input:focus        { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb),.15); }
.input::placeholder { color: var(--text3); }

.input-label {
  display:        block;
  font-size:      var(--text-xs);
  color:          var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom:  4px;
}

.form-group { margin-bottom: 12px; }

.checkbox-row {
  display:     flex;
  align-items: center;
  gap:         8px;
  font-size:   var(--text-sm);
  color:       var(--text2);
  cursor:      pointer;
}
.checkbox-row input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  transition:    border-color var(--t-fast), box-shadow var(--t-fast);
}

.card-pad   { padding: 20px; }
.card-pad-sm{ padding: 14px 16px; }

.card:hover { border-color: var(--border2); }

/* KPI Card */
.kpi-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       20px;
  position:      relative;
  overflow:      hidden;
  transition:    border-color var(--t-fast), transform var(--t-fast);
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--border2); box-shadow: 0 8px 24px var(--shadow); }
.kpi-card::before {
  content:  '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height:   2px;
  background: var(--kpi-color, var(--accent));
}

.kpi-label  { font-size: var(--text-xs); color: var(--text3); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 10px; font-weight: var(--fw-medium); }
.kpi-value  { font-family: var(--font-heading); font-size: 28px; font-weight: var(--fw-bold); line-height: 1; color: var(--text); }
.kpi-sub    { font-size: var(--text-xs); color: var(--text3); margin-top: 6px; }
.kpi-trend  { font-family: var(--font-mono); font-size: var(--text-xs); margin-top: 5px; }
.kpi-trend.up   { color: var(--green); }
.kpi-trend.down { color: var(--red); }

/* User detail card */
.user-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       20px;
  margin-bottom: 14px;
  animation:     slideUp var(--t-normal) both;
}

.user-card-header {
  display:       flex;
  align-items:   center;
  gap:           14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.user-avatar {
  width:           48px;
  height:          48px;
  border-radius:   var(--radius-md);
  background:      linear-gradient(135deg, var(--accent2), var(--accent));
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-family:     var(--font-mono);
  font-size:       17px;
  font-weight:     var(--fw-bold);
  color:           var(--text-inv);
  flex-shrink:     0;
}

.user-info-name { font-size: var(--text-base); font-weight: var(--fw-semi); color: var(--text); }
.user-info-sub  { font-size: var(--text-sm); color: var(--text3); margin-top: 3px; }

.user-meta { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.user-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }

.user-stat {
  background:    var(--surface2);
  border:        1px solid var(--border);
  border-radius: var(--radius-md);
  padding:       14px;
}
.user-stat-label { font-size: var(--text-xs); color: var(--text3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.user-stat-value { font-family: var(--font-mono); font-size: 22px; font-weight: var(--fw-bold); color: var(--text); }
.user-stat-sub   { font-size: var(--text-xs); color: var(--text3); margin-top: 4px; }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap {
  background:       var(--surface);
  border:           1px solid var(--border);
  border-radius:    var(--radius-lg);
  overflow-x:       auto;
  overflow-y:       visible;
  -webkit-overflow-scrolling: touch;
  max-width:        100%;
}

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

thead {
  background:    var(--surface2);
  border-bottom: 1px solid var(--border);
}

thead th {
  padding:        11px 14px;
  text-align:     left;
  font-size:      var(--text-xs);
  font-weight:    var(--fw-semi);
  color:          var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space:    nowrap;
  cursor:         pointer;
  user-select:    none;
  transition:     color var(--t-fast);
}
thead th:hover       { color: var(--text2); }
thead th.th-sort     { color: var(--accent); }
thead th .sort-arrow { display: inline-block; margin-left: 4px; opacity: .5; }

tbody tr { border-bottom: 1px solid var(--border); transition: background var(--t-fast); }
tbody tr:last-child  { border-bottom: none; }
tbody tr:hover       { background: var(--surface2); }

tbody td {
  padding:        10px 14px;
  font-size:      var(--text-sm);
  color:          var(--text2);
  vertical-align: middle;
}

.td-bold   { color: var(--text); font-weight: var(--fw-medium); }
.td-num    { text-align: right; font-family: var(--font-mono); }
.td-mono   { font-family: var(--font-mono); font-size: var(--text-xs); }

/* ── Progress bar ─────────────────────────────────────────── */
.progress-wrap { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.progress-bar  { flex: 1; height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; transition: width .8s ease; }
.fill-green  { background: var(--green); }
.fill-orange { background: var(--orange); }
.fill-red    { background: var(--red); }
.fill-accent { background: var(--accent); }
.fill-purple { background: var(--purple); }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display:         inline-flex;
  align-items:     center;
  gap:             4px;
  padding:         2px 8px;
  border-radius:   3px;
  font-size:     11px;
  font-weight:     var(--fw-medium);
  white-space:     nowrap;
  border:          1px solid transparent;
}

.badge-green  { background: var(--green-bg);   color: var(--green);  border-color: rgba(34,197,94,.2); }
.badge-red    { background: var(--red-bg);     color: var(--red);    border-color: rgba(244,63,94,.2); }
.badge-orange { background: var(--orange-bg);  color: var(--orange); border-color: rgba(249,115,22,.2); }
.badge-blue   { background: var(--blue-bg);    color: var(--blue);   border-color: rgba(96,165,250,.2); }
.badge-purple { background: var(--purple-bg);  color: var(--purple); border-color: rgba(167,139,250,.2); }
.badge-accent { background: rgba(var(--accent-rgb),.1); color: var(--accent); border-color: rgba(var(--accent-rgb),.25); }
.badge-muted  { background: var(--surface2);   color: var(--text3);  border-color: var(--border); }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display:       flex;
  border-bottom: 1px solid var(--border);
  gap:           0;
}

.tab {
  padding:       10px 18px;
  font-size:     var(--text-sm);
  font-weight:   var(--fw-medium);
  color:         var(--text3);
  cursor:        pointer;
  border-bottom: 2px solid transparent;
  transition:    all var(--t-fast);
  white-space:   nowrap;
  display:       flex;
  align-items:   center;
  gap:           6px;
}
.tab:hover       { color: var(--text2); }
.tab.active      { color: var(--accent); border-bottom-color: var(--accent); }
.tab svg         { opacity: .6; }
.tab.active svg  { opacity: 1; }

/* ── Chart container ──────────────────────────────────────── */
.chart-box {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       20px;
  display:       flex;
  flex-direction: column;
}
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: clamp(220px, 28vw, 340px);
}
.chart-canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.chart-box canvas {
  width: 100% !important;
  max-width: 100%;
}

/* ── Notification toast ───────────────────────────────────── */
.toast {
  position:      fixed;
  bottom:        24px;
  right:         24px;
  background:    var(--surface);
  border:        1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding:       13px 18px;
  display:       flex;
  align-items:   center;
  gap:           10px;
  font-size:     var(--text-sm);
  color:         var(--text2);
  transform:     translateY(80px);
  opacity:       0;
  transition:    all var(--t-normal);
  z-index:       9999;
  box-shadow:    0 8px 32px var(--shadow);
  max-width:     360px;
}
.toast.show    { transform: translateY(0); opacity: 1; }
.toast-dot     { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Login view ───────────────────────────────────────────── */
#loginView {
  position:        fixed;
  inset:           0;
  background:      var(--bg);
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  gap:             20px;
  z-index:         1000;
  transition:      background var(--t-normal);
  padding:         24px 16px;
}
[data-theme="light"] #loginView {
  background: linear-gradient(135deg, #e8eef5 0%, #f1f5f9 60%, #e8eef5 100%);
}


/* ── Login box ─────────────────────────────────────────────── */
.login-box {
  background:    var(--surface1);
  border:        1px solid var(--border);
  border-radius: var(--radius-xl);
  padding:       32px 36px 32px;
  width:         420px;
  max-width:     calc(100vw - 24px);
  box-shadow:    0 8px 40px var(--shadow);
  animation:     slideUp .35s cubic-bezier(.16,1,.3,1) both;
}

/* Header row: logo + lang button */
.login-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   28px;
}

.login-logo {
  display:     flex;
  align-items: center;
  gap:         12px;
}

.login-logo-icon {
  width:            42px;
  height:           42px;
  background:       linear-gradient(135deg, var(--accent2), var(--accent));
  border-radius:    var(--radius-md);
  display:          flex;
  align-items:      center;
  justify-content:  center;
  flex-shrink:      0;
}

.login-brand {
  font-family: var(--font-heading);
  font-size:   var(--text-lg);
  font-weight: var(--fw-bold);
  color:       var(--text);
  line-height: 1.2;
}

.login-brand-sub {
  font-size:   var(--text-xs);
  color:       var(--text3);
  letter-spacing: .06em;
  margin-top:  2px;
}

/* Language pill button */
.login-lang-btn {
  display:        inline-flex;
  align-items:    center;
  gap:            5px;
  padding:        4px 10px;
  border-radius:  6px;
  border:         1px solid rgb(71, 85, 105);
  background:     rgba(255,255,255,.05);
  color:          var(--text2);
  font-size:      12px;
  font-weight:    600;
  cursor:         pointer;
  letter-spacing: .04em;
  transition:     background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  position:       relative;
}
.login-lang-btn:hover {
  background:   rgba(255,255,255,.1);
  border-color: var(--accent);
  color:        var(--accent);
}
.login-lang-btn svg { opacity: .9; flex-shrink: 0; }

/* ── Lang dropdown ──────────────────────────────────────────── */
.login-lang-dropdown {
  position:   absolute;
  top:        calc(100% + 6px);
  right:      0;
  background: var(--surface1);
  border:     1px solid rgb(71,85,105);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  z-index:    9999;
  min-width:  90px;
  overflow:   hidden;
  display:    none;
}
.login-lang-dropdown.open { display: block; }
.login-lang-opt {
  display:     flex;
  align-items: center;
  gap:         8px;
  padding:     8px 14px;
  font-size:   13px;
  font-weight: 500;
  color:       var(--text);
  cursor:      pointer;
  transition:  background var(--t-fast);
  white-space: nowrap;
}
.login-lang-opt:hover { background: var(--surface2); }
.login-lang-opt.active {
  color:      var(--accent);
  background: rgba(var(--accent-rgb),.08);
}
.login-lang-opt-check {
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Section micro-label */
.login-section-label {
  font-size:      10px;
  font-weight:    600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color:          var(--text3);
  margin-top:     18px;
  margin-bottom:  8px;
}
.login-section-label:first-of-type {
  margin-top: 0;
}

/* Input field */
.login-field {
  margin-bottom: 8px;
}

.login-input {
  width:         100%;
  height:        40px;
  padding:       0 12px;
  background:    var(--surface2);
  border:        1px solid var(--border);
  border-radius: 4px;
  color:         var(--text);
  font-family:   var(--font-sans);
  font-size:     var(--text-sm);
  box-sizing:    border-box;
  transition:    border-color var(--t-fast), box-shadow var(--t-fast);
}
.login-input::placeholder { color: var(--text3); }
.login-input:focus {
  outline:      none;
  border-color: var(--accent);
  box-shadow:   0 0 0 3px rgba(var(--accent-rgb),.12);
}

/* Error box */
.login-error {
  background:    var(--red-bg);
  border:        1px solid rgba(244,63,94,.3);
  border-radius: 4px;
  padding:       9px 12px;
  font-size:     var(--text-xs);
  color:         var(--red);
  margin-bottom: 10px;
  display:       none;
  line-height:   1.5;
}

/* Theme pill-group */
.login-theme-pills {
  display:       flex;
  gap:           8px;
  margin-bottom: 20px;
}
.login-theme-pills .btn {
  flex:            1;
  justify-content: center;
  gap:             5px;
  font-size:       12px;
  font-weight:     500;
  height:          36px;
  border-color:    var(--border2);
  color:           var(--text2);
  background:      var(--surface2);
  border-radius:   var(--radius-md);
}
.login-theme-pills .btn:hover {
  border-color: var(--border2);
  background:   var(--surface3);
  color:        var(--text);
}
.login-theme-pills .btn.active {
  border-color: var(--accent);
  color:        var(--accent);
  background:   rgba(var(--accent-rgb),.08);
  font-weight:  600;
}

/* Submit */
.login-submit {
  width:         100%;
  height:        var(--h-btn-lg);
  background:    linear-gradient(135deg, var(--accent2), var(--accent));
  color:         var(--text-inv);
  border:        none;
  border-radius: 4px;
  font-family:   var(--font-heading);
  font-size:     var(--text-base);
  font-weight:   var(--fw-semi);
  cursor:        pointer;
  letter-spacing: .02em;
  transition:    filter var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  margin-top:    4px;
}
.login-submit:hover:not(:disabled) {
  filter:     brightness(1.08);
  transform:  translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb),.35);
}
.login-submit:disabled {
  opacity: .55;
  cursor:  not-allowed;
}

/* Footer */
.login-footer {
  text-align:  center;
  font-size:   var(--text-xs);
  color:       var(--text3);
  margin-top:  16px;
  margin-bottom: 0;
  line-height: 1.5;
}

.login-theme-row {
  display:         flex;
  justify-content: center;
  gap:             8px;
  margin-bottom:   24px;
}

/* ── Loading / empty states ──────────────────────────────── */
.state-empty {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  padding:         64px 32px;
  color:           var(--text3);
  text-align:      center;
  gap:             12px;
}

.state-empty-icon { font-size: 40px; opacity: .4; }
.state-empty-title { font-size: var(--text-base); font-weight: var(--fw-medium); color: var(--text2); }
.state-empty-sub   { font-size: var(--text-sm); line-height: 1.6; }

.state-loading {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             12px;
  padding:         56px;
  color:           var(--text3);
  font-size:       var(--text-sm);
}

.spinner {
  width:         20px;
  height:        20px;
  border:        2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation:     spin .8s linear infinite;
  flex-shrink:   0;
}

.error-banner {
  background:    var(--red-bg);
  border:        1px solid rgba(244,63,94,.25);
  border-radius: var(--radius-md);
  padding:       14px 18px;
  font-size:     var(--text-sm);
  color:         var(--red);
}

/* ── Info box ─────────────────────────────────────────────── */
.info-box {
  background:    var(--surface2);
  border:        1px solid var(--border);
  border-radius: var(--radius-md);
  padding:       18px;
  font-size:     var(--text-sm);
  color:         var(--text3);
  line-height:   1.8;
}

/* ── Pager ────────────────────────────────────────────────── */
.pager {
  display:     flex;
  align-items: center;
  justify-content: flex-end;
  gap:         8px;
  padding:     12px 0 4px;
  font-size:   var(--text-sm);
  color:       var(--text3);
}

/* ── Admin panel ──────────────────────────────────────────── */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.admin-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       24px;
}

.admin-card-title {
  font-size:     var(--text-base);
  font-weight:   var(--fw-semi);
  color:         var(--text);
  margin-bottom: 18px;
  display:       flex;
  align-items:   center;
  gap:           8px;
}

.domain-list { display: flex; flex-direction: column; gap: 6px; }
.domain-item {
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  padding:       10px 12px;
  background:    var(--surface2);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size:     var(--text-sm);
  transition:    border-color var(--t-fast);
}
.domain-item:hover { border-color: var(--border2); }
.domain-item-name  { color: var(--text); font-weight: var(--fw-medium); }
.domain-item-sub   { color: var(--text3); font-size: var(--text-xs); }

/* ── Responsive helpers ───────────────────────────────────── */
@media (max-width: 900px) {
  .admin-grid      { grid-template-columns: 1fr; }
  .user-stats-grid { grid-template-columns: repeat(2,1fr); }
  .grid-2          { grid-template-columns: 1fr; }
}

/* ── User Cards v2 (CDR per-user tab) ─────────────────────── */
#cdrUserCards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.uc-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-lg);
  padding:       18px;
  display:       flex;
  flex-direction: column;
  gap:           14px;
  transition:    box-shadow var(--t-fast), transform var(--t-fast);
}
.uc-card:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,.12);
  transform:  translateY(-1px);
}

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

.uc-avatar {
  width:           44px;
  height:          44px;
  border-radius:   50%;
  background:      linear-gradient(135deg, var(--accent2), var(--accent));
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       15px;
  font-weight:     700;
  color:           var(--text-inv);
  flex-shrink:     0;
  outline:         3px solid var(--ring, var(--border));
  outline-offset:  2px;
}

.uc-identity { flex: 1; min-width: 0; }
.uc-name {
  font-size:     14px;
  font-weight:   600;
  color:         var(--text);
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
}
.uc-ext {
  font-size:    11px;
  color:        var(--text3);
  font-family:  var(--font-mono);
  margin-top:   2px;
}

.uc-rate {
  font-size:   20px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.uc-bars { display: flex; flex-direction: column; gap: 8px; }

.uc-bar-row {
  display:     grid;
  grid-template-columns: 120px 32px 1fr 36px;
  align-items: center;
  gap:         6px;
  font-size:   12px;
}
.uc-dir-lbl { color: var(--text2); font-size: 11px; }
.uc-dir-lbl.in  { color: var(--green); }
.uc-dir-lbl.out { color: var(--blue); }
.uc-dir-num { text-align: right; font-weight: 600; font-size: 12px; }
.uc-dir-pct { text-align: right; color: var(--text3); font-size: 11px; }

.uc-bar-wrap {
  height:        6px;
  background:    var(--bg3);
  border-radius: 3px;
  overflow:      hidden;
}
.uc-bar-fill {
  height:        100%;
  border-radius: 3px;
  transition:    width .4s ease;
}

.uc-footer {
  display:       flex;
  justify-content: space-around;
  padding-top:   12px;
  border-top:    1px solid var(--border);
  gap:           4px;
  flex-wrap:     wrap;
}
.uc-foot-item { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.uc-foot-ico  { display: flex; align-items: center; margin-bottom: 2px; }
.uc-foot-val  { font-size: 14px; font-weight: 700; font-family: var(--font-heading); color: var(--text); text-align: center; white-space: nowrap; line-height: 1.2; }
.uc-foot-lbl  { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }

@media (max-width: 600px) {
  #cdrUserCards { grid-template-columns: 1fr; }
  .uc-bar-row   { grid-template-columns: 100px 28px 1fr 32px; }
}

/* ── Play button (recordings) ─────────────────────────────── */
.btn-play {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             5px;
  height:          var(--h-btn-sm);
  padding:         0 10px;
  border-radius:   var(--radius-pill);
  border:          1px solid rgba(96,165,250,.35);
  background:      rgba(96,165,250,.08);
  color:           var(--blue);
  font-size:       11px;
  font-weight:     600;
  cursor:          pointer;
  white-space:     nowrap;
  transition:      background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.btn-play:hover {
  background:  rgba(96,165,250,.18);
  border-color: rgba(96,165,250,.6);
  transform:   translateY(-1px);
}
.btn-play svg { flex-shrink: 0; }

/* ── Attempts expand pill ──────────────────────────────────── */
.btn-attempts {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             4px;
  height:          var(--h-btn-sm);
  padding:         0 9px;
  border-radius:   var(--radius-pill);
  border:          1px solid rgba(45,212,191,.3);
  background:      rgba(45,212,191,.07);
  color:           var(--accent);
  font-size:       11px;
  font-weight:     600;
  cursor:          pointer;
  white-space:     nowrap;
  transition:      background var(--t-fast), border-color var(--t-fast);
  user-select:     none;
}
.btn-attempts:hover {
  background:   rgba(45,212,191,.15);
  border-color: rgba(45,212,191,.55);
}
.btn-attempts.open {
  background:   rgba(45,212,191,.18);
  border-color: var(--accent);
}
.btn-attempts .chev {
  transition: transform var(--t-fast);
  flex-shrink: 0;
}
.btn-attempts.open .chev {
  transform: rotate(180deg);
}

/* ── Attempts sub-row ──────────────────────────────────────── */
.attempts-subrow td { padding: 0; }
.attempts-table {
  width: 100%;
  border-collapse: collapse;
  border-left: 3px solid rgba(45,212,191,.25);
}
.attempts-table th {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  padding: 5px 10px 5px 36px;
  text-align: left;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.attempts-table th.right { text-align: right; padding-right: 14px; }
.attempts-table td {
  font-size: 11px;
  padding: 6px 10px 6px 36px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.attempts-table tr:last-child td { border-bottom: none; }
.attempts-table .att-num {
  display: inline-block;
  width: 20px;
  text-align: right;
  color: var(--text3);
  font-size: 10px;
  margin-right: 8px;
  flex-shrink: 0;
}
.attempt-ok   { color: var(--green);  font-weight: 600; }
.attempt-miss { color: var(--red);    }
.attempt-busy { color: var(--orange); }

/* ── Login error shake + input error highlight ─────────────── */
@keyframes loginShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px); }
  40%     { transform: translateX(6px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}
.login-error.shake  { animation: loginShake .35s ease; }
.login-input.error  {
  border-color: var(--red);
  box-shadow:   0 0 0 3px rgba(244,63,94,.12);
}


/* ── Sortable column headers ───────────────────────────────── */
th.sortable {
  cursor:      pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover { color: var(--accent); }
th.sortable::after {
  content:     ' ⇅';
  font-size:   9px;
  opacity:     .35;
  margin-left: 2px;
}
th.sortable.sort-asc::after  { content: ' ↑'; opacity: .8; color: var(--accent); }
th.sortable.sort-desc::after { content: ' ↓'; opacity: .8; color: var(--accent); }

/* ── CC log queue text input ───────────────────────────────── */
#ccLogQueue.filter-control {
  min-width: 180px;
}

/* ── Expand chevron in date cell ───────────────────────────── */
.att-chev {
  display:        inline-flex;
  align-items:    center;
  cursor:         pointer;
  color:          var(--accent);
  vertical-align: middle;
  margin-left:    5px;
  opacity:        .75;
  transition:     opacity var(--t-fast);
}
.att-chev:hover { opacity: 1; }
.att-chev svg.chev { transition: transform var(--t-normal); }

/* ── Login logo below form ─────────────────────────────────── */
.login-logo-bottom {
  display: none; /* no longer used */
}

/* ── Brand logo below card in loginView ────────────────────── */
.login-brand-logo {
  display:     flex;
  align-items: center;
  justify-content: center;
  opacity:     .55;
  transition:  opacity var(--t-fast);
}
.login-brand-logo:hover { opacity: .75; }

/* ── Doughnut chart — square container, always a circle ─────── */
.chart-donut-wrap {
  position:    relative;
  width:       100%;
  /* Enforce 1:1 aspect ratio — padding trick */
  aspect-ratio: 1.8 / 1;
  max-height:  320px;
  overflow:    hidden;
}
.chart-donut-wrap canvas {
  position: absolute !important;
  inset:    0 !important;
  width:    100% !important;
  height:   100% !important;
}

/* ── filter-control inline in section-header: match btn-sm height ────── */
.section-header .filter-control {
  height:     var(--h-btn-sm) !important;
  padding:    0 10px !important;
  font-size:  12px !important;
}
.section-header .btn {
  height:     var(--h-btn-sm);
  padding:    0 12px;
  font-size:  12px;
}
