/* ============================================================
   PLACEHOLDER PAGES
   ============================================================ */
.placeholder {
    display: grid; place-items: center;
    min-height: 60vh; text-align: center;
}
.placeholder .ic {
    width: 88px; height: 88px; border-radius: 24px;
    background: var(--accent-soft); color: var(--accent-bright);
    display: grid; place-items: center; margin: 0 auto 24px;
}
.placeholder .ic svg { width: 40px; height: 40px; }
.placeholder h2 { font-family: var(--font-display); font-size: 24px; margin-bottom: 10px; }
.placeholder p { color: var(--text-secondary); max-width: 380px; }

/* ---------- Animation ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise .5s ease both; }
.rise-1 { animation-delay: .05s; }
.rise-2 { animation-delay: .12s; }
.rise-3 { animation-delay: .19s; }
.rise-4 { animation-delay: .26s; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .qa-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -280px; z-index: 100; transition: left .25s ease; }
    .sidebar.open { left: 0; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    /* Üst bar taşmasını önle: dolguyu küçült, aramayı daralt, ikincil ikonları gizle */
    .topbar { padding: 0 16px; gap: 12px; }
    .search-bar { min-width: 0; }
    .search-bar input { min-width: 0; width: 100%; }
    .topbar-actions { gap: 6px; }
    .topbar-actions > .icon-btn { display: none; }
    /* Sekme şeridi sayfayı taşırmasın — kendi içinde yatay kaydırılsın */
    .tabs { overflow-x: auto; flex-wrap: nowrap; }
    .tabs::-webkit-scrollbar { height: 0; }
    .tab { white-space: nowrap; flex-shrink: 0; }
}

/* Mobil menü arka örtüsü */
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
.sidebar-backdrop.show { opacity: 1; visibility: visible; }
@media (min-width: 861px) { .sidebar-backdrop { display: none; } }
@media (max-width: 560px) {
    .stat-grid, .qa-grid { grid-template-columns: repeat(2, 1fr); }
    .content { padding: 20px; }
}

/* ============================================================
   WORKSPACES / TABLES — entegrasyon bileşenleri
   ============================================================ */

/* Flash mesajları */
.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; margin-bottom: 22px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    animation: rise .35s ease both;
}
.flash svg { width: 18px; height: 18px; flex-shrink: 0; }
.flash span { flex: 1; }
.flash-ok  { background: var(--accent-soft); border: 1px solid var(--accent-dim); color: var(--accent-bright); }
.flash-err { background: rgba(240, 85, 109, 0.12); border: 1px solid rgba(240, 85, 109, 0.4); color: var(--danger); }
.flash-x { color: inherit; opacity: .6; }
.flash-x:hover { opacity: 1; }
.flash-x svg { width: 16px; height: 16px; }

/* Başlık satırı + inline buton */
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.btn-inline { width: auto; padding: 11px 18px; font-size: 14px; }
.page-title svg { width: 28px; height: 28px; vertical-align: -5px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; font-weight: 600; margin-bottom: 14px; }
/* Dil seçici (TR / EN / DE) */
.lang-picker { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated, transparent); color: var(--text-muted); }
.lang-picker svg { width: 15px; height: 15px; flex: none; }
.lang-picker select { appearance: none; -webkit-appearance: none; border: none; background: transparent; color: var(--text-primary); font: inherit; font-size: 12.5px; font-weight: 700; padding: 0 2px; cursor: pointer; max-width: 120px; }
.lang-picker select:focus { outline: none; }
.lang-picker:focus-within { border-color: var(--accent); }
.lang-picker.lang-fab { position: fixed; top: 16px; right: 64px; z-index: 50; }
@media (max-width: 640px) { .lang-picker select { max-width: 44px; } }

/* Kurumsal kip başlık yolu: Kurumsal Yönetim › Çalışma alanı › Sayfa */
.ent-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 14px; }
.ent-crumb a { color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; }
.ent-crumb a:hover { color: var(--accent); }
.ent-crumb svg { width: 15px; height: 15px; color: var(--accent); }
.ent-crumb-sep { opacity: .6; }
.ent-crumb-cur { color: var(--text-primary); }
.sheet-head .ent-crumb { margin-bottom: 0; }
.back-link:hover { color: var(--accent); }
.back-link svg { width: 16px; height: 16px; }

/* Sekmeler */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.tab {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 16px; color: var(--text-secondary);
    font-size: 14px; font-weight: 600;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent-bright); border-bottom-color: var(--accent); }
