/* Faz 9b: Toplantılar penceresi, yükümlülük detayındaki "Toplantılar" bölümü ve PDF tutanak (yazdırma) görünümü. */

.mtg-overlay {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}
.mtg-overlay.active { display: flex; }
body.test-mode .mtg-overlay { top: 30px; }

.mtg-box {
    width: 1180px;
    max-width: 96vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-shell);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    font-size: 13px;
}
.mtg-box.mtg-busy { cursor: progress; }
.mtg-box.mtg-busy .mtg-body { opacity: 0.7; pointer-events: none; }

.mtg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
}
.mtg-header-left, .mtg-header-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mtg-header-icon { font-size: 18px; }
.mtg-title { font-size: 16px; font-weight: 700; }
.mtg-project-pick { display: flex; align-items: center; gap: 6px; margin-left: 10px; color: var(--text-secondary); font-size: 12px; }
.mtg-project-pick select { max-width: 260px; }
.mtg-lang-btn { font-size: 12px; }

.mtg-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mtg-box select, .mtg-box input, .mtg-box textarea {
    font: inherit;
    font-size: 12.5px;
    color: var(--text-primary);
    background: var(--bg-shell);
    border: 1px solid var(--border-light);
    border-radius: 7px;
    padding: 5px 8px;
    min-height: 30px;
}
.mtg-box textarea { resize: vertical; width: 100%; }
.mtg-box input:focus, .mtg-box select:focus, .mtg-box textarea:focus { outline: 2px solid var(--accent-purple-light); border-color: var(--accent-purple); }

