:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fc;
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --primary: #6d5dfc;
    --primary-dark: #5948e8;
    --text: #172033;
    --muted: #788399;
    --border: #e5e9f2;
    --success: #0ba678;
    --warning: #d98b18;
    --danger: #dc4c64;
    --shadow: 0 12px 34px rgba(28, 39, 64, .08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

button,
input {
    font: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: white;
    background: linear-gradient(145deg, #7c6cff, #5141dd);
    box-shadow: 0 10px 24px rgba(109, 93, 252, .28);
    font-weight: 900;
}

.brand div {
    display: flex;
    flex-direction: column;
}

.brand strong {
    font-size: 14px;
    letter-spacing: .04em;
}

.brand small {
    margin-top: 3px;
    color: #8f9bb1;
    font-size: 11px;
}

.button {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 750;
}

.button-primary {
    color: white;
    background: var(--primary);
    box-shadow: 0 10px 24px rgba(109, 93, 252, .24);
}

.button-primary:hover {
    background: var(--primary-dark);
}

.button-ghost {
    color: var(--text);
    border: 1px solid var(--border);
    background: var(--surface);
}

.full {
    width: 100%;
}

.login-page {
    background: #111827;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(380px, .9fr) minmax(480px, 1.1fr);
}

.login-visual {
    display: flex;
    padding: 54px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    color: white;
    background:
        radial-gradient(circle at 70% 20%, rgba(124, 108, 255, .38), transparent 34%),
        radial-gradient(circle at 10% 90%, rgba(20, 184, 166, .18), transparent 30%),
        #111827;
}

.brand-large .brand-mark {
    width: 48px;
    height: 48px;
}

.visual-copy {
    max-width: 570px;
    position: relative;
    z-index: 1;
}

.visual-copy h1 {
    max-width: 540px;
    margin: 0;
    font-size: clamp(38px, 5vw, 66px);
    line-height: 1.06;
    letter-spacing: -.045em;
}

.visual-copy p {
    max-width: 500px;
    margin: 24px 0 0;
    color: #aeb8ca;
    font-size: 17px;
    line-height: 1.8;
}

.security-list {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: #b9c2d2;
    font-size: 13px;
}

.security-list div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.security-icon {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    color: #7ee0bd;
    background: rgba(11, 166, 120, .12);
}

.login-panel {
    display: grid;
    padding: 40px;
    place-items: center;
    background: var(--bg);
}

.login-card {
    width: min(440px, 100%);
    padding: 44px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-card h2 {
    margin: 0 0 10px;
    font-size: 30px;
    letter-spacing: -.03em;
}

.login-card > .muted {
    margin: 0 0 30px;
    line-height: 1.6;
}

.mobile-brand {
    display: none;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 750;
}

.login-form input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    color: var(--text);
    background: var(--surface-soft);
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(109, 93, 252, .10);
}

.login-form .button {
    margin-top: 16px;
}

.alert {
    margin: 0 0 18px;
    padding: 13px 15px;
    border-radius: 10px;
    font-size: 13px;
}

.alert-danger {
    color: #a93449;
    border: 1px solid #f5c7d0;
    background: #fff1f4;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    color: var(--muted);
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(11, 166, 120, .11);
}

.status-dot.warning {
    background: var(--warning);
    box-shadow: 0 0 0 4px rgba(217, 139, 24, .12);
}

.admin-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    display: flex;
    padding: 28px 20px;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    color: white;
    background: var(--sidebar);
}

.sidebar .brand {
    padding: 0 8px 26px;
}

.sidebar-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
}

.nav-title {
    margin: 23px 12px 8px;
    color: #6f7c92;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
}

.nav-link {
    display: flex;
    min-height: 46px;
    padding: 0 13px;
    align-items: center;
    gap: 12px;
    border-radius: 11px;
    color: #aeb8c9;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
}

