/* Dilekçe Robotu — memurlara özel dilekçe hazırlama aracı */
.dr-hero { position: relative; }
.dr-hero h1 { margin-bottom: .35rem; }
.dr-hero p { margin: 0; max-width: 780px; }
.dr-badges { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; }
.dr-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .7rem; border-radius: 999px; font-size: .76rem; font-weight: 700; border: 1px solid var(--theme-border, rgba(34,211,238,.35)); background: rgba(34,211,238,.08); color: var(--theme-ink, #e2e8f0); }
.dr-badge svg { width: 14px; height: 14px; color: var(--theme-accent, #22d3ee); }

.dr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1.1rem; align-items: start; margin-top: 1rem; }
.dr-form { display: grid; gap: .9rem; min-width: 0; }
.dr-card { background: var(--theme-panel, rgba(8,10,14,.88)); border: 1px solid var(--theme-border, rgba(34,211,238,.3)); border-radius: 14px; padding: 1rem 1.05rem 1.1rem; min-width: 0; }
.dr-card-head { display: flex; align-items: center; gap: .65rem; margin-bottom: .8rem; }
.dr-step { flex: 0 0 auto; display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; font-weight: 800; font-size: .82rem; background: var(--theme-accent, #22d3ee); color: #06202a; }
.dr-card-head h2 { margin: 0; font-size: 1.02rem; font-family: inherit; color: var(--theme-ink, #f1f5f9); }
.dr-card-head p { margin: .1rem 0 0; font-size: .78rem; color: var(--theme-muted, #94a3b8); }
.dr-card-head .dr-head-text { flex: 1 1 auto; min-width: 0; }
.dr-head-action { flex: 0 0 auto; }

/* Şablon seçici */
.dr-search { position: relative; margin-bottom: .7rem; }
.dr-search input { padding-left: 2.1rem !important; }
.dr-search svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--theme-muted, #94a3b8); pointer-events: none; }
.dr-groups { display: grid; gap: .7rem; max-height: 330px; overflow: auto; padding-right: .2rem; overscroll-behavior: contain; }
.dr-group-title { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--theme-muted, #94a3b8); margin: 0 0 .35rem; }
.dr-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .45rem; }
.dr-tpl { text-align: left; display: grid; gap: .15rem; padding: .55rem .65rem; border-radius: 10px; border: 1px solid rgba(148,163,184,.25); background: rgba(255,255,255,.03); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.dr-tpl strong { font-size: .84rem; line-height: 1.25; }
.dr-tpl span { font-size: .72rem; color: var(--theme-muted, #94a3b8); line-height: 1.3; }
.dr-tpl:hover { border-color: var(--theme-accent, #22d3ee); background: rgba(34,211,238,.07); }
.dr-tpl.is-active { border-color: var(--theme-accent, #22d3ee); background: rgba(34,211,238,.14); box-shadow: inset 0 0 0 1px var(--theme-accent, #22d3ee); }
.dr-empty { font-size: .82rem; color: var(--theme-muted, #94a3b8); margin: .3rem 0 0; }

/* Alanlar */
.dr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem .75rem; }
.dr-grid .dr-wide { grid-column: 1 / -1; }
.dr-field { display: grid; gap: .28rem; min-width: 0; }
.dr-field > label, .dr-label { font-size: .78rem; font-weight: 700; color: var(--theme-muted, #cbd5e1); }
.dr-field small { font-size: .72rem; color: var(--theme-muted, #94a3b8); line-height: 1.35; }
.dr-form input[type="text"], .dr-form input[type="date"], .dr-form input[type="number"], .dr-form input[type="email"], .dr-form input[type="tel"], .dr-form select, .dr-form textarea {
  width: 100%; box-sizing: border-box; padding: .55rem .65rem; border-radius: 9px; border: 1px solid rgba(148,163,184,.32); background: rgba(15,23,42,.85); color: #f1f5f9; font: inherit; font-size: .95rem; min-height: 2.5rem;
}
.dr-form textarea { min-height: 13rem; resize: vertical; line-height: 1.55; }
.dr-form textarea.dr-short { min-height: 4.5rem; }
.dr-form input:focus, .dr-form select:focus, .dr-form textarea:focus { outline: none; border-color: var(--theme-accent, #22d3ee); box-shadow: 0 0 0 2px rgba(34,211,238,.18); }
.dr-form input::placeholder, .dr-form textarea::placeholder { color: #64748b; }
.dr-hint { margin: .65rem 0 0; padding: .55rem .7rem; border-radius: 9px; font-size: .78rem; line-height: 1.45; border: 1px dashed rgba(34,211,238,.4); background: rgba(34,211,238,.06); color: var(--theme-ink, #e2e8f0); }
.dr-hint a { color: var(--theme-accent, #22d3ee); font-weight: 700; }
.dr-hint:empty { display: none; }
.dr-check { display: flex; align-items: center; gap: .5rem; font-size: .84rem; cursor: pointer; }
.dr-check input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--theme-accent, #22d3ee); }
.dr-body-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .35rem; }
.dr-body-state { font-size: .74rem; color: var(--theme-muted, #94a3b8); }
.dr-body-state.is-manual { color: #fbbf24; }

.dr-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.4rem; padding: 0 .9rem; border-radius: 10px; font: inherit; font-weight: 700; font-size: .84rem; cursor: pointer; border: 1px solid rgba(148,163,184,.35); background: transparent; color: inherit; text-decoration: none; white-space: nowrap; }
.dr-btn svg { width: 16px; height: 16px; }
.dr-btn:hover { border-color: var(--theme-accent, #22d3ee); color: var(--theme-accent, #22d3ee); }
.dr-btn--main { background: var(--theme-accent, #22d3ee); border-color: var(--theme-accent, #22d3ee); color: #06202a; }
.dr-btn--main:hover { color: #06202a; filter: brightness(1.07); }
.dr-btn--sm { min-height: 2rem; padding: 0 .65rem; font-size: .78rem; }
.dr-btn[disabled] { opacity: .6; cursor: wait; }

.dr-ekler { display: grid; gap: .45rem; }
.dr-ek-row { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; align-items: center; gap: .45rem; }
.dr-ek-row > span { font-weight: 800; font-size: .82rem; color: var(--theme-muted, #94a3b8); text-align: right; }
.dr-ek-del { width: 2.2rem; height: 2.2rem; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid rgba(148,163,184,.3); background: transparent; color: #fca5a5; cursor: pointer; }
.dr-ek-del svg { width: 15px; height: 15px; }

/* Önizleme */
.dr-preview-col { position: relative; min-width: 0; display: grid; gap: .65rem; will-change: transform; }
.dr-toolbar { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; justify-content: space-between; background: var(--theme-panel, rgba(8,10,14,.88)); border: 1px solid var(--theme-border, rgba(34,211,238,.3)); border-radius: 14px; padding: .6rem .7rem; }
.dr-toolbar-title { font-weight: 800; font-size: .9rem; display: flex; align-items: center; gap: .45rem; }
.dr-toolbar-title i { width: .55rem; height: .55rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.dr-toolbar-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.dr-stage { border-radius: 14px; background: repeating-linear-gradient(45deg, rgba(148,163,184,.06) 0 10px, rgba(148,163,184,.02) 10px 20px), #0b1220; border: 1px solid rgba(148,163,184,.18); padding: 14px; overflow: hidden; max-height: calc(100vh - 190px); overflow-y: auto; }
.dr-paper-wrap { position: relative; margin: 0 auto; transform-origin: top left; }
.dr-note { margin: 0; font-size: .74rem; color: var(--theme-muted, #94a3b8); text-align: center; line-height: 1.45; }

/* A4 kağıt (96 dpi: 794 × 1123 px, kenar boşlukları 2,5 cm / 2 cm) */
.dr-paper { width: 794px; min-height: 1123px; box-sizing: border-box; padding: 76px 76px 72px 94px; background: #fff; color: #111; box-shadow: 0 12px 34px rgba(0,0,0,.45); font-family: "Times New Roman", Times, "Liberation Serif", serif; font-size: 16px; line-height: 1.5; position: relative; }
.dr-paper.f-arial { font-family: Arial, "Liberation Sans", Helvetica, sans-serif; }
.dr-paper.f-calibri { font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; }
.dr-paper.s-11 { font-size: 14.67px; }
.dr-paper.s-13 { font-size: 17.33px; }
.dr-paper .p-tarih { text-align: right; margin: 0 0 2.2em; }
.dr-paper .p-makam { text-align: center; font-weight: 700; margin: 0; letter-spacing: .01em; }
.dr-paper .p-sehir { text-align: right; font-weight: 700; margin: .2em 0 0; padding-right: 2.5em; }
.dr-paper .p-konu { margin: 2em 0 1.2em; }
.dr-paper .p-konu b { font-weight: 700; }
.dr-paper .p-body p { margin: 0 0 .55em; text-align: justify; text-indent: 1.25cm; hyphens: auto; white-space: pre-wrap; }
.dr-paper .p-imza { margin: 2.4em 0 0 auto; width: 46%; text-align: center; }
.dr-paper .p-imza .p-imza-alan { color: #777; margin-bottom: .2em; }
.dr-paper .p-imza strong { display: block; font-weight: 700; }
.dr-paper .p-imza span { display: block; }
.dr-paper .p-alt { display: grid; gap: 1.2em; margin-top: 2.6em; }
.dr-paper .p-blok b { display: block; text-decoration: underline; margin-bottom: .15em; }
.dr-paper .p-blok p { margin: 0; white-space: pre-wrap; }
.dr-paper .p-blok ol { margin: 0; padding: 0; list-style: none; }
.dr-paper .ph { background: #fef08a; color: #713f12; border-radius: 2px; }
.dr-paper.is-export .ph { background: none; color: inherit; }
.dr-paper .dr-pagebreak { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed #f87171; pointer-events: none; }
.dr-paper .dr-pagebreak span { position: absolute; right: 8px; top: -1.4em; font: 700 11px/1 Arial, sans-serif; color: #dc2626; background: #fff; padding: 2px 5px; border-radius: 4px; }
.dr-paper.is-export .dr-pagebreak { display: none; }

/* Mobil sekmeler */
.dr-tabs { display: none; }
@media (max-width: 1020px) {
  .dr-layout { grid-template-columns: 1fr; }
  .dr-preview-col { transform: none !important; }
  .dr-stage { max-height: none; }
  .dr-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; position: sticky; top: 64px; z-index: 30; margin-top: .9rem; padding: .35rem; border-radius: 12px; background: rgba(8,10,14,.92); border: 1px solid var(--theme-border, rgba(34,211,238,.3)); backdrop-filter: blur(6px); }
  .dr-tabs button { min-height: 2.4rem; border-radius: 9px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 800; font-size: .88rem; cursor: pointer; }
  .dr-tabs button.is-active { background: var(--theme-accent, #22d3ee); color: #06202a; }
  .dr-layout[data-tab="form"] .dr-preview-col { display: none; }
  .dr-layout[data-tab="preview"] .dr-form { display: none; }
}
@media (max-width: 560px) {
  .dr-grid { grid-template-columns: 1fr; }
  .dr-card { padding: .85rem .8rem 1rem; }
  .dr-stage { padding: 8px; }
  .dr-toolbar-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .dr-toolbar-actions .dr-btn { width: 100%; }
}

/* Yazdırma: yalnızca dilekçe sayfası */
@media print {
  @page { size: A4; margin: 0; }
  body * { visibility: hidden !important; }
  #dr-print-root, #dr-print-root * { visibility: visible !important; }
  #dr-print-root { position: absolute; left: 0; top: 0; }
  #dr-print-root .dr-paper { box-shadow: none; }
  #dr-print-root .ph { background: none !important; color: inherit !important; }
  #dr-print-root .dr-pagebreak { display: none !important; }
}

.dr-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 9999; padding: .7rem 1rem; border-radius: 10px; background: #0f172a; color: #f1f5f9; border: 1px solid var(--theme-accent, #22d3ee); font-weight: 700; font-size: .86rem; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px); }
.dr-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.dr-note a { color: var(--theme-accent, #22d3ee); font-weight: 700; }
.dr-form [hidden], .dr-toolbar [hidden] { display: none !important; }
.dr-form select.dr-tpl-select { font-weight: 700; min-height: 2.9rem; font-size: 1rem; border-color: var(--theme-accent, #22d3ee); }
