:root {
  --ink: #1f1212;
  --muted: #7a5c5c;
  --bg: #f7f1f1;
  --surface: #ffffff;
  --line: #eddede;
  --accent: #c62828;
  --accent-press: #a51f1f;
  --accent-soft: #fde8e8;
  --whatsapp: #16a34a;
  --whatsapp-press: #15803d;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --radius: 14px;
  --pad: max(1rem, env(safe-area-inset-left));
  --pad-r: max(1rem, env(safe-area-inset-right));
  --pad-b: max(1.25rem, env(safe-area-inset-bottom));
  --pad-t: max(1rem, env(safe-area-inset-top));
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Telefon dikey content alanı */
.app-shell {
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  margin: 0 auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(31, 18, 18, 0.06);
}

.app-shell-wide {
  max-width: 1120px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem var(--pad) var(--pad-b);
  overflow-x: clip;
  min-width: 0;
  flex: 1;
}

.wrap-wide {
  max-width: none;
}

/* İmza / credit */
.credit-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  padding: 0.55rem var(--pad) 0.5rem;
  padding-top: max(0.55rem, env(safe-area-inset-top));
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.credit-logo-link {
  display: inline-flex;
  line-height: 0;
}

.credit-logo {
  height: 24px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.credit-bar span {
  min-width: 0;
  max-width: 100%;
}

.credit-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: inherit;
}

.credit-link:hover,
.credit-link:active,
.credit-link:visited {
  color: inherit;
}

.credit-logo-link:active {
  opacity: 0.8;
}

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  width: min(100% - 2.5rem, 340px);
  text-align: center;
  padding: 1.5rem 1rem;
}

.preloader-logo-link {
  display: inline-block;
  margin: 0 auto 1rem;
  line-height: 0;
}

.preloader-logo {
  display: block;
  width: min(220px, 70vw);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  animation: logoPulse 1.2s ease-in-out infinite;
}

.preloader-text .credit-link {
  color: inherit;
}

.preloader-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}

@keyframes logoPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.03);
  }
}

/* Ana sayfa: ekran ortası */
.home {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.brand-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.9rem;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
  box-shadow: 0 10px 24px rgba(198, 40, 40, 0.22);
}

