/* ==================================================================
   modules/drive.css — Drive (dr- öneki). Renkler yalnız token'lardan.
================================================================== */

/* Dosyalar: solda ağaç, sağda içerik (tam ekran, panel içinde kayar) */
.dr-page { flex: 1; min-height: 0; display: grid; grid-template-columns: 256px minmax(0, 1fr); }
.dr-tree { min-height: 0; overflow-y: auto; padding: 10px 8px 24px; border-right: 1px solid var(--line); background: var(--bg); overscroll-behavior: contain; }
.dr-tree ul { list-style: none; margin: 0; padding: 0; }
.dr-tsec { padding: 16px 10px 4px 32px; font-size: 11.5px; font-weight: 650; color: var(--text-3); letter-spacing: .01em; }
.dr-tsec.dr-tsep { padding: 0; margin: 10px 10px; border-top: 1px solid var(--line); }
.dr-tn { display: flex; align-items: center; padding-left: calc(var(--d, 0) * 14px); border-radius: var(--r-s); transition: background-color 100ms ease; }
.dr-tn:hover { background: var(--hover); }
.dr-tn.on { background: var(--selected); }
.dr-tn.on .dr-tl { color: var(--accent); font-weight: 600; }
.dr-tn.on .dr-tl svg.i { color: var(--accent); }
.dr-tw { flex: none; width: 22px; height: 30px; padding: 0; border: 0; background: transparent; color: var(--text-3); display: grid; place-items: center; border-radius: 5px; }
.dr-tw:hover { color: var(--text); }
.dr-tw svg.i { transition: transform 160ms var(--ease-out); }
.dr-tw[aria-expanded="true"] svg.i { transform: rotate(90deg); }
.dr-tw-sp { flex: none; width: 22px; }
.dr-tl { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 2px; border: 0; background: transparent; color: var(--text); font-size: 13.5px; text-align: left; border-radius: var(--r-s); }
.dr-tl > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-tl svg.i { color: var(--text-3); }
.dr-tn-n { flex: none; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dr-tl:focus-visible, .dr-tw:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.dr-main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.dr-bar { flex: none; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 16px 8px 20px; border-bottom: 1px solid var(--line); }
.dr-crumb { display: flex; align-items: center; gap: 1px; min-width: 0; font-size: 14px; overflow: hidden; }
.dr-crumb button { flex: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 14px; }
.dr-crumb button:hover { background: var(--hover); color: var(--text); }
.dr-crumb button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dr-crumb strong { min-width: 0; padding: 0 6px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-crumb > svg.i { flex: none; width: 14px; height: 14px; color: var(--text-3); }
.dr-spacer { flex: 1; min-width: 8px; }
.dr-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.dr-vdiv { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; }
.dr-sortsel { width: 140px; }
.dr-lay button { padding: 0 9px; }
.dr-seln { font-size: 13px; font-weight: 600; color: var(--accent); margin-right: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dr-mob, .dr-mtags { display: none; }
.dr-auto { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 20px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); background: var(--surface-2); }

.dr-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 28px; overscroll-behavior: contain; }
.dr-body > .empty-state { margin-top: 12vh; }
.dr-body.is-list { padding-top: 0; }

/* Izgara */
.dr-list.is-grid { display: flex; flex-direction: column; gap: 14px; }
.dr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; align-content: start; }
.dr-item { position: relative; cursor: pointer; user-select: none; -webkit-user-select: none; outline: none; transition: background-color 110ms ease, box-shadow 110ms ease; }
.dr-item:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.dr-item[aria-selected="true"] { background: var(--selected); }
.dr-tile { display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 10px; border-radius: var(--r-m); min-width: 0; }
.dr-tile:hover { background: var(--hover); }
.dr-tile[aria-selected="true"]:hover { background: var(--selected); }
.dr-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 8px; border-radius: 8px; overflow: hidden; background: var(--tone-bg, var(--surface-2)); color: var(--tone, var(--text-2)); }
.dr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dr-thumb > svg.i { width: 30px; height: 30px; stroke-width: 1.5; }
.dr-ext { position: absolute; left: 8px; bottom: 8px; padding: 3px 5px; border-radius: 4px; background: var(--surface); color: var(--tone, var(--text-2)); font: 700 10.5px/1 var(--mono); letter-spacing: .03em; }
.dr-okb { position: absolute; right: 8px; bottom: 8px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--t-green-bg); color: var(--t-green); }
.dr-okb svg.i { width: 12px; height: 12px; stroke-width: 2.4; }
.dr-name { display: block; min-width: 0; font-size: 13px; font-weight: 550; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.dr-sub { display: block; min-width: 0; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; font-variant-numeric: tabular-nums; }
.dr-star { position: absolute; top: 14px; right: 14px; z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--t-amber); }
.dr-star svg.i, .dr-starred svg.i { fill: currentColor; }
.dr-starred { color: var(--t-amber); }