.tab-count { font-size: 12px; color: var(--text-muted); background: var(--bg-surface); padding: 1px 8px; border-radius: 20px; }
.tab.active .tab-count { color: var(--accent); background: var(--accent-soft); }
.tab-badge { font-size: 11px; font-weight: 700; color: #07221b; background: var(--warning); padding: 1px 7px; border-radius: 20px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Workspace kart eklentileri */
.ws-card .ws-link { display: block; }
.ws-menu { display: flex; gap: 4px; }
.ws-card.archived { opacity: .85; }
.icon-mini {
    width: 30px; height: 30px; border-radius: 8px;
    display: inline-grid; place-items: center;
    color: var(--text-muted); border: 1px solid transparent;
}
.icon-mini:hover { color: var(--accent-bright); background: var(--bg-surface-2); }
.icon-mini.danger:hover { color: var(--danger); }
.icon-mini svg { width: 16px; height: 16px; }

.pill { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--text-muted); background: var(--bg-surface-2); padding: 3px 10px; border-radius: 20px; }
.pill-warn { color: #07221b; background: var(--warning); }

.card-actions { display: flex; gap: 8px; margin-top: 14px; }
.btn-sm {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 9px 12px; border-radius: 9px;
    font-size: 13px; font-weight: 600; transition: all .15s ease;
}
.btn-sm svg { width: 15px; height: 15px; }
.btn-sm-ok { background: var(--accent-soft); color: var(--accent-bright); border: 1px solid var(--accent-dim); }
.btn-sm-ok:hover { background: var(--accent-dim); color: #07221b; }
.btn-sm-ghost { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border-strong); }
.btn-sm-ghost:hover { color: var(--text-primary); border-color: var(--text-muted); }
.btn-sm-ghost.danger:hover { color: var(--danger); border-color: var(--danger); }

/* Detay düzeni */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.ws-head { display: flex; align-items: center; gap: 14px; }
.ws-folder.lg { width: 56px; height: 56px; border-radius: 14px; }
.ws-folder.lg svg { width: 28px; height: 28px; }
.ws-folder.sm { width: 38px; height: 38px; border-radius: 9px; }
.ws-folder.sm svg { width: 18px; height: 18px; }
.ws-desc { color: var(--text-secondary); margin-top: 14px; max-width: 700px; font-size: 14px; }
.grid-hint { color: var(--text-muted); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.grid-hint svg { width: 16px; height: 16px; }
.grid-hint code { background: var(--bg-surface); padding: 2px 7px; border-radius: 6px; color: var(--accent-bright); font-size: 12px; }

/* Tablo listesi */
.table-list { display: flex; flex-direction: column; gap: 8px; }
.table-row {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px; transition: all .15s ease;
}
.table-row:hover { border-color: var(--accent-dim); }
.table-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.table-row .name { font-weight: 600; font-size: 14.5px; }
.table-row .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.row-actions { display: flex; gap: 4px; }
.chev { color: var(--text-muted); }

.placeholder.sm { min-height: 220px; }
.placeholder.sm .ic { width: 60px; height: 60px; }

/* Paylaşım kutusu */
.share-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.share-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.share-form input, .share-form select { padding: 11px 13px; background: var(--bg-base); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; outline: none; }
.share-form input:focus, .share-form select:focus { border-color: var(--accent); }
.muted-note { color: var(--text-muted); font-size: 13px; text-align: center; padding: 10px 0; }
.share-hint { text-align: left; padding: 0 0 14px; margin-top: -8px; font-size: 12.5px; line-height: 1.5; }
.field-hint { display: block; margin-top: 6px; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.collab-list { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.collab-row { display: flex; align-items: center; gap: 11px; }
.collab-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-bright); font-weight: 700; font-size: 14px; }
.collab-meta { flex: 1; }
.collab-meta .name { font-weight: 600; font-size: 14px; }
.collab-meta .meta { font-size: 12px; color: var(--text-muted); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(7, 14, 22, 0.66); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    width: 100%; max-width: 440px;
    background: var(--bg-elevated); border: 1px solid var(--border-strong);
    border-radius: var(--radius); padding: 22px;
    animation: rise .3s ease both;
    /* Uzun formlar viewport'u aşınca içeriden kaydır; alt buton (Kaydet) hep erişilebilir kalsın. */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 18px; }
.modal-head h3 svg { width: 20px; height: 20px; color: var(--accent); }
.modal .field { margin-bottom: 14px; }
.modal .field label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.modal .field input, .modal .field select, .modal .field textarea {
    width: 100%; padding: 11px 13px; background: var(--bg-base);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 14px; outline: none; font-family: inherit;
}
.modal .field input:focus, .modal .field select:focus, .modal .field textarea:focus { border-color: var(--accent); }
.modal .field textarea { resize: vertical; }
/* Modal select'leri de özel chevron + native ok gizleme ile input'lara uydur */
.modal .field select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    cursor: pointer; padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2361788a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.modal .field select:disabled { opacity: .55; cursor: not-allowed; color: var(--text-muted); }
.modal .field select option { background: var(--bg-surface-2); color: var(--text-primary); }
.color-input { height: 44px; padding: 4px; cursor: pointer; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.modal-foot .btn-sm { width: auto; padding: 10px 16px; }

