/* Duyarlı düzen. Kırılımlar: 1280 (dar masaüstü) · 1024 (tablet yatay) · 900 (panel mobil kabuğa geçer) · 700 (telefon) · 380 (dar telefon) */

@media (max-width: 1500px) {
  .metric-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quad-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 1280px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .admin-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash-grid > .card:first-child, .admin-grid > .card:first-child { grid-column: 1 / -1; }
  .section-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .how { grid-template-columns: repeat(3, 1fr); }
  .how > .how-title { grid-column: 1 / -1; }
  .top-links a span.long { display: none; }
  .offers { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .offers .offer:first-child:nth-last-child(3) ~ .offer:last-child { grid-column: 1 / -1; }
  .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  .top-links { display: none; }
  .icon-button.mobile-menu-button { display: inline-grid; }
  .home-products { grid-template-columns: minmax(0, 1fr); margin-top: -46px; }
  .product-card { min-height: 0; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-toggle { display: inline-flex; }
  .filter-box { display: none; }
  .filter-box.open { display: block; }
  .user-menu .who { display: none; }
}

/* Panel: sidebar → çekmece + alt navigasyon */
@media (max-width: 900px) {
  .workspace { display: block; }
  .sidebar { display: none; }
  .workspace-top { height: 64px; background: var(--navy); color: #fff; padding: 0 10px 0 6px; gap: 6px; border-bottom: 0; }
  .workspace-top .title { display: none; }
  .workspace-top .mobile-only { display: inline-flex; }
  .workspace-top .logo { font-size: 16px; }
  .workspace-top .logo-mark { width: 30px; height: 34px; }
  .workspace-top .search-box { display: none; }
  .workspace-top .top-right { margin-left: auto; gap: 2px; }
  .workspace-top .icon-button:hover, .workspace-top .user-menu summary:hover { background: #ffffff1c; }
  .workspace-top .avatar { background: #24456f; border: 1px solid #5e7ea8; }
  .content { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .mobile-search { display: block; margin-bottom: 14px; }
  .mobile-bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: #fff; border-top: 1px solid #d9e5f0; box-shadow: 0 -5px 19px #0000000f; padding: 6px 4px max(6px, env(safe-area-inset-bottom)); gap: 2px; }
  .mobile-bottom a, .mobile-bottom button { border: 0; background: transparent; color: #3f5676; font-size: 12px; font-weight: 700; display: grid; justify-items: center; align-content: center; gap: 3px; padding: 6px 1px; border-radius: 12px; min-height: 54px; position: relative; }
  .mobile-bottom a:hover { text-decoration: none; }
  .mobile-bottom .active { background: #e1f9f7; color: var(--teal-ink); }
  .mobile-bottom .count { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--teal-btn); color: #fff; border-radius: 10px; font-size: 12px; min-width: 18px; padding: 0 4px; line-height: 18px; text-align: center; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)); right: 15px; left: 15px; max-width: none; }
  .compare-bar { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .button, .tab, .select, .pagination button { min-height: var(--tap); }
  .button.small { min-height: var(--tap); padding: 9px 14px; }
  .pagination button { min-width: var(--tap); height: var(--tap); }
  .link { min-height: var(--tap); padding: 10px 2px; }
  .welcome p { max-width: 52%; }
  .gauge-wrap { grid-template-columns: minmax(0, 1fr); }
  .bottom-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-grid, .admin-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  /* Tablolar kart listesine döner */
  table.dt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.dt, table.dt tbody, table.dt tr, table.dt td { display: block; width: 100%; }
  table.dt tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; background: #fff; }
  table.dt td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px dashed #e6edf6; text-align: right; }
  table.dt td::before { content: attr(data-label); font-weight: 700; color: #4a5b78; font-size: 12px; text-align: left; flex-shrink: 0; }
  table.dt td:last-child { border-bottom: 0; }
  table.dt td.actions { justify-content: flex-end; }
  table.dt td.actions::before { content: none; }
  .table-wrap { overflow: visible; }
  .list-row { flex-wrap: wrap; }
  .list-row .select { max-width: 100%; }
}
@media (min-width: 901px) {
  .mobile-search { display: none; }
}

@media (max-width: 700px) {
  body { font-size: 14px; }
  .container { width: calc(100% - 32px); }
  .site-header { height: 64px; }
  .header-flex { gap: 8px; }
  .site-header .logo { font-size: 16px; }
  .site-header .logo-mark { width: 30px; height: 34px; }
  .home-hero { padding: 22px 0 70px; }
  .hero-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .home-hero h1 { font-size: 34px; margin-top: 14px; }
  .home-hero .lead { font-size: 15px; }
  .hero-visual { min-height: 0; margin-top: 6px; }
  .hero-float { display: none; }
  .trust-list { font-size: 12px; gap: 8px 14px; margin-top: 16px; }
  .product-card { padding: 16px; }
  .product-card h2 { font-size: 19px; }
  .product-card .body { max-width: 66%; }
  .product-card .art { width: 40%; }
  .how, .section-grid, .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .how > .how-title { grid-column: auto; }
  .heading-row h1 { font-size: 23px; }
  .welcome { padding: 20px 18px; min-height: 150px; }
  .welcome h1 { font-size: 24px; max-width: 62%; }
  .welcome p { max-width: 58%; font-size: 14px; }
  .welcome .art { width: 52%; right: -10px; opacity: .95; }
  .metric-grid, .metric-grid.six { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric { padding: 13px 11px; gap: 9px; }
  .metric .icon { width: 36px; height: 36px; border-radius: 11px; }
  .metric .number { font-size: 24px; }
  .metric .go { display: none; }
  .card { padding: 15px; border-radius: 14px; }
  .card h2 { font-size: 16px; }
  .mini-products { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .mini-product { min-height: 92px; }
  .mini-product .art { width: 34%; }
  .mini-product.green .art { width: 20%; }
  .product-card.green .art { width: 26%; }
  .why-card .bullets { max-width: 100%; }
  .why-card .art { display: none; }
  .dash-grid, .admin-grid, .quad-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-grid > .card:first-child, .admin-grid > .card:first-child { grid-column: auto; }
  .field-grid, .detail-lines, .detail-lines.three, .login-options { grid-template-columns: minmax(0, 1fr); }
  .progress { gap: 5px; padding: 10px 9px; overflow: auto; }
  .progress li { font-size: 12px; gap: 5px; }
  .progress li b { width: 26px; height: 26px; }
  .progress li:not(.current):not(.sep) span { display: none; }
  .tabs { gap: 6px; }
  .tab { padding: 10px 13px; }
  .offers { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .offers .offer:last-child { grid-column: auto !important; }
  .info-bar .button { margin-left: 0; }
  .form-actions .button { flex: 1; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .modal-head { top: -18px; }
  .bar-row { grid-template-columns: 110px 1fr 36px; }
  .msg { max-width: 94%; }
  .filters .search-box { max-width: none; flex: 1 1 100%; }
  .filters .select { flex: 1 1 46%; }

  .compare-scroll { overflow-x: auto; }
  .compare-table { min-width: 520px; }
}

@media (max-width: 380px) {
  .container { width: calc(100% - 24px); }
  .content { padding-left: 12px; padding-right: 12px; }
  .home-hero h1 { font-size: 29px; }
  .metric { flex-direction: column; gap: 6px; }
  .metric .number { font-size: 22px; }
  .site-header .logo { font-size: 14px; }
  .workspace-top .logo b, .workspace-top .logo em { font-size: 14px; }
  .mobile-bottom a, .mobile-bottom button { font-size: 12px; letter-spacing: -.02em; }
  .offer-price strong { font-size: 23px; }
  .offer-rows > div { grid-template-columns: 96px 1fr; }
  .welcome h1 { font-size: 21px; }
}

@media print {
  .sidebar, .workspace-top, .mobile-bottom, .site-header, .footer, .notice, #toast { display: none !important; }
  .content { padding: 0; }
}

/* ---------- v4: finans ve admin ---------- */
@media (max-width: 1280px) { .target-grid, .report-list, .todo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .target-grid, .report-list, .todo-grid { grid-template-columns: minmax(0, 1fr); }
  .fin-bars .bar-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .fin-bars .bar-row b { text-align: left; }
  td.r { text-align: left; }
  .report-bar { align-items: stretch; flex-direction: column; }
}
@media (max-width: 900px) { .detail-lines a { display: inline-flex; align-items: center; min-height: var(--tap); } }
@media (max-width: 700px) { .metric .number.long { font-size: 15px; } }

@media (max-width: 1024px) { .workspace-top .logo img { height: 36px; } }
@media (max-width: 700px) { .site-header .logo img { height: 40px; } }
@media (max-width: 380px) { .site-header .logo img { height: 34px; } .workspace-top .logo img { height: 30px; } }
@media (min-width: 701px) { .site-header .logo img { height: 58px; } }

@media (max-width: 900px) { .todo-row { flex-wrap: wrap; } .todo-text { flex-basis: calc(100% - 46px); } .todo-actions { width: 100%; justify-content: flex-start; padding-left: 42px; } }
@media (max-width: 380px) { .todo-actions { padding-left: 0; } }
@media (max-width: 900px) { .todo-actions .button.small { min-height: var(--tap); } }

@media (max-width: 1024px) { .masonry { columns: 1; } }
@media (max-width: 1280px) { .workspace-top .site-link { display: none; } }

@media (max-width: 1100px) { .todo-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .button.icon-only { min-height: var(--tap); min-width: var(--tap); justify-content: center; } }
@media (max-width: 900px) { .todo-actions { flex-wrap: wrap; } }
