/*
  Hialgo UI/UX adaptation layer.
  Purpose: project-specific utilities for professional OMS/trading screens.
  Scope: opt-in classes only. Avoid broad Bootstrap overrides.
*/

:root {
    --hio-surface: #ffffff;
    --hio-surface-soft: #f8fafc;
    --hio-ink: #172033;
    --hio-muted: #667085;
    --hio-border: #e4eaf3;
    --hio-primary: #1a73e8;
    --hio-success: #087443;
    --hio-danger: #b42318;
    --hio-warning: #b54708;
    --hio-radius: 10px;
    --hio-shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.04);
    --hio-shadow-md: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.hio-auth-page {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(23, 32, 51, 0.92)),
        #0f172a;
    color: #f8fafc;
}

.hio-auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.hio-auth-panel {
    width: min(100%, 430px);
    padding: 24px;
    border: 1px solid rgba(226, 232, 240, 0.14);
    border-radius: 14px;
    background: #ffffff;
    color: var(--hio-ink);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.hio-auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.hio-auth-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--hio-primary);
    color: #fff;
    font-weight: 900;
}

.hio-auth-brand h1 {
    margin: 0;
    color: var(--hio-ink);
    font-size: 22px;
    font-weight: 850;
}

.hio-auth-brand p {
    margin: 2px 0 0;
    color: var(--hio-muted);
    font-size: 13px;
}

.hio-auth-form {
    display: grid;
    gap: 9px;
}

.hio-auth-form .form-label {
    margin-bottom: -3px;
    color: #475467;
    font-size: 12px;
    font-weight: 800;
}

.hio-auth-form .form-control {
    min-height: 42px;
}

.hio-auth-form .btn {
    min-height: 42px;
    margin-top: 8px;
    font-weight: 800;
}

.hio-auth-link {
    margin-top: 16px;
    color: var(--hio-muted);
    font-size: 13px;
    text-align: center;
}

.hio-auth-link a {
    color: var(--hio-primary);
    font-weight: 800;
}

.hio-page {
    width: min(100%, 1220px);
    margin: 0 auto;
    padding: 18px clamp(12px, 1.8vw, 28px);
}

.hio-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.hio-kicker {
    color: var(--hio-primary);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.hio-title {
    margin: 0;
    color: var(--hio-ink);
    font-size: 21px;
    font-weight: 850;
    letter-spacing: 0;
}

.hio-subtitle {
    margin: 4px 0 0;
    color: var(--hio-muted);
    font-size: 13px;
}

.hio-panel {
    border: 1px solid var(--hio-border);
    border-radius: var(--hio-radius);
    background: var(--hio-surface);
    box-shadow: var(--hio-shadow-sm);
}

.hio-panel-pad {
    padding: 14px 16px;
}

.hio-dense-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.hio-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.hio-metric {
    padding: 12px 14px;
    border: 1px solid var(--hio-border);
    border-radius: var(--hio-radius);
    background: var(--hio-surface);
    box-shadow: var(--hio-shadow-sm);
}

.hio-metric span {
    display: block;
    color: var(--hio-muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.hio-metric strong {
    display: block;
    margin-top: 3px;
    color: var(--hio-ink);
    font-size: 21px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.hio-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid #d0d5dd;
    background: var(--hio-surface-soft);
    color: #475467;
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.hio-chip-success {
    border-color: #bce9cd;
    background: #eaf8f0;
    color: var(--hio-success);
}

.hio-chip-danger {
    border-color: #f5beb9;
    background: #fff5f4;
    color: var(--hio-danger);
}

.hio-chip-warning {
    border-color: #f6c68d;
    background: #fff4e8;
    color: var(--hio-warning);
}

.hio-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.hio-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--hio-border);
    border-radius: var(--hio-radius);
    background: var(--hio-surface);
}

.hio-table {
    min-width: 760px;
    margin-bottom: 0;
}

.hio-table thead th {
    background: var(--hio-surface-soft);
    color: #344054;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    white-space: nowrap;
}

.hio-table td,
.hio-table th {
    vertical-align: middle;
}

.hio-modal-compact .modal-body {
    padding: 10px 12px;
}

.hio-modal-compact .form-label {
    margin-bottom: 3px;
    color: #475467;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.hio-modal-compact .form-control,
.hio-modal-compact .form-select {
    min-height: 32px;
    font-size: 12px;
}

.hio-num {
    font-variant-numeric: tabular-nums;
}

.hio-focus-ring:focus-visible,
.hio-panel a:focus-visible,
.hio-panel button:focus-visible {
    outline: 2px solid rgba(26, 115, 232, 0.55);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .hio-page-header {
        flex-direction: column;
    }

    .hio-action-row {
        justify-content: stretch;
    }

    .hio-action-row .btn {
        flex: 1 1 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hio-panel,
    .hio-chip,
    .hio-action-row .btn {
        transition: none !important;
    }
}