.nav-link.active {
    color: white;
    background: linear-gradient(90deg, #6d5dfc, #5948e8);
    box-shadow: 0 10px 24px rgba(109, 93, 252, .22);
}

.nav-link.disabled {
    opacity: .65;
}

.nav-link small {
    margin-left: auto;
    color: #7f8aa0;
    font-size: 9px;
    text-transform: uppercase;
}

.nav-icon {
    width: 21px;
    text-align: center;
    font-size: 17px;
}

.sidebar-footer {
    display: grid;
    gap: 14px;
}

.user-card {
    display: flex;
    padding: 13px;
    align-items: center;
    gap: 11px;
    border: 1px solid #293549;
    border-radius: 13px;
    background: var(--sidebar-soft);
}

.avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    color: white;
    background: #37445a;
    font-weight: 800;
}

.user-card div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.user-card strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card small {
    margin-top: 4px;
    color: #8d99ad;
    font-size: 10px;
}

.sidebar-footer .button-ghost {
    color: #bac4d4;
    border-color: #2d394d;
    background: transparent;
}

.main-content {
    min-width: 0;
    padding: 34px;
}

.topbar {
    display: flex;
    margin-bottom: 26px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -.035em;
}

.topbar p {
    margin: 7px 0 0;
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-badge,
.safe-badge,
.panel-badge {
    display: inline-flex;
    min-height: 34px;
    padding: 0 12px;
    align-items: center;
    gap: 9px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .06em;
}

.mode-badge {
    color: #8b5914;
    border: 1px solid #f0d39f;
    background: #fff8e9;
}

.connection-banner {
    display: flex;
    margin-bottom: 22px;
    padding: 17px 20px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid #ddd8ff;
    border-radius: 14px;
    background: #f4f2ff;
}

.connection-banner > div {
    display: flex;
    align-items: center;
    gap: 14px;
}

.connection-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    color: white;
    background: var(--primary);
    font-weight: 900;
}

.connection-banner strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.connection-banner p {
    margin: 0;
    color: #737d91;
    font-size: 12px;
}

.safe-badge {
    color: #4937c8;
    background: white;
}

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

.metric-card,
.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 5px 22px rgba(28, 39, 64, .035);
}

.metric-card {
    padding: 20px;
}

.metric-head {
    display: flex;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metric-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    font-size: 16px;
}

.metric-icon.purple {
    color: #6d5dfc;
    background: #eeecff;
}

.metric-icon.blue {
    color: #3478d4;
    background: #eaf3ff;
}

.metric-icon.green {
    color: #0b9b70;
    background: #e9f9f3;
}

.metric-icon.orange {
    color: #d47a25;
    background: #fff2e6;
}

.metric-card > strong {
    display: block;
    min-height: 28px;
    margin-bottom: 7px;
    font-size: 19px;
    letter-spacing: -.025em;
}

.metric-card small {
    color: var(--muted);
    font-size: 11px;
}

.dashboard-grid {
    display: grid;
    margin-bottom: 22px;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr);
    gap: 18px;
}

.panel {
    padding: 22px;
}

.panel-header {
    display: flex;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
}

.panel-header h2 {
    margin: 0;
    font-size: 17px;
}

.panel-badge {
    min-height: 29px;
    color: var(--muted);
    background: var(--surface-soft);
}

.empty-state {
    display: grid;
    min-height: 230px;
    place-items: center;
    align-content: center;
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 14px;
    place-items: center;
    border-radius: 16px;
    color: var(--primary);
    background: #f0eeff;
    font-size: 22px;
}

.empty-state strong {
    font-size: 14px;
}

