/* Bootstrap temel katmandır; bu dosya sadece TradeSystem teması ve ortak kabuk bileşenlerini tutar. */

:root {
    --ts-navy: #212348;
    --ts-burgundy: #921831;
    --ts-green: #0b5e34;
    --ts-bg: #f3f5f8;
    --ts-panel: #e2e6eb;
    --ts-border: #d9dee7;
    --ts-muted: #6c757d;
    --ts-ink: #061b3a;
    --ts-blue: #123f6d;
    --ts-deep: #061a35;
    --ts-white: #ffffff;
    --ts-shadow: 0 20px 55px rgba(0, 0, 0, .24);
    --ts-panel-shadow: 0 12px 34px rgba(6, 27, 58, .12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ts-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.auth-page,
.app-page {
    background:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(115deg, #101642 0%, #062244 42%, #3a173e 70%, var(--ts-burgundy) 100%);
    background-size: 96px 96px, 96px 96px, auto;
}

.login-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 24px;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 26px;
}

.login-topbar,
.panel-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 12px;
    min-width: 210px;
    height: 62px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 18px;
    background: rgba(255, 255, 255, .9);
    color: var(--ts-ink);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: var(--ts-burgundy);
    color: var(--ts-white);
    font-size: 1.05rem;
    font-weight: 900;
}

.brand strong,
.brand small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand strong {
    font-size: 1.05rem;
    line-height: 1.12;
}

.brand small {
    margin-top: 2px;
    color: #667085;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.1;
}

.portal-label {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--ts-white);
}

.portal-label span,
.login-panel-heading span {
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.portal-label strong,
.login-panel-heading strong {
    color: var(--ts-white);
    font-size: 1.1rem;
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    align-items: center;
    gap: 46px;
    min-height: 0;
}

.hero-copy {
    max-width: 820px;
    color: var(--ts-white);
}

.hero-copy h1 {
    max-width: 760px;
    margin: 0;
    font-size: 4.35rem;
    font-weight: 900;
    line-height: 1.04;
}

.hero-copy .lead {
    max-width: 760px;
    margin: 28px 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: 1.18rem;
    font-weight: 500;
}

.signal-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 178px));
    gap: 14px;
    margin-top: 40px;
}

.signal-row div {
    min-height: 90px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
}

.signal-row span,
.signal-row small {
    display: block;
}

.signal-row span {
    color: var(--ts-white);
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1.05;
}

.signal-row small {
    margin-top: 8px;
    color: rgba(255, 255, 255, .72);
    font-weight: 700;
}

.login-panel {
    width: 100%;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(18, 22, 55, .86), rgba(34, 24, 52, .72));
    box-shadow: var(--ts-shadow);
    backdrop-filter: blur(24px);
}

.login-panel-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.login-panel-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    color: var(--ts-white);
    font-size: 1.48rem;
    background: linear-gradient(135deg, var(--ts-burgundy), var(--ts-navy));
}

.login-panel-heading span,
.login-panel-heading strong {
    display: block;
}

.login-panel-heading span {
    color: rgba(255, 255, 255, .62);
}

.login-form .form-label {
    margin-bottom: .4rem;
    color: rgba(255, 255, 255, .76);
    font-size: .78rem;
    font-weight: 800;
}

.login-form .input-group {
    min-height: 60px;
}

.login-form .input-group-text {
    width: 58px;
    justify-content: center;
    border: 0;
    border-radius: 8px 0 0 8px;
    background: rgba(255, 255, 255, .94);
    color: var(--ts-burgundy);
}

.login-form .form-control {
    min-height: 60px;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: rgba(255, 255, 255, .94);
    color: var(--ts-ink);
    font-weight: 600;
}

.login-form .form-control:focus {
    background: var(--ts-white);
    box-shadow: 0 0 0 4px rgba(33, 35, 72, .28);
}

.btn-burgundy {
    min-height: 60px;
    border: 0;
    border-radius: 8px;
    background: #b82755;
    color: var(--ts-white);
    font-size: 1rem;
    font-weight: 900;
}

.btn-burgundy:hover,
.btn-burgundy:focus {
    background: var(--ts-burgundy);
    color: var(--ts-white);
}

.app-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.app-alert-danger {
    border: 1px solid rgba(184, 39, 85, .35);
    background: rgba(184, 39, 85, .12);
    color: #ffd8e3;
}

.panel-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 22px;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px 22px 22px;
}

