/*
  Hialgo Platform V2
  A deeper UI/UX Pro Max adaptation for production OMS screens.
  Visual-only layer: no API, selector, form, or execution-flow changes.
*/

:root {
    --hio-bg: #eaf0f7;
    --hio-surface: #ffffff;
    --hio-surface-2: #f7f9fc;
    --hio-ink: #09111f;
    --hio-text: #182338;
    --hio-muted: #617089;
    --hio-line: #d8e2ef;
    --hio-line-soft: #e9eef6;
    --hio-primary: #1e40af;
    --hio-primary-2: #2563eb;
    --hio-accent: #d97706;
    --hio-buy: #087443;
    --hio-sell: #b42318;
    --hio-warn: #b54708;
    --hio-shadow-1: 0 1px 2px rgba(9, 17, 31, 0.06), 0 10px 28px rgba(9, 17, 31, 0.08);
    --hio-shadow-2: 0 18px 46px rgba(9, 17, 31, 0.14);
}

body.ha-platform-v2 {
    background:
        linear-gradient(180deg, rgba(9, 17, 31, 0.08) 0, rgba(9, 17, 31, 0) 270px),
        radial-gradient(circle at 85% 0, rgba(37, 99, 235, 0.12), transparent 28%),
        var(--hio-bg);
    color: var(--hio-text);
    font-family: Inter, "Fira Sans", "Segoe UI", Arial, sans-serif;
}

.hio-auth-page {
    min-height: 100dvh;
    overflow-x: hidden;
}

.hio-auth-shell {
    width: 100%;
    min-height: 100dvh;
    padding: 18px;
}

.hio-auth-panel {
    width: min(100%, 430px);
    max-width: calc(100vw - 32px);
}

.ha-platform-v2 .ha-topbar {
    height: 58px;
    background: linear-gradient(90deg, #07111f 0, #101b2f 52%, #0b1220 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ha-platform-v2 .ha-sidebar {
    border-right: 1px solid #dde6f2;
    background:
        linear-gradient(180deg, #ffffff 0, #f7f9fc 56%, #eef4fb 100%);
}

body.ha-platform-v2.ha-sidebar-collapsed .ha-sidebar {
    width: var(--ha-sidebar-collapsed-width);
}

.ha-platform-v2 .ha-nav-group summary {
    color: #667085;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ha-platform-v2 .ha-nav-link {
    min-height: 34px;
    border-radius: 10px;
    color: #334155;
    font-size: 12px;
    font-weight: 850;
}

.ha-platform-v2 .ha-nav-link:hover {
    background: #eef5ff;
    color: var(--hio-primary);
}

.ha-platform-v2 .ha-nav-link.active {
    background: linear-gradient(90deg, #e8f1ff, #f8fbff);
    color: var(--hio-primary);
    box-shadow: inset 3px 0 0 var(--hio-primary), inset 0 0 0 1px rgba(30, 64, 175, 0.09);
}

.ha-platform-v2 .ha-platform-container,
.ha-platform-v2 .ha-content-shell,
.ha-platform-v2 .basket-shell,
.ha-platform-v2 .orders-wrapper,
.ha-platform-v2 .watchlist-workspace {
    width: min(100%, 1480px);
    max-width: 1480px;
    margin-left: auto;
    margin-right: auto;
}

.ha-platform-v2 .container-fluid.ha-platform-container {
    padding: 18px 18px 28px;
}

.ha-platform-v2 .ha-content-shell,
.ha-platform-v2 .basket-shell {
    padding: 18px 18px 34px;
}

.ha-platform-v2 .ha-admin-page-header,
.ha-platform-v2 .basket-header,
.ha-platform-v2 .ha-execution-header {
    position: relative;
    overflow: hidden;
    min-height: 112px;
    padding: 18px 20px;
    border: 1px solid rgba(9, 17, 31, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(9, 17, 31, 0.98), rgba(22, 34, 55, 0.96)),
        #0b1220;
    color: #fff;
    box-shadow: var(--hio-shadow-2);
}

.ha-platform-v2 .ha-admin-page-header > *,
.ha-platform-v2 .basket-header > *,
.ha-platform-v2 .ha-execution-header > * {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.ha-platform-v2 .ha-admin-page-header p,
.ha-platform-v2 .ha-admin-page-header .text-muted,
.ha-platform-v2 .basket-header .text-muted,
.ha-platform-v2 .ha-execution-header p {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.ha-platform-v2 .ha-admin-page-header::before,
.ha-platform-v2 .basket-header::before,
.ha-platform-v2 .ha-execution-header::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, #3b82f6, #d97706);
}

.ha-platform-v2 .ha-admin-page-header::after,
.ha-platform-v2 .basket-header::after,
.ha-platform-v2 .ha-execution-header::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -120px;
    width: 340px;
    height: 260px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22), transparent 68%);
    pointer-events: none;
}

.ha-platform-v2 .ha-admin-page-header h3,
.ha-platform-v2 .basket-header h3,
.ha-platform-v2 .ha-execution-header h3 {
    color: #fff;
    font-size: clamp(22px, 2vw, 30px);
    font-weight: 950;
    letter-spacing: 0;
}

.ha-platform-v2 .ha-admin-page-header p,
.ha-platform-v2 .ha-admin-page-header .text-muted,
.ha-platform-v2 .basket-header .text-muted,
.ha-platform-v2 .ha-execution-header p {
    color: #b8c4d6 !important;
}

.ha-platform-v2 .ha-admin-kicker {
    color: #93c5fd;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ha-platform-v2 .ha-platform-panel,
.ha-platform-v2 .ha-admin-card,
.ha-platform-v2 .basket-panel,
.ha-platform-v2 .watchlist-card,
.ha-platform-v2 .ha-order-book-panel {
    border: 1px solid var(--hio-line);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 255, 0.98)),
        var(--hio-surface);
    box-shadow: var(--hio-shadow-1);
}

