/**
 * MEKANIKLAB MKY Dashboard - Temel Stil Dosyası
 */
@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');

:root {
    --sidebar-bg: #0b0e14;
    --main-bg: #111827;
    --card-bg: #1f2937;
    --orange: #ff6600;
    --turquoise: #00ced1;
    --text-main: #e5e7eb;
    --sidebar-width: 250px;
    --header-height: 20vh;
    --agent-width: 380px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Özel Scrollbar Tasarımı */
#content::-webkit-scrollbar { width: 10px; }
#content::-webkit-scrollbar-track { background: var(--main-bg); }
#content::-webkit-scrollbar-thumb { 
    background: #374151; 
    border-radius: 10px; 
    transition: background 0.3s;
}
#content::-webkit-scrollbar-thumb:hover { background: var(--orange); }

/* Submenu Görünürlük Mantığı */
.has-submenu .submenu {
    display: none;
    list-style: none;
    padding-left: 20px;
    background: rgba(0, 0, 0, 0.2);
}
.has-submenu.open .submenu {
    display: block;
}
.has-submenu.active > a {
    color: var(--orange);
    border-left: 3px solid var(--orange);
}

body, html { 
    margin: 0 !important; padding: 0 !important; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    height: 100%; background: var(--main-bg); color: var(--text-main); 
    overflow: hidden; 
}
#app { display: flex; height: 100vh; }
.ui-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 10, 0.75);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 998;
}
.ui-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar */
#sidebar { 
    width: var(--sidebar-width); background: var(--sidebar-bg); 
    border-right: 1px solid #1f2937; display: flex; flex-direction: column; 
    position: fixed; left: 0; top: 0; height: 100%; z-index: 1002;
    transition: transform 0.3s ease;
}
#sidebar.closed { transform: translateX(-100%); }

.logo { 
    padding: 20px 10px; text-align: center; font-weight: 800; margin-bottom: 30px; 
    font-size: 1.1rem; letter-spacing: 1px; font-family: 'Audiowide', cursive;
    width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.orange { color: var(--orange); }
#sidebar nav ul { list-style: none; padding: 0; margin: 20px 0; }
#sidebar nav li a { color: #9ca3af; text-decoration: none; padding: 12px 25px; display: block; transition: 0.3s; }
#sidebar nav li a:hover { background: rgba(255,102,0,0.1); color: var(--text-main); border-left: 3px solid var(--orange); }
.nav-section-label {
    padding: 6px 25px 10px;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.section-header-shell {
    display: grid;
    gap: 14px;
    padding: 22px 22px 0;
}
.section-header-main {
    padding: 20px 22px;
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(0, 206, 209, 0.12), transparent 28%),
        radial-gradient(circle at left center, rgba(255, 102, 0, 0.14), transparent 34%),
        rgba(17, 24, 39, 0.82);
    border: 1px solid rgba(255,255,255,0.08);
}
.section-header-main h1 {
    margin: 8px 0 10px;
    font-size: 1.75rem;
}
.section-header-main p {
    max-width: 860px;
    color: #9ca3af;
    line-height: 1.65;
}
.section-tab-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.section-tab {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.14);
    transition: 0.2s ease;
}
.section-tab:hover,
.section-tab.active {
    color: #ffffff;
    border-color: rgba(255, 102, 0, 0.42);
    box-shadow: 0 10px 24px rgba(255, 102, 0, 0.12);
}

/* Sidebar Handle (Hamburger) */
.sidebar-handle {
    position: absolute; right: -45px; top: 20px; 
    background: var(--sidebar-bg); color: white; 
    width: 45px; height: 45px; display: flex; 
    align-items: center; justify-content: center;
    cursor: pointer; border-radius: 0 5px 5px 0;
    border: 1px solid #1f2937; border-left: none;
    font-size: 1.5rem;
}