.empty-state p {
    max-width: 350px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.status-list {
    display: grid;
}

.status-list > div {
    display: flex;
    min-height: 51px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

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

.status-list span {
    color: var(--muted);
}

.status-list strong {
    font-size: 10px;
    letter-spacing: .04em;
}

.status-safe {
    color: var(--success);
}

.status-warning {
    color: var(--warning);
}

.status-muted {
    color: var(--muted);
}

.timeline-item {
    display: grid;
    padding: 16px 4px;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 13px;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 5px rgba(109, 93, 252, .11);
}

.timeline-item strong {
    font-size: 13px;
}

.timeline-item p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.timeline-item time {
    color: var(--muted);
    font-size: 10px;
}

@media (max-width: 1100px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 800px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-visual {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 20px;
    }

    .mobile-brand {
        display: flex;
        margin-bottom: 34px;
        align-items: center;
        gap: 12px;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        position: static;
    }

    .sidebar-nav {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        padding: 20px;
    }
}

@media (max-width: 580px) {
    .login-card {
        padding: 28px 22px;
    }

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

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .connection-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .timeline-item {
        grid-template-columns: auto 1fr;
    }

    .timeline-item time {
        display: none;
    }
}

/* Motor kontrol sayfası */
.notice {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    line-height: 1.5;
}

.notice ul {
    margin: 8px 0 0 18px;
}

.notice-success {
    color: #b8f5cf;
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
}

.notice-danger {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.control-form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.control-form label {
    display: grid;
    gap: 7px;
}

.control-form label > span {
    color: #aab3c5;
    font-size: 13px;
    font-weight: 600;
}

.control-form input {
    width: 100%;
    padding: 12px 13px;
    color: #f8fafc;
    background: #111827;
    border: 1px solid #334155;
    border-radius: 10px;
    outline: none;
}

.control-form input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.button-primary {
    color: #ffffff;
    background: #6d28d9;
    border-color: #7c3aed;
}

.button-primary:hover {
    background: #7c3aed;
}

.button-danger {
    color: #ffffff;
    background: #b91c1c;
    border-color: #dc2626;
}

.button-danger:hover {
    background: #dc2626;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.panel-divider {
    margin: 26px 0;
    border: 0;
    border-top: 1px solid #263244;
}

.audit-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.audit-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
}

.audit-table th,
.audit-table td {
    padding: 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #263244;
}

.audit-table th {
    color: #94a3b8;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.audit-table td {
    color: #dbe3ef;
    font-size: 13px;
}

/* =========================================================
   Modern Engine Control
   ========================================================= */

.engine-page {
    --engine-bg: #f4f6fb;
    --engine-card: #ffffff;
    --engine-border: #e5e9f2;
    --engine-text: #10182b;
    --engine-muted: #71809b;
    --engine-purple: #6952e8;
    --engine-green: #12a66a;
    --engine-red: #dc4b5d;
    --engine-orange: #f39a3c;
    --engine-blue: #3b82f6;

    max-width: 1440px;
    margin: 0 auto;
    color: var(--engine-text);
}

.engine-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.engine-kicker,
.engine-section-label,
.control-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--engine-purple);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.live-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.12);
}

.live-pulse.running {
    background: var(--engine-green);
    box-shadow: 0 0 0 5px rgba(18, 166, 106, 0.12);
}

.engine-hero h1 {
    margin: 8px 0 4px;
    color: var(--engine-text);
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.engine-hero p {
    margin: 0;
    color: var(--engine-muted);
    font-size: 14px;
}

.engine-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.environment-pill,
.engine-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.environment-pill {
    color: #a85a08;
    background: #fff8e8;
    border: 1px solid #f4d9a6;
}

.environment-pill > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
}

.engine-refresh {
    color: #4b5870;
    background: #ffffff;
    border: 1px solid var(--engine-border);
    transition: 160ms ease;
}

.engine-refresh:hover {
    color: var(--engine-purple);
    border-color: #c8c0fa;
    transform: translateY(-1px);
}

.engine-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 14px;
}

.engine-alert .alert-symbol {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    font-weight: 900;
}

.engine-alert strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}

.engine-alert p {
    margin: 0;
    font-size: 13px;
}

.engine-alert.success {
    color: #087448;
    background: #effcf6;
    border-color: #bcebd4;
}

.engine-alert.success .alert-symbol {
    color: #ffffff;
    background: #12a66a;
}

.engine-alert.info {
    color: #3450a3;
    background: #f0f4ff;
    border-color: #ccd7ff;
}

.engine-alert.info .alert-symbol {
    color: #ffffff;
    background: #5a70d6;
}

.engine-alert.danger {
    color: #9f2f40;
    background: #fff2f4;
    border-color: #f5c6cd;
}

.engine-alert.danger .alert-symbol {
    color: #ffffff;
    background: #dc4b5d;
}

.engine-connection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 15px 17px;
    border: 1px solid;
    border-radius: 16px;
}