/* Seçim kutusu: üzerine gelince, seçiliyken ya da seçim varken görünür */
.dr-check { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; opacity: 0; transition: opacity 120ms ease, background-color 120ms ease, border-color 120ms ease; }
.dr-check::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform 140ms var(--ease-out); }
.dr-check-sp { flex: none; width: 20px; }
.dr-tile .dr-check { position: absolute; top: 14px; left: 14px; z-index: 1; }
.dr-tile .dr-check-sp { display: none; }
.dr-item:hover .dr-check, .dr-item:focus-visible .dr-check, .dr-item[aria-selected="true"] .dr-check, .has-sel .dr-check { opacity: 1; }
.dr-item[aria-selected="true"] .dr-check { background: var(--accent); border-color: var(--accent); }
.dr-item[aria-selected="true"] .dr-check::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
@media (hover: none) { .dr-tile .dr-check, .dr-row .dr-check { opacity: 1; } }

/* Klasör kutuları (kompakt) */
.dr-fgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.dr-ftile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-m); background: var(--surface-2); min-width: 0; }
.dr-ftile:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--hover)); box-shadow: inset 0 0 0 1px var(--line); }
.dr-ftile .dr-check { position: absolute; left: 19px; top: 50%; margin-top: -10px; z-index: 1; }
.dr-ftile .dr-fic { transition: opacity 120ms ease; }
.dr-ftile:not(.dr-virtual):hover .dr-fic, .dr-ftile:not(.dr-virtual):focus-visible .dr-fic, .dr-ftile[aria-selected="true"] .dr-fic, .has-sel .dr-ftile:not(.dr-virtual) .dr-fic { opacity: 0; }
.dr-ghead { font-size: 12px; font-weight: 650; color: var(--text-2); margin: 4px 2px -6px; }
.dr-ghead:first-child { margin-top: 0; }
.dr-ftile .dr-check-sp { display: none; }
.dr-ftxt { min-width: 0; flex: 1; display: grid; }
.dr-ftxt .dr-name, .dr-ftxt .dr-sub { padding: 0; }
.dr-fic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.dr-fic.ok { background: var(--t-green-bg); color: var(--t-green); box-shadow: none; }
.dr-item.drop-on { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }

