:root {
    --bg-dark: #0d1117;
    --bg-panel: #161b22;
    --bg-header: #1c2128;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #2f81f7;
    --success: #3fb950;
    --danger: #f85149;
    --warning: #d29922;
    --side-width: 280px;
}

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

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    height: 100vh;
    overflow: hidden;
}

/* ── Topbar ── */
.topbar {
    height: 50px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
}
.topbar-brand { display: flex; align-items: center; gap: 8px; min-width: 240px; }
.brand-icon { font-size: 20px; }
.brand-name { font-weight: 600; font-size: 15px; }
.topbar-center { flex: 1; text-align: center; }
.session-timer { font-family: 'Courier New', monospace; font-size: 18px; color: var(--accent); letter-spacing: 3px; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 130px; justify-content: flex-end; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-idle { background: var(--text-secondary); }
.status-recording { background: var(--danger); animation: pulse 0.8s ease-in-out infinite; }
.status-processing { background: var(--warning); animation: pulse 0.4s ease-in-out infinite; }
.status-ready { background: var(--success); }
.status-text { font-size: 12px; color: var(--text-secondary); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ── Layout ── */
main { padding-top: 50px; height: 100vh; }

#app {
    display: grid;
    grid-template-columns: var(--side-width) 1fr var(--side-width);
    height: calc(100vh - 50px);
}

/* ── Panels ── */
.panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
}
.panel:last-child { border-right: none; border-left: 1px solid var(--border); }

.panel-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.panel-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.btn-icon:hover { color: var(--text-primary); background: var(--border); }

/* ── Left Panel ── */
.panel-left { background: var(--bg-panel); }
.command-log { flex: 1; overflow-y: auto; padding: 8px; }

.log-entry {
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    border-left: 3px solid var(--border);
    background: var(--bg-dark);
}
.log-entry.ui-action { border-left-color: var(--accent); }
.log-entry.symptom-log { border-left-color: var(--success); }
.log-entry.unknown { border-left-color: var(--text-secondary); }
.log-time { font-size: 11px; color: var(--text-secondary); margin-bottom: 3px; }
.log-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 600;
}
.badge-ui { background: rgba(47,129,247,0.2); color: var(--accent); }
.badge-symptom { background: rgba(63,185,80,0.2); color: var(--success); }
.badge-sim { background: rgba(210,153,34,0.2); color: var(--warning); }
.log-text { color: var(--text-primary); font-size: 13px; line-height: 1.4; word-break: break-word; }
.log-detail { font-size: 11px; color: var(--text-secondary); margin-top: 3px; font-style: italic; }
.log-entry.simulation { border-left-color: var(--warning); opacity: 0.85; }

