* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: #f3f6fc; color: #0f172a; }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }

.sc-wrap { width: min(1100px, calc(100% - 24px)); margin: 0 auto; }
.sc-main { padding: 16px 0 24px; }

/* App shell */
.sc-app { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sc-side {
  background: #ffffff;
  color: #0f172a;
  padding: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid #e2e8f0;
  box-shadow: 4px 0 18px rgba(15, 23, 42, .04);
}
.sc-brand { display: inline-flex; align-items: center; justify-content: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; width: 100%; }
.sc-brand.inline { width: auto; padding: 8px 10px; }
.sc-brand img { max-height: 28px; width: auto; display: block; }
.sc-user { margin-top: 12px; background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%); border: 1px solid #dbeafe; border-radius: 12px; padding: 10px; }
.sc-user-name { font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.sc-user-meta { font-size: 12px; color: #475569; line-height: 1.5; word-break: break-word; }
.sc-side-nav { margin-top: 12px; display: grid; gap: 8px; }
.sc-side-nav a { color: #0f172a; background: #ffffff; border: 1px solid #e2e8f0; padding: 10px 11px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.sc-side-nav a.active, .sc-side-nav a:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; text-decoration: none; }

.sc-content { min-width: 0; display: flex; flex-direction: column; }
.sc-topbar {
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 18px;
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sc-topbar-title { font-size: 18px; font-weight: 800; color: #0f172a; }
.sc-topbar-sub { font-size: 13px; color: #64748b; }
.sc-login-top { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 10px 0; }

.sc-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; box-shadow: 0 10px 24px rgba(2, 6, 23, .05); }
.sc-grid { display: grid; gap: 14px; }
.sc-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sc-kpi h3 { margin: 0 0 6px; font-size: 13px; color: #64748b; font-weight: 700; }
.sc-kpi .v { font-size: 28px; font-weight: 800; color: #1d4ed8; }

.sc-title { margin: 0 0 14px; font-size: 24px; }
.sc-sub { margin: 0 0 14px; color: #64748b; }
.sc-alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.sc-ok { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; }
.sc-bad { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px; border-bottom: 1px solid #e2e8f0; text-align: left; }
th { background: #f8fafc; color: #334155; }
.sc-table { overflow: auto; border-radius: 12px; border: 1px solid #e2e8f0; }

form.sc-form { display: grid; gap: 12px; }
form.sc-form .row { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; }
textarea { min-height: 120px; }
.sc-btn { display: inline-block; border: 0; background: #1d4ed8; color: #fff; border-radius: 10px; padding: 11px 14px; font-weight: 700; cursor: pointer; }
.sc-btn:hover { filter: brightness(.95); text-decoration: none; }
.sc-btn-sm { padding: 7px 10px; border-radius: 8px; font-size: 12px; }
.sc-btn-pay { background: #dc2626; }
.sc-btn-pay:hover { background: #b91c1c; }
.sc-muted { color: #94a3b8; font-size: 13px; }
.sc-status { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #eef2ff; color: #1e3a8a; font-size: 12px; font-weight: 700; }
.sc-status.is-due { background: #fee2e2; color: #b91c1c; }
.sc-status.is-ok { background: #dcfce7; color: #166534; }
.sc-row-due td { background: #fff5f5; color: #7f1d1d; }

.sc-ticket-list { display: grid; gap: 10px; }
.sc-ticket { border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; background: linear-gradient(180deg, #fff 0%, #f8fbff 100%); }
.sc-ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sc-ticket-id { font-size: 12px; font-weight: 800; color: #475569; letter-spacing: .3px; }
.sc-ticket-title { margin: 0 0 6px; font-size: 16px; }
.sc-ticket-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: #64748b; font-size: 12px; margin-bottom: 8px; }
.sc-ticket-desc { margin: 0 0 8px; color: #0f172a; font-size: 14px; line-height: 1.45; }
.sc-ticket-update { border: 1px solid #fde68a; background: #fffbeb; border-radius: 10px; padding: 8px 10px; font-size: 13px; color: #78350f; margin-top: 8px; }
.sc-ticket-update.done { border-color: #bbf7d0; background: #ecfdf5; color: #166534; }

.sc-support-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sc-action-row { display: flex; gap: 8px; align-items: center; }
.sc-btn-ghost { background: #e2e8f0; color: #0f172a; }
.sc-btn-ghost:hover { background: #cbd5e1; }
.sc-support-layout { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); margin-top: 14px; }
.sc-ticket-table tbody tr.is-selected td { background: #eff6ff; }
.sc-row-title { font-weight: 700; color: #0f172a; }
.sc-row-sub { font-size: 12px; color: #64748b; margin-top: 3px; }
.sc-duration { font-weight: 700; color: #1f2937; }
.sc-duration.live { color: #92400e; }
.sc-duration.done { color: #166534; }
.sc-ticket-detail { display: grid; gap: 8px; }
.sc-ticket-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sc-ticket-top-actions { display: flex; gap: 8px; align-items: center; }
.sc-ticket-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sc-info-pill { border: 1px solid #dbe3ef; background: #f8fbff; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

.sc-ticket-hero { background: linear-gradient(135deg, #eef4ff 0%, #ffffff 45%, #f0fdf4 100%); border: 1px solid #dbe7ff; }
.sc-ticket-hero-title { margin-top: 8px; font-size: 16px; font-weight: 700; color: #0f172a; }
.sc-ticket-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.sc-sum-card { border-radius: 14px; padding: 12px 14px; border: 1px solid #e2e8f0; box-shadow: 0 8px 18px rgba(2, 6, 23, .05); }
.sc-sum-card .k { font-size: 12px; color: #64748b; margin-bottom: 6px; font-weight: 700; }
.sc-sum-card .v { font-size: 16px; color: #0f172a; font-weight: 800; }
.sc-sum-card.status { background: linear-gradient(180deg, #eff6ff, #ffffff); }
.sc-sum-card.created { background: linear-gradient(180deg, #fff7ed, #ffffff); }
.sc-sum-card.connection { background: linear-gradient(180deg, #f5f3ff, #ffffff); }
.sc-sum-card.duration { background: linear-gradient(180deg, #ecfdf5, #ffffff); }

.sc-timeline { position: relative; display: grid; gap: 14px; }
.sc-tl-item { display: grid; grid-template-columns: 120px 28px 1fr; gap: 10px; align-items: start; }
.sc-tl-time { text-align: right; color: #334155; font-size: 12px; padding-top: 2px; }
.sc-tl-time small { color: #64748b; }
.sc-tl-track { position: relative; min-height: 100%; }
.sc-tl-track::before { content: ""; position: absolute; left: 13px; top: -10px; bottom: -10px; width: 2px; background: #dbe3ef; }
.sc-tl-item:first-child .sc-tl-track::before { top: 12px; }
.sc-tl-item:last-child .sc-tl-track::before { bottom: calc(100% - 12px); }
.sc-tl-dot { position: absolute; left: 7px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: #1d4ed8; border: 2px solid #fff; box-shadow: 0 0 0 2px #bfdbfe; }
.sc-tl-content { border: 1px solid #e2e8f0; background: linear-gradient(180deg,#ffffff,#f8fbff); border-radius: 12px; padding: 10px 12px; }
.sc-tl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.sc-tl-head span { color: #64748b; font-size: 12px; font-weight: 700; }
.sc-tl-text { margin-top: 6px; color: #0f172a; font-size: 14px; line-height: 1.45; white-space: normal; word-break: break-word; }
.sc-type-complete .sc-tl-dot { background: #16a34a; box-shadow: 0 0 0 2px #bbf7d0; }
.sc-type-client .sc-tl-dot { background: #7c3aed; box-shadow: 0 0 0 2px #ddd6fe; }
.sc-type-admin .sc-tl-dot { background: #0ea5e9; box-shadow: 0 0 0 2px #bae6fd; }
.sc-type-assigned .sc-tl-dot { background: #f59e0b; box-shadow: 0 0 0 2px #fde68a; }

/* Invoice page */
.sc-inv-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 55%, #ecfdf5 100%);
  border-color: #dbe7ff;
}
.sc-inv-kpis .sc-card:nth-child(1) { background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); }
.sc-inv-kpis .sc-card:nth-child(2) { background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%); }
.sc-inv-kpis .sc-card:nth-child(3) { background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%); }
.sc-inv-kpis .sc-card:nth-child(4) { background: linear-gradient(180deg, #ecfeff 0%, #ffffff 100%); }
.sc-inv-table-wrap { padding: 10px; }
.sc-inv-table { min-width: 900px; }
.sc-inv-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.sc-inv-table tbody tr:nth-child(even):not(.sc-row-due) td { background: #fbfdff; }
.sc-inv-table tbody tr:hover td { background: #eef4ff; }
.sc-inv-chip {
  display: inline-block;
  background: #eef2ff;
  color: #1e3a8a;
  border: 1px solid #c7d2fe;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

/* Connections page */
.sc-conn-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #eef4ff 0%, #ffffff 55%, #f0fdf4 100%);
  border-color: #dbe7ff;
}
.sc-conn-kpis .sc-card:nth-child(1) { background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); }
.sc-conn-kpis .sc-card:nth-child(2) { background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%); }
.sc-conn-kpis .sc-card:nth-child(3) { background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%); }
.sc-conn-kpis .sc-card:nth-child(4) { background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%); }
.sc-conn-table-wrap { padding: 10px; }
.sc-conn-table { min-width: 920px; }
.sc-conn-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.sc-conn-table tbody tr:nth-child(even) td { background: #fbfdff; }
.sc-conn-table tbody tr:hover td { background: #eef4ff; }
.sc-conn-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 2px; }
.sc-conn-item {
  border-color: #dbe7ff;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 14px;
}
.sc-conn-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.sc-conn-id {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
  background: #eef4ff;
  border: 1px solid #dbe7ff;
  border-radius: 10px;
  padding: 5px 10px;
}
.sc-conn-item-body { display: grid; gap: 9px; }
.sc-conn-field {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
}
.sc-conn-field span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: #64748b;
  font-weight: 700;
}
.sc-conn-field strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}
.sc-conn-item-foot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sc-conn-activation { font-size: 12px; color: #475569; }
.sc-conn-activation strong { color: #0f172a; }
.sc-conn-empty { color: #64748b; font-weight: 700; }
.sc-info-list { display: grid; gap: 8px; font-size: 14px; color: #0f172a; }
.sc-info-list > div { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #fff; }
.sc-live-usage { background: linear-gradient(135deg, #f8fffb 0%, #ffffff 55%, #eff6ff 100%); border-color: #d9f3e4; }
.sc-live-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sc-live-right { display: flex; align-items: center; gap: 10px; }
.sc-live-loader {
  margin-bottom: 12px;
  border: 1px solid #dbe7ff;
  border-radius: 12px;
  background: #f8fbff;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sc-live-loader.is-loading { border-color: #93c5fd; }
.sc-live-clock {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}
.sc-live-clock svg {
  width: 34px;
  height: 34px;
  transform: rotate(-90deg);
  display: block;
}
.sc-live-clock-track {
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 4;
}
.sc-live-clock-progress {
  fill: none;
  stroke: #2563eb;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100.53;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .12s linear;
}
.sc-live-clock span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #1e3a8a;
}
.sc-live-loader-text {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.sc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.sc-live-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
}
.sc-live-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sc-live-item {
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(2, 6, 23, .07);
}
.sc-live-item-rx {
  border-color: #86efac;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 55%, #f0fdf4 100%);
}
.sc-live-item-tx {
  border-color: #fca5a5;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 55%, #fef2f2 100%);
}
.sc-live-item-rx .sc-live-label { color: #166534; }
.sc-live-item-tx .sc-live-label { color: #991b1b; }
.sc-live-item-rx .sc-live-value { color: #166534; }
.sc-live-item-tx .sc-live-value { color: #991b1b; }
.sc-live-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .3px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.sc-live-value {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 900;
  margin-bottom: 11px;
}
.sc-live-bar { width: 100%; height: 12px; border-radius: 999px; background: rgba(255,255,255,.7); overflow: hidden; }
.sc-live-fill { height: 100%; border-radius: 999px; transition: width .35s ease; }
.sc-live-fill.rx { background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%); }
.sc-live-fill.tx { background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%); }
.sc-live-card-meta {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.sc-live-max { color: #334155; font-weight: 700; }
.sc-live-max strong { font-weight: 900; }
.sc-live-peak-time { color: #64748b; }
.sc-live-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #475569;
  font-size: 12px;
}
.sc-prof-hero { background: linear-gradient(135deg, #eef4ff 0%, #ffffff 55%, #f0fdf4 100%); border-color: #dbe7ff; }
.sc-prof-grid { display: grid; gap: 14px; grid-template-columns: 1.2fr 1fr; }
.sc-prof-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sc-prof-list > div { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 14px; }
.sc-prof-list strong { color: #334155; display: block; font-size: 12px; margin-bottom: 3px; }
.sc-prof-address-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sc-prof-address-card { border: 1px solid #dbe3ef; border-radius: 14px; padding: 12px; background: linear-gradient(180deg, #ffffff, #f8fbff); box-shadow: 0 8px 18px rgba(2, 6, 23, .05); }
.sc-prof-address-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sc-prof-addr-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sc-prof-addr-mini > div { border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; padding: 8px 10px; font-size: 13px; }
.sc-prof-addr-mini strong { display: block; font-size: 11px; color: #475569; margin-bottom: 2px; }
.sc-prof-map-wrap { margin-top: 10px; }
.sc-prof-map { width: 100%; border: 0; border-radius: 12px; min-height: 220px; background: #f1f5f9; }
.sc-security-card { background: linear-gradient(135deg, #eef4ff 0%, #ffffff 60%, #ecfeff 100%); border-color: #dbe7ff; }
.sc-security-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

.sc-settings-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.sc-settings-panel { background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); border-color: #dbe7ff; }
.sc-settings-tips { background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%); }
.sc-tip-list { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 8px; color: #334155; }
.sc-tip-list li { line-height: 1.45; }
.sc-btn-soft { background: #e2e8f0; color: #0f172a; }
.sc-btn-soft:hover { background: #cbd5e1; }

.sc-footer { border-top: 1px solid #e2e8f0; background: #fff; padding: 12px 16px; color: #64748b; font-size: 13px; }

@media (max-width: 992px) {
  .sc-app { grid-template-columns: 1fr; }
  .sc-side {
    position: relative;
    height: auto;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 0;
  }
  .sc-side-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sc-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-conn-card-grid { grid-template-columns: 1fr; }
  .sc-support-layout { grid-template-columns: 1fr; }
  .sc-ticket-info-grid { grid-template-columns: 1fr; }
  .sc-ticket-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .sc-side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-topbar { padding: 10px 12px; }
  .sc-topbar-title { font-size: 16px; }
  .sc-topbar-sub { display: none; }
  .sc-grid-2, .sc-grid-4 { grid-template-columns: 1fr; }
  form.sc-form .row { grid-template-columns: 1fr; }
  .sc-live-grid { grid-template-columns: 1fr; }
  .sc-live-head, .sc-live-meta, .sc-live-card-meta { flex-direction: column; align-items: flex-start; }
  .sc-live-loader { width: 100%; }
  .sc-live-value { font-size: 26px; }
  .sc-conn-item-foot { flex-direction: column; align-items: flex-start; }
  .sc-support-actions { flex-direction: column; align-items: flex-start; }
  .sc-ticket-top { flex-direction: column; align-items: flex-start; }
  .sc-ticket-summary-grid { grid-template-columns: 1fr; }
  .sc-tl-item { grid-template-columns: 1fr; gap: 8px; }
  .sc-tl-time { text-align: left; }
  .sc-tl-track { display: none; }
  .sc-inv-hero { flex-direction: column; align-items: flex-start; }
  .sc-conn-hero { flex-direction: column; align-items: flex-start; }
  .sc-security-head { flex-direction: column; align-items: flex-start; }
  .sc-settings-grid { grid-template-columns: 1fr; }
  .sc-prof-grid, .sc-prof-list, .sc-prof-address-grid, .sc-prof-addr-mini { grid-template-columns: 1fr; }
}

