.hesap-body { background: #000; }
.hesap-main { padding: 28px 0 80px; position: relative; z-index: 1; }
.hesap-main .wrap { width: min(1000px, calc(100% - 24px)); }
.auth-card {
  max-width: 440px;
  margin: 24px auto;
  background: rgba(16, 0, 0, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
.auth-card h1 { margin: 0 0 8px; font-size: 1.45rem; }
.auth-card form { display: grid; gap: 12px; margin-top: 16px; }
.auth-card button { width: 100%; }
.flash { padding: 12px 14px; border-radius: 12px; font-weight: 700; margin: 0 0 16px; }
.flash-ok { background: rgba(61,154,95,.15); border: 1px solid rgba(61,154,95,.4); }
.flash-err { background: rgba(225,6,0,.12); border: 1px solid var(--line); }
.company-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(16,0,0,.72);
  margin-bottom: 10px;
}
.entry-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.panel, .panel-box { overflow-x: auto; }
.entry-table th, .entry-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.entry-table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.pos { color: #7dffa6; font-weight: 800; }
.neg { color: #ff8a8a; font-weight: 800; }
.gallery-acc { display: grid; gap: 8px; }
.gallery-acc details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a0000;
}
.gallery-acc summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.gallery-acc summary::-webkit-details-marker { display: none; }
.gallery-acc summary span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.gallery-acc .acc-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.gallery-pane { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.gallery-pane-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.photo-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-top: 14px; }
.photo-card { margin: 0; background: #0a0000; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.photo-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.photo-card figcaption { display: flex; justify-content: space-between; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px; font-size: .75rem; color: var(--muted); }
.ap-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin: 10px 0;
}
.ap-grid label { margin: 0; }
.ap-grid input { width: 100%; }
.ap-status { min-height: 1.2em; }
.ap-checks {
  display: grid;
  gap: 6px 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin: 8px 0 4px;
}
.ap-check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-size: .9rem;
}
.ap-check input { width: auto; accent-color: var(--red); }
.ap-zero td { opacity: .42; }
.ap-unit-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: flex-end;
  font-size: .78rem;
  font-weight: 700;
  text-align: right;
  max-width: min(100%, 460px);
}
.ap-durum { color: #7dffa6; }
.ap-durum b { color: #4ad67a; margin-right: 4px; }
.ap-sirada { color: #ffd36a; }
.ap-sirada b { color: #ffb020; margin-right: 4px; }
.ap-extra-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0;
}
.ap-extra-name { flex: 1; min-width: 120px; font-weight: 700; }
.ap-extra-qty { width: 90px; }
.ap-note-view {
  color: #ff4d4d;
  font-weight: 800;
  margin: 10px 0 0;
  white-space: pre-wrap;
}
.gallery-acc .ap-unit > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px 12px;
}
.ap-sum-notes {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  text-align: left;
}
.ap-sum-note {
  color: #ff4d4d;
  font-weight: 800;
  font-size: .82rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
}
.ap-notes { display: grid; gap: 8px; }
.ap-note-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #140404;
}
.ap-note-text {
  margin: 0;
  color: #ff4d4d;
  font-weight: 800;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.ap-note-del { flex-shrink: 0; }
.mini { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.mini input, .mini select { width: auto; }
.grid-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 18px 0; }
.stat-card { background: rgba(16,0,0,.72); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat-card span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.stat-card strong { display: block; font-size: 1.2rem; margin-top: 6px; }
.panel-box, .panel {
  background: rgba(16,0,0,.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
}
.panel-box h2 { margin: 0 0 12px; font-size: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.small { font-size: .82rem; color: var(--muted); }
.hesap-main button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: #e10600;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.hesap-main button.ghost, .hesap-main .btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a {
  text-decoration: none; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); font-weight: 700; font-size: .88rem;
}
.tabs a.is-on { background: #e10600; border-color: #e10600; color: #fff; }
.hesap-nav a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: .88rem;
}
.hesap-body .header-inner { position: relative; }
.hesap-nav {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 10px;
  right: 10px;
  z-index: 60;
  flex-direction: column;
  gap: 4px;
  background: #0d0000;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  max-height: min(70dvh, 420px);
  overflow: auto;
}
.hesap-nav.is-open { display: flex; }
.hesap-nav a {
  padding: 14px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
}
.hesap-nav a:hover { background: rgba(225, 6, 0, .18); }
.hesap-main input,
.hesap-main select,
.hesap-main textarea { font-size: 16px; }
.hesap-main button,
.hesap-main .btn { min-height: 44px; touch-action: manipulation; }

@media (min-width: 1024px) {
  .hesap-nav {
    display: flex;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    max-height: none;
    overflow: visible;
    gap: 6px;
  }
  .hesap-nav a {
    padding: 8px 12px;
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
  }
}

@media (max-width: 1023px) {
  .hesap-main { padding: 18px 0 72px; }
  .hesap-main h1 { font-size: 1.35rem; word-break: break-word; }
  .company-link {
    flex-direction: column;
    align-items: stretch;
  }
  .company-link .actions {
    width: 100%;
  }
  .company-link .actions .btn,
  .company-link .actions a {
    flex: 1 1 calc(50% - 8px);
    min-height: 44px;
    text-align: center;
  }
  .company-link .actions > span {
    flex: 1 1 100%;
    font-size: 1.12rem;
    font-weight: 800;
  }
  .mini { flex-direction: column; align-items: stretch; }
  .mini input, .mini select, .mini button, .mini .btn { width: 100%; }
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .ap-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .ap-checks { grid-template-columns: 1fr; }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .tabs a { white-space: nowrap; flex-shrink: 0; min-height: 40px; }
  .gallery-acc summary strong { min-width: 0; word-break: break-word; }
  .gallery-acc .ap-unit > summary { grid-template-columns: 1fr; }
  .ap-unit-sum {
    justify-content: flex-start;
    text-align: left;
    max-width: none;
  }
  .auth-card { margin: 16px 0; padding: 16px; }
  .panel, .panel-box { overflow-x: visible; }
  table.stack-table thead { display: none; }
  table.stack-table,
  table.stack-table tbody,
  table.stack-table tr,
  table.stack-table td {
    display: block;
    width: 100%;
  }
  table.stack-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #0a0000;
  }
  table.stack-table td {
    border: 0;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }
  table.stack-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex: 0 0 88px;
  }
  table.stack-table td:not([data-label])::before,
  table.stack-table td[data-label=""]::before { content: none; flex: 0; }
}

@media (max-width: 480px) {
  .grid-stats { grid-template-columns: 1fr; }
}
