:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --warn: #b45309;
  --danger: #b91c1c;
  --side: #0b1220;
  --side-text: #cbd5e1;
  --radius: 10px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d1fae5 0%, transparent 55%),
    linear-gradient(180deg, #eef2f7 0%, var(--bg) 40%);
  color: var(--ink);
  display: flex;
  min-height: 100vh;
}

.side {
  width: 240px;
  flex-shrink: 0;
  background: var(--side);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: .75rem; align-items: center; margin-bottom: 1.75rem; color: #fff; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 8px;
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .85rem;
}
.brand > div { flex: 1; min-width: 0; }
.brand strong { display: block; font-size: .95rem; }
.brand small { color: #94a3b8; font-size: .75rem; }
.corp-bell {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  text-decoration: none;
  font-size: 1.05rem;
  color: #e2e8f0;
  border-radius: 8px;
}
.corp-bell:hover { background: rgba(255,255,255,.08); color: #fff; }
.corp-bell.corp-bell-pulse {
  animation: corp-bell-pulse .55s ease;
}
@keyframes corp-bell-pulse {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.2); }
  65% { transform: scale(1.08); }
}
.corp-bell-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.side nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.side nav a {
  color: var(--side-text); text-decoration: none; padding: .55rem .7rem;
  border-radius: 8px; font-size: .92rem;
}
.side nav a:hover, .side nav a.on { background: rgba(255,255,255,.08); color: #fff; }
.side nav a.on { background: rgba(20,184,166,.18); color: #99f6e4; }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: .9rem; margin-top: .5rem; }
.acct { font-size: .8rem; color: #94a3b8; margin-bottom: .4rem; word-break: break-word; }
.linkish {
  background: none; border: 0; color: #99f6e4; cursor: pointer; padding: 0; font: inherit;
}

.main { flex: 1; padding: 1.75rem 2rem 3rem; min-width: 0; }
.main-alone { max-width: 440px; margin: 0 auto; padding-top: 8vh; }

h1 { font-size: 1.45rem; margin: 0 0 .35rem; letter-spacing: -.02em; }
.sub { color: var(--muted); margin: 0 0 1.5rem; font-size: .95rem; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.5rem; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.stat .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.stat .val { font-size: 1.45rem; font-weight: 650; margin-top: .25rem; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; margin-bottom: 1.25rem;
}
.panel h2 { font-size: 1rem; margin: 0 0 .9rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .35rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .45rem;
  border-radius: 4px; background: #f3f4f6; color: #374151;
}
.badge.havuzda { background: #fef3c7; color: #92400e; }
.badge.kuryede { background: #dbeafe; color: #1e40af; }
.badge.teslim_edildi { background: #d1fae5; color: #065f46; }
.badge.iptal { background: #fee2e2; color: #991b1b; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: .65rem 1.1rem; font-weight: 600; font-size: .92rem; cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.block { width: 100%; }

label { display: block; font-size: .85rem; font-weight: 600; margin: 0 0 .35rem; }
input, select, textarea {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; margin-bottom: .9rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #99f6e4; border-color: var(--accent); }
.form-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.alert {
  padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem;
}
.alert.err { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert.warn { background: #fffbeb; color: var(--warn); border: 1px solid #fde68a; }
.mono { font-family: var(--mono); font-size: .85rem; word-break: break-all; }
.key-copy-row {
  display: flex; align-items: flex-start; gap: .45rem; margin-top: .4rem;
}
.key-copy-row .mono { flex: 1; min-width: 0; }
.btn-copy {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: 6px; cursor: pointer;
  border: 1px solid #a7f3d0; background: #fff; color: #065f46;
}
.btn-copy:hover { background: #ccfbf1; }
.copy-feedback { font-size: .8rem; font-weight: 600; color: #047857; align-self: center; white-space: nowrap; }
.map-box {
  height: 320px; border-radius: var(--radius); border: 1px solid var(--line);
  background: #e8eef5; overflow: hidden; margin-top: .75rem;
}
.login-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.75rem; box-shadow: 0 12px 40px rgba(15, 23, 42, .06);
}
.login-card .logo { display: flex; gap: .75rem; align-items: center; margin-bottom: 1.25rem; }
.muted { color: var(--muted); font-size: .88rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; align-items: center; }
.actions form { display: inline-flex; margin: 0; }
/* Güzergâh: yer aç — aksiyonlar tek satır kalsın */
.col-route {
  max-width: 11.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-actions {
  width: 1%;
  min-width: 11rem;
  white-space: nowrap;
  vertical-align: middle;
}
/* flex td üzerinde kırılgan; iç sarmalayıcı kullan */
.row-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: .28rem;
  white-space: nowrap;
  min-width: max-content;
}
.row-actions form {
  display: inline-flex;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  flex: 0 0 auto;
}
.row-actions .btn-sm { flex-shrink: 0; }
.btn-sm { padding: .28rem .48rem; font-size: .72rem; line-height: 1.2; }
.req { color: var(--danger); font-weight: 700; }
textarea { resize: vertical; min-height: 4rem; }

@media (max-width: 860px) {
  body { flex-direction: column; }
  .side { width: 100%; height: auto; position: relative; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }
  .main { padding: 1.25rem 1rem 2.5rem; }
}