.ha-platform-v2 .ha-admin-card-head {
    border-bottom: 1px solid var(--hio-line-soft);
    background: linear-gradient(180deg, #fff, #f8fbff);
}

.ha-platform-v2 .ha-admin-card-head h5,
.ha-platform-v2 .basket-panel h5 {
    color: var(--hio-ink);
    font-size: 14px;
    font-weight: 950;
}

.ha-platform-v2 .ha-admin-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.ha-platform-v2 .ha-admin-stat,
.ha-platform-v2 .hio-metric {
    min-height: 92px;
    padding: 15px;
    border-radius: 15px;
    background:
        linear-gradient(180deg, #fff, #f8fbff);
    box-shadow: var(--hio-shadow-1);
}

.ha-platform-v2 .ha-admin-stat span,
.ha-platform-v2 .hio-metric span {
    color: var(--hio-muted);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ha-platform-v2 .ha-admin-stat strong,
.ha-platform-v2 .hio-metric strong {
    color: var(--hio-ink);
    font-family: "Fira Code", Consolas, monospace;
    font-size: 28px;
    font-weight: 800;
}

.ha-platform-v2 .btn {
    border-radius: 10px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ha-platform-v2 .btn:hover {
    transform: translateY(-1px);
}

.ha-platform-v2 .btn-primary {
    border-color: var(--hio-primary);
    background: linear-gradient(180deg, #315bd6, var(--hio-primary));
    box-shadow: 0 8px 18px rgba(30, 64, 175, 0.22);
}

.ha-platform-v2 .btn-success {
    border-color: var(--hio-buy);
    background: linear-gradient(180deg, #0d8a50, var(--hio-buy));
}

.ha-platform-v2 .btn-danger {
    border-color: var(--hio-sell);
    background: linear-gradient(180deg, #c73b2f, var(--hio-sell));
}

.ha-platform-v2 .btn-outline-primary,
.ha-platform-v2 .btn-outline-secondary,
.ha-platform-v2 .btn-outline-success,
.ha-platform-v2 .btn-outline-danger {
    background: #fff;
}

.ha-platform-v2 .form-label {
    color: var(--hio-muted);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ha-platform-v2 .form-control,
.ha-platform-v2 .form-select {
    min-height: 36px;
    border-color: #cfdaea;
    border-radius: 10px;
    color: var(--hio-ink);
    font-size: 13px;
    font-weight: 750;
    box-shadow: none;
}

.ha-platform-v2 .form-control:focus,
.ha-platform-v2 .form-select:focus {
    border-color: #93b4ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.ha-platform-v2 .table-responsive,
.ha-platform-v2 .dataTables_scroll,
.ha-platform-v2 .dataTables_scrollBody {
    border-radius: 14px;
}

.ha-platform-v2 .ha-platform-table,
.ha-platform-v2 .ha-data-table,
.ha-platform-v2 .orders-table,
.ha-platform-v2 .basket-grid,
.ha-platform-v2 .ha-groups-table {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    color: #182338;
    font-size: 12px;
}

.ha-platform-v2 .ha-platform-table thead th,
.ha-platform-v2 .ha-data-table thead th,
.ha-platform-v2 .orders-table thead th,
.ha-platform-v2 .basket-grid thead th,
.ha-platform-v2 .ha-groups-table thead th {
    height: 38px;
    border-top: 1px solid var(--hio-line-soft);
    border-bottom: 1px solid var(--hio-line);
    background: linear-gradient(180deg, #f4f7fb, #edf3fa);
    color: #42526a;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ha-platform-v2 .ha-platform-table tbody td,
.ha-platform-v2 .ha-data-table tbody td,
.ha-platform-v2 .orders-table tbody td,
.ha-platform-v2 .basket-grid tbody td,
.ha-platform-v2 .ha-groups-table tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid #eaf0f7;
    vertical-align: middle;
}

.ha-platform-v2 .ha-platform-table tbody tr:hover td,
.ha-platform-v2 .ha-data-table tbody tr:hover td,
.ha-platform-v2 .orders-table tbody tr:hover td,
.ha-platform-v2 .basket-grid tbody tr:hover td,
.ha-platform-v2 .ha-groups-table tbody tr:hover td {
    background: #f6faff;
}

.ha-platform-v2 .row-order-buy-executed > td {
    background: #eefaf4 !important;
}

.ha-platform-v2 .row-order-sell-executed > td {
    background: #fff1f1 !important;
}

.ha-platform-v2 .row-order-rejected > td {
    background: #fff4e5 !important;
}

.ha-platform-v2 .row-order-cancelled > td {
    background: #f4f6f8 !important;
}

.ha-platform-v2 .row-order-pending > td {
    background: #eff6ff !important;
}

.ha-platform-v2 .ha-status-pill,
.ha-platform-v2 .status-pill,
.ha-platform-v2 .badge {
    border-radius: 999px;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ha-platform-v2 .dataTables_wrapper {
    overflow: visible;
}

.ha-platform-v2 .dataTables_wrapper .ha-dt-toolbar {
    margin: 0 0 12px;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98));
}

.ha-platform-v2 .dataTables_wrapper .dataTables_filter input {
    min-width: 280px;
    height: 34px;
}

.ha-platform-v2 .dataTables_wrapper .dt-buttons .btn,
.ha-platform-v2 .dataTables_wrapper .dt-button {
    min-height: 32px;
}

.ha-platform-v2 .orders-wrapper {
    max-width: 1480px;
}

.ha-platform-v2 .ha-order-control-bar {
    border-radius: 16px;
}

.ha-platform-v2 .ha-oms-tabs {
    border-color: #cfdced;
    background: #eef4fb;
}

.ha-platform-v2 .ha-oms-tabs .nav-link.active {
    background: var(--hio-ink);
}

.ha-platform-v2 #orderModal .modal-dialog {
    max-width: min(1060px, calc(100vw - 20px));
}

.ha-platform-v2 #orderModal .modal-content,
.ha-platform-v2 #multiOrderModal .modal-content,
.ha-platform-v2 .ha-platform-modal {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 16px;
    box-shadow: 0 28px 80px rgba(9, 17, 31, 0.34);
}

.ha-platform-v2 #orderModal .ha-order-header,
.ha-platform-v2 #multiOrderModal .modal-header {
    background:
        linear-gradient(110deg, #07111f, #14223a 60%, #0b1220);
}

.ha-platform-v2 #orderModal .ha-order-body,
.ha-platform-v2 #multiOrderModal .modal-body {
    background:
        linear-gradient(180deg, #eef4fb, #e8eef6);
}

.ha-platform-v2 #orderModal .ha-order-section {
    border-color: #d4deeb;
    background: rgba(255, 255, 255, 0.96);
}

.ha-platform-v2 #orderModal .ha-side-option,
.ha-platform-v2 #orderModal .ha-tab-option {
    border-width: 1px;
}

.ha-platform-v2 #orderModal .ha-side-buy.active,
.ha-platform-v2 #orderModal .ha-side-sell.active {
    color: #fff;
}

.ha-platform-v2 #orderModal .ha-quote-card {
    border-color: #d4deeb;
    background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.ha-platform-v2 .ha-multi-command,
.ha-platform-v2 .multi-order-shell {
    border-color: #d4deeb;
}

.ha-platform-v2 .basket-shell {
    max-width: 1480px;
}

.ha-platform-v2 .basket-panel {
    padding: 16px;
}

.ha-platform-v2 .basket-panel .table-responsive {
    overflow: auto;
}

.ha-platform-v2 .portfolio-live-row .fw-semibold,
.ha-platform-v2 .basket-grid .fw-semibold,
.ha-platform-v2 .orders-table .fw-semibold {
    color: var(--hio-ink);
}

.ha-platform-v2 .portfolio-pnl-cell,
.ha-platform-v2 .portfolio-unrealized-cell,
.ha-platform-v2 .portfolio-mtm-cell,
.ha-platform-v2 .portfolio-value-cell,
.ha-platform-v2 .portfolio-ltp-cell {
    font-family: "Fira Code", Consolas, monospace;
    font-size: 12px;
}

.ha-platform-v2 .watchlist-workspace {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    gap: 14px;
    height: auto;
    min-height: calc(100vh - 76px);
    padding: 18px;
}

.ha-platform-v2 .watchlist-workspace .left-panel,
.ha-platform-v2 .watchlist-workspace .right-panel {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
}

.ha-platform-v2 .wl-search input,
.ha-platform-v2 #search {
    height: 38px;
    border-color: #cfdaea;
    border-radius: 12px;
    font-size: 13px;
}

.ha-platform-v2 .wl-card {
    border-bottom-color: #eaf0f7;
}

.ha-platform-v2 .wl-symbol {
    font-weight: 950;
}

.ha-platform-v2 .wl-actions button {
    border-radius: 9px;
    font-weight: 900;
}

.ha-platform-v2 .ha-copytrade-page .follower-row,
.ha-platform-v2 .ha-groups-page .ha-admin-card,
.ha-platform-v2 .ha-broker-page .ha-admin-card {
    border-color: #d4deeb;
}

@media (max-width: 1024px) {
    .ha-platform-v2 .watchlist-workspace {
        grid-template-columns: 1fr;
    }

    .ha-platform-v2 .ha-admin-page-header,
    .ha-platform-v2 .basket-header,
    .ha-platform-v2 .ha-execution-header {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    html,
    body.ha-platform-v2 {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body.ha-platform-v2 {
        padding-top: var(--ha-topbar-height) !important;
        padding-left: 0 !important;
    }

    .ha-platform-v2 .ha-topbar {
        height: var(--ha-topbar-height);
        padding: 0 10px;
        gap: 8px;
    }

    .ha-platform-v2 .ha-menu-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        min-width: 42px;
        height: 38px;
        align-items: center;
        justify-content: center;
        padding: 0 10px;
        border-radius: 10px;
        font-size: 0;
    }

    .ha-platform-v2 .ha-menu-toggle::before {
        content: "Menu";
        font-size: 12px;
        font-weight: 900;
    }

    .ha-platform-v2 .ha-brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .ha-platform-v2 .ha-brand strong {
        font-size: 14px;
        white-space: nowrap;
    }

    .ha-platform-v2 .ha-brand small,
    .ha-platform-v2 .ha-user-meta {
        display: none;
    }

    .ha-platform-v2 .ha-topbar-user {
        flex: 0 0 auto;
    }

    .ha-platform-v2 .ha-logout {
        min-height: 34px;
        padding: 6px 9px;
        border-radius: 9px;
        font-size: 11px;
    }

    .ha-platform-v2 .ha-sidebar {
        top: var(--ha-topbar-height);
        bottom: 0;
        width: min(88vw, 330px);
        max-width: 330px;
        z-index: 1040;
        box-shadow: 20px 0 50px rgba(9, 17, 31, 0.22);
    }

    .ha-platform-v2 .ha-nav-backdrop {
        z-index: 1035;
    }

    .ha-platform-v2 .container-fluid.ha-platform-container,
    .ha-platform-v2 .ha-content-shell,
    .ha-platform-v2 .basket-shell,
    .ha-platform-v2 .watchlist-workspace {
        padding: 10px;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .ha-platform-v2 .ha-admin-page-header,
    .ha-platform-v2 .basket-header,
    .ha-platform-v2 .ha-execution-header {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 15px;
        border-radius: 14px;
    }

    .ha-platform-v2 .ha-admin-page-header > div,
    .ha-platform-v2 .basket-header > div,
    .ha-platform-v2 .ha-execution-header > div {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .ha-platform-v2 .ha-admin-page-header p,
    .ha-platform-v2 .ha-admin-page-header .text-muted,
    .ha-platform-v2 .basket-header .text-muted,
    .ha-platform-v2 .ha-execution-header p {
        width: 100%;
        max-width: 100%;
        white-space: normal !important;
        overflow-wrap: break-word;
        word-break: normal;
        line-height: 1.45;
    }

    .ha-platform-v2 .ha-admin-page-header .d-flex,
    .ha-platform-v2 .basket-header .d-flex,
    .ha-platform-v2 .ha-execution-actions {
        width: 100%;
        flex-direction: column;
    }

    .ha-platform-v2 .ha-admin-page-header .btn,
    .ha-platform-v2 .basket-header .btn,
    .ha-platform-v2 .ha-execution-actions .btn {
        width: 100%;
        min-height: 42px;
    }

    .ha-platform-v2 .ha-admin-stat-grid,
    .ha-platform-v2 .hio-metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .ha-platform-v2 .ha-admin-stat,
    .ha-platform-v2 .hio-metric {
        min-height: 78px;
        padding: 11px;
    }

    .ha-platform-v2 .ha-admin-stat strong,
    .ha-platform-v2 .hio-metric strong {
        font-size: 22px;
    }

    .ha-platform-v2 .ha-command-grid,
    .ha-platform-v2 .ha-command-stack {
        grid-template-columns: 1fr;
    }

    .ha-platform-v2 .ha-order-control-bar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .ha-platform-v2 .ha-order-filter {
        width: 100%;
    }

    .ha-platform-v2 .ha-oms-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        border-radius: 12px;
    }

    .ha-platform-v2 .ha-oms-tabs .nav-item,
    .ha-platform-v2 .ha-oms-tabs .nav-link {
        width: 100%;
        min-width: 0;
    }

    .ha-platform-v2 .table-responsive,
    .ha-platform-v2 .dataTables_scroll,
    .ha-platform-v2 .dataTables_scrollBody {
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .ha-platform-v2 .ha-platform-table,
    .ha-platform-v2 .ha-data-table,
    .ha-platform-v2 .orders-table,
    .ha-platform-v2 .basket-grid,
    .ha-platform-v2 .ha-groups-table {
        min-width: 760px;
        font-size: 11px;
    }

    .ha-platform-v2 .orders-table {
        min-width: 980px;
    }

    .ha-platform-v2 .portfolio-live-row td,
    .ha-platform-v2 .orders-table td,
    .ha-platform-v2 .basket-grid td {
        white-space: nowrap;
    }

    .ha-platform-v2 .dataTables_wrapper .dataTables_filter input {
        min-width: 0;
    }

    .ha-platform-v2 .dataTables_wrapper .dt-buttons,
    .ha-platform-v2 .dataTables_wrapper .dataTables_length {
        width: 100%;
    }

    .ha-platform-v2 .dataTables_wrapper .dataTables_length label,
    .ha-platform-v2 .dataTables_wrapper .dataTables_length select {
        width: 100%;
    }

    .ha-platform-v2 .dataTables_wrapper .ha-dt-toolbar {
        gap: 8px;
        border-radius: 12px;
    }

    .ha-platform-v2 .dataTables_wrapper .dt-buttons .btn,
    .ha-platform-v2 .dataTables_wrapper .dt-button {
        flex: 1 1 auto;
        min-height: 36px;
    }

    .ha-platform-v2 .basket-panel {
        padding: 12px;
    }

    .ha-platform-v2 .basket-shell .basket-panel > .row,
    .ha-platform-v2 .basket-shell .basket-panel form.row {
        row-gap: 10px;
    }

    .ha-platform-v2 .basket-shell .basket-panel .btn,
    .ha-platform-v2 .portfolio-order-btn,
    .ha-platform-v2 .link-basket-btn {
        min-height: 38px;
    }

    .ha-platform-v2 .watchlist-workspace {
        display: grid;
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 10px;
    }

    .ha-platform-v2 .watchlist-workspace .left-panel,
    .ha-platform-v2 .watchlist-workspace .right-panel {
        width: 100%;
        min-width: 0;
        padding: 10px;
    }

    .ha-platform-v2 .wl-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ha-platform-v2 .wl-tabs .tab {
        min-height: 36px;
    }

    .ha-platform-v2 #orderModal .modal-content,
    .ha-platform-v2 #multiOrderModal .modal-content {
        border-radius: 0;
    }

    .ha-platform-v2 #orderModal .modal-dialog,
    .ha-platform-v2 #multiOrderModal .modal-dialog {
        width: 100%;
        max-width: 100%;
        height: 100%;
        margin: 0;
    }

    .ha-platform-v2 #orderModal .modal-content,
    .ha-platform-v2 #multiOrderModal .modal-content {
        width: 100vw;
        max-width: 100vw;
        min-height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    .ha-platform-v2 #orderModal .modal-body,
    .ha-platform-v2 #multiOrderModal .modal-body {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .ha-platform-v2 #orderModal .ha-order-body,
    .ha-platform-v2 #orderModal .ha-order-section,
    .ha-platform-v2 #orderModal .ha-order-layout,
    .ha-platform-v2 #orderModal .ha-order-grid,
    .ha-platform-v2 #orderModal .ha-price-grid,
    .ha-platform-v2 #orderModal .ha-target-grid,
    .ha-platform-v2 #orderModal .ha-side-segment,
    .ha-platform-v2 #orderModal .ha-tab-segment {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .ha-platform-v2 #orderModal .ha-order-header,
    .ha-platform-v2 #multiOrderModal .modal-header {
        min-height: auto;
        padding: 10px 12px;
    }

    .ha-platform-v2 #orderModal .ha-order-symbol-line,
    .ha-platform-v2 #orderModal .ha-order-meta-line {
        max-width: calc(100vw - 74px);
    }

    .ha-platform-v2 #orderModal .ha-order-layout,
    .ha-platform-v2 #orderModal .ha-order-grid,
    .ha-platform-v2 #orderModal .ha-price-grid,
    .ha-platform-v2 #orderModal .ha-target-grid {
        grid-template-columns: 1fr !important;
    }

    .ha-platform-v2 #orderModal .ha-side-segment,
    .ha-platform-v2 #orderModal .ha-tab-segment {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        overflow: hidden;
    }

    .ha-platform-v2 #orderModal .ha-tab-option,
    .ha-platform-v2 #orderModal .ha-side-option {
        min-width: 0;
        min-height: 40px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .ha-platform-v2 #orderModal .ha-quote-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ha-platform-v2 #orderModal .modal-footer,
    .ha-platform-v2 #multiOrderModal .modal-footer {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
    }

    .ha-platform-v2 #orderModal .modal-footer .btn,
    .ha-platform-v2 #multiOrderModal .modal-footer .btn {
        width: 100%;
        min-height: 42px;
    }

    .ha-platform-v2 .ha-multi-command {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .ha-platform-v2 .multi-order-shell {
        max-height: 55dvh;
    }

    .ha-platform-v2 .multi-order-table {
        min-width: 1120px;
    }
}