/* Liste */
.dr-lhead, .dr-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 190px 190px 84px 120px 52px; align-items: center; gap: 12px; padding: 0 12px; }
.dr-lhead { position: sticky; top: 0; z-index: 2; min-height: 36px; margin: 0 -20px; padding: 0 32px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-2); }
.dr-lhead button { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.dr-lhead button:hover { color: var(--text); }
.dr-lhead button svg.i { color: var(--accent); }
.dr-row { min-height: 44px; border-bottom: 1px solid var(--line); border-radius: 0; }
.dr-row:hover { background: var(--hover); }
.dr-row[aria-selected="true"]:hover { background: var(--selected); }
.dr-rn { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dr-rn .dr-name { padding: 0; flex: 0 1 auto; }
.dr-rn .dr-star { position: static; width: auto; height: auto; background: none; }
.dr-c { min-width: 0; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-c.num { font-variant-numeric: tabular-nums; }
.dr-tags { display: flex; gap: 4px; }
.dr-ri { flex: none; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--tone-bg, var(--surface-2)); color: var(--tone, var(--text-2)); }
.dr-ri.fo { background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }
.dr-ri.fo.ok { background: var(--t-green-bg); color: var(--t-green); box-shadow: none; }
.dr-ri svg.i { width: 15px; height: 15px; }

/* Bırakma alanı */
.dr-drop { position: absolute; inset: 8px; z-index: 5; display: none; place-items: center; align-content: center; gap: 8px; border: 2px dashed var(--accent); border-radius: var(--r-l); background: color-mix(in srgb, var(--accent-soft) 85%, var(--bg)); color: var(--accent); pointer-events: none; font-size: 14px; }
.dr-drop svg.i { width: 28px; height: 28px; }
.dr-main.over .dr-drop { display: grid; }

/* Yükleme göstergesi */
.dr-up { position: fixed; right: 20px; bottom: 20px; z-index: 900; width: 300px; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); display: grid; gap: 8px; font-size: 12.5px; animation: dr-up-in 200ms var(--ease-out); }
.dr-up[hidden] { display: none; }
.dr-up-head { display: flex; align-items: center; gap: 8px; }
.dr-up-head svg.i { color: var(--accent); }
.dr-up.done .dr-up-head svg.i { color: var(--green); }
.dr-up-row { display: grid; gap: 4px; }
.dr-up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.dr-up-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.dr-up-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.dr-up.done .dr-up-bar i { background: var(--green); }
.dr-up-more { color: var(--text-3); }
.dr-up-row.err .dr-up-name { color: var(--red); }
.dr-up-row.err .dr-up-bar i, .dr-up.done .dr-up-row.err .dr-up-bar i { background: var(--red); transform: scaleX(1); }
@keyframes dr-up-in { from { opacity: 0; transform: translateY(8px); } }

/* Paylaşımlar ve çöp tabloları */
.dr-spage { padding-top: 8px; }
.dr-stable td, .dr-ttable td { vertical-align: middle; }
.dr-cellt { display: grid; min-width: 0; }
.dr-cellt .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.dr-perm { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.dr-perm .tag svg.i { width: 11px; height: 11px; }
.dr-acts { text-align: right; white-space: nowrap; }
.dr-actw { display: inline-flex; align-items: center; gap: 6px; }
.dr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dr-mbar { display: none; }

/* Arşivler */
.dr-arch { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.dr-alist { min-height: 0; overflow-y: auto; padding: 4px 8px 24px; border-right: 1px solid var(--line); }
.dr-alist .dr-tsec { padding-left: 10px; }
.dr-aitem { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--r-m); background: transparent; color: var(--text); text-align: left; transition: background-color 100ms ease; }
.dr-aitem:hover { background: var(--hover); }
.dr-aitem[aria-current="true"] { background: var(--selected); }
.dr-aitem:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dr-aitem .main-txt { min-width: 0; display: grid; }
.dr-aitem .main-txt strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-aitem .main-txt span { font-size: 12px; color: var(--text-2); }
.dr-adet { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.dr-ahead { flex: none; display: flex; align-items: flex-start; gap: 16px; padding: 18px 22px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dr-atitle { flex: 1; min-width: 0; }
.dr-atitle h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.015em; }
.dr-ameta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.dr-ameta .btn.ghost { padding: 0 6px; margin: 0 -2px; }
.dr-aacts { display: flex; align-items: center; gap: 10px; flex: none; }
.dr-abody { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 28px; }
.dr-abody .row-item .badge { flex: none; }

/* Diyaloglar */
.dr-ltarget { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface-2); min-width: 0; }
.dr-ltarget > svg.i { color: var(--text-2); flex: none; }
.dr-ltarget .main-txt { flex: 1; min-width: 0; display: grid; }
.dr-ltarget .main-txt strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-ltarget .main-txt span { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-urlrow { display: flex; gap: 8px; align-items: center; }
.dr-urlrow .input { flex: 1; min-width: 0; }
.dr-mono { font-family: var(--mono); font-size: 12.5px; }
.dr-perms { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 24px; min-width: 0; }
.dr-perms legend { padding: 0; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); width: 100%; }
.dr-perms[disabled] { opacity: .55; }
.dr-nopw { margin-top: 8px; font-size: 12.5px; }
.dr-lfoot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.dr-lfoot .btn { margin-left: auto; }
.dr-revbox { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--r-m); background: var(--red-soft); }
.dr-revbox[hidden] { display: none; }
.dr-revacts { display: flex; justify-content: flex-end; gap: 8px; }
.dr-warn { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13.5px; color: var(--text); }
.dr-warn > svg.i { flex: none; margin-top: 2px; color: var(--red); }
.dr-warn .hint-i { flex: none; }

/* Dosya detayı */
.dr-pv { display: grid; place-items: center; min-height: 300px; padding: 16px; border-radius: var(--r-l); background: var(--surface-2); }
.dr-pvimg { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; display: block; }
.dr-pvimg:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dr-pvimg img { display: block; max-width: 100%; max-height: 48vh; border-radius: 8px; }
.dr-tcard { width: 168px; aspect-ratio: 3 / 4; display: grid; place-items: center; align-content: center; gap: 10px; border-radius: 14px; background: var(--tone-bg, var(--surface)); color: var(--tone, var(--text-2)); text-align: center; padding: 12px; }
.dr-tcard > svg.i { width: 42px; height: 42px; stroke-width: 1.4; }
.dr-tcard b { font: 700 15px/1 var(--mono); letter-spacing: .04em; }
.dr-tcard span { font-size: 12px; color: var(--text-2); }
.dr-tagrow { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.dr-loc { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; margin-left: -6px; }
.dr-tcall { margin-bottom: 16px; background: var(--red-soft); }
.dr-vers .row-item { gap: 10px; flex-wrap: wrap; }
.dr-ver .main-txt strong { font-size: 13.5px; white-space: normal; }
.dr-vat { font-weight: 400; color: var(--text-2); font-size: 12.5px; }
.dr-vnote { display: block; margin-top: 2px; white-space: normal; }
.dr-vnote b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.dr-rel { grid-template-columns: 90px minmax(0, 1fr); }
.dr-lrow { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 420px; }
.dr-lrow .field-btn { flex: 1; min-width: 0; }
.dr-relbtns { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.dr-relbtns .btn.ghost { height: 24px; padding: 0 6px; margin: 0 -6px; font-size: 13px; }
.dr-lk .main-txt strong { font-weight: 500; }
.dr-lk .badge, .dr-lk .btn { flex: none; }
.dr-pempty { padding: 24px; }
.dr-akv { grid-template-columns: 84px minmax(0, 1fr); font-size: 12.5px; }
.dr-akv dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-astate { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 10px; border-radius: var(--r-s); background: var(--red-soft); color: var(--red); font-size: 12.5px; font-weight: 600; }

/* Müşteri dosyaları (müşteri detayı + portal) */
.dr-cf { display: grid; gap: 22px; }
.dr-cfsec .block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dr-cfsec .block-head h3 { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; font-weight: 650; }
.dr-cfsec .block-head h3 svg.i { color: var(--text-3); }
.dr-cfsec .block-head .meta { color: var(--text-2); font-size: 12.5px; }
.dr-cfsec .row-item { gap: 10px; }
.dr-cfsec .row-item .main-txt { display: grid; }
.dr-cfsec .row-item .main-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-cfsec button.row-item > svg.i:last-child { color: var(--text-3); }
.dr-cfnone { margin: 0; font-size: 13px; }

/* Telefon */
@media (max-width: 760px) {
  .dr-page { grid-template-columns: minmax(0, 1fr); }
  .dr-tree { display: none; }
  .dr-mob { display: grid; flex: none; }
  .dr-mtags { display: inline-flex; }
  .dr-bar { flex-wrap: wrap; gap: 6px; padding: 8px 12px 8px 16px; }
  .dr-crumb { flex: 1 1 0; }
  .dr-crumb button { max-width: 110px; }
  .dr-spacer { display: none; }
  .dr-tools { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
  .dr-tools .dr-vdiv { display: none; }
  .dr-tools .btn span { display: none; }
  .dr-tools .dr-seln { margin-right: auto; }
  .dr-sortsel { width: 112px; }
  .dr-auto { padding: 8px 16px; }
  .dr-body { padding: 12px 16px calc(96px + env(safe-area-inset-bottom)); }
  .dr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dr-fgrid { grid-template-columns: minmax(0, 1fr); }
  .dr-lhead, .dr-row { grid-template-columns: 22px minmax(0, 1fr) 72px; gap: 10px; padding: 0 4px; }
  .dr-lhead { margin: 0 -16px; padding: 0 20px; }
  .dr-hide { display: none !important; }
  .dr-up { right: 12px; left: 12px; width: auto; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .dr-mbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 15px; }
  .dr-arch { display: flex; flex-direction: column; overflow-y: auto; padding: 12px 16px calc(96px + env(safe-area-inset-bottom)); }
  .dr-alist { border-right: 0; padding: 0; overflow: visible; flex: none; }
  .dr-adet { flex: none; margin-top: 12px; border-top: 1px solid var(--line); }
  .dr-ahead { padding: 14px 0; }
  .dr-abody { padding: 12px 0; overflow: visible; }
  .dr-acts .btn span { display: none; }
  .dr-cellt .t { max-width: 180px; }
  .dr-lrow { max-width: none; }
}