/* ── Center Panel ── */
.panel-center { background: var(--bg-dark); }
.panel-center-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mic-section { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.mic-btn {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 2px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.mic-btn svg { width: 38px; height: 38px; pointer-events: none; }
.mic-btn:hover { border-color: var(--accent); color: var(--accent); }
.mic-btn.recording {
    background: rgba(248,81,73,0.12);
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 0 10px rgba(248,81,73,0.08), 0 0 0 20px rgba(248,81,73,0.04);
}
.mic-status { font-size: 13px; color: var(--text-secondary); text-align: center; }

.transcript-box {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}
.transcript-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.transcript-text { color: var(--text-primary); font-size: 14px; line-height: 1.5; }

.approval-panel {
    background: rgba(210,153,34,0.08);
    border: 1px solid var(--warning);
    border-radius: 8px;
    padding: 16px;
}
.approval-title { color: var(--warning); font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.approval-desc { color: var(--text-primary); font-size: 13px; margin-bottom: 14px; line-height: 1.4; }
.approval-actions { display: flex; gap: 10px; }
.btn-approve { background: var(--success); color: #fff; border: none; padding: 8px 22px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; transition: opacity 0.15s; }
.btn-reject { background: var(--danger); color: #fff; border: none; padding: 8px 22px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; transition: opacity 0.15s; }
.btn-approve:hover, .btn-reject:hover { opacity: 0.82; }

.voice-profiles-box {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.voice-profiles-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
}
.voice-profiles-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.enroll-row {
    display: flex;
    gap: 6px;
}
.enroll-input {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.enroll-input:focus { border-color: var(--accent); }
.enroll-input::placeholder { color: var(--text-secondary); }
.btn-enroll {
    background: rgba(47,129,247,0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: background 0.15s;
}
.btn-enroll:hover { background: rgba(47,129,247,0.2); }
.btn-enroll:disabled { opacity: 0.4; cursor: not-allowed; }
.enroll-status { font-size: 11px; color: var(--text-secondary); }

.profile-list { display: flex; flex-direction: column; gap: 4px; }
.profile-empty { font-size: 11px; color: var(--text-secondary); text-align: center; padding: 4px 0; font-style: italic; }
.profile-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 6px 10px;
}
.profile-name { flex: 1; font-size: 13px; color: var(--text-primary); font-weight: 500; }
.profile-date { font-size: 10px; color: var(--text-secondary); }
.profile-delete {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}
.profile-delete:hover { color: var(--danger); }

.voice-badge {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    transition: opacity 0.3s;
}
.badge-match { background: rgba(63,185,80,0.15); color: var(--success); border: 1px solid var(--success); }
.badge-nomatch { background: rgba(248,81,73,0.15); color: var(--danger); border: 1px solid var(--danger); }

.hizir-section { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 4px; }
.btn-secondary {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.scan-status { font-size: 12px; color: var(--text-secondary); }

/* ── Right Panel ── */
.panel-right { background: var(--bg-panel); }
.ai-panel { flex: 1; overflow-y: auto; padding: 12px; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 20px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
}
.empty-icon { font-size: 36px; opacity: 0.4; }

.suggestion-content { display: flex; flex-direction: column; gap: 10px; }

.suggestion-alert {
    background: rgba(248,81,73,0.12);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 12px;
    color: var(--danger);
    font-weight: 700;
    font-size: 14px;
}

.suggestion-section {
    background: var(--bg-header);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}
.suggestion-section-title {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
}
.suggestion-item {
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.4;
}
.suggestion-item:last-child { border-bottom: none; }

.confidence-bar { height: 6px; background: var(--border); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.confidence-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.6s ease; }

.suggestion-sevk {
    background: rgba(47,129,247,0.08) !important;
    border-color: var(--accent) !important;
}

/* ── Utils ── */
.hidden { display: none !important; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Mobile Tab Bar ── */
.mobile-tabs {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 54px;
    background: var(--bg-header);
    border-top: 1px solid var(--border);
    z-index: 100;
}
.mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: color 0.15s;
    padding: 6px 0;
    -webkit-tap-highlight-color: transparent;
}
.mobile-tab.active { color: var(--accent); }
.mobile-tab-icon { font-size: 20px; line-height: 1; }

/* ── Responsive: Tablet (768-1023px) ── */
@media (max-width: 1023px) and (min-width: 768px) {
    :root { --side-width: 220px; }
    .brand-name { font-size: 13px; }
    .session-timer { font-size: 15px; letter-spacing: 1px; }
}

/* ── Responsive: Mobile (<768px) ── */
@media (max-width: 767px) {
    body { overflow: auto; }

    .topbar { padding: 0 10px; gap: 6px; }
    .topbar-brand { min-width: unset; gap: 6px; }
    .brand-name { font-size: 13px; }
    .brand-icon { font-size: 17px; }
    .session-timer { font-size: 14px; letter-spacing: 1px; }
    .topbar-right { min-width: unset; }
    .status-text { display: none; }

    main { padding-top: 50px; }

    #app {
        display: block;
        height: calc(100dvh - 50px - 54px);
    }

    .panel {
        display: none !important;
        height: calc(100dvh - 50px - 54px);
        border-right: none !important;
        border-left: none !important;
        overflow: hidden;
    }
    .panel.mobile-active { display: flex !important; }

    .mobile-tabs { display: flex; }

    /* Mikrofon butonu daha büyük - dokunma dostu */
    .mic-btn { width: 96px; height: 96px; }
    .mic-btn svg { width: 44px; height: 44px; }

    /* Onay butonları tam genişlik */
    .approval-actions { flex-direction: column; }
    .btn-approve, .btn-reject { width: 100%; padding: 12px; font-size: 14px; }

    /* Kayıt satırı dikey */
    .enroll-row { flex-direction: column; }
    .btn-enroll { width: 100%; padding: 10px; }

    .panel-center-body { padding: 16px 14px; gap: 14px; }
}
