/*
 * t-sgtm panel - styles
 * Version: 1.0.3 | Author: Trabsky
 * Trabsky admin design system (T-Lang tokens), prefix t-sgtm-. Literal values, no CSS vars.
 */

/* === BASE === */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #f4f5f7; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px; color: #374151; letter-spacing: -0.02em; line-height: 1.5;
}
a { color: #1343F0; text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #eef0f2;
  padding: 1px 6px; border-radius: 0.6em; letter-spacing: 0; color: #1a1a1a; word-break: break-all; }
h1, h2, h3, .t-sgtm-kpi__n, .t-sgtm-mini__n { font-family: 'Inter Tight', 'Inter', -apple-system, sans-serif; letter-spacing: 0; }

/* === SHELL === */
.t-sgtm-app { max-width: 1440px; margin: 0 auto; padding: 0 20px 40px; }
.t-sgtm-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 16px; flex-wrap: wrap; }
.t-sgtm-brand { display: flex; align-items: center; gap: 10px; color: #0a0a0a; }
.t-sgtm-brand:hover { text-decoration: none; }
.t-sgtm-brand__logo { width: 34px; height: 34px; border-radius: 0.6em; background: #1343F0; color: #fff; display: grid;
  place-items: center; font: 700 18px 'Inter Tight', sans-serif; }
.t-sgtm-brand__name { font: 700 18px 'Inter Tight', sans-serif; letter-spacing: 0; }
.t-sgtm-brand__ver { font-size: 11px; color: #9ca3af; }
.t-sgtm-top__user { display: flex; align-items: center; gap: 12px; }
.t-sgtm-top__email { font-size: 13px; color: #6b7280; }
.t-sgtm-main { min-width: 0; }
.t-sgtm-foot { margin-top: 32px; padding-top: 14px; border-top: 1px solid #e6e6e6; font-size: 11px; color: #9ca3af; }
.t-sgtm-crumbs { font-size: 12px; color: #9ca3af; margin: 4px 0 10px; }

/* === TYPOGRAPHY === */
.t-sgtm-page-title { font-size: 24px; font-weight: 700; color: #0a0a0a; margin: 0 0 4px; }
.t-sgtm-page-sub { font-size: 14px; color: #6b7280; margin: 0 0 22px; }
.t-sgtm-meta { font-size: 12px; color: #9ca3af; margin: 6px 0; }
.t-sgtm-link { font-size: 13px; font-weight: 600; color: #1343F0; }
.t-sgtm-headrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }

/* === CARDS === */
.t-sgtm-card { display: block; background: #fff; border: 1px solid #cccccc; border-radius: 1em; padding: 20px 24px; margin-bottom: 16px; color: inherit; }
a.t-sgtm-card:hover { text-decoration: none; border-color: #1343F0; }
.t-sgtm-section-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.t-sgtm-section-h h3 { font-size: 15px; font-weight: 600; margin: 0; color: #1a1a1a; }
.t-sgtm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.t-sgtm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.t-sgtm-empty h3 { font-size: 15px; font-weight: 600; margin: 8px 0 6px; color: #1a1a1a; }
.t-sgtm-empty p { color: #6b7280; margin: 0 0 8px; }

/* === KPIs === */
.t-sgtm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.t-sgtm-kpi { background: #fff; border: 1px solid #cccccc; border-radius: 1em; padding: 18px; }
.t-sgtm-kpi__l { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; font-weight: 600; }
.t-sgtm-kpi__n { font-size: 24px; font-weight: 600; color: #0a0a0a; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 6px; }
.t-sgtm-kpi__n--accent { color: #1343F0; }
.t-sgtm-kpi__n--error { color: #c62828; }
.t-sgtm-kpi__h { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.t-sgtm-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.t-sgtm-mini__l { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; }
.t-sgtm-mini__n { display: block; font-size: 20px; font-weight: 600; color: #0a0a0a; font-variant-numeric: tabular-nums; }
.t-sgtm-mini__t { display: block; font-size: 13px; color: #374151; margin-top: 4px; }

/* === BADGES, PILLS, NOTICES === */
.t-sgtm-badge { display: inline-block; padding: 3px 12px; border-radius: 1em; font-size: 12px; font-weight: 600; background: #eef0f2; color: #4b5563; white-space: nowrap; }
.t-sgtm-badge--active { background: #e6f4ea; color: #16803c; }
.t-sgtm-badge--pending { background: #fff4e0; color: #b45309; }
.t-sgtm-badge--conflict { background: #fde8e8; color: #c62828; }
.t-sgtm-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.t-sgtm-pills--left { margin-bottom: 12px; }
.t-sgtm-pills__item { background: #fff; border: 1px solid #cccccc; border-radius: 1em; padding: 6px 14px; font-size: 13px; font-weight: 600; color: #374151; }
.t-sgtm-pills__item:hover { border-color: #1343F0; text-decoration: none; }
.t-sgtm-pills__item.is-active { background: #1343F0; border-color: #1343F0; color: #fff; }
.t-sgtm-notice { border: 1px solid #cccccc; background: #fff; border-radius: 1em; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }
.t-sgtm-notice--ok { border-color: #16803c; background: #e6f4ea; color: #14532d; }
.t-sgtm-notice--error { border-color: #c62828; background: #fde8e8; color: #7f1d1d; }
.t-sgtm-legend { font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 6px; }
.t-sgtm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.t-sgtm-dot--in { background: #1343F0; }
.t-sgtm-dot--out { background: #9db0f8; }
.t-sgtm-dot--err { background: #c62828; border-radius: 50%; }

/* === CHART === */
.t-sgtm-chart { width: 100%; height: auto; display: block; }
.t-sgtm-chart text { font-size: 10px; fill: #9ca3af; font-family: 'Inter', sans-serif; }
.t-sgtm-bar--in { fill: #1343F0; }
.t-sgtm-bar--out { fill: #9db0f8; }
.t-sgtm-bar--err { fill: #c62828; }
.t-sgtm-axis { stroke: #e0e0e0; stroke-width: 1; }

/* === TABLES === */
.t-sgtm-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid #e0e0e0; border-radius: 0.7em; overflow: hidden; }
.t-sgtm-table th { background: #f8f9fb; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: #6b7280; text-align: left; padding: 10px 14px; }
.t-sgtm-table td { padding: 10px 14px; font-size: 13px; border-top: 1px solid #f0f0f1; vertical-align: middle; }
.t-sgtm-table tr:hover td { background: rgba(19, 67, 240, 0.03); }
.t-sgtm-table tr.is-error td { background: #fff8f8; }
.t-sgtm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.t-sgtm-nowrap { white-space: nowrap; }
.t-sgtm-desc { color: #4b5563; max-width: 520px; }
.t-sgtm-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }

/* === FORMS & BUTTONS === */
.t-sgtm-form { display: grid; gap: 14px; margin-top: 8px; }
.t-sgtm-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #374151; }
input[type=email], input[type=password], input[type=search], input[type=text], select {
  font: inherit; font-weight: 400; border: 1px solid #cccccc; border-radius: 0.6em; padding: 9px 12px; background: #fff; color: #1a1a1a; min-width: 0;
}
input:focus, select:focus { outline: none; border-color: #1343F0; box-shadow: 0 0 0 1px #1343F0; }
.t-sgtm-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.t-sgtm-filters input[type=search] { flex: 1; min-width: 220px; }
.t-sgtm-btn { display: inline-block; font: 600 13px 'Inter', sans-serif; letter-spacing: -0.01em; border: 1px solid #cccccc; background: #fff;
  color: #374151; border-radius: 0.7em; padding: 8px 16px; cursor: pointer; }
.t-sgtm-btn:hover { border-color: #1343F0; color: #1343F0; text-decoration: none; }
.t-sgtm-btn[disabled] { opacity: .5; cursor: not-allowed; }
.t-sgtm-btn--primary { background: #1343F0; border-color: #1343F0; color: #fff; }
.t-sgtm-btn--primary:hover { background: #0d35c7; border-color: #0d35c7; color: #fff; }
.t-sgtm-btn--ghost { border-color: transparent; background: transparent; }
.t-sgtm-btn--block { width: 100%; padding: 11px 16px; }
.t-sgtm-inline { display: inline; margin: 0; }

/* === DETAIL === */
.t-sgtm-health { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.t-sgtm-hrow { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e6e6e6; }
.t-sgtm-hrow .k { color: #6b7280; }
.t-sgtm-hrow .v { font-weight: 600; text-align: right; }
.t-sgtm-pre { background: #0f172a; color: #e2e8f0; border-radius: 0.7em; padding: 16px; overflow: auto; font-size: 12px; line-height: 1.5; max-height: 560px; white-space: pre-wrap; word-break: break-word; }
.t-sgtm-help summary { cursor: pointer; font: 600 15px 'Inter Tight', sans-serif; color: #1a1a1a; }
.t-sgtm-help p { color: #4b5563; font-size: 13px; }

/* === LOGIN === */
.t-sgtm-login { max-width: 420px; margin: 40px auto; }

/* === RESPONSIVE === */
@media (max-width: 1100px) { .t-sgtm-kpis { grid-template-columns: repeat(2, 1fr); } .t-sgtm-two { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .t-sgtm-app { padding: 0 12px 32px; }
  .t-sgtm-health { grid-template-columns: 1fr; }
  .t-sgtm-table--log th:nth-child(6), .t-sgtm-table--log td:nth-child(6),
  .t-sgtm-table--log th:nth-child(2), .t-sgtm-table--log td:nth-child(2) { display: none; }
  .t-sgtm-card { padding: 16px; }
  .t-sgtm-mini { grid-template-columns: 1fr 1fr; }
}
