* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f6f9; --card: #fff; --line: #e3e8ef; --text: #1e2837; --muted: #64748b;
  --accent: #2563eb; --accent-d: #1d4ed8; --green: #16a34a; --red: #dc2626; --orange: #d97706;
  --sidebar: #101828; --sidebar-text: #cbd5e1;
}
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
h1, h2 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { display: flex; min-height: 100vh; }

.sidebar { width: 210px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; flex-shrink: 0; }
.brand { padding: 20px 18px; font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid #1f2a3d; }
.sidebar nav { flex: 1; padding: 10px 0; }
.sidebar nav a { display: block; padding: 10px 18px; margin: 1px 8px; border-radius: 7px; color: var(--sidebar-text); text-decoration: none; font-size: 13.5px; transition-property: background-color, color; transition-duration: 120ms; transition-timing-function: ease-out; }
.sidebar nav a:hover { background: #1a2438; color: #fff; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid #1f2a3d; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.linklike { background: none; border: none; color: #93b4f5; cursor: pointer; font-size: 13px; padding: 0; }
.linklike:hover { text-decoration: underline; }

.content { flex: 1; padding: 28px 32px; max-width: 1200px; }
h1 { font-size: 21px; margin-bottom: 18px; }
h2 { font-size: 16px; margin: 22px 0 10px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.stat .num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Sunucu → müşteri dağılım kartları */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-bottom: 4px; }
.server-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.server-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 13px 16px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.server-name { font-weight: 700; font-size: 14px; }
.server-meta { color: var(--muted); font-size: 12px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.count-pill { flex-shrink: 0; background: #dbeafe; color: #1d4ed8; border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.count-pill.count-empty { background: #f1f5f9; color: var(--muted); }
.server-customers { list-style: none; padding: 4px 0; }
.server-customers li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 16px; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.server-customers li:last-child { border-bottom: none; }
.server-customers a { text-decoration: none; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-customers a:hover { text-decoration: underline; }
.server-cust-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.server-empty { padding: 16px; color: var(--muted); font-size: 13px; text-align: center; }

table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
td.money, th.right { font-variant-numeric: tabular-nums; }
td .actions { display: flex; gap: 8px; align-items: center; }

label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.checkline { display: flex; align-items: center; gap: 8px; padding-top: 22px; }
.checkline label { margin: 0; }

.btn { display: inline-block; background: var(--accent); color: #fff; border: none; border-radius: 7px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition-property: background-color, transform, box-shadow; transition-duration: 120ms; transition-timing-function: ease-out; }
.btn:hover { background: var(--accent-d); }
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn-ghost:hover { background: #eff6ff; }
.mt { margin-top: 14px; }
.w100 { width: 100%; }
.mt0 { margin-top: 0; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-aktif { background: #dcfce7; color: #15803d; }
.badge-askida { background: #fef3c7; color: #b45309; }
.badge-iptal { background: #fee2e2; color: #b91c1c; }
.badge-gecikme { background: #fee2e2; color: #b91c1c; }
.badge-yakin { background: #fef3c7; color: #b45309; }
.badge-panel { background: #e0e7ff; color: #4338ca; }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
.flash-ok { background: #dcfce7; color: #15803d; }
.flash-err { background: #fee2e2; color: #b91c1c; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--sidebar); }
.login-box { background: #fff; border-radius: 12px; padding: 34px; width: 360px; }
.login-box h1 { text-align: center; margin-bottom: 20px; }
.login-box .field { margin-bottom: 14px; }

.muted { color: var(--muted); }
.right { text-align: right; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
a { color: var(--accent); }

@media (max-width: 800px) {
  .wrap { flex-direction: column; }
  .sidebar { width: 100%; }
  .content { padding: 16px; }
  table { display: block; overflow-x: auto; }
}