/* Content Adjustment */
#content { 
    display: flex; flex-direction: column; 
    background: var(--main-bg); color: var(--text-main); 
    margin-left: var(--sidebar-width); 
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s ease, width 0.3s ease; 
    overflow-y: auto; height: 100vh; padding: 0 !important;
}
.sidebar-closed #content { margin-left: 0 !important; width: 100% !important; }


/* Sağ Kayar Ajan Paneli */
.agent-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--agent-width);
    height: 100%;
    background: rgba(5, 7, 10, 0.75) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease; display: flex; flex-direction: column; z-index: 1001;
}
.agent-sidebar.closed { transform: translateX(100%); }

.drawer-handle {
    display: none;
}

.chat-area { flex: 1; padding: 15px; overflow-y: auto; background: rgba(0,0,0,0.2); }
.chat-input { padding: 15px; border-top: 1px solid #374151; display: flex; gap: 10px; flex-direction: column; }
.chat-input textarea { 
    width: 100%; background: #111827; border: 1px solid #374151; color: white;
    padding: 10px; border-radius: 12px; resize: none; box-sizing: border-box; min-height: 52px; line-height: 1.5;
}
.chat-input button { background: var(--orange); color: white; border: none; padding: 8px; border-radius: 4px; cursor: pointer; }
.chat-message {
    display: flex;
    margin-bottom: 12px;
}
.chat-message.user {
    justify-content: flex-end;
}
.chat-message.agent,
.chat-message.system {
    justify-content: flex-start;
}
.chat-bubble {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 14px;
    line-height: 1.55;
    word-break: break-word;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(17, 24, 39, 0.9);
}
.chat-message.user .chat-bubble {
    color: #ffffff;
    background: rgba(255, 102, 0, 0.16);
}
.chat-message.agent .chat-bubble {
    color: #eceee8;
    background: rgba(255,255,255,0.06);
}
.chat-message.system .chat-bubble {
    color: #ffd0d0;
    background: rgba(239, 68, 68, 0.1);
}
.chat-message-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.chat-message-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chat-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #cfe0f5;
    font-size: 0.68rem;
    line-height: 1.2;
}
.chat-message-time {
    color: #94a3b8;
    font-size: 0.7rem;
    white-space: nowrap;
}
.chat-message-text {
    line-height: 1.55;
}
.cmd-slash {
    color: var(--turquoise);
    font-weight: 700;
}
.cmd-mention {
    color: #ffb26b;
    font-weight: 700;
}

.task-actions { opacity: 0; transition: 0.3s; display: flex; gap: 10px; }
.task-item:hover .task-actions { opacity: 1; }

/* Pasta Dilimi / Pulse Grafik Efekti */
.task-chart { 
    width: 85px; height: 85px; border-radius: 50%; 
    background: conic-gradient(var(--orange) 0% 70%, #374151 70% 100%); 
    position: relative; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.2);
}
.task-chart::after {
    content: "70%"; position: absolute; width: 60px; height: 60px; 
    background: var(--card-bg); border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 0.9rem;
}

