:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #dde1e7;
  --text: #1c2330;
  --muted: #5d6778;
  --accent: #2458d6;
  --accent-text: #ffffff;
  --green: #1f8a4c;
  --green-bg: #e3f4ea;
  --red: #c23a33;
  --red-bg: #fbe7e5;
  --gray: #6b7280;
  --gray-bg: #eceef1;
  --amber: #9a6400;
  --amber-bg: #fff3d6;
  --edited: #fff6c2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #191d23;
    --surface-2: #20252d;
    --border: #2c323c;
    --text: #e6e9ee;
    --muted: #9aa3b2;
    --accent: #6d95ff;
    --accent-text: #0b1020;
    --green: #4cc47f;
    --green-bg: #173324;
    --red: #f07a72;
    --red-bg: #3a1c1a;
    --gray: #9aa3b2;
    --gray-bg: #262b33;
    --amber: #f0c060;
    --amber-bg: #3a2e12;
    --edited: #4a4216;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
pre { background: var(--surface-2); padding: 10px; border-radius: 8px; overflow-x: auto; margin: 6px 0 0; }

/* yerleşim */
.topbar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; letter-spacing: .3px; color: var(--text); }
.brand small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.userbox { display: flex; align-items: center; gap: 10px; color: var(--muted); }
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 2px; }
.stat .sub { color: var(--muted); font-size: 12px; }

/* bileşenler */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 8px; font: inherit; font-size: 14px;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.small { padding: 3px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input.edited { background: var(--edited); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.form-row > * { flex: 1; min-width: 140px; }
.form-row > .btn { flex: 0 0 auto; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash.ok { background: var(--green-bg); color: var(--green); }
.flash.error { background: var(--red-bg); color: var(--red); }
.warn { background: var(--amber-bg); color: var(--amber); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.green, .badge.done { background: var(--green-bg); color: var(--green); }
.badge.red, .badge.failed, .badge.cancelled { background: var(--red-bg); color: var(--red); }
.badge.gray { background: var(--gray-bg); color: var(--gray); }
.badge.queued, .badge.claimed { background: var(--amber-bg); color: var(--amber); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.on { background: var(--green); }
.dot.off { background: var(--red); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.table-wrap { overflow-x: auto; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* oda ızgarası */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.room {
  display: block; border-radius: var(--radius); padding: 10px 12px; color: var(--text);
  border: 1px solid var(--border); border-left: 5px solid var(--gray); background: var(--surface);
}
.room:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.room.green { border-left-color: var(--green); background: var(--green-bg); }
.room.red { border-left-color: var(--red); background: var(--red-bg); }
.room .no { font-weight: 700; font-size: 17px; }
.room .iedl { font-size: 11px; color: var(--muted); }
.room .guest { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room .busy { font-size: 11px; color: var(--amber); font-weight: 600; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* işlem ilerlemesi */
.progress { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); }
.progress .bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 8px; }
.progress .bar span { display: block; height: 100%; width: 40%; background: var(--accent); animation: slide 1.2s infinite ease-in-out; }
.progress.finished .bar { display: none; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

.login-box { max-width: 380px; margin: 60px auto; }
.hero { max-width: 640px; margin: 60px auto; text-align: center; }
.hero p { color: var(--muted); }
details summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { padding: 10px 16px; }
  main { padding: 16px 16px 40px; }
}
