:root {
  --bg: #0f1115;
  --card: #181b22;
  --accent: #25D366;
  --accent2: #3b82f6;
  --text: #f9fafb;
  --muted: #9ca3af;
  --danger: #ef4444;
  --warn: #b45309;
  --ok: #15803d;
  --border: #1f2937;
}

html, body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #1f2933, #050609);
  color: var(--text);
  min-height: 100vh;
}

header {
  padding: 14px 24px;
  background: #050609cc;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
header small { color: var(--muted); font-size: 12px; }
header a { color: var(--danger); text-decoration: none; }
header a:hover { text-decoration: underline; }

.container {
  max-width: 1700px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  border: 1px solid #111827;
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 16px 0; font-size: 16px; }
.card h3 { margin: 12px 0 8px 0; font-size: 14px; color: var(--muted); }

button, .btn,
a.btn-primary, a.btn-secondary, a.btn-danger, a.btn-warn, a.btn-muted,
.btn-primary, .btn-secondary, .btn-danger, .btn-warn, .btn-muted {
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none !important;
  display: inline-block;
  line-height: 1.2;
  vertical-align: middle;
  white-space: nowrap;
}
a.btn-primary, a.btn-secondary, a.btn-danger, a.btn-warn, a.btn-muted {
  /* anchors don't get default browser focus ring etc.; mirror visited too */
  color: inherit;
}
a.btn-primary, a.btn-primary:visited, a.btn-primary:hover { color: #022c22; }
a.btn-secondary, a.btn-secondary:visited, a.btn-secondary:hover { color: #fff; }
a.btn-danger, a.btn-danger:visited, a.btn-danger:hover { color: #fff; }
a.btn-warn, a.btn-warn:visited, a.btn-warn:hover { color: #fff; }
a.btn-muted, a.btn-muted:visited, a.btn-muted:hover { color: var(--text); }
.btn-primary { background: var(--accent); color: #022c22; }
.btn-secondary { background: var(--accent2); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warn { background: var(--warn); color: white; }
.btn-muted { background: #374151; color: var(--text); }
button:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Top-level tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab {
  padding: 10px 18px;
  background: transparent;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

/* Sub-tabs (Tanımlar) */
.subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.subtab {
  padding: 6px 14px;
  background: #111827;
  color: var(--muted);
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
}
.subtab.active { background: var(--accent2); color: white; }
.subtab.disabled { opacity: 0.4; pointer-events: none; }

/* Forms */
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  margin: 6px 0 14px 0;
  border-radius: 6px;
  border: 1px solid #374151;
  background: #020617;
  color: var(--text);
  box-sizing: border-box;
  font-size: 13px;
  font-family: inherit;
}
textarea { min-height: 80px; resize: vertical; }

/* Date-picker dark-theme polish — brighten the native picker icon on the
   right (the only affordance we keep) and a subtle hover/focus ring. */
input[type="date"] {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="date"]:hover { border-color: #60a5fa; }
input[type="date"]:focus { border-color: #60a5fa; outline: none; box-shadow: 0 0 0 2px rgba(96,165,250,0.25); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) brightness(1.4); opacity: 0.9; cursor: pointer; }
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.row { display: flex; gap: 12px; }
.col { flex: 1; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 500; }
tbody tr:hover { background: rgba(59, 130, 246, 0.05); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; text-align: right; }

/* Denser rows for the Listeler grids — the main search-result table on
   /panel/list, any child-row tables on /panel/list/<entity>/<pk>, and
   Denetim Kayıtları (panel_audit). vertical-align: middle so action
   buttons / <details> pills / <code> chips all share a centerline with
   the plain text cells. */
.list-table { font-size: 12px; }
.list-table th, .list-table td { padding: 4px 8px; line-height: 1.35; vertical-align: middle; }
/* Strip the global "details > summary" 10px top margin + fat padding so
   the JSON disclosure chip lines up with the rest of the row instead of
   sliding to the cell bottom. */
.list-table details, .list-table summary { margin: 0; }
.list-table details > summary { padding: 2px 8px; font-size: 11px; font-weight: 600; }
/* Tag chips inside the grid use the baseline font-size so the row
   font reads as homogenous; the global .tag rule is 11px which sits
   close enough to look uniform with the 12px body. */
.list-table .tag { font-size: 11px; padding: 1px 6px; }
/* The row height was being dictated by the global button padding (9×18,
   font 13). Shrink action buttons inside the grid so the row height
   actually follows the .list-table cell padding. */
.list-table .btn-primary,
.list-table .btn-secondary,
.list-table .btn-danger,
.list-table .btn-warn,
.list-table .btn-muted,
.list-table a.btn-primary,
.list-table a.btn-secondary,
.list-table a.btn-danger,
.list-table a.btn-warn,
.list-table a.btn-muted {
  padding: 3px 10px;
  font-size: 11px;
}
/* <code> chips (hotel_id / room_id pills) inflate the line height — give
   them a 0 vertical margin so the row collapses to the text height. */
.list-table code { padding: 1px 6px; font-size: 10px; line-height: 1.2; }

/* Misc */
.muted { color: var(--muted); }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.tag-ok { background: #052e16; color: #4ade80; }
.tag-warn { background: #451a03; color: #fcd34d; }
.tag-danger { background: #7f1d1d; color: #fca5a5; }
.tag-muted { background: #1f2937; color: var(--muted); }

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
}
.flash-ok { background: #052e16; border: 1px solid #15803d; color: #4ade80; }
.flash-err { background: #7f1d1d; border: 1px solid #b91c1c; color: #fca5a5; }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0;
  font-size: 13px;
  color: var(--muted);
}
.pager a, .pager span { padding: 4px 10px; }

details > summary {
  cursor: pointer;
  padding: 8px;
  background: #111827;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}
details[open] > summary { background: var(--border); }

/* Diff modal */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal.open { display: flex; }
.modal-content {
  background: var(--card);
  padding: 22px;
  border-radius: 12px;
  max-width: 600px;
  width: calc(100% - 32px);
  max-height: 86vh;
  overflow-y: auto;
}
.modal-content h3 { margin-top: 0; }
.diff-table td { padding: 6px 10px; font-family: monospace; font-size: 12px; }
.diff-table .diff-old { color: #fca5a5; text-decoration: line-through; }
.diff-table .diff-new { color: #4ade80; }

code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
       background: #020617; padding: 2px 6px; border-radius: 4px; }