.mtg-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.mtg-columns { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.mtg-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mtg-section {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mtg-h { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.mtg-h-btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.mtg-count { font-weight: 600; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.mtg-muted { color: var(--text-muted); font-size: 11.5px; }
.mtg-hint { margin-top: -4px; }
.mtg-empty { color: var(--text-muted); font-size: 12px; padding: 6px 0; }
.mtg-note {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--accent-purple-light);
    border-radius: 8px;
    padding: 7px 10px;
}
.mtg-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.mtg-pending {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
}
.mtg-pending-err { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.mtg-small { font-size: 11.5px; padding: 3px 9px; align-self: flex-start; }
.mtg-danger { color: #dc2626; }

/* Liste satırları */
.mtg-row, .mtg-ob-row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: var(--bg-shell);
    border: 1px solid var(--border-light);
    border-radius: 9px;
    padding: 8px 10px;
    cursor: pointer;
    font: inherit;
    color: var(--text-primary);
}
.mtg-row:hover, .mtg-ob-row:hover { border-color: var(--accent-purple); box-shadow: var(--shadow-card); }
.mtg-row-deleted { opacity: 0.55; text-decoration: line-through; }
.mtg-row-date { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.mtg-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtg-row-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.mtg-status { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.mtg-st-draft { background: #f1f5f9; color: #475569; }
.mtg-st-open { background: #dbeafe; color: #1d4ed8; }
.mtg-st-in_progress { background: #fef3c7; color: #b45309; }
.mtg-st-closed { background: #dcfce7; color: #15803d; }
.mtg-st-deleted { background: #fee2e2; color: #b91c1c; }

.mtg-series, .mtg-backlog-item {
    background: var(--bg-shell);
    border: 1px solid var(--border-light);
    border-radius: 9px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mtg-bl-title { font-weight: 600; }
.mtg-bl-actions { display: flex; gap: 6px; align-items: center; }
.mtg-bl-actions select { flex: 1; min-width: 0; }

/* Formlar */
.mtg-form { display: flex; flex-direction: column; gap: 10px; background: var(--bg-shell); border: 1px dashed var(--border-light); border-radius: 10px; padding: 10px 12px; }
.mtg-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.mtg-field { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--text-secondary); min-width: 0; }
.mtg-field > input, .mtg-field > select, .mtg-field > textarea { width: 100%; }
.mtg-span2 { grid-column: 1 / -1; }
.mtg-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mtg-inline-form { flex-direction: row; align-items: center; padding: 6px; border-style: solid; }
.mtg-inline-form input, .mtg-inline-form select { flex: 1; min-width: 0; }
.mtg-ref-picker { display: flex; gap: 6px; }
.mtg-ref-picker > select { flex: 0 0 auto; }
.mtg-ref-value { flex: 1; display: flex; min-width: 0; }
.mtg-ref-value > * { flex: 1; min-width: 0; }

/* Toplantı sayfası */
.mtg-page { display: flex; flex-direction: column; gap: 12px; }
.mtg-page-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mtg-page-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mtg-meeting-head { display: flex; flex-direction: column; gap: 6px; }
.mtg-meeting-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mtg-meeting-title { font-size: 20px; font-weight: 800; }
.mtg-meeting-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--text-secondary); font-size: 12.5px; }
.mtg-meeting-meta a { color: var(--accent-blue); word-break: break-all; }
.mtg-notes, .mtg-item-notes { white-space: pre-wrap; color: var(--text-secondary); font-size: 12.5px; line-height: 1.5; }
.mtg-status-bar { display: flex; gap: 8px; flex-wrap: wrap; }

.mtg-agenda-section { display: flex; flex-direction: column; gap: 6px; }
.mtg-agenda-section + .mtg-agenda-section { margin-top: 6px; }
.mtg-agenda-section-title { font-weight: 700; font-size: 12.5px; color: var(--accent-purple); border-bottom: 1px solid var(--border-light); padding-bottom: 3px; }
.mtg-item {
    background: var(--bg-shell);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.mtg-item-moved { opacity: 0.7; border-style: dashed; }
.mtg-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mtg-item-num { color: var(--text-muted); font-weight: 700; }
.mtg-item-title { font-weight: 700; }
.mtg-item-meta { color: var(--text-muted); font-size: 11.5px; }
.mtg-item-tools { margin-left: auto; display: flex; align-items: center; gap: 3px; }
.mtg-move { max-width: 190px; font-size: 11.5px !important; min-height: 26px !important; padding: 2px 6px !important; }
.mtg-icon-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    min-width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
}
.mtg-icon-btn:hover:not(:disabled) { background: var(--sidebar-item-hover); border-color: var(--border-light); }
.mtg-icon-btn:disabled { opacity: 0.3; cursor: default; }
.mtg-trail { font-size: 11.5px; color: #0369a1; }
.mtg-trail-moved { color: #b45309; font-weight: 600; }
.mtg-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--sidebar-bg);
    color: var(--text-primary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
button.mtg-chip { cursor: pointer; }
button.mtg-chip:hover { border-color: var(--accent-purple); color: var(--accent-purple); }
.mtg-chip-obligation { border-color: rgba(59, 130, 246, 0.35); }
.mtg-chip-subtask { border-color: rgba(16, 185, 129, 0.35); }
.mtg-chip-kb { border-color: rgba(124, 58, 237, 0.35); }

.mtg-outcomes { border-top: 1px dashed var(--border-light); padding-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.mtg-outcomes-title { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.mtg-outcomes ul { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.mtg-outcomes li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.mtg-outcomes li::before { content: '•'; color: var(--accent-emerald); font-weight: 800; }
.mtg-outcome-links { display: flex; gap: 6px; flex-wrap: wrap; }
.mtg-link-btn { font: inherit; font-size: 11.5px; border: none; background: none; color: var(--accent-blue); cursor: pointer; padding: 2px 4px; }
.mtg-link-btn:hover { text-decoration: underline; }
.mtg-add-item { align-self: flex-start; }

.mtg-people { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.mtg-people li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--bg-shell); border: 1px solid var(--border-light); border-radius: 8px; padding: 4px 8px; }
.mtg-person-name { font-weight: 600; }
.mtg-people li .mtg-icon-btn { margin-left: auto; }
.mtg-person-form { flex-direction: column; align-items: stretch; border-style: solid; }
.mtg-person-form button { align-self: flex-end; }

/* Yükümlülük detayındaki bölüm ve Proje Kimlik Kartı */
.mtg-ob-section, .mtg-card-section { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.mtg-ob-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.mtg-ob-row { grid-template-columns: auto minmax(0, 1fr) auto auto; font-size: 12px; }
.mtg-card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mtg-card-btn { font-size: 11.5px; font-weight: 600; background: var(--accent-purple-light); color: var(--accent-purple); white-space: nowrap; }

@media (max-width: 900px) {
    .mtg-columns { grid-template-columns: 1fr; }
    .mtg-row { grid-template-columns: 1fr auto; }
    .mtg-row-meta { display: none; }
}

/* ---------- PDF tutanak: yalnızca yazdırırken görünür ---------- */
#mtg-print { display: none; }
@media print {
    @page { size: A4; margin: 16mm 14mm; }
    body.mtg-printing { height: auto !important; overflow: visible !important; padding: 0 !important; background: #fff !important; color: #000 !important; }
    body.mtg-printing > *:not(#mtg-print) { display: none !important; }
    body.mtg-printing #mtg-print { display: block !important; }
}
.mtgp { font-family: 'Inter', 'Segoe UI', Arial, 'Helvetica Neue', sans-serif; color: #0f172a; font-size: 10.5pt; line-height: 1.45; }
.mtgp-kicker { font-size: 8.5pt; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #64748b; }
.mtgp h1 { font-size: 17pt; margin: 2pt 0 2pt; }
.mtgp h2 { font-size: 12pt; margin: 14pt 0 6pt; border-bottom: 1px solid #cbd5e1; padding-bottom: 2pt; }
.mtgp h3 { font-size: 10.5pt; margin: 10pt 0 4pt; color: #6d28d9; }
.mtgp-project { color: #475569; margin-bottom: 8pt; }
.mtgp table { border-collapse: collapse; width: 100%; }
.mtgp-meta th { text-align: left; width: 28%; color: #475569; font-weight: 600; padding: 2pt 6pt 2pt 0; vertical-align: top; }
.mtgp-meta td { padding: 2pt 0; }
.mtgp-actions td { border-bottom: 1px solid #e2e8f0; padding: 3pt 6pt 3pt 0; vertical-align: top; }
.mtgp-item { margin: 0 0 7pt; break-inside: avoid; }
.mtgp-item-title { font-weight: 700; }
.mtgp-muted { color: #64748b; font-size: 9.5pt; }
.mtgp-text { white-space: pre-wrap; }
.mtgp-outcomes { margin: 3pt 0 0 14pt; }
.mtgp-footer { margin-top: 18pt; font-size: 8.5pt; color: #94a3b8; border-top: 1px solid #e2e8f0; padding-top: 4pt; }