.status-text.working { color: #3b82f6; }
.status-text.queued { color: #f59e0b; }
.status-text.error { color: #ef4444; }

.btn-danger { background: #ef4444; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; }
.btn-cancel { background: #4b5563; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; }

/* Görev İzleme Kartları ve Durum Göstergeleri */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--card-bg); padding: 20px; border-radius: 12px; border: 1px solid #374151; transition: 0.3s; }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(255, 102, 0, 0.2); }
.dashboard-grid-wide { grid-template-columns: 1.2fr 1fr 1fr 1fr; align-items: stretch; }
.stat-card-emphasis {
    background:
        radial-gradient(circle at top right, rgba(0, 206, 209, 0.18), transparent 32%),
        radial-gradient(circle at top left, rgba(255, 102, 0, 0.22), transparent 35%),
        var(--card-bg);
}
.card-kicker {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--turquoise);
    margin-bottom: 12px;
    font-weight: 700;
}
.stat-card .value {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 10px 0 8px;
}
.trend { color: #9ca3af; }
.trend.up { color: #10b981; }
.micro-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.micro-metrics div {
    padding: 12px;
    border-radius: 12px;
    background: rgba(11, 14, 20, 0.58);
    border: 1px solid rgba(255,255,255,0.08);
}
.micro-metrics small {
    display: block;
    color: #9ca3af;
    margin-bottom: 4px;
}
.micro-metrics strong {
    font-size: 1.1rem;
}
.legend-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}
.bar-stack {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}
.bar-line {
    display: grid;
    grid-template-columns: 90px 1fr 48px;
    gap: 12px;
    align-items: center;
}
.mini-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.mini-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--orange), #ff9955);
}
.mini-bar-fill.alt {
    background: linear-gradient(90deg, var(--turquoise), #79e4ea);
}
.mini-bar-fill.muted {
    background: linear-gradient(90deg, #9ca3af, #cbd5e1);
}
.compact-list {
    display: grid;
    gap: 12px;
}
.compact-list-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(11, 14, 20, 0.58);
    border: 1px solid rgba(255,255,255,0.08);
}
.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.task-monitor { background: var(--card-bg); border-radius: 12px; border: 1px solid #374151; padding: 20px; }
.task-list { list-style: none; padding: 0; margin-top: 15px; }
.task-item { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px; border-bottom: 1px solid #374151; 
    cursor: pointer; transition: 0.2s; position: relative;
}
.task-item:hover { background: rgba(255, 255, 255, 0.05); border-left: 2px solid var(--orange); }
.task-item:last-child { border-bottom: none; }

/* Görev Özet Alanı (Summary Grid) */
.task-summary-wrapper { display: flex; gap: 20px; margin-bottom: 20px; align-items: center; background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; }
.summary-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; }
.stat-box { background: #111827; padding: 10px; border-radius: 6px; text-align: center; border: 1px solid #374151; }
.stat-box span { display: block; font-size: 0.75rem; color: var(--text-muted); }
.stat-box b { font-size: 1.1rem; color: var(--orange); }

/* Pasta Dilimi / Pulse Grafik */
.task-chart { width: 80px; height: 80px; border-radius: 50%; background: conic-gradient(var(--orange) 70%, #374151 0); position: relative; }
.task-chart::after { content: ""; position: absolute; inset: 15px; background: var(--card-bg); border-radius: 50%; }

/* Lightbox (Detay Paneli) */
.lightbox { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
    background: rgba(5, 7, 10, 0.6); z-index: 9999; display: none; 
    align-items: center; justify-content: center; backdrop-filter: blur(15px);
    padding: 20px;
}
.lightbox.active { display: flex; animation: fadeIn 0.3s ease; }

.lightbox-content { 
    position: relative;
    background: rgba(31, 41, 55, 0.88); width: min(94vw, 1280px);
    max-width: 1280px;
    max-height: 92vh; padding: 0; border-radius: 20px; 
    border: 1px solid rgba(255, 102, 0, 0.3); 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex; flex-direction: column; overflow: hidden;
}

.lightbox-content::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(0, 206, 209, 0.12), transparent 30%),
        radial-gradient(circle at top left, rgba(255, 102, 0, 0.18), transparent 35%);
    pointer-events: none;
}

.modal-header { padding: 25px; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.2); }
.modal-body { padding: 30px; overflow-y: auto; flex: 1; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; }
.detail-item label { display: block; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.detail-item span { color: var(--text-main); font-size: 1rem; font-weight: 500; }

.modal-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border-radius: 18px;
    margin-bottom: 24px;
}

.modal-identity {
    display: flex;
    align-items: center;
    gap: 18px;
}

.identity-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--orange), #ff9253);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 12px 24px rgba(255, 102, 0, 0.25);
}

.identity-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.identity-subtitle {
    color: #9fb0c5;
    font-size: 0.92rem;
}

.modal-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.modal-badge {
    min-width: 92px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(255,255,255,0.08);
}

.modal-badge span {
    display: block;
    font-size: 0.7rem;
    color: #8fa0b8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal-badge strong {
    color: #fff;
    font-size: 0.92rem;
}

.detail-section {
    margin-bottom: 26px;
}

.detail-section-full .enhanced-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-section-title {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--turquoise);
    margin-bottom: 14px;
    font-weight: 700;
}

