/* Trade2Sync console — tokens transcribed from the approved Trade2Sync
   Admin.dc.html design mockup (light theme, distinct from the dark /admin/ skin). */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f4f5f7;
    font-family: 'Instrument Sans', system-ui, sans-serif;
    color: #111827;
    font-size: 14px;
}

a { color: #3664f8; text-decoration: none; }
a:hover { color: #274bd6; text-decoration: underline; }

input, select, button, textarea { font-family: inherit; }
input:focus, select:focus { outline: 2px solid #3664f8; outline-offset: -1px; }
::placeholder { color: #9ca3af; }

.t2s-mono { font-family: 'JetBrains Mono', monospace; }

@keyframes t2sPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- Login ---------------------------------------------------------- */

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

.t2s-login-brand {
    flex: 1;
    background: #3664f8;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 60px;
}

.t2s-login-brand-head { display: flex; align-items: center; gap: 14px; }
.t2s-login-mark { width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.t2s-login-wordmark { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.t2s-login-headline { font-size: 40px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; max-width: 420px; }
.t2s-login-sub { margin-top: 18px; font-size: 16px; color: rgba(255,255,255,.75); max-width: 420px; line-height: 1.55; }
.t2s-login-foot { font-size: 13px; color: rgba(255,255,255,.55); }

.t2s-login-form-side { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; }
.t2s-login-form-wrap { width: 360px; }
.t2s-login-title { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.t2s-login-desc { margin-top: 6px; font-size: 14px; color: #6b7280; }

.t2s-field { margin-top: 14px; }
.t2s-field:first-of-type { margin-top: 28px; }
.t2s-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.t2s-field input {
    width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;
}

.t2s-error { font-size: 13px; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 12px; margin-top: 14px; }

.t2s-btn-primary {
    padding: 11px; background: #3664f8; color: #fff; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.t2s-btn-primary:hover { background: #274bd6; }

.t2s-login-submit { margin-top: 14px; width: 100%; }

/* ---- App shell -------------------------------------------------------- */

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

.t2s-sidebar {
    flex-shrink: 0; width: 240px; background: #101426; color: #fff;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.t2s-sidebar-head { display: flex; align-items: center; gap: 11px; padding: 18px 16px 12px; }
.t2s-sidebar-mark { width: 30px; height: 30px; border-radius: 7px; background: #3664f8; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.t2s-sidebar-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }

.t2s-nav { padding: 2px 10px 6px; flex: 1; overflow-y: auto; }
.t2s-nav-group { margin-bottom: 4px; }
.t2s-nav-group-label {
    font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,.35); text-transform: uppercase;
    letter-spacing: .08em; padding: 12px 12px 5px;
}
.t2s-nav-link {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
    font-size: 13.5px; font-weight: 500; cursor: pointer; margin-bottom: 2px; position: relative;
    color: rgba(255,255,255,.6); text-decoration: none;
}
.t2s-nav-link:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.t2s-nav-link.is-active { color: #fff; background: rgba(54,100,248,.35); }
.t2s-nav-link.is-active::before {
    content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: #3664f8;
}
.t2s-nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; }
.t2s-nav-icon svg { width: 100%; height: 100%; }

.t2s-sidebar-foot { padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.t2s-user-chip { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.t2s-avatar { width: 32px; height: 32px; border-radius: 50%; background: #3664f8; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.t2s-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t2s-user-role { font-size: 11px; color: rgba(255,255,255,.55); }
.t2s-signout {
    margin-top: 12px; width: 100%; padding: 7px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.8);
    border: 1px solid rgba(255,255,255,.12); border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer;
}
.t2s-signout:hover { background: rgba(255,255,255,.14); }

.t2s-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.t2s-topbar {
    background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 28px; height: 58px;
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5;
}
.t2s-topbar-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.t2s-topbar-right { display: flex; align-items: center; gap: 14px; }
.t2s-live-indicator { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #059669; }
.t2s-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: t2sPulse 1.6s ease-in-out infinite; }
.t2s-role-badge { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: #eef2ff; color: #3664f8; border: 1px solid #dbe3ff; }

.t2s-content { padding: 24px 28px; flex: 1; }

.t2s-messages { margin: 0 0 16px; }
.t2s-message {
    font-size: 13px; padding: 10px 14px; border-radius: 8px; margin-bottom: 8px;
    background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0;
}
.t2s-message.error { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* ---- Stat cards / generic cards --------------------------------------- */

.t2s-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.t2s-stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 18px 20px; }
.t2s-stat-head { display: flex; align-items: center; justify-content: space-between; }
.t2s-stat-label { font-size: 12px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.t2s-stat-value { font-size: 30px; font-weight: 700; margin-top: 6px; }
.t2s-stat-sub { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.t2s-progress { margin-top: 8px; height: 6px; border-radius: 99px; background: #eef0f4; overflow: hidden; }
.t2s-progress-fill { height: 100%; border-radius: 99px; background: #3664f8; }

.t2s-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; margin-top: 18px; }
.t2s-card-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid #e5e7eb; gap: 16px; }
.t2s-card-title { font-size: 13.5px; font-weight: 600; }

.t2s-sparkline { display: flex; align-items: flex-end; gap: 2px; height: 24px; flex: 1; justify-content: flex-end; overflow: hidden; }
.t2s-sparkline span { width: 5px; border-radius: 2px 2px 0 0; flex-shrink: 0; }

/* ---- Toolbars / filters ------------------------------------------------ */

.t2s-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.t2s-input, .t2s-select {
    padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13.5px; background: #fff;
}
.t2s-input { flex: 1; max-width: 340px; }
.t2s-spacer { flex: 1; }

.t2s-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.t2s-tab { padding: 7px 16px; border-radius: 99px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid #d1d5db; background: #fff; color: #374151; }
.t2s-tab.is-active { background: #3664f8; color: #fff; border-color: #3664f8; }

/* ---- Tables -------------------------------------------------------- */

.t2s-table { width: 100%; border-collapse: collapse; }
.t2s-table-head {
    display: grid; gap: 12px; padding: 10px 18px; background: #fafafa; border-bottom: 1px solid #e5e7eb;
    font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em;
}
.t2s-table-row { display: grid; gap: 12px; padding: 11px 18px; border-bottom: 1px solid #f1f2f4; font-size: 13px; align-items: center; }
.t2s-table-row:last-child { border-bottom: none; }
.t2s-empty { padding: 34px; text-align: center; color: #9ca3af; font-size: 13.5px; }
.t2s-actions-cell { text-align: right; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* ---- Buttons --------------------------------------------------------- */

.t2s-btn { padding: 9px 16px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.t2s-btn.blue { background: #3664f8; color: #fff; }
.t2s-btn.blue:hover { background: #274bd6; }
.t2s-btn-ghost { padding: 5px 11px; background: #fff; border: 1px solid #d1d5db; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; color: #374151; }
.t2s-btn-ghost:hover { background: #f4f5f7; }
.t2s-btn-danger { padding: 5px 9px; background: #fff; border: 1px solid #fecaca; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; color: #dc2626; }
.t2s-btn-danger:hover { background: #fef2f2; }

/* ---- Badges ------------------------------------------------------------ */

.t2s-badge { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px; display: inline-block; }
.t2s-badge.good { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.t2s-badge.bad { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.t2s-badge.muted { background: #f4f5f7; color: #9ca3af; border: 1px solid #e5e7eb; }

/* ---- Toggle switches ---------------------------------------------------- */

.t2s-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; border: none; background: none; padding: 0; }
.t2s-switch-track { width: 36px; height: 20px; border-radius: 99px; position: relative; background: #d1d5db; transition: background .15s; }
.t2s-switch-track.on { background: #10b981; }
.t2s-switch-track.on.blue { background: #3664f8; }
.t2s-switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.t2s-switch-track.on .t2s-switch-knob { left: 18px; }

/* ---- Forms (settings / modals) ---------------------------------------- */

.t2s-form-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 24px; max-width: 640px; }
.t2s-form-title { font-size: 15px; font-weight: 700; margin: 0; }
.t2s-form-desc { font-size: 13px; color: #6b7280; margin-top: 4px; line-height: 1.5; }
.t2s-form-code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: #f4f5f7; padding: 1px 6px; border-radius: 4px; }

.t2s-form-row { margin-top: 16px; }
.t2s-form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.t2s-form-row input[type="text"], .t2s-form-row input[type="url"], .t2s-form-row input[type="number"],
.t2s-form-row input[type="password"], .t2s-form-row input[type="email"] {
    width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px;
}
.t2s-form-hint { font-weight: 400; color: #9ca3af; }

.t2s-resolved-url-box { background: #f8f9fb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px 14px; margin-top: 16px; }
.t2s-resolved-url-label { font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.t2s-resolved-url-value { font-family: 'JetBrains Mono', monospace; font-size: 12px; margin-top: 6px; color: #3664f8; word-break: break-all; }

/* ---- Modal overlay ------------------------------------------------------ */

.t2s-overlay {
    position: fixed; inset: 0; background: rgba(16,20,38,.55); display: flex; align-items: center;
    justify-content: center; z-index: 50; padding: 20px;
}
.t2s-modal { background: #fff; border-radius: 14px; width: 440px; max-width: 100%; padding: 26px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.t2s-modal-title { font-size: 17px; font-weight: 700; margin: 0; }
.t2s-modal-actions { margin-top: 22px; display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Payload detail ----------------------------------------------------- */

.t2s-payload { margin: 0; padding: 14px 18px; background: #101426; color: #c8d3f5; font-size: 12px; font-family: 'JetBrains Mono', monospace; line-height: 1.6; overflow-x: auto; }

details.t2s-msg-row summary { list-style: none; cursor: pointer; }
details.t2s-msg-row summary::-webkit-details-marker { display: none; }

@media (max-width: 900px) {
    .t2s-sidebar { display: none; }
    .t2s-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