.engine-connection.online {
    background: linear-gradient(90deg, #f4f1ff, #fbfaff);
    border-color: #d9d1ff;
}

.engine-connection.offline {
    background: #fff3f4;
    border-color: #f2c8ce;
}

.connection-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-orb {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #ffffff;
    background: var(--engine-purple);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(105, 82, 232, 0.22);
}

.offline .connection-orb {
    background: var(--engine-red);
}

.connection-main strong {
    display: block;
    margin-bottom: 3px;
    color: var(--engine-text);
    font-size: 13px;
}

.connection-main p {
    margin: 0;
    color: var(--engine-muted);
    font-size: 12px;
}

.connection-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--engine-purple);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.connection-label > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--engine-green);
}

.offline .connection-label > span {
    background: var(--engine-red);
}

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

.engine-stat {
    position: relative;
    min-height: 145px;
    padding: 18px;
    overflow: hidden;
    background: var(--engine-card);
    border: 1px solid var(--engine-border);
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(30, 45, 75, 0.045);
}

.engine-stat::after {
    position: absolute;
    right: -28px;
    bottom: -34px;
    width: 100px;
    height: 100px;
    content: "";
    border-radius: 50%;
    background: currentColor;
    opacity: 0.035;
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.stat-label {
    color: var(--engine-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.stat-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: currentColor;
    background: color-mix(in srgb, currentColor 10%, white);
    border-radius: 11px;
}

.engine-stat > strong {
    display: block;
    margin-bottom: 6px;
    color: var(--engine-text);
    font-size: 21px;
    letter-spacing: -0.03em;
}

.engine-stat > p {
    margin: 0;
    color: var(--engine-muted);
    font-size: 12px;
}

.accent-green {
    color: var(--engine-green);
}

.accent-violet {
    color: var(--engine-purple);
}

.accent-blue {
    color: var(--engine-blue);
}

.accent-orange {
    color: var(--engine-orange);
}

.accent-red {
    color: var(--engine-red);
}

.accent-gray {
    color: #77849a;
}

.engine-control-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin-bottom: 18px;
    padding: 26px;
    background:
        radial-gradient(
            circle at right top,
            rgba(105, 82, 232, 0.08),
            transparent 34%
        ),
        #ffffff;
    border: 1px solid var(--engine-border);
    border-radius: 20px;
    box-shadow: 0 14px 40px rgba(30, 45, 75, 0.06);
}

.engine-power-ring {
    display: grid;
    width: 86px;
    height: 86px;
    place-items: center;
    border: 9px solid #eceff5;
    border-radius: 50%;
}

.is-running .engine-power-ring {
    border-color: #c7f0df;
    box-shadow: 0 0 0 7px #effbf6;
}

.power-symbol {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    color: #7a879b;
    background: #f2f4f8;
    border-radius: 50%;
    font-size: 25px;
    font-weight: 900;
}

.is-running .power-symbol {
    color: #ffffff;
    background: var(--engine-green);
    box-shadow: 0 10px 24px rgba(18, 166, 106, 0.24);
}

.control-content h2 {
    margin: 6px 0;
    color: var(--engine-text);
    font-size: 22px;
    letter-spacing: -0.03em;
}

.control-content > p {
    max-width: 650px;
    margin: 0;
    color: var(--engine-muted);
    font-size: 13px;
    line-height: 1.65;
}

.control-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 17px;
}

.control-facts span {
    display: grid;
    gap: 2px;
}

.control-facts small {
    color: var(--engine-muted);
    font-size: 10px;
    text-transform: uppercase;
}

.control-facts strong {
    color: var(--engine-text);
    font-size: 12px;
}

.control-action {
    min-width: 190px;
    text-align: center;
}

.control-action form {
    margin: 0;
}

.control-action > small {
    display: block;
    margin-top: 9px;
    color: var(--engine-muted);
    font-size: 10px;
}

.engine-action-button {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 20px;
    color: #ffffff;
    border: 0;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: 160ms ease;
}