.enhanced-grid {
    gap: 16px;
}

.detail-card {
    background: rgba(11, 14, 20, 0.72);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.detail-card-wide {
    grid-column: 1 / -1;
}

.detail-card label {
    display: block;
    color: #8ca0b8;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.detail-value {
    color: #f6f7fb;
    line-height: 1.55;
    word-break: break-word;
}

.modal-input {
    width: 100%;
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-input:focus {
    border-color: rgba(255, 102, 0, 0.65);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.15);
}

.modal-textarea {
    min-height: 110px;
    resize: vertical;
}

.modal-loading,
.modal-error {
    padding: 48px 18px;
    text-align: center;
    border-radius: 16px;
    background: rgba(11, 14, 20, 0.72);
    border: 1px solid rgba(255,255,255,0.08);
}

.modal-error {
    color: #ff8d8d;
}

.close-modal { 
    background: rgba(255,255,255,0.1); border: none; color: white; width: 35px; height: 35px; 
    border-radius: 50%; cursor: pointer; transition: 0.3s; font-size: 1.2rem;
}
.close-modal:hover { background: var(--orange); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Pulse Animasyonları */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 10px; }
.dot-online { background: #10b981; box-shadow: 0 0 8px #10b981; }
.dot-working { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; animation: pulse-blue 2s infinite; }
.dot-error { background: #ef4444; box-shadow: 0 0 8px #ef4444; animation: pulse-red 1.5s infinite; }
.dot-queued { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

@keyframes pulse-blue {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Profesyonel Form ve Kart Tasarımları */
.glass-card {
    background: rgba(31, 41, 55, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 102, 0, 0.2);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.sleek-form .form-row { margin-bottom: 20px; min-width: 0; }
.sleek-form label { display: block; color: #9ca3af; margin-bottom: 8px; font-size: 0.9rem; line-height: 1.45; }
.sleek-form input { 
    width: 100%; padding: 12px; background: #111827; border: 1px solid #374151; 
    color: white; border-radius: 8px; transition: 0.3s;
}
:root {
    --checkbox-size: 20px;
}
.sleek-form input,
.sleek-form select,
.sleek-form textarea,
.sleek-form small,
.text-dim,
.alert,
.detail-value,
.identity-subtitle {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.sleek-form small,
.text-dim {
    display: block;
    line-height: 1.55;
}
.sleek-form .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 6px;
    line-height: 1.45;
    color: #d7deea;
    min-height: 28px;
}
.sleek-form .checkbox-label input[type="checkbox"],
.permission-option input[type="checkbox"],
.permission-option input[type="radio"] {
    width: var(--checkbox-size);
    min-width: var(--checkbox-size);
    height: var(--checkbox-size);
    margin: 2px 0 0;
    padding: 0;
    flex: 0 0 var(--checkbox-size);
    accent-color: var(--orange);
    cursor: pointer;
}
.sleek-form .checkbox-label span {
    display: block;
    padding-top: 1px;
    min-width: 0;
}
.sleek-form input:focus { border-color: var(--orange); outline: none; box-shadow: 0 0 10px rgba(255,102,0,0.2); }
.input-disabled { opacity: 0.6; cursor: not-allowed; }
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.btn-orange-glow { 
    background: var(--orange); color: white; border: none; padding: 12px 25px; 
    border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.3s;
    box-shadow: 0 4px 15px rgba(255,102,0,0.3);
}
.btn-orange-glow:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,102,0,0.5); }
.btn-secondary-glow {
    background: rgba(0, 206, 209, 0.12);
    color: #dffbfc;
    border: 1px solid rgba(0, 206, 209, 0.45);
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0, 206, 209, 0.12);
}
.btn-secondary-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 206, 209, 0.22);
}
.btn-danger-glow {
    background: #dc2626;
    color: #ffffff;
    border: 1px solid #ef4444;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.22);
}
.btn-danger-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.32);
}

