@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-muted: #f0f3f9;
  --border: #e5e7ed;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #5f6c80;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #38bdf8;
  --danger: #ef4444;
  --success: #16a34a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-strong);
}

.app-shell {
  min-height: 100vh;
}

.app-footer {
  padding: 24px 32px 32px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 18px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--text);
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--surface-muted);
  font-size: 18px;
}

.brand small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-weight: 500;
  color: var(--muted);
}

.nav-item::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.2s ease;
}

.nav-item.active {
  color: var(--primary-strong);
}

.nav-item.active::after {
  background: var(--primary);
}

.nav-item.disabled {
  color: rgba(95, 108, 128, 0.6);
  pointer-events: none;
}

.nav-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.nav-actions form {
  margin: 0;
}

.main-content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
}

.page-header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
}

.page-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.metrics-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 28px;
}

.metric-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  margin-top: 16px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
}

.metric-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.surface {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
}

.surface + .surface {
  margin-top: 24px;
}

.surface-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.surface-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.surface-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.new-store-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.new-store-form input {
  flex: 1 1 260px;
}

.dashboard-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
}

.settings-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: stretch;
}

.settings-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.settings-card .actions {
  margin-top: auto;
}

.settings-card.small-card {
  max-width: 360px;
}

.settings-card.small-card textarea {
  min-height: 200px;
}

.settings-grid .surface:last-child {
  grid-column: span 2;
  max-width: none;
}

.status-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.iys-date-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.iys-query-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.iys-query-error {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(220, 38, 38, 1);
}

.iys-highlight-row {
  background: rgba(37, 99, 235, 0.08);
}

.iys-highlight-row:hover {
  background: rgba(37, 99, 235, 0.12);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  min-width: 640px;
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

tbody tr:hover {
  background: var(--surface-muted);
}

.store-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-slug {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  width: max-content;
}

.qr-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.qr-inline img {
  width: 84px;
  height: 84px;
  padding: 8px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions.center {
  justify-content: center;
}

.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.bulk-actions label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.bulk-buttons {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form {
  display: inline-flex;
}

.quick-actions {
  display: grid;
  gap: 14px;
}

.summary-list {
  display: grid;
  gap: 14px;
}

.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
}

.summary-item strong {
  display: block;
  font-size: 15px;
}

.summary-item div span {
  color: var(--muted);
  font-size: 13px;
}

.summary-item .badge {
  margin-left: 12px;
}

.quick-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
  font-weight: 500;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.quick-action span {
  color: var(--muted);
  font-size: 13px;
}

.quick-action-value {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.12);
}

.recent-list {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.recent-item strong {
  font-size: 14px;
}

.recent-item span {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary-strong);
  font-weight: 600;
  font-size: 13px;
}

.badge.success {
  background: rgba(34, 197, 94, 0.14);
  color: var(--success);
}

.badge.muted {
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
}

.badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: rgba(220, 38, 38, 1);
}

.badge.warning {
  background: rgba(251, 191, 36, 0.18);
  color: rgba(217, 119, 6, 1);
}

.empty-state {
  padding: 48px 32px;
  text-align: center;
  color: var(--muted);
  border: 2px dashed var(--border);
  border-radius: 18px;
  background: var(--surface-muted);
}

.empty-state h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

.btn,
button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.25);
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(37, 99, 235, 0.28);
}

.btn:active,
button:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--surface-muted);
  box-shadow: none;
  transform: translateY(0);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: none;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--muted);
  font-size: 13px;
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-ellipsis {
  color: var(--muted);
  font-size: 13px;
}

.pagination-links .btn-small.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  transform: translateY(0);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.alert {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.alert-success {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.alert-warning {
  border-color: rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.12);
  color: #b45309;
}

.alert-danger {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.detail-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
}

.info-card {
  display: grid;
  gap: 16px;
}

.info-card strong {
  font-size: 16px;
}

.info-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.search-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search-inline input[type='text'],
.search-inline select {
  min-width: 200px;
  width: auto;
}

.store-filter {
  min-width: 180px;
}

.search-inline .date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.search-inline .date-input {
  width: 150px;
  min-width: 0;
}

.summary-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 14px;
}

.summary-toggle input {
  margin: 0;
}

.search-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.summary-report {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  background: #fafafa;
}

.summary-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-report-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-report-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  padding: 4px 0;
  border-bottom: 1px dashed #e0e0e0;
}

.summary-report-item:last-child {
  border-bottom: none;
}

.summary-count {
  font-weight: 600;
}

.settings-card {
  display: grid;
  gap: 20px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group strong {
  font-size: 15px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-indicator {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.2s ease;
}

.toggle-indicator::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-indicator {
  background: var(--primary);
}

.toggle input:checked + .toggle-indicator::after {
  transform: translateX(20px);
}

.toggle span:last-child {
  font-weight: 600;
}

.public-shell {
  max-width: 440px;
  margin: 0 auto;
  padding: 64px 20px 96px;
}

.public-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.public-card h1 {
  margin: 8px 0 0;
  font-size: 28px;
  text-align: center;
}

.public-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.public-subtitle {
  text-align: center;
}

.public-logo {
  width: 140px;
  max-width: 60%;
  margin: 0 auto 16px;
  display: block;
}

.public-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.public-form label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}

.public-form button {
  justify-content: center;
}

.kvkk-box {
  max-height: 160px;
  overflow-y: auto;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.kvkk-box-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 13px;
  color: inherit;
}

.kvkk-consent {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.kvkk-consent input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.kvkk-snippet {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.8);
  color: var(--muted);
  font-size: 12px;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.success-card {
  text-align: center;
  display: grid;
  gap: 16px;
}

.success-card p {
  color: var(--muted);
  margin: 0;
}

.campaign-code-box {
  padding: 16px;
  border: 1px dashed var(--primary);
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--text);
  display: grid;
  gap: 6px;
}

.campaign-code {
  font-size: 28px;
  letter-spacing: 4px;
  font-weight: 700;
  color: var(--primary-strong);
}

@media (max-width: 1080px) {
  .dashboard-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .nav-menu {
    flex-wrap: wrap;
    gap: 16px;
  }
}

@media (max-width: 720px) {
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .main-content {
    padding: 32px 20px 64px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 100%;
  }

  .new-store-form {
    flex-direction: column;
    align-items: stretch;
  }
}
