/* Tradingunal Professional UI — additive compatibility layer
   Existing class names, routes and JS hooks are intentionally preserved. */
:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --sidebar: #07111f;
    --sidebar-soft: #0d1b2d;
    --primary: #635bff;
    --primary-dark: #4f46e5;
    --text: #111827;
    --muted: #667085;
    --border: #e2e8f0;
    --success: #079669;
    --warning: #d97706;
    --danger: #dc354f;
    --shadow: 0 12px 34px rgba(15, 23, 42, .07);
    --radius: 16px;
    --tu-cyan: #19c6d4;
    --tu-navy: #07111f;
    --tu-purple: #635bff;
}
html { scroll-behavior: smooth; }
body {
    font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
    font-feature-settings: "tnum" 1, "cv02" 1, "cv03" 1;
    text-rendering: optimizeLegibility;
}
body.admin-page {
    background:
        radial-gradient(circle at 95% 0, rgba(99,91,255,.06), transparent 27rem),
        #f3f6fb;
}
::selection { color: #fff; background: #635bff; }
:focus-visible { outline: 3px solid rgba(25,198,212,.35); outline-offset: 2px; }

/* Brand */
.brand-mark {
    width: 44px; height: 44px; border-radius: 14px;
    color: #fff; background: linear-gradient(145deg, #19c6d4 0%, #635bff 78%);
    box-shadow: 0 12px 30px rgba(25,198,212,.18), 0 8px 18px rgba(99,91,255,.24);
    font-size: 11px; letter-spacing: -.04em; font-weight: 900;
}
.brand strong { letter-spacing: .075em; }

/* Shell */
.admin-shell { grid-template-columns: 272px minmax(0,1fr); }
.sidebar {
    position: sticky; top: 0; height: 100vh;
    padding: 22px 16px;
    background:
      radial-gradient(circle at 15% 0, rgba(25,198,212,.12), transparent 17rem),
      linear-gradient(180deg, #07111f, #091525 62%, #07111f);
    border-right: 1px solid rgba(255,255,255,.06);
    box-shadow: 12px 0 36px rgba(7,17,31,.08);
}
.sidebar-brand-row { padding: 0 6px 20px; }
.sidebar-brand strong { color: #f8fafc; }
.sidebar-brand small { color: #72829b; }
.sidebar-nav { gap: 4px; }
.nav-title {
    margin: 19px 12px 8px; color: #63728a !important;
    font-size: 9px !important; letter-spacing: .18em !important;
}
.nav-link {
    min-height: 44px; padding: 0 12px; border: 1px solid transparent;
    border-radius: 12px; color: #9cabc0; font-size: 13px;
    transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.nav-link:hover:not(.disabled) {
    color: #f8fafc; background: rgba(255,255,255,.055);
    border-color: rgba(255,255,255,.055); transform: translateX(2px);
}
.nav-link.active {
    color: #fff; background: linear-gradient(90deg, rgba(99,91,255,.27), rgba(25,198,212,.08));
    border-color: rgba(125,119,255,.22); box-shadow: inset 3px 0 0 #19c6d4;
}
.nav-icon {
    display: inline-grid; width: 28px; height: 28px; place-items: center;
    border-radius: 9px; color: #8290a6; background: rgba(255,255,255,.045);
    font-family: "Segoe UI Symbol", sans-serif; font-size: 15px;
}
.nav-link.active .nav-icon { color: #8ceaf0; background: rgba(25,198,212,.1); }
.sidebar-system-state { margin-top: auto; }
.status-dot { animation: tuPulse 2.4s ease-in-out infinite; }
@keyframes tuPulse { 50% { box-shadow: 0 0 0 7px rgba(7,150,105,0); } }

.admin-topbar {
    min-height: 72px; padding: 0 30px; border-color: rgba(226,232,240,.9);
    background: rgba(255,255,255,.88); box-shadow: 0 8px 28px rgba(15,23,42,.035);
}
.topbar-page-title > span { color: #635bff; }
.topbar-icon-button, .profile-trigger { transition: .18s ease; }
.topbar-icon-button:hover, .profile-trigger:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15,23,42,.07); }
.topbar-avatar { background: linear-gradient(145deg,#19c6d4,#635bff); }
.topbar-menu { border: 1px solid #e1e7f0; border-radius: 16px; box-shadow: 0 22px 60px rgba(15,23,42,.16); }
.content-viewport { max-width: 1720px; padding: 30px; }

/* Shared professional surfaces */
.panel, .metric-card, .engine-stat, .management-panel, .profile-summary-card,
.profile-action-card, .signals-stat-card, .signals-progress-panel, .signals-list-panel,
.notification-archive, .engine-settings-card, .tenant-quality-panel,
.manual-market-card, .manual-trade-card, .history-table-panel {
    border-color: #e1e7f0 !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.025), 0 12px 32px rgba(15,23,42,.045) !important;
}
.metric-card, .engine-stat, .management-stat, .signals-stat-card,
.profile-action-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.metric-card:hover, .engine-stat:hover, .management-stat:hover, .signals-stat-card:hover,
.profile-action-card:hover { transform: translateY(-2px); border-color: #d4d8ff !important; box-shadow: 0 16px 38px rgba(15,23,42,.075) !important; }
h1, h2, h3 { color: #101828; letter-spacing: -.025em; }
.eyebrow, .page-eyebrow, .management-eyebrow, .engine-kicker, .history-kicker { color: #5b52ef !important; }
.button, button, a { -webkit-tap-highlight-color: transparent; }
.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(135deg,#635bff,#5148e6); box-shadow: 0 10px 22px rgba(99,91,255,.22); }
.button-ghost { border-color: #dce3ed; }
input, select, textarea { font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: #7770ff !important; box-shadow: 0 0 0 4px rgba(99,91,255,.1) !important; }

/* Headers */
.engine-hero, .management-header, .page-header, .history-hero {
    border: 1px solid rgba(99,91,255,.13) !important;
    background:
      radial-gradient(circle at 92% 4%, rgba(99,91,255,.11), transparent 32%),
      radial-gradient(circle at 75% 110%, rgba(25,198,212,.08), transparent 28%),
      linear-gradient(135deg,#fff,#fafaff) !important;
    box-shadow: 0 14px 38px rgba(15,23,42,.055) !important;
}
.environment-pill, .mode-badge { border-color: rgba(99,91,255,.18) !important; color: #4f46e5 !important; background: #f3f1ff !important; }

/* Data tables */
.management-table-wrap, .signals-table-wrap, .history-table-wrap { scrollbar-color: #b9c3d2 #f7f9fc; scrollbar-width: thin; }
table { font-variant-numeric: tabular-nums; }
th { color: #667085 !important; background: #f7f9fc !important; letter-spacing: .045em; }
td { border-color: #edf1f6 !important; }
tbody tr { transition: background .15s ease; }
tbody tr:hover td { background: #f8f8ff !important; }

/* Login */
.login-page { background: #07111f; }
.login-shell { grid-template-columns: minmax(380px, .95fr) minmax(460px, 1.05fr); }
.login-visual {
    background:
      radial-gradient(circle at 78% 18%, rgba(99,91,255,.38), transparent 31%),
      radial-gradient(circle at 12% 86%, rgba(25,198,212,.2), transparent 29%),
      linear-gradient(145deg,#07111f,#0b1930);
}
.login-visual::after { content:""; position:absolute; width:420px; height:420px; right:-170px; bottom:-210px; border:1px solid rgba(255,255,255,.08); border-radius:50%; box-shadow: 0 0 0 55px rgba(255,255,255,.018), 0 0 0 110px rgba(255,255,255,.012); }
.login-panel { background: #f4f7fb; }
.login-card { border-color:#e0e6ef; box-shadow:0 28px 70px rgba(15,23,42,.13); }
.login-form input { transition:.18s ease; }

/* Responsive */
@media (max-width: 1180px) {
    .content-viewport { padding: 24px; }
    .metric-grid, .engine-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: minmax(0,1fr); }
    .sidebar { position: fixed; height:100dvh; }
    .admin-topbar { padding: 0 18px; }
    .content-viewport { padding: 20px; }
    .engine-hero, .management-header, .page-header, .history-hero { align-items:flex-start !important; flex-direction:column !important; }
    .history-summary { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
    .history-performance { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width: 640px) {
    .content-viewport { padding: 14px; }
    .admin-topbar { min-height:64px; padding:0 12px; }
    .topbar-user-copy, .profile-chevron { display:none; }
    .profile-trigger { padding:4px; }
    .metric-grid, .engine-stat-grid, .management-stat-grid, .signals-stat-grid,
    .history-summary, .history-performance { grid-template-columns: 1fr !important; }
    .engine-hero, .management-header, .page-header, .history-hero { padding: 20px !important; border-radius:16px !important; }
    .login-panel { padding:18px; }
    .login-card { padding:28px 22px; border-radius:20px; }
    .topbar-menu { position:fixed !important; top:70px !important; left:12px !important; right:12px !important; width:auto !important; max-width:none !important; }
    .button { min-height:46px; }
}
@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* TRADINGUNAL ENGINE TOPBAR CONTEXT V3 */
body.engine-context-page .admin-topbar {
    min-height: 96px;
    padding: 10px 20px;
    gap: 16px;
    align-items: center;
}

body.engine-context-page .admin-topbar > .topbar-left {
    flex: 0 0 auto;
}

body.engine-context-page .admin-topbar .topbar-page-title {
    display: none;
}

body.engine-context-page .topbar-context {
    flex: 1 1 auto;
    min-width: 0;
}

body.engine-context-page .engine-topbar-context {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

body.engine-context-page .engine-topbar-copy {
    min-width: 0;
}

body.engine-context-page .engine-topbar-copy .engine-kicker {
    display: flex;
    margin: 0 0 4px;
    align-items: center;
    gap: 7px;
    color: #5b52ef;
    font-size: 8px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .13em;
    text-transform: uppercase;
}

body.engine-context-page .engine-topbar-copy .live-pulse {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
}

body.engine-context-page .engine-topbar-copy h1 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.035em;
}

body.engine-context-page .engine-topbar-copy p {
    max-width: 600px;
    margin: 4px 0 0;
    overflow: hidden;
    color: #718096;
    font-size: 11px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.engine-context-page
.engine-topbar-context
.engine-hero-actions {
    display: flex;
    flex: 0 0 auto;
    margin: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

body.engine-context-page
.engine-topbar-context
.environment-pill,
body.engine-context-page
.engine-topbar-context
.engine-refresh {
    min-height: 34px;
    margin: 0;
    border-radius: 10px;
    white-space: nowrap;
}

body.engine-context-page
.engine-topbar-context
.environment-pill {
    padding: 0 12px;
    font-size: 9px;
}

body.engine-context-page
.engine-topbar-context
.engine-refresh {
    height: 34px;
    padding: 0 13px;
    font-size: 10px;
}

body.engine-context-page .engine-page {
    margin-top: 0;
}

@media (max-width: 1100px) {
    body.engine-context-page .admin-topbar {
        padding-inline: 16px;
        gap: 10px;
    }

    body.engine-context-page .engine-topbar-context {
        gap: 12px;
    }

    body.engine-context-page .engine-topbar-copy p {
        max-width: 390px;
    }
}

@media (max-width: 850px) {
    body.engine-context-page .admin-topbar {
        min-height: 84px;
        padding: 8px 14px;
    }

    body.engine-context-page .engine-topbar-copy h1 {
        font-size: 20px;
    }

    body.engine-context-page .engine-topbar-copy p {
        display: none;
    }

    body.engine-context-page
    .engine-topbar-context
    .environment-pill {
        display: none;
    }
}

@media (max-width: 640px) {
    body.engine-context-page .admin-topbar {
        min-height: 76px;
        padding: 7px 10px;
        gap: 7px;
    }

    body.engine-context-page .topbar-context {
        min-width: 0;
    }

    body.engine-context-page .engine-topbar-context {
        gap: 7px;
    }

    body.engine-context-page .engine-topbar-copy h1 {
        max-width: 145px;
        overflow: hidden;
        font-size: 17px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.engine-context-page .engine-topbar-copy .engine-kicker {
        max-width: 155px;
        overflow: hidden;
        font-size: 7px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.engine-context-page
    .engine-topbar-context
    .engine-refresh {
        width: 36px;
        min-width: 36px;
        padding: 0;
        font-size: 0;
    }

    body.engine-context-page
    .engine-topbar-context
    .engine-refresh span {
        font-size: 15px;
    }

    body.engine-context-page .topbar-user-copy,
    body.engine-context-page .profile-chevron {
        display: none;
    }
}

@media (max-width: 430px) {
    body.engine-context-page
    .engine-topbar-context
    .engine-hero-actions {
        display: none;
    }

    body.engine-context-page .notification-trigger {
        display: none;
    }

    body.engine-context-page .engine-topbar-copy h1 {
        max-width: 175px;
    }
}

/* TRADINGUNAL ENGINE MODALS V1 */
body.engine-context-page
.engine-topbar-context
.engine-hero-actions {
    flex-wrap: nowrap;
}

body.engine-context-page .engine-topbar-tool {
    display: inline-flex;
    min-height: 34px;
    padding: 0 12px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #e4e8f1;
    border-radius: 10px;
    color: #3c465d;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .04);
    font: inherit;
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    cursor: pointer;
    transition:
        border-color .18s ease,
        color .18s ease,
        background .18s ease,
        transform .18s ease;
}

body.engine-context-page .engine-topbar-tool:hover {
    border-color: rgba(91, 82, 239, .28);
    color: #5148df;
    background: #f8f7ff;
    transform: translateY(-1px);
}

body.engine-context-page
.engine-topbar-tool
.engine-tool-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #5b52ef;
    background: #efedff;
    font-size: 11px;
}

body.engine-context-page .engine-topbar-tool small {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #5b52ef;
    background: #efedff;
    font-size: 8px;
    font-weight: 800;
}

.engine-dialog {
    width: min(1180px, calc(100vw - 40px));
    max-width: none;
    max-height: calc(100vh - 40px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 22px;
    color: #172033;
    background: #f7f9fc;
    box-shadow:
        0 28px 80px rgba(7, 17, 31, .28),
        0 3px 12px rgba(7, 17, 31, .12);
}

.engine-dialog[open] {
    animation: engine-dialog-in .18s ease-out;
}

.engine-dialog::backdrop {
    background: rgba(7, 17, 31, .58);
    backdrop-filter: blur(5px);
}

.engine-dialog-frame {
    display: flex;
    max-height: calc(100vh - 40px);
    flex-direction: column;
    overflow: hidden;
}

.engine-dialog-header {
    display: flex;
    flex: 0 0 auto;
    padding: 20px 24px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid #e7ebf2;
    background: rgba(255, 255, 255, .96);
}

.engine-dialog-header > div {
    min-width: 0;
}

.engine-dialog-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #5b52ef;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .14em;
}

.engine-dialog-header h2 {
    margin: 0;
    color: #121a2b;
    font-size: 22px;
    font-weight: 820;
    line-height: 1.2;
    letter-spacing: -.03em;
}

.engine-dialog-header p {
    margin: 5px 0 0;
    color: #788399;
    font-size: 11px;
    line-height: 1.45;
}

.engine-dialog-close {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #e3e7ef;
    border-radius: 12px;
    color: #657087;
    background: #ffffff;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

.engine-dialog-close:hover {
    border-color: #fecdd3;
    color: #e1455a;
    background: #fff5f6;
}

.engine-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.engine-dialog .engine-settings-card,
.engine-dialog .engine-audit-card {
    margin: 0 !important;
    border: 1px solid #e5eaf2;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.engine-dialog .engine-settings-head {
    padding-top: 0;
}

.engine-audit-dialog {
    width: min(1050px, calc(100vw - 40px));
}

@keyframes engine-dialog-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1150px) {
    body.engine-context-page
    .engine-topbar-tool
    > span:not(.engine-tool-icon) {
        display: none;
    }

    body.engine-context-page .engine-topbar-tool {
        width: 36px;
        min-width: 36px;
        padding: 0;
    }

    body.engine-context-page
    .engine-topbar-tool small {
        display: none;
    }
}

@media (max-width: 850px) {
    body.engine-context-page .engine-topbar-tool {
        display: none;
    }

    .engine-dialog {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        border-radius: 18px;
    }

    .engine-dialog-frame {
        max-height: calc(100vh - 24px);
    }

    .engine-dialog-header {
        padding: 16px 18px;
    }

    .engine-dialog-header h2 {
        font-size: 19px;
    }

    .engine-dialog-header p {
        display: none;
    }

    .engine-dialog-content {
        padding: 14px;
    }
}

@media (max-width: 640px) {
    .engine-dialog {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .engine-dialog-frame {
        height: 100dvh;
        max-height: 100dvh;
    }

    .engine-dialog-header {
        padding: 13px 14px;
    }

    .engine-dialog-content {
        padding: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .engine-dialog[open] {
        animation: none;
    }

    body.engine-context-page .engine-topbar-tool {
        transition: none;
    }
}


/* TRADINGUNAL ENGINE VISUAL BALANCE V4 */

/* -------------------------------------------------------
   Sayfa kabuğu ve üst bar
------------------------------------------------------- */

body.engine-context-page .admin-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 98px;
    border-bottom: 1px solid #e7ebf3;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
    backdrop-filter: blur(14px);
}

body.engine-context-page .main-content {
    background:
        radial-gradient(
            circle at 85% 5%,
            rgba(99, 91, 255, .055),
            transparent 26%
        ),
        #f4f7fb;
}

body.engine-context-page .content-viewport {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px 26px 42px;
}

body.engine-context-page .engine-page {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 18px;
}

body.engine-context-page .engine-page > section {
    margin-top: 0;
    margin-bottom: 0;
}

/* -------------------------------------------------------
   Üst başlık
------------------------------------------------------- */

body.engine-context-page .engine-topbar-copy h1 {
    font-size: 26px;
    font-weight: 820;
}

body.engine-context-page .engine-topbar-copy p {
    max-width: 680px;
    margin-top: 5px;
    font-size: 12px;
}

body.engine-context-page .engine-topbar-copy .engine-kicker {
    margin-bottom: 5px;
    font-size: 9px;
}

body.engine-context-page
.engine-topbar-context
.engine-hero-actions {
    gap: 9px;
}

body.engine-context-page
.engine-topbar-context
.environment-pill,
body.engine-context-page
.engine-topbar-context
.engine-refresh,
body.engine-context-page
.engine-topbar-tool {
    min-height: 38px;
    border-radius: 11px;
}

body.engine-context-page
.engine-topbar-context
.engine-refresh,
body.engine-context-page
.engine-topbar-tool {
    padding-right: 14px;
    padding-left: 14px;
    font-size: 11px;
}

/* -------------------------------------------------------
   Motor bağlantı bandı
------------------------------------------------------- */

body.engine-context-page .engine-connection {
    min-height: 62px;
    padding: 13px 16px;
    border-radius: 15px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .045);
}

body.engine-context-page .connection-main {
    gap: 12px;
}

body.engine-context-page .connection-orb {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

body.engine-context-page .connection-main strong {
    font-size: 13px;
}

body.engine-context-page .connection-main p {
    margin-top: 3px;
    font-size: 10px;
}

body.engine-context-page .connection-label {
    font-size: 9px;
}

/* -------------------------------------------------------
   Üst durum kartları
------------------------------------------------------- */

body.engine-context-page .engine-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

body.engine-context-page .engine-stat {
    min-height: 126px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid #e4e9f1;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .045);
}

body.engine-context-page .engine-stat .stat-label {
    font-size: 9px;
    letter-spacing: .04em;
}

body.engine-context-page .engine-stat .stat-icon {
    width: 30px;
    height: 30px;
}

body.engine-context-page .engine-stat > strong {
    display: block;
    margin-top: 16px;
    font-size: 17px;
    line-height: 1.15;
}

body.engine-context-page .engine-stat > p {
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.45;
}

/* -------------------------------------------------------
   Piyasa kalite paneli
------------------------------------------------------- */

body.engine-context-page .tenant-quality-panel {
    padding: 20px;
    border: 1px solid #e3e8f0;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .045);
}

body.engine-context-page .tenant-quality-head {
    margin-bottom: 16px;
}

body.engine-context-page .tenant-quality-head h2 {
    margin-top: 5px;
    font-size: 17px;
    line-height: 1.25;
}

body.engine-context-page .engine-section-label {
    font-size: 9px;
    letter-spacing: .12em;
}

body.engine-context-page .tenant-safety-badge {
    min-height: 28px;
    padding: 0 11px;
    font-size: 8px;
}

body.engine-context-page .tenant-quality-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
}

body.engine-context-page .tenant-quality-grid article {
    min-height: 94px;
    padding: 14px;
    border: 1px solid #e5eaf2;
    border-radius: 13px;
    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #f8faff 100%
        );
}

body.engine-context-page .tenant-quality-grid article small {
    font-size: 9px;
    line-height: 1.35;
}

body.engine-context-page .tenant-quality-grid article strong {
    display: block;
    margin: 8px 0 5px;
    font-size: 18px;
    line-height: 1;
}

body.engine-context-page .tenant-quality-grid article span {
    font-size: 9px;
    line-height: 1.35;
}

body.engine-context-page .tenant-quality-footer {
    display: flex;
    margin-top: 15px;
    padding-top: 14px;
    flex-wrap: wrap;
    gap: 10px 24px;
    border-top: 1px solid #e8ecf3;
    font-size: 9px;
}

/* -------------------------------------------------------
   Ana motor kontrol kartı
------------------------------------------------------- */

body.engine-context-page .engine-control-card {
    display: grid;
    min-height: 230px;
    padding: 22px 24px;
    grid-template-columns: 150px minmax(280px, 1fr) 190px;
    align-items: center;
    gap: 28px;
    overflow: hidden;
    border: 1px solid #e1e7f0;
    border-radius: 20px;
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(99, 91, 255, .08),
            transparent 32%
        ),
        #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .055);
}

body.engine-context-page .control-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

body.engine-context-page .engine-gauge {
    transform: scale(1.06);
    transform-origin: center;
}

body.engine-context-page .control-content {
    max-width: 650px;
}

body.engine-context-page .control-eyebrow {
    font-size: 9px;
    letter-spacing: .13em;
}

body.engine-context-page .control-content h2 {
    margin-top: 8px;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -.025em;
}

body.engine-context-page .control-content > p {
    max-width: 620px;
    margin-top: 9px;
    font-size: 11px;
    line-height: 1.65;
}

body.engine-context-page .control-facts {
    display: flex;
    margin-top: 18px;
    flex-wrap: wrap;
    gap: 11px;
}

body.engine-context-page .control-facts > span {
    min-width: 92px;
    padding: 9px 11px;
    border: 1px solid #e7ebf2;
    border-radius: 10px;
    background: #f8faff;
}

body.engine-context-page .control-facts small {
    display: block;
    margin-bottom: 4px;
    font-size: 8px;
}

body.engine-context-page .control-facts strong {
    font-size: 11px;
}

body.engine-context-page .control-action {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

body.engine-context-page .control-action form {
    width: 100%;
}

body.engine-context-page .engine-action-button {
    width: 100%;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 13px;
    font-size: 12px;
    box-shadow: 0 8px 18px rgba(225, 69, 90, .16);
}

body.engine-context-page .control-action > small {
    margin-top: 9px;
    text-align: center;
    font-size: 9px;
    line-height: 1.45;
}

/* -------------------------------------------------------
   Modal iyileştirmeleri
------------------------------------------------------- */

body.engine-context-page .engine-dialog-content {
    scrollbar-width: thin;
    scrollbar-color: #c8cede transparent;
}

body.engine-context-page
.engine-dialog-content::-webkit-scrollbar {
    width: 8px;
}

body.engine-context-page
.engine-dialog-content::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #c8cede;
    background-clip: padding-box;
}

/* -------------------------------------------------------
   Orta ekran
------------------------------------------------------- */

@media (max-width: 1180px) {
    body.engine-context-page .content-viewport {
        padding: 20px;
    }

    body.engine-context-page .engine-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.engine-context-page .tenant-quality-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.engine-context-page .engine-control-card {
        grid-template-columns: 145px minmax(240px, 1fr) 170px;
        gap: 20px;
    }
}

/* -------------------------------------------------------
   Tablet
------------------------------------------------------- */

@media (max-width: 850px) {
    body.engine-context-page .content-viewport {
        padding: 16px;
    }

    body.engine-context-page .engine-page {
        gap: 14px;
    }

    body.engine-context-page .tenant-quality-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.engine-context-page .engine-control-card {
        grid-template-columns: 130px minmax(0, 1fr);
        gap: 20px;
    }

    body.engine-context-page .control-action {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
}

/* -------------------------------------------------------
   Mobil
------------------------------------------------------- */

@media (max-width: 640px) {
    body.engine-context-page .content-viewport {
        padding: 12px;
    }

    body.engine-context-page .engine-stat-grid,
    body.engine-context-page .tenant-quality-grid {
        grid-template-columns: 1fr;
    }

    body.engine-context-page .engine-stat {
        min-height: 112px;
    }

    body.engine-context-page .tenant-quality-panel {
        padding: 15px;
    }

    body.engine-context-page .tenant-quality-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    body.engine-context-page .engine-control-card {
        padding: 18px 15px;
        grid-template-columns: 1fr;
        text-align: center;
    }

    body.engine-context-page .control-content {
        max-width: 100%;
    }

    body.engine-context-page .control-facts {
        justify-content: center;
    }

    body.engine-context-page .control-action {
        grid-column: auto;
    }
}

/* TRADINGUNAL ENGINE ACTION MOVE V1 */

/*
 * Bağlantı açıklamasının yerine gerçek motor kontrolü gelir.
 * Mevcut form ve buton sınıfları korunur.
 */
body.engine-context-page .engine-quick-control {
    display: flex;
    min-height: 76px;
    padding: 13px 16px;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid #e3e8f0;
    border-radius: 16px;
    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f8faff 100%
        );
    box-shadow: 0 6px 18px rgba(15, 23, 42, .045);
}

body.engine-context-page
.engine-quick-control
.control-action {
    display: block;
    width: 100%;
    max-width: 270px;
    min-width: 0;
    margin: 0;
}

body.engine-context-page
.engine-quick-control
.control-action form {
    width: 100%;
    margin: 0;
}

body.engine-context-page
.engine-quick-control
.engine-action-button {
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 0 20px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
}

body.engine-context-page
.engine-quick-control
.control-action > small {
    display: block;
    margin: 7px 0 0;
    color: #7b8598;
    text-align: center;
    font-size: 8px;
    line-height: 1.4;
}

/*
 * Alt motor kartında sağ sütun kaldırıldığı için gösterge ve
 * motor durumu iki dengeli sütun hâline getirilir.
 */
body.engine-context-page .engine-control-card {
    grid-template-columns: 160px minmax(0, 1fr) !important;
}

body.engine-context-page
.engine-control-card
.control-content {
    max-width: 760px;
}

@media (max-width: 1180px) {
    body.engine-context-page .engine-control-card {
        grid-template-columns: 145px minmax(0, 1fr) !important;
    }
}

@media (max-width: 850px) {
    body.engine-context-page .engine-control-card {
        grid-template-columns: 130px minmax(0, 1fr) !important;
    }

    body.engine-context-page
    .engine-quick-control
    .control-action {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    body.engine-context-page .engine-quick-control {
        min-height: auto;
        padding: 12px;
    }

    body.engine-context-page .engine-control-card {
        grid-template-columns: 1fr !important;
    }
}

/* TRADINGUNAL ENGINE COMPLETE CONTROL MOVE V2 */

/*
 * Gösterge, motor bilgisi ve kontrol düğmesi üst alanda
 * tek ve dengeli bir yönetim kartı olarak gösterilir.
 */
body.engine-context-page .engine-primary-control {
    display: grid;
    min-height: 206px;
    padding: 22px 26px;
    grid-template-columns:
        150px
        minmax(320px, 1fr)
        210px !important;
    align-items: center;
    gap: 28px;
    border: 1px solid #e1e7f0;
    border-radius: 20px;
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(99, 91, 255, .09),
            transparent 34%
        ),
        linear-gradient(
            135deg,
            #ffffff 0%,
            #fbfcff 100%
        );
    box-shadow: 0 10px 30px rgba(15, 23, 42, .055);
}

body.engine-context-page
.engine-primary-control
.control-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

body.engine-context-page
.engine-primary-control
.engine-gauge {
    transform: scale(1.04);
    transform-origin: center;
}

body.engine-context-page
.engine-primary-control
.control-content {
    width: 100%;
    max-width: 720px;
}

body.engine-context-page
.engine-primary-control
.control-content h2 {
    font-size: 21px;
}

body.engine-context-page
.engine-primary-control
.control-content > p {
    max-width: 650px;
    font-size: 11px;
    line-height: 1.6;
}

body.engine-context-page
.engine-primary-control
.control-action {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 210px;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

body.engine-context-page
.engine-primary-control
.control-action form {
    width: 100%;
    margin: 0;
}

body.engine-context-page
.engine-primary-control
.engine-action-button {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0 18px;
    border-radius: 13px;
    font-size: 11px;
    font-weight: 800;
}

body.engine-context-page
.engine-primary-control
.control-action > small {
    display: block;
    margin: 9px 0 0;
    color: #7b8598;
    text-align: center;
    font-size: 8px;
    line-height: 1.45;
}

/*
 * Önceki taşıma işleminden kalan quick-control biçimi artık
 * kullanılmıyor. Bu kural olası boş alanı gizler.
 */
body.engine-context-page .engine-quick-control:empty {
    display: none;
}

@media (max-width: 1180px) {
    body.engine-context-page .engine-primary-control {
        grid-template-columns:
            140px
            minmax(260px, 1fr)
            180px !important;
        padding: 20px;
        gap: 20px;
    }

    body.engine-context-page
    .engine-primary-control
    .control-action {
        max-width: 180px;
    }
}

@media (max-width: 900px) {
    body.engine-context-page .engine-primary-control {
        grid-template-columns:
            130px
            minmax(0, 1fr) !important;
    }

    body.engine-context-page
    .engine-primary-control
    .control-action {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    body.engine-context-page .engine-primary-control {
        padding: 18px 15px;
        grid-template-columns: 1fr !important;
        gap: 16px;
        text-align: center;
    }

    body.engine-context-page
    .engine-primary-control
    .control-action {
        grid-column: auto;
        max-width: 100%;
    }

    body.engine-context-page
    .engine-primary-control
    .control-facts {
        justify-content: center;
    }
}


/* TRADINGUNAL RESPONSIVE ADMIN SHELL V1 */

/* =======================================================
   GENEL SAYFA KABUĞU
======================================================= */

html {
    min-height: 100%;
    background: #f4f7fb;
}

body.admin-page {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

.admin-shell {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: start;
}

.admin-workspace {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
}

.main-content {
    width: 100%;
    min-width: 0;
}

.content-viewport {
    width: 100%;
    min-width: 0;
    margin-right: auto;
    margin-left: auto;
    box-sizing: border-box;
}

/* Bütün içerik elemanlarında taşma güvenliği */
.admin-workspace img,
.admin-workspace svg,
.admin-workspace video,
.admin-workspace canvas {
    max-width: 100%;
}

.admin-workspace input,
.admin-workspace select,
.admin-workspace textarea,
.admin-workspace button {
    max-width: 100%;
    box-sizing: border-box;
}

/* =======================================================
   MASAÜSTÜ SIDEBAR
======================================================= */

@media (min-width: 901px) {
    .admin-shell {
        grid-template-columns: 272px minmax(0, 1fr);
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 80;
        display: flex;
        width: 272px;
        min-width: 272px;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        align-self: start;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
    }

    .sidebar-brand-row {
        flex: 0 0 auto;
    }

    .sidebar-nav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color:
            rgba(148, 163, 184, .32)
            transparent;
    }

    .sidebar-nav::-webkit-scrollbar {
        width: 5px;
    }

    .sidebar-nav::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(148, 163, 184, .32);
    }

    .sidebar-system-state {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        flex: 0 0 auto;
        margin-top: auto;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* =======================================================
   TABLET VE MOBİL SIDEBAR
======================================================= */

@media (max-width: 900px) {
    .admin-shell {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .admin-workspace {
        width: 100%;
        min-width: 0;
    }

    /*
     * Açılma/kapanma transform sınıfları mevcut CSS/JS tarafından
     * yönetilmeye devam eder. Burada yalnızca boyut ve kaydırma
     * davranışı güvenli hâle getirilmektedir.
     */
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1001;
        display: flex;
        width: min(86vw, 310px);
        max-width: 310px;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
        overscroll-behavior: contain;
    }

    .sidebar-brand-row {
        flex: 0 0 auto;
    }

    .sidebar-nav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-system-state {
        position: relative;
        right: auto;
        bottom: auto;
        left: auto;
        flex: 0 0 auto;
        margin-top: auto;
        padding-bottom:
            max(
                10px,
                env(safe-area-inset-bottom)
            );
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        width: 100%;
        height: 100vh;
        height: 100dvh;
    }

    .admin-topbar {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .topbar-left,
    .topbar-actions,
    .topbar-context {
        min-width: 0;
    }
}

/* =======================================================
   GENEL MOBİL İÇERİK
======================================================= */

@media (max-width: 640px) {
    body.admin-page {
        min-width: 320px;
    }

    .content-viewport {
        width: 100%;
        max-width: none;
        padding-right: 12px;
        padding-left: 12px;
    }

    .main-content {
        overflow-x: clip;
    }

    /*
     * Geniş tablolar sayfanın tamamını taşırmak yerine kendi
     * alanları içinde yatay kaydırılabilir.
     */
    .table-responsive,
    .data-table-wrapper,
    .table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* =======================================================
   MOTOR SAYFASI RESPONSIVE GÜVENLİK
======================================================= */

body.engine-context-page .engine-page,
body.engine-context-page .engine-page > *,
body.engine-context-page .engine-primary-control,
body.engine-context-page .tenant-quality-panel,
body.engine-context-page .engine-stat-grid {
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    body.engine-context-page .content-viewport {
        width: 100%;
        max-width: none;
        padding: 16px;
    }

    body.engine-context-page .engine-stat-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    body.engine-context-page .tenant-quality-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    body.engine-context-page .engine-primary-control {
        width: 100%;
        grid-template-columns:
            130px minmax(0, 1fr) !important;
    }

    body.engine-context-page
    .engine-primary-control
    .control-action {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 340px;
        margin-right: auto;
        margin-left: auto;
    }

    /*
     * Ayarlar ve Denetim düğmeleri mobilde kaybolmamalı.
     * Önceki max-width:850 kuralını geçersiz kılar.
     */
    body.engine-context-page .engine-topbar-tool {
        display: inline-flex !important;
        width: 36px;
        min-width: 36px;
        padding: 0;
    }

    body.engine-context-page
    .engine-topbar-tool
    > span:not(.engine-tool-icon),
    body.engine-context-page
    .engine-topbar-tool
    small {
        display: none;
    }
}

@media (max-width: 640px) {
    body.engine-context-page .content-viewport {
        padding: 12px;
    }

    body.engine-context-page .engine-page {
        gap: 12px;
    }

    body.engine-context-page .engine-stat-grid,
    body.engine-context-page .tenant-quality-grid {
        grid-template-columns: 1fr;
    }

    body.engine-context-page .engine-primary-control {
        width: 100%;
        padding: 18px 14px;
        grid-template-columns: 1fr !important;
        gap: 16px;
        text-align: center;
    }

    body.engine-context-page
    .engine-primary-control
    .control-action {
        grid-column: auto;
        max-width: 100%;
    }

    body.engine-context-page
    .engine-primary-control
    .control-facts {
        justify-content: center;
    }

    body.engine-context-page .engine-gauge {
        max-width: 180px;
        margin: 0 auto;
    }

    body.engine-context-page .engine-dialog {
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }

    body.engine-context-page .engine-dialog-frame {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
    }

    body.engine-context-page .engine-dialog-content {
        min-width: 0;
        padding: 10px;
        overflow-x: hidden;
        overflow-y: auto;
    }
}

/*
 * Çok dar telefonlarda üst bar araçları simge olarak kalır.
 * Önceki 430px kuralının bütün araç grubunu gizlemesini engeller.
 */
@media (max-width: 430px) {
    body.engine-context-page
    .engine-topbar-context
    .engine-hero-actions {
        display: flex !important;
        gap: 5px;
    }

    body.engine-context-page
    .engine-topbar-context
    .environment-pill {
        display: none;
    }

    body.engine-context-page
    .engine-topbar-context
    .engine-refresh,
    body.engine-context-page
    .engine-topbar-tool {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0;
    }

    body.engine-context-page
    .engine-topbar-context
    .engine-refresh {
        font-size: 0;
    }

    body.engine-context-page
    .engine-topbar-context
    .engine-refresh span {
        font-size: 14px;
    }

    body.engine-context-page .engine-topbar-copy p {
        display: none;
    }
}

/* iPhone yatay güvenli alanları */
@supports (padding: max(0px)) {
    @media (max-width: 900px) {
        .sidebar {
            padding-left: env(safe-area-inset-left);
        }

        .admin-topbar {
            padding-right:
                max(
                    12px,
                    env(safe-area-inset-right)
                );
        }
    }
}

/* TRADINGUNAL FIXED VIEWPORT SIDEBAR V2 */

/*
 * Masaüstünde sidebar grid yüksekliğine bağlı kalmaz.
 * Doğrudan tarayıcı görünüm alanına sabitlenir.
 */
@media (min-width: 901px) {
    html,
    body.admin-page {
        min-height: 100%;
    }

    body.admin-page {
        overflow-x: hidden;
    }

    .admin-shell {
        display: block !important;
        width: 100% !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
    }

    .sidebar {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        top: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        z-index: 200 !important;

        display: flex !important;
        width: 272px !important;
        min-width: 272px !important;
        max-width: 272px !important;

        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;

        margin: 0 !important;
        flex-direction: column !important;
        align-self: auto !important;
        overflow: hidden !important;
        box-sizing: border-box !important;

        background: #07111f !important;
    }

    .sidebar-brand-row {
        position: relative;
        flex: 0 0 auto !important;
    }

    .sidebar-nav {
        position: relative;
        flex: 1 1 0 !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color:
            rgba(148, 163, 184, .30)
            transparent;
    }

    .sidebar-nav::-webkit-scrollbar {
        width: 5px;
    }

    .sidebar-nav::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(148, 163, 184, .30);
    }

    .sidebar-system-state {
        position: relative !important;
        inset: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;

        width: auto !important;
        flex: 0 0 auto !important;
        margin-top: auto !important;
        box-sizing: border-box !important;
    }

    .admin-workspace {
        display: block !important;
        width: calc(100% - 272px) !important;
        min-width: 0 !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        margin: 0 0 0 272px !important;
        box-sizing: border-box !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/*
 * Tablet ve telefonda masaüstü sabitlemesini sıfırlar.
 * Sidebar mevcut JavaScript tarafından açılıp kapatılır.
 */
@media (max-width: 900px) {
    .admin-shell {
        display: block !important;
        width: 100% !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
    }

    .admin-workspace {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        z-index: 1001 !important;

        width: min(86vw, 310px) !important;
        min-width: 0 !important;
        max-width: 310px !important;

        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;

        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .sidebar-nav {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-system-state {
        position: relative !important;
        inset: auto !important;
        flex: 0 0 auto !important;
        margin-top: auto !important;
        padding-bottom:
            max(
                10px,
                env(safe-area-inset-bottom)
            );
    }
}

/* Çok kısa ekranlarda marka ve menü alanının ezilmesini engeller. */
@media (max-height: 620px) {
    .sidebar-brand-row {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .sidebar-system-state {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
}


/* =========================================================
   TRADINGUNAL POSITIONS TOPBAR DESIGN V1
   ========================================================= */

/*
 * Pozisyonlar sayfasında üst bar, sayfa başlığını ve temel
 * aksiyonları barındıran profesyonel bir çalışma başlığıdır.
 */
body.positions-context-page .admin-topbar {
    min-height: 104px;
    padding: 14px 24px;
    gap: 20px;
    align-items: center;
    border-bottom: 1px solid #e8ecf3;
    background:
        radial-gradient(
            circle at 72% 0,
            rgba(108, 92, 231, .055),
            transparent 30%
        ),
        rgba(255, 255, 255, .97);
}

/*
 * Normal masaüstü başlığı, yeni ayrıntılı başlık kullanıldığı
 * için gizlenir. Mobil menü düğmesi etkilenmez.
 */
body.positions-context-page
.admin-topbar
.topbar-page-title {
    display: none;
}

body.positions-context-page
.admin-topbar
.topbar-left {
    flex: 0 0 auto;
}

body.positions-context-page
.admin-topbar
.topbar-context {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
}

body.positions-context-page
.positions-topbar-context {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

body.positions-context-page
.positions-topbar-copy {
    min-width: 0;
}

body.positions-context-page
.positions-topbar-copy
.engine-kicker {
    margin-bottom: 5px;
    color: #635bdb;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: .11em;
    text-transform: uppercase;
}

body.positions-context-page
.positions-topbar-copy h1 {
    margin: 0;
    color: #10192d;
    font-size: 23px;
    font-weight: 850;
    line-height: 1.12;
    letter-spacing: -.035em;
}

body.positions-context-page
.positions-topbar-copy p {
    margin: 5px 0 0;
    overflow: hidden;
    color: #7a869b;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.positions-context-page
.positions-topbar-actions {
    display: flex;
    min-width: max-content;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

body.positions-context-page
.positions-mode-pill,
body.positions-context-page
.positions-refresh {
    min-height: 38px;
    box-sizing: border-box;
    border-radius: 11px;
}

body.positions-context-page
.positions-mode-pill {
    display: inline-flex;
    padding: 0 14px;
    align-items: center;
    justify-content: center;
}

body.positions-context-page
.positions-refresh {
    display: inline-flex;
    padding: 0 15px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
}

/*
 * Terminal artık eski hero kartının altında değil, içerik
 * alanının doğrudan başlangıcında bulunur.
 */
body.positions-context-page .main-content {
    min-width: 0;
    background:
        linear-gradient(
            180deg,
            #f4f7fc 0%,
            #f7f9fc 100%
        );
}

body.positions-context-page .content-viewport {
    width: 100%;
    max-width: 1720px;
    min-width: 0;
    padding-top: 18px;
}

body.positions-context-page .positions-page {
    gap: 16px;
}

body.positions-context-page
.positions-page
> .trading-terminal:first-of-type {
    margin-top: 0;
}

/*
 * Terminali üst başlık alanıyla görsel olarak uyumlu hâle getir.
 */
body.positions-context-page
.positions-page
.trading-terminal {
    border-color: #e1e6ef;
    border-radius: 18px;
    box-shadow:
        0 14px 34px rgba(29, 42, 72, .065),
        0 2px 8px rgba(29, 42, 72, .025);
}

body.positions-context-page
.positions-page
.trading-terminal
.market-card-header {
    padding-top: 19px;
    padding-bottom: 16px;
}

body.positions-context-page
.positions-page
.trading-terminal
.market-card-title h2 {
    margin-bottom: 0;
}

/* =========================================================
   POZİSYONLAR TOPBAR — TABLET
   ========================================================= */

@media (max-width: 1100px) {
    body.positions-context-page .admin-topbar {
        min-height: 96px;
        padding-right: 18px;
        padding-left: 18px;
        gap: 14px;
    }

    body.positions-context-page
    .positions-topbar-context {
        gap: 15px;
    }

    body.positions-context-page
    .positions-topbar-copy p {
        max-width: 440px;
    }

    body.positions-context-page
    .positions-mode-pill {
        padding-right: 11px;
        padding-left: 11px;
    }

    body.positions-context-page
    .content-viewport {
        padding-top: 16px;
    }
}

/* =========================================================
   POZİSYONLAR TOPBAR — MOBİL MENÜ EŞİĞİ
   ========================================================= */

@media (max-width: 900px) {
    body.positions-context-page .admin-topbar {
        position: relative;
        min-height: 86px;
        padding: 10px 14px;
        gap: 10px;
    }

    body.positions-context-page
    .admin-topbar
    .topbar-left {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
    }

    body.positions-context-page
    .admin-topbar
    .mobile-menu-button {
        display: inline-flex;
    }

    body.positions-context-page
    .admin-topbar
    .topbar-context {
        min-width: 0;
        flex: 1 1 auto;
    }

    body.positions-context-page
    .positions-topbar-context {
        min-width: 0;
        gap: 10px;
    }

    body.positions-context-page
    .positions-topbar-copy {
        overflow: hidden;
    }

    body.positions-context-page
    .positions-topbar-copy h1 {
        font-size: 20px;
    }

    body.positions-context-page
    .positions-topbar-copy p {
        display: none;
    }

    body.positions-context-page
    .positions-topbar-copy
    .engine-kicker {
        overflow: hidden;
        max-width: 230px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.positions-context-page
    .positions-topbar-actions {
        gap: 6px;
    }

    body.positions-context-page
    .positions-mode-pill,
    body.positions-context-page
    .positions-refresh {
        min-height: 36px;
    }

    body.positions-context-page
    .positions-mode-pill {
        padding: 0 10px;
        font-size: 9px;
    }

    body.positions-context-page
    .positions-refresh {
        width: 36px;
        min-width: 36px;
        padding: 0;
    }

    body.positions-context-page
    .positions-refresh-label {
        display: none;
    }

    body.positions-context-page
    .content-viewport {
        padding-top: 14px;
    }
}

/* =========================================================
   POZİSYONLAR TOPBAR — TELEFON
   ========================================================= */

@media (max-width: 640px) {
    body.positions-context-page .admin-topbar {
        min-height: 74px;
        padding: 8px 10px;
        gap: 7px;
    }

    body.positions-context-page
    .positions-topbar-context {
        gap: 7px;
    }

    body.positions-context-page
    .positions-topbar-copy
    .engine-kicker {
        max-width: 165px;
        margin-bottom: 3px;
        font-size: 7px;
        letter-spacing: .075em;
    }

    body.positions-context-page
    .positions-topbar-copy h1 {
        overflow: hidden;
        max-width: 175px;
        font-size: 18px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.positions-context-page
    .positions-mode-pill,
    body.positions-context-page
    .positions-refresh {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0;
        border-radius: 9px;
    }

    /*
     * Dar ekranda TESTNET yazısı yerine durum noktası görünür.
     * Erişilebilir metin HTML içerisinde kalmaya devam eder.
     */
    body.positions-context-page
    .positions-mode-pill {
        overflow: hidden;
        color: transparent !important;
        font-size: 0;
    }

    body.positions-context-page
    .positions-mode-pill > span {
        width: 7px;
        height: 7px;
        margin: 0;
    }

    body.positions-context-page
    .admin-topbar
    .topbar-actions {
        gap: 5px;
    }

    body.positions-context-page
    .admin-topbar
    .topbar-user-copy,
    body.positions-context-page
    .admin-topbar
    .profile-chevron {
        display: none;
    }

    body.positions-context-page
    .content-viewport {
        padding-top: 10px;
    }

    body.positions-context-page
    .positions-page {
        gap: 12px;
    }

    body.positions-context-page
    .positions-page
    .trading-terminal {
        border-radius: 14px;
    }
}

/*
 * Çok dar telefonlarda profil alanı ve topbar kontrollerinin
 * birbirinin üzerine binmesini önler.
 */
@media (max-width: 430px) {
    body.positions-context-page
    .positions-topbar-copy
    .engine-kicker {
        display: none;
    }

    body.positions-context-page
    .positions-topbar-copy h1 {
        max-width: 118px;
        font-size: 17px;
    }

    body.positions-context-page
    .positions-mode-pill {
        display: none;
    }

    body.positions-context-page
    .admin-topbar
    .notification-trigger {
        width: 33px;
        min-width: 33px;
        height: 33px;
    }

    body.positions-context-page
    .admin-topbar
    .profile-trigger {
        padding-right: 0;
        padding-left: 0;
    }
}


/* =========================================================
   TRADINGUNAL FLASH TOAST DESIGN V1
   ========================================================= */

/*
 * Bildirimler JavaScript tarafından bu sabit konteynere
 * taşınır. Böylece sayfa düzeninde boşluk bırakmaz.
 */
.positions-toast-stack {
    position: fixed;
    z-index: 1600;
    top: 122px;
    right: 22px;
    display: flex;
    width: min(410px, calc(100vw - 44px));
    max-height: calc(100vh - 150px);
    padding: 0;
    flex-direction: column;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: none;
    overscroll-behavior: contain;
}

.positions-toast-stack:empty {
    display: none;
}

.positions-toast-stack
.positions-flash-message {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 72px;
    margin: 0;
    padding: 15px 48px 15px 16px;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    overflow: hidden;
    pointer-events: auto;
    border: 1px solid transparent;
    border-radius: 15px;
    opacity: 0;
    transform: translateX(28px) scale(.97);
    box-sizing: border-box;
    box-shadow:
        0 22px 50px rgba(15, 23, 42, .16),
        0 5px 16px rgba(15, 23, 42, .08);
    transition:
        opacity .24s ease,
        transform .28s cubic-bezier(.22, 1, .36, 1);
}

.positions-toast-stack
.positions-flash-message.is-visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.positions-toast-stack
.positions-flash-message.is-leaving {
    opacity: 0;
    transform: translateX(34px) scale(.96);
}

/*
 * Başarı popup'ı
 */
.positions-toast-stack
.positions-flash-message.success {
    color: #116447;
    border-color: rgba(22, 168, 117, .24);
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(31, 190, 132, .13),
            transparent 42%
        ),
        rgba(240, 253, 247, .98);
}

.positions-toast-stack
.positions-flash-message.success
.alert-symbol {
    color: #fff;
    background:
        linear-gradient(
            135deg,
            #22bd83,
            #079263
        );
    box-shadow:
        0 7px 18px rgba(7, 146, 99, .24);
}

/*
 * Hata ve işlem uyarısı popup'ı
 */
.positions-toast-stack
.positions-flash-message.danger {
    color: #9d293c;
    border-color: rgba(218, 65, 89, .24);
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(226, 75, 99, .12),
            transparent 42%
        ),
        rgba(255, 246, 248, .98);
}

.positions-toast-stack
.positions-flash-message.danger
.alert-symbol {
    color: #fff;
    background:
        linear-gradient(
            135deg,
            #ed6076,
            #c92e47
        );
    box-shadow:
        0 7px 18px rgba(201, 46, 71, .22);
}

/*
 * Popup simgesi
 */
.positions-toast-stack
.positions-flash-message
.alert-symbol {
    display: inline-flex;
    width: 34px;
    height: 34px;
    margin: 0;
    align-items: center;
    justify-content: center;
    align-self: center;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 900;
}

/*
 * Popup metinleri
 */
.positions-toast-stack
.positions-flash-message > div {
    min-width: 0;
}

.positions-toast-stack
.positions-flash-message strong {
    display: block;
    margin: 0 0 4px;
    color: currentColor;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.3;
}

.positions-toast-stack
.positions-flash-message p {
    margin: 2px 0 0;
    color: #667287;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/*
 * Manuel kapatma düğmesi
 */
.positions-toast-close {
    position: absolute;
    top: 50%;
    right: 12px;
    display: inline-flex;
    width: 28px;
    height: 28px;
    padding: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: #718096;
    border: 0;
    border-radius: 8px;
    outline: none;
    background: rgba(255, 255, 255, .72);
    font-size: 19px;
    font-weight: 500;
    line-height: 1;
    transform: translateY(-50%);
    transition:
        color .15s ease,
        background .15s ease,
        transform .15s ease;
}

.positions-toast-close:hover {
    color: #172033;
    background: #fff;
    transform:
        translateY(-50%)
        scale(1.06);
}

.positions-toast-close:focus-visible {
    box-shadow:
        0 0 0 3px
        rgba(99, 91, 219, .18);
}

/*
 * Bildirim açıkken sağ taraftaki kaydırma çubuğunu sadeleştir.
 */
.positions-toast-stack {
    scrollbar-width: thin;
    scrollbar-color:
        rgba(113, 128, 150, .32)
        transparent;
}

.positions-toast-stack::-webkit-scrollbar {
    width: 5px;
}

.positions-toast-stack::-webkit-scrollbar-track {
    background: transparent;
}

.positions-toast-stack::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(113, 128, 150, .32);
}

/* Tablet ve mobil */
@media (max-width: 900px) {
    .positions-toast-stack {
        top: 96px;
        right: 14px;
        width: min(390px, calc(100vw - 28px));
        max-height: calc(100dvh - 115px);
    }
}

@media (max-width: 640px) {
    .positions-toast-stack {
        top: 82px;
        right: 10px;
        left: 10px;
        width: auto;
        max-height: calc(100dvh - 96px);
        gap: 8px;
    }

    .positions-toast-stack
    .positions-flash-message {
        min-height: 66px;
        padding:
            13px
            44px
            13px
            13px;
        grid-template-columns:
            31px
            minmax(0, 1fr);
        gap: 10px;
        border-radius: 13px;
    }

    .positions-toast-stack
    .positions-flash-message
    .alert-symbol {
        width: 31px;
        height: 31px;
        border-radius: 9px;
        font-size: 13px;
    }

    .positions-toast-stack
    .positions-flash-message strong {
        font-size: 11px;
    }

    .positions-toast-stack
    .positions-flash-message p {
        font-size: 9px;
    }

    .positions-toast-close {
        right: 9px;
    }
}

/*
 * Animasyon azaltma tercihini destekle.
 */
@media (prefers-reduced-motion: reduce) {
    .positions-toast-stack
    .positions-flash-message {
        transition: opacity .01ms linear;
        transform: none;
    }

    .positions-toast-stack
    .positions-flash-message.is-visible {
        transform: none;
    }

    .positions-toast-stack
    .positions-flash-message.is-leaving {
        transform: none;
    }
}


/* =========================================================
   TRADINGUNAL POSITION SYMBOL CHART LINK DESIGN V1
   ========================================================= */

/*
 * Açık pozisyon tablosundaki coin sembolü, mevcut terminale
 * grafik yükleyen erişilebilir bir kontrol gibi görünür.
 */
.positions-page
#live-positions-body
.position-symbol-chart-link {
    position: relative;
    display: inline-flex;
    min-height: 28px;
    padding: 4px 8px;
    cursor: pointer;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    color: #4438bd;
    border: 1px solid transparent;
    border-radius: 8px;
    outline: none;
    background: transparent;
    font-weight: 900;
    line-height: 1.2;
    text-decoration: none;
    transition:
        color .16s ease,
        border-color .16s ease,
        background .16s ease,
        box-shadow .16s ease,
        transform .16s ease;
}

/*
 * Sembolün grafik açtığını belirten küçük trend simgesi.
 */
.positions-page
#live-positions-body
.position-symbol-chart-link::after {
    content: '↗';
    display: inline-flex;
    color: #7661e7;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    transform: translate(-3px, 2px);
    transition:
        opacity .16s ease,
        transform .16s ease;
}

.positions-page
#live-positions-body
.position-symbol-chart-link:hover {
    color: #523bd4;
    border-color: rgba(106, 84, 224, .16);
    background: #f3f0ff;
    transform: translateY(-1px);
}

.positions-page
#live-positions-body
.position-symbol-chart-link:hover::after {
    opacity: 1;
    transform: translate(0, 0);
}

.positions-page
#live-positions-body
.position-symbol-chart-link:focus-visible {
    color: #4f38ce;
    border-color: rgba(106, 84, 224, .28);
    background: #f3f0ff;
    box-shadow:
        0 0 0 3px
        rgba(106, 84, 224, .13);
}

.positions-page
#live-positions-body
.position-symbol-chart-link:focus-visible::after {
    opacity: 1;
    transform: translate(0, 0);
}

/*
 * Grafik yüklenirken sembol üzerindeki durum.
 */
.positions-page
#live-positions-body
.position-symbol-chart-link.is-loading-chart {
    cursor: wait;
    color: #725be3;
    border-color: rgba(106, 84, 224, .18);
    background: #f4f1ff;
}

.positions-page
#live-positions-body
.position-symbol-chart-link.is-loading-chart::after {
    content: '';
    width: 10px;
    height: 10px;
    opacity: 1;
    border: 2px solid rgba(114, 91, 227, .24);
    border-top-color: #725be3;
    border-radius: 50%;
    transform: none;
    animation:
        position-symbol-chart-spin
        .7s
        linear
        infinite;
}

@keyframes position-symbol-chart-spin {
    to {
        transform: rotate(360deg);
    }
}

/*
 * Tıklanan pozisyon satırını kısa süreli vurgular.
 */
.positions-page
#live-positions-body
tr {
    transition:
        background-color .28s ease,
        box-shadow .28s ease;
}

.positions-page
#live-positions-body
tr.is-chart-selected {
    background:
        linear-gradient(
            90deg,
            rgba(109, 87, 226, .105),
            rgba(109, 87, 226, .025)
        );
    box-shadow:
        inset 3px 0 0 #735ce2;
}

.positions-page
#live-positions-body
tr.is-chart-selected
.position-symbol-chart-link {
    color: #533bd0;
}

/*
 * Dokunmatik ekranda sembolün tıklanabilir olduğu sürekli
 * görülebilir; hover davranışına bağımlı kalmaz.
 */
@media (hover: none) {
    .positions-page
    #live-positions-body
    .position-symbol-chart-link {
        border-color: rgba(106, 84, 224, .12);
        background: #f7f5ff;
    }

    .positions-page
    #live-positions-body
    .position-symbol-chart-link::after {
        opacity: .75;
        transform: translate(0, 0);
    }
}

@media (max-width: 640px) {
    .positions-page
    #live-positions-body
    .position-symbol-chart-link {
        min-height: 32px;
        padding: 5px 8px;
    }

    .positions-page
    #live-positions-body
    .position-symbol-chart-link::after {
        opacity: .8;
        transform: translate(0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .positions-page
    #live-positions-body
    .position-symbol-chart-link,
    .positions-page
    #live-positions-body
    tr {
        transition: none;
    }

    .positions-page
    #live-positions-body
    .position-symbol-chart-link.is-loading-chart::after {
        animation-duration: 1.4s;
    }
}


/* =========================================================
   TRADINGUNAL SWEETALERT DESIGN V1
   ========================================================= */

.tradingunal-swal-popup {
    width: min(470px, calc(100vw - 28px)) !important;
    padding: 27px 27px 23px !important;
    overflow: hidden !important;
    border: 1px solid rgba(221, 226, 237, .95) !important;
    border-radius: 20px !important;
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(109, 87, 226, .10),
            transparent 37%
        ),
        #fff !important;
    box-shadow:
        0 28px 70px rgba(18, 27, 48, .22),
        0 8px 24px rgba(18, 27, 48, .10) !important;
    font-family: inherit !important;
}

.tradingunal-swal-popup .swal2-title {
    padding: 0 !important;
    color: #151f35 !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    letter-spacing: -.035em !important;
}

.tradingunal-swal-popup .swal2-html-container {
    margin: 13px 0 0 !important;
    color: #6f7b91 !important;
    font-size: 12px !important;
    line-height: 1.65 !important;
}

.tradingunal-swal-popup .swal2-actions {
    width: 100% !important;
    margin: 21px 0 0 !important;
    gap: 9px !important;
}

.tradingunal-swal-confirm,
.tradingunal-swal-cancel {
    min-height: 43px;
    padding: 0 18px;
    cursor: pointer;
    border: 0;
    border-radius: 11px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 900;
    transition:
        transform .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}

.tradingunal-swal-confirm {
    color: #fff;
    background:
        linear-gradient(
            135deg,
            #765ce8,
            #5940cf
        );
    box-shadow:
        0 10px 22px rgba(89, 64, 207, .22);
}

.tradingunal-swal-cancel {
    color: #667287;
    border: 1px solid #e0e5ed;
    background: #f5f7fa;
}

.tradingunal-swal-confirm:hover,
.tradingunal-swal-cancel:hover {
    transform: translateY(-1px);
}

.tradingunal-swal-confirm:focus-visible,
.tradingunal-swal-cancel:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px
        rgba(118, 92, 232, .16);
}

.swal-trade-summary {
    display: grid;
    margin-top: 4px;
    padding: 14px 16px;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    align-items: center;
    gap: 10px 20px;
    border: 1px solid #e6e9f0;
    border-radius: 13px;
    background: rgba(248, 249, 253, .88);
    text-align: left;
}

.swal-trade-summary span {
    color: #8a94a6;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.swal-trade-summary strong {
    color: #202a40;
    font-size: 12px;
    font-weight: 900;
    text-align: right;
}

.swal-error-list {
    max-height: 230px;
    overflow-y: auto;
    text-align: left;
}

.swal-error-list p {
    margin: 0 0 7px;
    padding: 9px 11px;
    color: #9e3042;
    border: 1px solid rgba(213, 63, 87, .14);
    border-radius: 9px;
    background: #fff5f7;
    font-size: 11px;
    line-height: 1.5;
}

.tradingunal-swal-toast {
    width: min(390px, calc(100vw - 28px)) !important;
    padding: 14px 43px 14px 15px !important;
    border-radius: 15px !important;
}

.tradingunal-swal-toast .swal2-title {
    font-size: 14px !important;
    text-align: left !important;
}

.tradingunal-swal-toast .swal2-html-container,
.tradingunal-swal-toast .swal2-content {
    color: #667287 !important;
    font-size: 10px !important;
    text-align: left !important;
}

.tradingunal-swal-toast .swal2-timer-progress-bar {
    background:
        linear-gradient(
            90deg,
            #1eb77d,
            #765ce8
        ) !important;
}

/*
 * Artık SweetAlert kullanılan geçici mesajlar sayfa akışında
 * görünmez. Kritik bağlantı ve motor uyarıları etkilenmez.
 */
.positions-page > .positions-flash-message {
    display: none !important;
}

@media (max-width: 640px) {
    .tradingunal-swal-popup {
        padding: 22px 18px 18px !important;
        border-radius: 16px !important;
    }

    .tradingunal-swal-popup .swal2-title {
        font-size: 19px !important;
    }

    .tradingunal-swal-popup .swal2-actions {
        flex-direction: column-reverse;
    }

    .tradingunal-swal-confirm,
    .tradingunal-swal-cancel {
        width: 100%;
        margin: 0 !important;
    }

    .tradingunal-swal-toast {
        width: calc(100vw - 20px) !important;
    }
}

/* =========================================================
   TRADINGUNAL MOBILE SIDEBAR NAV VISIBILITY FIX V1
   admin.css içindeki eski mobil `display: none` kuralını
   yalnızca çekmece menü için sıfırlar.
   ========================================================= */
@media (max-width: 960px) {
    .sidebar-nav {
        display: flex !important;
        flex: 1 1 0 !important;
        min-height: 0 !important;
        flex-direction: column;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* TRADINGUNAL POSITION DROPDOWN DESIGN V2 BEGIN */

/*
 * Bildirim panelinin genel görünümü
 */
#notification-dropdown.notification-menu {
    width: min(430px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid rgba(106, 155, 210, 0.22);
    border-radius: 18px;
    background:
        linear-gradient(
            180deg,
            rgba(11, 30, 51, 0.985) 0%,
            rgba(7, 23, 40, 0.99) 100%
        );
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.46),
        0 0 0 1px rgba(255, 255, 255, 0.025) inset;
    backdrop-filter: blur(18px);
}

#notification-dropdown .notification-list {
    max-height: min(560px, calc(100vh - 190px));
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color:
        rgba(90, 151, 211, 0.38)
        transparent;
}

#notification-dropdown .notification-list::-webkit-scrollbar {
    width: 7px;
}

#notification-dropdown .notification-list::-webkit-scrollbar-track {
    background: transparent;
}

#notification-dropdown .notification-list::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background:
        rgba(90, 151, 211, 0.38);
    background-clip: padding-box;
}

/*
 * Ortak pozisyon bildirim kartı
 */
#notification-list .position-notification-card {
    --position-accent: #25d98f;
    --position-accent-soft: rgba(37, 217, 143, 0.12);
    --position-accent-border: rgba(37, 217, 143, 0.38);

    position: relative !important;
    display: block;
    min-height: 132px;
    margin: 0 0 9px !important;
    padding: 52px 15px 13px 17px !important;
    overflow: hidden;
    border:
        1px solid var(--position-accent-border) !important;
    border-left:
        3px solid var(--position-accent) !important;
    border-radius: 14px !important;
    color: #dcecff !important;
    text-decoration: none !important;
    background:
        radial-gradient(
            circle at 0 0,
            var(--position-accent-soft),
            transparent 48%
        ),
        linear-gradient(
            145deg,
            rgba(15, 38, 62, 0.96),
            rgba(8, 26, 45, 0.98)
        ) !important;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.025) inset;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

#notification-list
.position-notification-card:last-child {
    margin-bottom: 0 !important;
}

#notification-list
.position-notification-card:hover {
    z-index: 1;
    transform: translateY(-1px);
    border-color: var(--position-accent) !important;
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.28),
        0 0 22px var(--position-accent-soft);
}

#notification-list
.position-notification-card::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 7px;
    width: 2px;
    border-radius: 999px;
    background: var(--position-accent);
    box-shadow: 0 0 13px var(--position-accent);
    opacity: 0.78;
}

/*
 * LONG ve SHORT işlem yönü
 */
#notification-list
.position-notification-card.position-direction-long {
    --position-accent: #20db8a;
    --position-accent-soft: rgba(32, 219, 138, 0.13);
    --position-accent-border: rgba(32, 219, 138, 0.34);
}

#notification-list
.position-notification-card.position-direction-short {
    --position-accent: #ff596d;
    --position-accent-soft: rgba(255, 89, 109, 0.13);
    --position-accent-border: rgba(255, 89, 109, 0.36);
}

/*
 * Üst kimlik ve durum satırı
 */
#notification-list .position-notification-toolbar {
    position: absolute;
    top: 11px;
    right: 12px;
    left: 16px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    pointer-events: none;
}

#notification-list .position-notification-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

#notification-list .position-notification-symbol {
    overflow: hidden;
    color: #f2f8ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.025em;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#notification-list .position-direction-badge,
#notification-list .position-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 7px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.035em;
    white-space: nowrap;
}

#notification-list .position-direction-badge {
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid currentColor;
    font-size: 9px;
}

#notification-list
.position-direction-badge.is-long {
    color: #61efb1;
    background: rgba(25, 190, 116, 0.12);
    box-shadow:
        0 0 14px rgba(32, 219, 138, 0.08) inset;
}

#notification-list
.position-direction-badge.is-short {
    color: #ff8291;
    background: rgba(235, 65, 86, 0.13);
    box-shadow:
        0 0 14px rgba(255, 89, 109, 0.08) inset;
}

#notification-list .position-status-badge {
    min-height: 25px;
    padding: 0 9px;
    border: 1px solid transparent;
    font-size: 8px;
    text-transform: uppercase;
}

#notification-list
.position-status-badge.is-opened {
    color: #d8ffed;
    border-color: rgba(59, 226, 153, 0.5);
    background:
        linear-gradient(
            135deg,
            rgba(25, 177, 106, 0.92),
            rgba(17, 133, 82, 0.96)
        );
    box-shadow:
        0 6px 16px rgba(13, 158, 90, 0.22),
        0 1px 0 rgba(255, 255, 255, 0.13) inset;
}

#notification-list
.position-status-badge.is-closed {
    color: #fff1f3;
    border-color: rgba(255, 117, 132, 0.48);
    background:
        linear-gradient(
            135deg,
            rgba(219, 58, 78, 0.96),
            rgba(165, 37, 55, 0.97)
        );
    box-shadow:
        0 6px 16px rgba(211, 45, 68, 0.22),
        0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

/*
 * Mevcut bildirim metninin okunabilirliği
 */
#notification-list
.position-notification-card
:not(.position-notification-toolbar)
:not(.position-notification-facts) {
    position: relative;
}

#notification-list
.position-notification-card p {
    margin-top: 5px;
    margin-bottom: 7px;
    color: #a9bfd4 !important;
    font-size: 10.5px !important;
    line-height: 1.55 !important;
}

#notification-list
.position-notification-card strong {
    color: #eef7ff;
}

/*
 * Fiyat ve pozisyon büyüklüğü bilgi alanları
 */
#notification-list .position-notification-facts {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid rgba(141, 178, 211, 0.12);
    pointer-events: none;
}

#notification-list .position-notification-fact {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    padding: 7px 9px;
    border: 1px solid rgba(132, 172, 210, 0.1);
    border-radius: 9px;
    background: rgba(3, 17, 31, 0.34);
}

#notification-list
.position-notification-fact small {
    color: #6f8ba4;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#notification-list
.position-notification-fact strong {
    overflow: hidden;
    color: #e8f3ff;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#notification-list
.position-notification-fact strong.is-positive {
    color: #47eaa3;
}

#notification-list
.position-notification-fact strong.is-negative {
    color: #ff7182;
}

/*
 * Okunmamış bildirim vurgusu
 */
#notification-list
.position-notification-card.is-unread,
#notification-list
.position-notification-card.unread,
#notification-list
.position-notification-card[data-read="false"] {
    box-shadow:
        0 13px 32px rgba(0, 0, 0, 0.28),
        0 0 25px var(--position-accent-soft);
}

#notification-list
.position-notification-card.is-unread::after,
#notification-list
.position-notification-card.unread::after,
#notification-list
.position-notification-card[data-read="false"]::after {
    content: "";
    position: absolute;
    top: 9px;
    right: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--position-accent);
    box-shadow: 0 0 10px var(--position-accent);
}

/*
 * Küçük ekran uyumluluğu
 */
@media (max-width: 520px) {
    #notification-dropdown.notification-menu {
        right: 8px !important;
        left: 8px !important;
        width: auto;
    }

    #notification-list .position-notification-card {
        padding-top: 78px !important;
    }

    #notification-list .position-notification-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    #notification-list .position-status-badge {
        align-self: flex-start;
    }

    #notification-list .position-notification-facts {
        grid-template-columns: 1fr;
    }
}

/* TRADINGUNAL POSITION DROPDOWN DESIGN V2 END */