@media (max-width: 420px) {
    .hio-auth-shell {
        align-items: center;
        justify-content: center;
        padding: 14px;
    }

    .hio-auth-panel {
        width: 100%;
        max-width: 100%;
        padding: 24px 18px;
        border-radius: 16px;
    }

    .hio-auth-brand {
        align-items: center;
    }

    .hio-auth-brand h1 {
        font-size: 22px;
    }

    .hio-auth-form .form-control,
    .hio-auth-form .btn {
        min-height: 44px;
    }

    .ha-platform-v2 .ha-admin-stat-grid,
    .ha-platform-v2 .hio-metric-grid {
        grid-template-columns: 1fr;
    }

    .ha-platform-v2 .ha-admin-page-header h3,
    .ha-platform-v2 .basket-header h3,
    .ha-platform-v2 .ha-execution-header h3 {
        font-size: 20px;
    }

    .ha-platform-v2 .ha-platform-table,
    .ha-platform-v2 .ha-data-table,
    .ha-platform-v2 .basket-grid,
    .ha-platform-v2 .ha-groups-table {
        min-width: 700px;
    }

    .ha-platform-v2 .orders-table {
        min-width: 920px;
    }

    .ha-platform-v2 #orderModal .ha-quote-strip,
    .ha-platform-v2 #orderModal .ha-side-segment,
    .ha-platform-v2 #orderModal .ha-tab-segment {
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ha-platform-v2 *,
    .ha-platform-v2 *::before,
    .ha-platform-v2 *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