.engine-action-button.start {
    background: linear-gradient(135deg, #6952e8, #806cf2);
    box-shadow: 0 10px 24px rgba(105, 82, 232, 0.23);
}

.engine-action-button.stop {
    background: linear-gradient(135deg, #c93e50, #e15768);
    box-shadow: 0 10px 24px rgba(201, 62, 80, 0.2);
}

.engine-action-button:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

.engine-action-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    box-shadow: none;
}

.risk-unlock-card,
.engine-audit-card {
    margin-bottom: 18px;
    padding: 22px;
    background: #ffffff;
    border: 1px solid var(--engine-border);
    border-radius: 18px;
}

.risk-unlock-head > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.risk-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #ffffff;
    background: var(--engine-red);
    border-radius: 12px;
    font-weight: 900;
}

.risk-unlock-head strong {
    color: var(--engine-text);
}

.risk-unlock-head p {
    margin: 3px 0 0;
    color: var(--engine-muted);
    font-size: 12px;
}

.risk-unlock-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
    gap: 12px;
    margin-top: 18px;
}

.risk-unlock-form label {
    display: grid;
    gap: 6px;
}

.risk-unlock-form label > span {
    color: var(--engine-muted);
    font-size: 11px;
    font-weight: 700;
}

.risk-unlock-form input {
    min-height: 43px;
    padding: 0 12px;
    color: var(--engine-text);
    background: #f8f9fc;
    border: 1px solid var(--engine-border);
    border-radius: 11px;
}

.risk-unlock-form button {
    min-height: 43px;
    padding: 0 18px;
    color: #ffffff;
    background: var(--engine-red);
    border: 0;
    border-radius: 11px;
    font-weight: 800;
    cursor: pointer;
}

.audit-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
}

.audit-card-head h2 {
    margin: 5px 0 0;
    color: var(--engine-text);
    font-size: 19px;
}

.record-count {
    padding: 7px 10px;
    color: var(--engine-muted);
    background: #f4f6fa;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
}

.audit-row {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) 150px 145px;
    align-items: center;
    gap: 14px;
    padding: 14px 3px;
    border-top: 1px solid #edf0f5;
}

.audit-status {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 900;
}

.audit-status.success {
    color: #087448;
    background: #e8f8f1;
}

.audit-status.failed,
.audit-status.denied {
    color: #a83243;
    background: #ffebee;
}

.audit-main strong,
.audit-user strong {
    display: block;
    color: var(--engine-text);
    font-size: 12px;
}

.audit-main p,
.audit-user small {
    display: block;
    margin: 3px 0 0;
    color: var(--engine-muted);
    font-size: 11px;
}

.audit-row time {
    color: var(--engine-muted);
    font-size: 11px;
    text-align: right;
}

.audit-empty {
    padding: 28px 0;
    color: var(--engine-muted);
    text-align: center;
    border-top: 1px solid #edf0f5;
}