/* Sabit Header Stili */
.main-header {
    height: var(--header-height); min-height: var(--header-height); width: 100%;
    position: sticky; top: 0 !important; left: 0; z-index: 1000;
    background: rgba(5, 7, 10, 0.98) !important;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid #374151 !important;
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 40px; margin: 0 !important;
}

.main-header h2 {
    font-size: 2.2rem !important; margin: 0; color: var(--text-main); font-weight: 800;
}

#mainContentArea { flex-grow: 1; padding: 30px; min-height: 80vh; }

.header-stats { display: flex; gap: 20px; }
.stat-mini-card { background: #111827; padding: 10px 20px; border-radius: 8px; border: 1px solid #374151; }
.stat-mini-card span { display: block; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 2px; }
.stat-mini-card b { font-size: 1rem; color: var(--orange); }

/* Sayfalama Stilleri */
.pagination-nav { display: flex; align-items: center; gap: 8px; }
.page-link { 
    background: #111827; border: 1px solid #374151; color: white; 
    padding: 4px 10px; border-radius: 5px; text-decoration: none; transition: 0.2s;
    font-size: 0.85rem;
}
.page-link:hover { border-color: var(--orange); background: rgba(255,102,0,0.1); }
.page-link.active { background: var(--orange); color: white; border-color: var(--orange); box-shadow: 0 0 10px rgba(255,102,0,0.3); }
.page-info { font-size: 0.75rem; color: #9ca3af; padding: 0 5px; }

/* Select Dropdown Fix */
select, select option {
    background-color: #0b0e14 !important;
    color: #ffffff !important;
}
/* Alerts */
.alert { padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.alert-success { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid #10b981; }
.alert-danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid #ef4444; }
.alert-warning { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border: 1px solid #f59e0b; }

/* Active Menu */
#sidebar nav li.active a { background: rgba(255,102,0,0.1); color: var(--text-main); border-left: 3px solid var(--orange); }
.text-orange { color: var(--orange); }
.text-danger { color: #ef4444; }
.text-turquoise { color: #00ced1; }
.text-dim { color: #9ca3af; font-size: 0.85rem; }
.settings-info-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-left: 0.35rem;
    border-radius: 999px;
    background: rgba(3, 195, 236, 0.14);
    border: 1px solid rgba(3, 195, 236, 0.38);
    color: #03c3ec;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
    position: relative;
    color: #03c3ec;
}
.settings-info-badge::after {
    content: attr(data-help);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    width: min(420px, 72vw);
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: pre-line;
    box-shadow: 0 14px 35px rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.24);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 40;
}
.settings-info-badge:hover::after,
.settings-info-badge:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}
.crm-list-controls-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(244,247,251,0.92));
    border: 1px solid rgba(148, 163, 184, 0.28);
}
.header-row {
    background: rgba(148, 163, 184, 0.14) !important;
    color: #0f172a;
}
.customer-row {
    background: rgba(255, 255, 255, 0.88);
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}
.customer-row:hover {
    background: rgba(236, 242, 248, 0.96);
}
body.layout-dark .crm-list-controls-panel,
body.dark .crm-list-controls-panel {
    background: linear-gradient(180deg, rgba(15,23,42,0.94), rgba(2,6,23,0.9));
    border-color: rgba(71, 85, 105, 0.44);
}
body.layout-dark .header-row,
body.dark .header-row {
    background: rgba(30, 41, 59, 0.9) !important;
    color: #e5eef8;
}
body.layout-dark .customer-row,
body.dark .customer-row {
    background: rgba(15, 23, 42, 0.9);
    border-top-color: rgba(71, 85, 105, 0.34);
}
body.layout-dark .customer-row:hover,
body.dark .customer-row:hover {
    background: rgba(30, 41, 59, 0.96);
}
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.settings-general-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}
.planner-provider-block {
    grid-column: 1 / -1;
}
.planner-provider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.planner-provider-actions {
    display: flex;
    gap: 8px;
}
.planner-provider-add {
    background: rgba(16, 185, 129, 0.18);
    color: #dffaf0;
    border: 1px solid rgba(16, 185, 129, 0.55);
}
.planner-provider-remove {
    background: rgba(239, 68, 68, 0.16);
    color: #ffe1e1;
    border: 1px solid rgba(239, 68, 68, 0.55);
}
.planner-provider-add:hover,
.planner-provider-remove:hover {
    transform: translateY(-1px);
}
.task-bulk-stop-btn {
    margin-left: auto;
}
.permission-panels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 22px 0;
}
.permission-card,
.user-card {
    background: rgba(11, 14, 20, 0.72);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 18px;
}
.permission-card-title {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--turquoise);
    margin-bottom: 12px;
    font-weight: 700;
}
.permission-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    color: #d7deea;
    line-height: 1.45;
}
.permission-option input {
    margin-top: 2px;
}
.users-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.user-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.permission-overrides summary {
    cursor: pointer;
    color: #cbd5e1;
    font-weight: 600;
}
.resolved-permissions {
    margin: 18px 0;
    color: #9ca3af;
    line-height: 1.6;
}