.panel-topbar {
    align-items: center;
}

.panel-topbar .brand {
    min-width: 214px;
    height: 64px;
}

.panel-nav {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.panel-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    color: rgba(255, 255, 255, .92);
    font-size: .82rem;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.panel-nav-link:hover,
.panel-nav-link.is-active {
    background: rgba(255, 255, 255, .16);
    color: var(--ts-white);
}

.panel-user {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    gap: 12px;
    min-width: 0;
    color: var(--ts-white);
    font-size: .82rem;
    font-weight: 850;
}

.panel-user span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-user a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, .24);
}

.content-shell {
    overflow: auto;
    width: 100%;
    min-height: 0;
    padding: 24px 22px 28px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 24px;
    background: var(--ts-bg);
    box-shadow: var(--ts-shadow);
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.page-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--ts-deep);
    color: var(--ts-white);
    font-size: 1.25rem;
}

.page-heading h1,
.surface-panel h2 {
    margin: 0;
    color: var(--ts-ink);
    font-weight: 900;
    line-height: 1.12;
}

.page-heading h1 {
    font-size: 1.4rem;
}

.page-heading p {
    margin: 4px 0 0;
    color: var(--ts-muted);
    font-weight: 700;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 114px;
    padding: 18px 18px 16px;
    border-radius: 8px;
    color: var(--ts-white);
}

.metric-card span,
.metric-card small {
    display: block;
    color: rgba(255, 255, 255, .76);
    font-size: .78rem;
    font-weight: 800;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    color: var(--ts-white);
    font-size: 1.9rem;
    font-weight: 950;
    line-height: 1;
}

.metric-card small {
    margin-top: 9px;
}

.metric-card > .bi {
    position: absolute;
    right: 18px;
    top: 18px;
    color: rgba(255, 255, 255, .42);
    font-size: 2rem;
}

.metric-card::after {
    position: absolute;
    right: -44px;
    bottom: -56px;
    width: 132px;
    height: 132px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    content: "";
}

.metric-navy { background: var(--ts-deep); }
.metric-burgundy { background: var(--ts-burgundy); }
.metric-blue { background: var(--ts-blue); }
.metric-green { background: var(--ts-green); }

.panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 14px;
}

.panel-grid.dashboard-pair-grid {
    display: grid;
    grid-template-columns: minmax(420px, .78fr) minmax(720px, 1.22fr);
    gap: 18px;
    max-width: none;
    margin-right: auto;
    margin-left: auto;
}

.panel-grid.dashboard-pair-grid > .surface-panel {
    min-width: 0;
}

.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table-wrap {
    overflow-x: hidden;
}

.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table th,
.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table th:nth-child(1),
.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table td:nth-child(1) {
    width: 22%;
}

.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table th:nth-child(2),
.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table td:nth-child(2) {
    width: 13%;
}

.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table th:nth-child(3),
.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table td:nth-child(3) {
    width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
}

.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table th:nth-child(4),
.panel-grid.dashboard-pair-grid > .surface-panel:nth-child(2) .app-table td:nth-child(4) {
    width: 17%;
    white-space: nowrap;
    overflow-wrap: normal;
}

.single-panel-row {
    margin-top: 14px;
}

.surface-panel {
    border: 1px solid var(--ts-border);
    border-radius: 8px;
    background: var(--ts-white);
    box-shadow: var(--ts-panel-shadow);
}

.surface-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--ts-border);
}

.surface-panel h2 {
    font-size: 1rem;
}

.surface-panel-header span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 8px;
    background: #edf1f6;
    color: var(--ts-ink);
    font-size: .78rem;
    font-weight: 900;
}

.status-list {
    padding: 14px 16px 16px;
}

.status-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    border-bottom: 1px solid #eef1f5;
}

.status-list > div:last-child {
    border-bottom: 0;
}

.status-list span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #30435f;
    font-weight: 800;
}

.status-list .bi {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f6eaf0;
    color: var(--ts-burgundy);
}

.status-list strong {
    color: var(--ts-ink);
    font-weight: 950;
    white-space: nowrap;
}

.placeholder-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 170px;
    padding: 20px;
}

.placeholder-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: #f6eaf0;
    color: var(--ts-burgundy);
    font-size: 1.45rem;
}

.placeholder-panel p {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--ts-muted);
    font-weight: 700;
}

.app-table-wrap {
    padding: 0;
}

