* {
    box-sizing: border-box;
}

:root {
    --bg: #0D1117;
    --panel: #161B22;
    --panel-2: #1C2430;
    --text: #E0E0E0;
    --text-strong: #FFFFFF;
    --muted: #9AA4B2;
    --accent: #4A9EFF;
    --ok: #2DBA7F;
    --bad: #E74C3C;
    --warn: #F4B942;
    --border: #2A3443;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    --sidebar-w: 200px;
    --topbar-h: 64px;
}

html[data-theme="light"] {
    --bg: #F3F6FB;
    --panel: #FFFFFF;
    --panel-2: #F7FAFF;
    --text: #263241;
    --text-strong: #111827;
    --muted: #5D6B80;
    --accent: #2F7DF6;
    --ok: #1F9F62;
    --bad: #D64545;
    --warn: #D4951D;
    --border: #D7E0EC;
    --shadow: 0 6px 20px rgba(16, 24, 40, 0.08);
}

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

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

.layout {
    height: 100vh;
    overflow: hidden;
}

.topbar {
    grid-area: topbar;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar h1 {
    margin: 0;
    font-size: 18px;
    color: var(--text-strong);
}

.sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: var(--sidebar-w);
    min-width: 200px;
    height: calc(100vh - var(--topbar-h));
    border-right: 1px solid var(--border);
    background: var(--panel);
    padding: 14px 10px;
    overflow: visible;
    z-index: 25;
}

.sidebar-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 8px 10px;
}

.nav {
    display: grid;
    gap: 6px;
}

.nav-item {
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--panel-2);
    border-color: var(--border);
}

.nav-item.active {
    background: rgba(74, 158, 255, 0.18);
    border-color: var(--accent);
    color: var(--text-strong);
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 20;
}

.content {
    padding: 16px;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.main-content {
    margin-left: 200px;
    height: calc(100vh - var(--topbar-h));
}

.tab {
    display: none;
    min-height: 0;
}

.tab.active {
    display: block;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.page-head h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 20px;
}

.btn, .btn-icon {
    border: 1px solid var(--border);
    background: var(--panel-2);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
}

.btn:hover, .btn-icon:hover {
    border-color: var(--accent);
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.badge {
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    padding: 4px 10px;
}

.badge.ok { background: rgba(45, 186, 127, 0.15); border-color: var(--ok); }
.badge.bad { background: rgba(231, 76, 60, 0.15); border-color: var(--bad); }
.badge.warn { background: rgba(244, 185, 66, 0.15); border-color: var(--warn); }

.input, .textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--panel-2);
    border-radius: 10px;
    padding: 10px 12px;
}

.input:focus, .textarea:focus {
    outline: 2px solid rgba(74, 158, 255, 0.35);
    border-color: var(--accent);
}

.list {
    padding: 12px;
    display: grid;
    gap: 8px;
}

.list-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-2);
    padding: 10px;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 40;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.open { display: flex; }

.modal-content {
    width: min(840px, 100%);
    max-height: 90vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
}

.modal-head {
    position: sticky;
    top: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--panel);
}

.modal-body {
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}
.modal-body > div,
.modal-body .customer-wizard-host {
    white-space: normal;
}


.toast-root {
    position: fixed;
    right: 14px;
    bottom: 14px;
    display: grid;
    gap: 8px;
    z-index: 60;
}

.toast {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    padding: 10px 12px;
    min-width: 220px;
}

.toast.success { border-left: 4px solid var(--ok); }
.toast.error { border-left: 4px solid var(--bad); }
.toast.info { border-left: 4px solid var(--accent); }

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }

    .sidebar {
        top: var(--topbar-h);
        left: -200px;
        min-width: 200px;
        overflow: visible;
        transition: left 0.2s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .overlay.open {
        display: block;
    }

    .topbar h1 {
        font-size: 16px;
    }

    .btn, .btn-icon {
        padding: 8px 10px;
    }
}

@media (max-width: 600px) {
    .content {
        padding: 10px;
    }

    .topbar {
        padding: 0 10px;
    }
}


/* IAOS Oturum Güvenliği - Üst Bar */
.session-countdown {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    font-size: 12px;
    opacity: 0.9;
    white-space: nowrap;
}

.logout-btn {
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.25);
}

.logout-btn:hover {
    background: rgba(185, 28, 28, 0.35);
}

/* IAOS Oturum Güvenliği - Görünürlük Güçlendirme */
.topbar-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
}

#sessionCountdown.session-countdown,
.session-countdown {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    min-height: 30px !important;
    padding: 6px 11px !important;
    border: 1px solid rgba(96, 165, 250, 0.45) !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.72) !important;
    color: #dbeafe !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    z-index: 20 !important;
}

#globalLogoutBtn.logout-btn,
.logout-btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 32px !important;
    padding: 7px 12px !important;
    border: 1px solid rgba(248, 113, 113, 0.72) !important;
    border-radius: 10px !important;
    background: rgba(127, 29, 29, 0.55) !important;
    color: #fee2e2 !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    z-index: 21 !important;
}

#globalLogoutBtn.logout-btn:hover,
.logout-btn:hover {
    background: rgba(185, 28, 28, 0.75) !important;
}


/* IAOS Oturum Güvenliği - DOM Enjeksiyon Görünürlüğü */
#globalLogoutBtn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#sessionCountdown {
    display: inline-flex !important;
    visibility: visible !important;
}

/* PR-ADMIN-UX-FULL-MENU-HUMANIZATION-1 */
.admin-full-menu-humanization-card {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    background: var(--panel-2);
}

.admin-full-menu-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-full-menu-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.admin-full-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .admin-full-menu-grid {
        grid-template-columns: 1fr;
    }
}

.admin-full-menu-blocked {
    margin: 4px 0 8px 18px;
    padding: 0;
    font-size: 12px;
}

.admin-full-menu-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.admin-full-menu-next {
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(74, 158, 255, 0.08);
}

.admin-full-menu-exec {
    font-size: 12px;
    color: var(--muted);
}

.service-detail-technical {
    margin-top: 10px;
}