@media (max-width: 900px) {
    #sidebar {
        z-index: 1004;
    }

    #sidebar.closed {
        transform: translateX(calc(-100% + 58px));
    }

    #content {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-handle {
        right: -46px;
        top: 14px;
    }

    .agent-sidebar {
        width: min(92vw, 420px);
        z-index: 1004;
    }

    .agent-sidebar.closed {
        transform: translateX(calc(100% - 58px));
    }

    .drawer-handle {
        display: none;
    }

    #app.sidebar-open-mobile #sidebar,
    #app.agent-open-mobile .agent-sidebar {
        transform: translateX(0);
    }

    .main-header {
        padding: 18px 20px 18px 28px;
    }

    #mainContentArea {
        padding: 22px 16px 30px;
    }

    .lightbox {
        padding: 10px;
    }

    .lightbox-content {
        width: 100%;
        max-width: none;
        max-height: 94vh;
        border-radius: 18px;
    }

    .modal-header {
        padding: 18px;
        align-items: flex-start;
    }

    .modal-body {
        padding: 18px;
    }

    .modal-header > div:first-child {
        flex-wrap: wrap;
        gap: 10px;
    }

    .detail-grid,
    .enhanced-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-wide,
    .dashboard-panels,
    .micro-metrics {
        grid-template-columns: 1fr;
    }

    .detail-section-full .enhanced-grid {
        grid-template-columns: 1fr;
    }

    .permissions-grid,
    .permission-panels {
        grid-template-columns: 1fr;
    }

    .user-card-header {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    .modal-badges {
        justify-content: flex-start;
    }
}

/* Arayüz 2.0: daha sıkı, daha okunaklı ve kırılmaya dayanıklı yerleşim */
body,
html {
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(0, 206, 209, 0.10), transparent 24%),
        radial-gradient(circle at top right, rgba(255, 102, 0, 0.12), transparent 30%),
        var(--main-bg);
}

.page-shell,
.dashboard-shell {
    display: grid;
    gap: 18px;
}

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 24px 26px;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
        rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 18px 48px rgba(0,0,0,0.22);
}

.page-eyebrow {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--turquoise);
    margin-bottom: 10px;
    font-weight: 700;
}

.page-description {
    max-width: 760px;
    color: #9fb0c5;
    line-height: 1.7;
    font-size: 0.96rem;
}

.page-hero-actions,
.hero-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-chip {
    min-width: 160px;
    max-width: 280px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(11, 14, 20, 0.62);
    border: 1px solid rgba(255,255,255,0.08);
}

.hero-chip span {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #90a3bc;
    margin-bottom: 6px;
}

.hero-chip strong {
    display: block;
    color: #f4f7fb;
    font-size: 0.9rem;
    line-height: 1.5;
}