.app-table {
    margin: 0;
    min-width: 860px;
    color: var(--ts-ink);
}

.app-table thead th {
    border-bottom: 1px solid var(--ts-border);
    background: #f8fafc;
    color: #4b5d78;
    font-size: .74rem;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-table tbody td {
    border-bottom: 1px solid #eef1f5;
    color: #1d3150;
    font-size: .82rem;
    font-weight: 700;
    vertical-align: middle;
}

.app-table tbody tr:last-child td {
    border-bottom: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.status-success {
    background: #e8f5ee;
    color: var(--ts-green);
}

.status-danger {
    background: #f8e9ef;
    color: var(--ts-burgundy);
}

.status-warning {
    background: #fff5d8;
    color: #7a5200;
}

.status-neutral {
    background: #edf1f6;
    color: #445572;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 148px;
    padding: 22px;
    color: var(--ts-muted);
    font-weight: 800;
    text-align: center;
}

.empty-state .bi {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #edf1f6;
    color: var(--ts-burgundy);
    font-size: 1.3rem;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--ts-border);
}

.pagination-bar span {
    color: #4b5d78;
    font-size: .8rem;
    font-weight: 900;
}

.btn-outline-navy {
    border-color: var(--ts-navy);
    color: var(--ts-navy);
    font-weight: 900;
}

.btn-outline-navy:hover,
.btn-outline-navy:focus {
    background: var(--ts-navy);
    color: var(--ts-white);
}

.btn-outline-navy.disabled {
    pointer-events: none;
    opacity: .45;
}

.settings-form {
    padding: 16px;
}

.settings-form .form-label {
    color: #30435f;
    font-weight: 900;
}

.settings-form .form-control {
    border-color: var(--ts-border);
    border-radius: 8px;
    color: var(--ts-ink);
    font-weight: 700;
}

.settings-form .form-control:focus {
    border-color: var(--ts-navy);
    box-shadow: 0 0 0 4px rgba(33, 35, 72, .12);
}

.btn-compact {
    min-height: 42px;
    padding: 9px 16px;
    font-size: .9rem;
}

.paper-close-form {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 190px;
}

.paper-close-input {
    width: 118px;
    border-color: var(--ts-border);
    border-radius: 8px;
    color: var(--ts-ink);
    font-weight: 800;
}

.paper-close-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
}

.app-message {
    margin-bottom: 12px;
    padding: 11px 12px;
    border-radius: 8px;
    font-weight: 800;
}

.app-message-success {
    border: 1px solid rgba(11, 94, 52, .18);
    background: #e8f5ee;
    color: var(--ts-green);
}

.app-message-danger {
    border: 1px solid rgba(146, 24, 49, .22);
    background: #f8e9ef;
    color: var(--ts-burgundy);
}

@media (max-width: 1199.98px) {
    .login-layout {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .hero-copy {
        max-width: none;
    }

    .hero-copy h1 {
        font-size: 3.25rem;
    }

    .login-panel {
        max-width: 520px;
    }

    .panel-topbar {
        flex-wrap: wrap;
    }

    .panel-nav {
        order: 3;
        flex-basis: 100%;
        justify-content: flex-start;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }

    .panel-grid.dashboard-pair-grid {
        grid-template-columns: 1fr;
        max-width: none;
    }

}

@media (max-width: 767.98px) {
    .login-shell,
    .panel-shell {
        padding: 14px;
    }

    .login-topbar,
    .panel-topbar {
        align-items: flex-start;
    }

    .portal-label {
        display: none;
    }

    .brand {
        min-width: 0;
        max-width: 100%;
    }

    .hero-copy h1 {
        font-size: 2.35rem;
    }

    .hero-copy .lead {
        margin-top: 18px;
        font-size: 1rem;
    }

    .signal-row {
        grid-template-columns: 1fr;
        margin-top: 22px;
    }

    .login-panel {
        padding: 18px;
        border-radius: 20px;
    }

    .panel-user {
        width: 100%;
        justify-content: space-between;
    }

    .panel-user span {
        max-width: calc(100% - 90px);
    }

    .content-shell {
        padding: 18px 14px 22px;
        border-radius: 18px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .placeholder-panel,
    .page-heading {
        align-items: flex-start;
    }

    .placeholder-panel {
        flex-direction: column;
    }
}

@media (max-width: 479.98px) {
    .panel-nav-link {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }

    .status-list > div {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 0;
    }
}