@media (max-width: 1100px) {
    .engine-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .engine-control-card {
        grid-template-columns: auto 1fr;
    }

    .control-action {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 760px) {
    .engine-hero,
    .engine-connection {
        align-items: flex-start;
        flex-direction: column;
    }

    .engine-hero-actions {
        width: 100%;
    }

    .environment-pill,
    .engine-refresh {
        flex: 1;
    }

    .engine-stat-grid {
        grid-template-columns: 1fr;
    }

    .engine-control-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .control-visual {
        display: flex;
        justify-content: center;
    }

    .control-facts {
        justify-content: center;
    }

    .risk-unlock-form {
        grid-template-columns: 1fr;
    }

    .audit-row {
        grid-template-columns: auto 1fr;
    }

    .audit-user,
    .audit-row time {
        grid-column: 2;
        text-align: left;
    }
}

/* =========================================================
   Engine Activity Gauge
   Görsel tarama aktivitesi göstergesidir.
   ========================================================= */

.engine-gauge {
    --gauge-size: 184px;
    --gauge-green: #12a66a;
    --gauge-lime: #6ecb63;
    --gauge-orange: #f3a43b;
    --gauge-red: #e45768;
    --needle-angle: -120deg;

    display: grid;
    width: var(--gauge-size);
    flex: 0 0 var(--gauge-size);
    justify-items: center;
    gap: 10px;
}

.gauge-face {
    position: relative;
    width: var(--gauge-size);
    height: var(--gauge-size);
    overflow: hidden;
    background:
        radial-gradient(
            circle at center,
            #ffffff 0 34%,
            #f8fafc 35% 53%,
            transparent 54%
        ),
        conic-gradient(
            from 225deg,
            #d7dde8 0deg 45deg,
            #50c591 45deg 112deg,
            #f0b24f 112deg 175deg,
            #e65b6c 175deg 225deg,
            transparent 225deg 360deg
        );
    border: 1px solid #e4e9f1;
    border-radius: 50%;
    box-shadow:
        0 16px 36px rgba(28, 43, 72, 0.1),
        inset 0 0 0 9px rgba(255, 255, 255, 0.78),
        inset 0 -12px 24px rgba(62, 75, 102, 0.05);
}

.gauge-face::before {
    position: absolute;
    inset: 15px;
    z-index: 1;
    content: "";
    background:
        radial-gradient(
            circle at 50% 62%,
            rgba(105, 82, 232, 0.05),
            transparent 48%
        ),
        #ffffff;
    border: 1px solid #edf0f5;
    border-radius: 50%;
    box-shadow: inset 0 2px 10px rgba(30, 45, 75, 0.05);
}

.gauge-face::after {
    position: absolute;
    inset: 5px;
    z-index: 0;
    content: "";
    border: 1px solid rgba(105, 82, 232, 0.08);
    border-radius: 50%;
}

.gauge-zone {
    position: absolute;
    z-index: 2;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.zone-low {
    left: 25px;
    bottom: 35px;
    background: #aab4c5;
    box-shadow: 0 0 10px rgba(170, 180, 197, 0.5);
}

.zone-medium {
    top: 29px;
    left: 89px;
    background: var(--gauge-green);
    box-shadow: 0 0 12px rgba(18, 166, 106, 0.5);
}

.zone-high {
    right: 25px;
    bottom: 35px;
    background: var(--gauge-red);
    box-shadow: 0 0 12px rgba(228, 87, 104, 0.5);
}

.gauge-tick {
    position: absolute;
    z-index: 3;
    top: 14px;
    left: 50%;
    width: 2px;
    height: 11px;
    background: #77849a;
    border-radius: 2px;
    transform-origin: 50% 78px;
}

.tick-0 {
    transform: translateX(-50%) rotate(-120deg);
}

.tick-1 {
    transform: translateX(-50%) rotate(-80deg);
}

.tick-2 {
    transform: translateX(-50%) rotate(-40deg);
}

.tick-3 {
    transform: translateX(-50%) rotate(0deg);
}

.tick-4 {
    transform: translateX(-50%) rotate(40deg);
}

.tick-5 {
    transform: translateX(-50%) rotate(80deg);
}

.tick-6 {
    transform: translateX(-50%) rotate(120deg);
}

.gauge-number {
    position: absolute;
    z-index: 4;
    color: #7a879b;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.number-0 {
    left: 28px;
    bottom: 37px;
}

.number-1 {
    left: 22px;
    top: 61px;
}

.number-2 {
    left: 49px;
    top: 29px;
}

.number-3 {
    top: 19px;
    left: 50%;
    transform: translateX(-50%);
}

.number-4 {
    top: 29px;
    right: 49px;
}

.number-5 {
    top: 61px;
    right: 22px;
}

.number-6 {
    right: 28px;
    bottom: 37px;
}

.gauge-needle {
    position: absolute;
    z-index: 7;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 70px;
    margin-top: -70px;
    margin-left: -2px;
    transform: rotate(var(--needle-angle));
    transform-origin: 50% 100%;
    filter: drop-shadow(0 3px 4px rgba(220, 75, 93, 0.25));
}

.gauge-needle > span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        #9d2636,
        #e94f62 60%,
        #ff8a98
    );
    border-radius: 5px 5px 2px 2px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.gauge-hub {
    position: absolute;
    z-index: 9;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    background:
        radial-gradient(
            circle at 38% 35%,
            #ffffff 0 8%,
            #8995a8 10%,
            #273246 58%,
            #111827 100%
        );
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow:
        0 3px 10px rgba(17, 24, 39, 0.3),
        0 0 0 1px #cfd6e1;
    transform: translate(-50%, -50%);
}

.gauge-readout {
    position: absolute;
    z-index: 5;
    bottom: 27px;
    left: 50%;
    display: grid;
    justify-items: center;
    transform: translateX(-50%);
}

.gauge-readout strong {
    color: #172033;
    font-size: 13px;
    line-height: 1;
    letter-spacing: -0.02em;
}

.gauge-readout small {
    margin-top: 3px;
    color: #8b97a9;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.gauge-state {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    color: #768297;
    background: #f1f4f8;
    border: 1px solid #e3e8f0;
    border-radius: 999px;
    font-size: 8px;
    letter-spacing: 0.08em;
}

.gauge-state-dot {
    width: 6px;
    height: 6px;
    background: #9ba6b7;
    border-radius: 50%;
}

/* Motor çalışmıyorken ibre sıfır konumunda kalır. */
.gauge-stopped .gauge-needle {
    --needle-angle: -120deg;
    transition: transform 700ms cubic-bezier(.2, .8, .2, 1);
}

.gauge-stopped .gauge-face {
    filter: saturate(0.58);
}

/* Motor aktifken gösterge aydınlanır. */
.gauge-running .gauge-face {
    border-color: #cfece0;
    box-shadow:
        0 18px 40px rgba(18, 166, 106, 0.13),
        0 0 0 7px rgba(18, 166, 106, 0.055),
        inset 0 0 0 9px rgba(255, 255, 255, 0.8),
        inset 0 -12px 24px rgba(18, 166, 106, 0.055);
}

.gauge-running .gauge-state {
    color: #087448;
    background: #eaf9f2;
    border-color: #c8eddc;
}

.gauge-running .gauge-state-dot {
    background: var(--gauge-green);
    box-shadow:
        0 0 0 4px rgba(18, 166, 106, 0.12),
        0 0 12px rgba(18, 166, 106, 0.55);
    animation: gauge-status-pulse 1.8s ease-in-out infinite;
}

/*
 * Python motoru her çevrimden sonra yaklaşık 30 saniye beklediği
 * için görsel çevrim de 30 saniyede bir tekrarlanır.
 *
 * Bu hareket performans ölçümü değil, tarama aktivitesi efektidir.
 */
.gauge-running .gauge-needle {
    animation: engine-scan-sweep 30s
        cubic-bezier(.24, .75, .34, 1)
        infinite;
}

/* İbre çoğunlukla 3K–5K bölgesinde hareket eder. */
@keyframes engine-scan-sweep {
    0% {
        transform: rotate(-120deg);
    }

    1.5% {
        transform: rotate(-48deg);
    }

    3.5% {
        transform: rotate(2deg);
    }

    5.5% {
        transform: rotate(76deg);
    }

    7.5% {
        transform: rotate(36deg);
    }

    9.5% {
        transform: rotate(82deg);
    }

    12% {
        transform: rotate(42deg);
    }

    16% {
        transform: rotate(58deg);
    }

    22%,
    94% {
        transform: rotate(46deg);
    }

    97% {
        transform: rotate(20deg);
    }

    100% {
        transform: rotate(-120deg);
    }
}

@keyframes gauge-status-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.55;
        transform: scale(0.82);
    }
}

/* Hareket azaltma tercihi olan kullanıcılar için. */
@media (prefers-reduced-motion: reduce) {
    .gauge-running .gauge-needle {
        animation: none;
        transform: rotate(46deg);
    }

    .gauge-running .gauge-state-dot {
        animation: none;
    }
}

@media (max-width: 1100px) {
    .engine-gauge {
        --gauge-size: 170px;
    }

    .gauge-tick {
        transform-origin: 50% 71px;
    }
}

@media (max-width: 760px) {
    .engine-gauge {
        --gauge-size: 184px;
        margin: 0 auto;
    }

    .gauge-tick {
        transform-origin: 50% 78px;
    }
}

/* Gauge için kontrol kartı yerleşim düzeltmeleri */

.engine-control-card {
    grid-template-columns: 190px minmax(0, 1fr) 190px;
    min-height: 245px;
}

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

@media (max-width: 1100px) {
    .engine-control-card {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .engine-control-card .control-action {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .engine-control-card {
        grid-template-columns: 1fr;
    }

    .engine-control-card .control-action {
        grid-column: auto;
    }
}