.admin-surface {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
        rgba(17, 24, 39, 0.88);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.2);
}

.surface-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.surface-head-inline {
    margin-bottom: 20px;
}

.surface-head h3 {
    font-size: 1.14rem;
    color: #fff;
    margin-bottom: 6px;
}

.surface-head p {
    color: #9fb0c5;
    line-height: 1.6;
}

.settings-cluster-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-cluster {
    padding: 18px;
    border-radius: 20px;
    background: rgba(8, 12, 18, 0.54);
    border: 1px solid rgba(255,255,255,0.07);
    min-width: 0;
}

.cluster-span-2 {
    grid-column: 1 / -1;
}

.cluster-head {
    margin-bottom: 16px;
}

.cluster-head h3 {
    color: #f8fafc;
    font-size: 1.04rem;
    margin-bottom: 6px;
}

.cluster-head p,
.provider-note {
    color: #97a9c2;
    line-height: 1.62;
    font-size: 0.9rem;
}

.settings-fields {
    display: grid;
    gap: 14px 16px;
}

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

.settings-fields.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-field {
    margin-bottom: 0 !important;
    padding: 14px 14px 12px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255,255,255,0.06);
    min-width: 0;
}

.compact-field label {
    margin-bottom: 8px;
}

.field-span-2 {
    grid-column: span 2;
}

.field-span-3 {
    grid-column: span 3;
}

.provider-stack {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.provider-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(11, 14, 20, 0.7);
    border: 1px solid rgba(255,255,255,0.08);
}

.memory-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
}

.memory-table {
    display: grid;
    gap: 8px;
}

.memory-row {
    display: grid;
    grid-template-columns: 70px 1.4fr 1.5fr 110px 70px 170px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(11, 14, 20, 0.52);
    border: 1px solid rgba(255,255,255,0.06);
}

.memory-head {
    background: rgba(255,255,255,0.04);
    color: #9fb0c5;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.memory-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 102, 0, 0.14);
    border: 1px solid rgba(255, 102, 0, 0.28);
    color: #ffd6bf;
    font-size: 0.76rem;
    white-space: nowrap;
}

.memory-badge.kind-new {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.24);
    color: #b7f7dc;
}

.memory-badge.kind-update {
    background: rgba(0, 206, 209, 0.12);
    border-color: rgba(0, 206, 209, 0.24);
    color: #bff6f7;
}

.memory-badge.kind-duplicate {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.24);
    color: #d9e3f0;
}

.memory-stack {
    display: grid;
    gap: 12px;
}

.memory-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(11, 14, 20, 0.56);
    border: 1px solid rgba(255,255,255,0.06);
}

.memory-card-head,
.memory-event-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.memory-summary {
    margin: 12px 0;
    color: #d9e3f0;
    line-height: 1.7;
}

.memory-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #9fb0c5;
    font-size: 0.84rem;
}

.memory-timeline {
    display: grid;
    gap: 14px;
}

.memory-event {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 14px;
    align-items: flex-start;
}

.memory-event-dot {
    width: 12px;
    height: 12px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 0 6px rgba(255, 102, 0, 0.14);
}

.memory-event-body {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(11, 14, 20, 0.52);
    border: 1px solid rgba(255,255,255,0.06);
}

.memory-link-row,
.memory-link-card,
.memory-mini-link {
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.memory-link-row:hover,
.memory-link-card:hover,
.memory-mini-link:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 102, 0, 0.24);
    background: rgba(255, 102, 0, 0.06);
}

.memory-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.memory-detail-grid-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.memory-detail-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(11, 14, 20, 0.54);
    border: 1px solid rgba(255,255,255,0.06);
}

.memory-detail-card h4 {
    margin-bottom: 12px;
    color: #f8fafc;
}

.memory-kv {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.memory-kv:last-child {
    border-bottom: none;
}

.memory-kv span {
    color: #9fb0c5;
}

.memory-kv strong {
    color: #f4f7fb;
    text-align: right;
}

.memory-mini-list {
    display: grid;
    gap: 10px;
}

.memory-mini-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255,255,255,0.06);
}