.brand h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.15rem, 5.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.stack {
  display: grid;
  gap: 0.75rem;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 54px;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.btn i {
  font-size: 1.05em;
  margin: 0;
}

.btn:active {
  opacity: 0.92;
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
}

.btn-whatsapp:active {
  background: var(--whatsapp-press);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:active {
  background: var(--accent-press);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn-small {
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  flex: 1;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.panel {
  background: #faf7f7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.panel h2 i {
  color: var(--accent);
  margin-right: 0.5rem;
}

.file-list .name i {
  color: var(--accent);
  margin-right: 0.5rem;
}

.login-form label i,
.admin-kicker i,
.row-time i {
  margin-right: 0.45rem;
}

.panel .hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.file-drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 1rem;
  border: 1.5px dashed #e4b4b4;
  border-radius: var(--radius);
  background: #fff7f7;
  text-align: center;
  cursor: pointer;
}

.file-drop .drop-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.55rem;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.file-drop strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.file-drop span {
  color: var(--muted);
  font-size: 0.85rem;
}

.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-list {
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
  max-width: 100%;
  min-width: 0;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 0.85rem;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.file-list .name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list .size {
  color: var(--muted);
  flex: 0 0 auto;
  white-space: nowrap;
}

.alert {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
}

.alert-ok {
  background: var(--accent-soft);
  color: #8f1d1d;
}

.alert i {
  margin-right: 0.5rem;
}

.alert-err {
  background: var(--danger-bg);
  color: var(--danger);
}

.has-bottom-bar .wrap {
  padding-bottom: 1rem;
}

.bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 50;
  margin-top: auto;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-bar-inner {
  width: 100%;
  margin: 0;
  padding: 0.65rem var(--pad);
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.55rem;
}

.bottom-bar .btn {
  min-height: 50px;
  font-size: 0.95rem;
}

.bottom-bar .btn:disabled {
  opacity: 0.45;
}

.login-form {
  display: grid;
  gap: 0.75rem;
}

.login-form label {
  font-size: 0.9rem;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  appearance: none;
}

/* Admin paneli */
.admin-body {
  background: #e8e2e2;
}

.admin-body .app-shell-wide {
  box-shadow: 0 0 0 1px rgba(31, 18, 18, 0.06), 0 16px 48px rgba(31, 18, 18, 0.07);
}

.admin-body .credit-bar {
  position: sticky;
  top: 0;
  z-index: 30;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  min-height: calc(100dvh - 70px);
  align-content: start;
}

.admin-sidebar {
  background: #fffaf9;
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.85rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  /* min-height yüzünden uyarı altında boşluk oluşmasın */
  height: auto;
  align-self: start;
  width: 100%;
}

.admin-title-block {
  min-width: 0;
}

.admin-kicker {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.admin-kicker i {
  margin: 0;
}

.admin-sidebar h1 {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.admin-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.admin-chip.is-active i {
  color: var(--accent);
}

.admin-chip {
  min-height: 34px;
  padding: 0 0.55rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.admin-chip i {
  margin: 0;
  color: var(--accent);
}

.admin-chip-muted {
  color: var(--muted);
}

.admin-chip-muted i {
  color: var(--muted);
}

.admin-chip:active {
  opacity: 0.88;
}

.admin-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.4rem 0.45rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  text-align: left;
  min-width: 0;
}

.stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.72rem;
}

.stat-icon i {
  margin: 0;
}

.stat-text {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}

.stat-sub {
  display: none !important;
}

.stat-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.05;
}

.admin-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.admin-notice i {
  margin-top: 0.05rem;
  color: #ea580c;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.admin-notice strong {
  display: block;
  font-size: 0.72rem;
  margin-bottom: 0.1rem;
  line-height: 1.3;
}

.admin-notice span {
  display: block;
  font-size: 0.66rem;
  line-height: 1.35;
  opacity: 0.95;
}

.admin-panel-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.7rem 0.75rem;
}

.admin-panel-box h3 {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-panel-box h3 i {
  margin: 0;
  color: var(--accent);
}

.admin-settings-page {
  background: transparent;
  border: 0;
  padding: 0;
}

.admin-settings-form {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.settings-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.95rem 0.95rem;
}

.settings-block h3 {
  margin: 0 0 0.7rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.settings-block h3 i {
  margin: 0;
  color: var(--accent);
  font-size: 0.9rem;
}

.settings-hint {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  line-height: 1.35;
}

.settings-hint i {
  margin-top: 0.1rem;
  color: var(--accent);
}

.list-head h2 i {
  margin-right: 0.3rem;
  color: var(--accent);
}

.admin-settings-form label {
  display: grid;
  gap: 0.28rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
}

.admin-settings-form label > span {
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-settings-form label > span i {
  margin: 0;
  color: var(--accent);
  width: 1em;
  text-align: center;
}

.admin-settings-form input[type="text"],
.admin-settings-form input[type="password"],
.admin-settings-form input[type="number"],
.admin-settings-form input[type="url"] {
  width: 100%;
  min-height: 42px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
}

.admin-settings-form input:focus,
.admin-settings-form textarea:focus {
  outline: none;
  border-color: #e0b4b4;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.08);
}

.theme-color-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
}

.theme-color-row input[type="color"] {
  width: 48px;
  height: 42px;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.theme-color-row input[type="text"] {
  min-height: 42px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

.admin-settings-form textarea {
  width: 100%;
  min-height: 72px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.settings-grid-stack {
  margin-top: 0.75rem;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-settings-save {
  min-height: 44px;
  width: 100%;
  max-width: 220px;
  margin: 0;
  font-size: 0.9rem;
  border-radius: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.brand-upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  align-items: stretch;
}

.brand-upload {
  display: grid;
  grid-template-rows: auto 88px auto auto 28px;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf7f7;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
  height: 100%;
}

.brand-upload-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink);
  font-size: 0.8rem;
  min-height: 1.25rem;
}

.brand-upload-title i {
  margin: 0;
  color: var(--accent);
}

.brand-upload-title strong {
  font-weight: 800;
}

.brand-upload-preview {
  position: relative;
  width: 100%;
  height: 88px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  padding: 0.5rem;
}

.brand-remove-x {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #c62828;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, background 0.15s ease;
}

.brand-remove-x:hover {
  transform: scale(1.06);
  background: #b71c1c;
}

.brand-remove-x.is-active {
  background: #455a64;
}

.brand-remove-x i {
  font-size: 0.78rem;
  line-height: 1;
}

.brand-upload.is-pending-remove .brand-thumb {
  opacity: 0.35;
  filter: grayscale(0.4);
}

.brand-thumb {
  width: 100%;
  height: 64px;
  display: grid;
  place-items: center;
}

.brand-thumb-favicon {
  width: 64px;
  height: 64px;
}

.brand-thumb img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
  display: block;
}

.brand-thumb-favicon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.brand-thumb > i {
  font-size: 1.35rem;
  opacity: 0.55;
}

.brand-file-btn {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 36px;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  grid-template-columns: none !important;
}

.brand-file-btn i {
  margin: 0;
  color: var(--accent);
}

.brand-upload small {
  display: block;
  min-height: 2.2em;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
  text-align: center;
}

.upload-ext-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.45rem;
}

.upload-ext-chip {
  margin: 0 !important;
  min-height: 36px;
  padding: 0.35rem 0.55rem !important;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 0.76rem !important;
  font-weight: 700;
  justify-content: flex-start;
}

.upload-ext-chip:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, #fff);
}

.admin-settings-form .admin-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  grid-template-columns: none;
  color: var(--ink);
  font-size: 0.86rem;
  padding: 0;
}

.admin-settings-form .settings-check-card {
  min-height: 42px;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.admin-settings-form .admin-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

@media (min-width: 900px) {
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }

  .settings-span-2 {
    grid-column: 1 / -1;
  }

  .brand-upload-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .settings-block {
    padding: 1rem 1.15rem 1.1rem;
  }
}

.admin-qr-box {
  text-align: center;
}

.admin-qr-url {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.35;
}

.admin-qr-canvas {
  display: inline-grid;
  place-items: center;
  margin: 0 auto 0.55rem;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-qr-canvas img,
.admin-qr-canvas canvas {
  display: block;
  width: 160px !important;
  height: 160px !important;
}

.admin-qr-download {
  min-height: 36px;
  width: 100%;
  font-size: 0.8rem;
}

.admin-content {
  padding: 0.55rem 0.85rem 1.35rem;
  min-width: 0;
  background: #fff;
  align-self: stretch;
}

.admin-filters {
  width: 100%;
  margin: 0 0 0.85rem;
  padding: 0;
}

.filter-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 100%;
  gap: 0.35rem;
  background: #f3eded;
  padding: 0.35rem;
  border-radius: 12px;
}

.filter-tab {
  min-height: 40px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #5b4a4a;
  text-align: center;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.filter-tab i,
.filter-tab span i {
  font-size: 0.78rem;
  margin: 0;
}

.filter-tab.is-active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.list-head {
  display: flex;
  align-items: center;
  gap: 0.55rem 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.list-head h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.list-head .list-head-end,
.filter-date-btn.list-head-end {
  margin-left: auto;
}

.list-count {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.admin-refresh-btn {
  margin-left: auto;
  min-height: 34px;
  padding: 0 0.7rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.admin-refresh-btn i {
  color: var(--accent);
}

.admin-refresh-btn:hover {
  border-color: #f0c8c8;
  background: var(--accent-soft);
}

.admin-refresh-btn.is-loading i {
  animation: admin-spin 0.7s linear infinite;
}

@keyframes admin-spin {
  to { transform: rotate(360deg); }
}

.filter-date-btn {
  margin-left: 0;
  position: relative;
  overflow: hidden;
  min-height: 34px;
  padding: 0 0.7rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.filter-date-btn i {
  margin: 0;
  color: var(--accent);
}

.filter-date-btn.is-active {
  border-color: #f0c8c8;
  background: var(--accent-soft);
  color: var(--accent);
}

.filter-date-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 0;
}

.bulk-bar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(31, 18, 18, 0.04);
}

.bulk-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
}

.bulk-check-text {
  min-width: 0;
}

.bulk-check-full {
  display: none;
}

.bulk-check-short {
  display: inline;
}

.bulk-check input,
.row-check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.bulk-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}

.bulk-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.bulk-btn {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  padding: 0 0.85rem;
  background: var(--danger);
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  white-space: nowrap;
}

.bulk-btn-full {
  display: none;
}

.bulk-btn-short {
  display: inline;
}

.bulk-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bulk-btn i {
  margin: 0;
}

@media (min-width: 480px) {
  .bulk-check-full {
    display: inline;
  }

  .bulk-check-short {
    display: none;
  }

  .bulk-btn-full {
    display: inline;
  }

  .bulk-btn-short {
    display: none;
  }

  .bulk-actions {
    grid-template-columns: auto 1fr;
  }

  .bulk-btn {
    width: 100%;
  }
}

@media (min-width: 640px) {
  .bulk-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
  }

  .bulk-actions {
    display: flex;
    width: auto;
    flex: 0 0 auto;
    grid-template-columns: none;
  }

  .bulk-btn {
    width: auto;
    min-height: 36px;
  }
}

.table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: 28px 52px 1fr;
  gap: 0.55rem 0.6rem;
  align-items: center;
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}

.row:hover {
  background: #fffaf9;
}

.row:last-child {
  border-bottom: 0;
}

.row-check {
  display: grid;
  place-items: center;
  grid-row: 1 / span 2;
  align-self: center;
  cursor: pointer;
}

.thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  grid-row: 1 / span 2;
  align-self: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

.empty i {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-size: 1.6rem;
  color: var(--accent);
}

.row-info {
  min-width: 0;
  grid-column: 3;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.12rem 0.35rem;
  border-radius: 5px;
  line-height: 1.2;
}

.type-pill i {
  margin: 0;
  font-size: 0.65rem;
}

.row-name {
  margin: 0 0 0.25rem;
  font-size: 0.84rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.row-actions {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
}

.row-actions form {
  display: contents;
}

.act {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f9fafb;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding: 0 0.35rem;
}

.act i {
  margin: 0;
  font-size: 0.78rem;
}

.act:active {
  opacity: 0.88;
}

.act-main {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.act-danger {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: var(--danger);
  width: 100%;
}

.act-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
  background: #f3f4f6;
  color: #9ca3af;
}

@media (min-width: 640px) {
  .row {
    grid-template-columns: 28px 56px 1fr auto;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
  }

  .row-check,
  .thumb {
    grid-row: auto;
  }

  .thumb {
    width: 56px;
    height: 56px;
  }

  .row-info {
    grid-column: auto;
  }

  .row-actions {
    grid-column: auto;
    margin-top: 0;
    min-width: 240px;
  }
}

@media (min-width: 900px) {
  .admin-body .app-shell-wide {
    max-width: min(1280px, calc(100% - 1.5rem));
    margin-top: 0;
    border-radius: 0;
  }

  .admin-layout {
    grid-template-columns: 300px 1fr;
    grid-template-rows: none;
    align-items: start;
    align-content: stretch;
  }

  .admin-sidebar {
    position: sticky;
    top: 3.4rem;
    height: calc(100dvh - 3.4rem);
    align-self: start;
    overflow: auto;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding: 1.15rem 1rem 1.25rem;
    gap: 0.85rem;
  }

  .admin-kicker {
    font-size: 0.72rem;
  }

  .admin-sidebar h1 {
    margin-top: 0.35rem;
    font-size: 1.05rem;
    line-height: 1.3;
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  .admin-side-actions {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }


  .admin-chip {
    min-height: 40px;
    padding: 0 0.7rem;
    border-radius: 10px;
    font-size: 0.82rem;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .stat-card {
    border-radius: 10px;
    padding: 0.5rem 0.55rem;
    gap: 0.45rem;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 0.78rem;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  .admin-notice {
    gap: 0.55rem;
    padding: 0.75rem 0.8rem;
    border-radius: 12px;
  }

  .admin-notice i {
    margin-top: 0.1rem;
    font-size: 1rem;
  }

  .admin-notice strong {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
    line-height: 1.35;
  }

  .admin-notice span {
    font-size: 0.72rem;
    line-height: 1.45;
  }

  .admin-content {
    padding: 1.15rem 1.25rem 1.75rem;
  }

  .row-name {
    font-size: 0.95rem;
  }

  .row-meta {
    font-size: 0.8rem;
  }

  .row-meta i {
    margin-right: 0.2rem;
  }
}

.empty {
  text-align: center;
  padding: 2.8rem 1.25rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.empty strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.empty span {
  font-size: 0.88rem;
  max-width: 28ch;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.9rem 0 0.25rem;
}

.pager-btn {
  min-height: 40px;
  min-width: 72px;
  padding: 0 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.pager-btn i {
  margin: 0;
}

.pager-btn.is-disabled {
  opacity: 0.4;
}

.pager-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pager-num {
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.pager-num.is-active {
  background: var(--accent);
  color: #fff;
}

.pager-dots {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 0.1rem;
}

.actions {
  display: flex;
  gap: 0.35rem;
}

.print-page {
  background: #fff;
  padding: 1rem;
  min-height: 100dvh;
}

.print-page img {
  display: block;
  margin: 0 auto;
  max-height: 80dvh;
  width: auto;
  object-fit: contain;
}

.print-page-pdf {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-bottom: 0;
}

.print-frame {
  flex: 1;
  width: 100%;
  min-height: 70dvh;
  border: 0;
  background: #f3f3f3;
}

.print-page .toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex: 0 0 auto;
}

@media (min-width: 640px) {
  .brand h1 {
    font-size: 1.75rem;
  }

  .admin-top h1 {
    font-size: 1.15rem;
  }
}

@media print {
  .print-page .toolbar,
  .no-print {
    display: none !important;
  }

  .print-page {
    padding: 0;
    min-height: 0;
    height: auto;
  }

  .print-page img {
    max-height: none;
    max-width: 100%;
    width: auto;
    height: auto;
  }

  .print-page-pdf,
  .print-frame {
    height: 100%;
    min-height: 100vh;
  }
}