.memory-mini-item strong {
    color: #f4f7fb;
}

.memory-mini-item span {
    color: #9fb0c5;
    text-align: right;
    font-size: 0.85rem;
}

.memory-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.memory-action-form {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255,255,255,0.06);
}

.memory-action-form textarea {
    width: 100%;
    min-height: 74px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(11, 14, 20, 0.72);
    color: #f8fafc;
    resize: vertical;
    font: inherit;
}

.memory-action-form textarea::placeholder {
    color: #7f8ea3;
}

.memory-action-form button,
.memory-action-form .btn-danger {
    width: 100%;
    text-align: center;
}

.memory-action-form-danger {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(127, 29, 29, 0.18);
}

.provider-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.provider-order {
    color: var(--turquoise);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.76rem;
    margin-bottom: 4px;
}

.sticky-form-actions {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

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

.user-surface {
    padding: 22px;
}

.diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.diagnostic-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(11, 14, 20, 0.72);
    border: 1px solid rgba(255,255,255,0.08);
}

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

.diagnostic-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.diagnostic-ok {
    color: #c9fff4;
    background: rgba(16, 185, 129, 0.16);
}

.diagnostic-warning {
    color: #ffe3ad;
    background: rgba(245, 158, 11, 0.16);
}

.diagnostic-error {
    color: #ffd7d7;
    background: rgba(239, 68, 68, 0.16);
}

.profile-surface {
    max-width: 720px;
}

.monitor-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.monitor-head h2 {
    margin-bottom: 6px;
}

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

.dashboard-grid-refined .stat-card {
    min-height: 100%;
}

.ops-hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
}

.ops-command-list,
.ops-lane-grid,
.ops-signal-grid,
.ops-memory-grid {
    display: grid;
    gap: 16px;
}

.ops-command-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-lane-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
}

.ops-signal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ops-memory-grid {
    grid-template-columns: 1.2fr 1fr;
}

.ops-kpi {
    display: grid;
    gap: 6px;
}

.ops-kpi strong {
    font-size: 2rem;
    line-height: 1;
}

.ops-kpi span,
.ops-line,
.ops-stack p {
    color: #9ca3af;
}

.ops-stack {
    display: grid;
    gap: 12px;
}

.ops-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.ops-line:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.ops-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #e5e7eb;
    font-size: 0.82rem;
}

.ops-mini-list {
    display: grid;
    gap: 10px;
}

.ops-mini-item {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.ops-mini-item strong,
.ops-line strong {
    color: #f8fafc;
}

.ops-mini-item small {
    display: block;
    margin-top: 6px;
    color: #94a3b8;
}

.task-monitor {
    border-radius: 20px;
    background: rgba(17, 24, 39, 0.88);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 16px 38px rgba(0,0,0,0.18);
}

.task-item {
    gap: 16px;
}

.task-item strong,
.compact-list-item strong {
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .settings-cluster-grid,
    .compact-permission-panels,
    .diagnostic-grid,
    .settings-fields.cols-3,
    .dashboard-grid-refined,
    .ops-command-list,
    .ops-lane-grid,
    .ops-signal-grid,
    .ops-memory-grid,
    .ops-hero-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .settings-cluster-grid,
    .compact-permission-panels,
    .diagnostic-grid,
    .memory-action-grid,
    .settings-fields.cols-2,
    .settings-fields.cols-3,
    .dashboard-grid-refined,
    .ops-command-list,
    .ops-lane-grid,
    .ops-signal-grid,
    .ops-memory-grid,
    .ops-hero-grid {
        grid-template-columns: 1fr;
    }

    .cluster-span-2,
    .field-span-2,
    .field-span-3 {
        grid-column: auto;
    }

    .page-hero,
    .surface-head,
    .provider-card-head,
    .monitor-head {
        flex-direction: column;
    }
}
