:root {
  --brand: #499D58; --brand-dark: #3B844A; --brand-soft: #EDF6EF;
  --bg: #F4F4F5; --panel: #FFFFFF; --surface2: #FAFAFA; --hover: #F4F4F6;
  --line: #E4E4E7; --line2: #EFEFF1; --text: #18181B; --text2: #3F3F46; --muted: #71717A; --faint: #A1A1AA;
  --danger: #E5484D; --danger-soft: #FEF2F2; --warn: #D97706; --warn-soft: #FFF7ED; --info: #2563EB; --info-soft: #EEF4FF;
  --violet: #6D28D9; --violet-soft: #F5F3FF;
  --r: 10px; --r-lg: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--brand-dark); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }

/* giris */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 36px 28px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.05); }
.logo { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, #5BB16A, var(--brand-dark)); display: grid; place-items: center; margin: 0 auto 16px; color: #fff; font-weight: 800; font-size: 22px; }
.login-card h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.3px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.ms-btn { display: flex; align-items: center; justify-content: center; gap: 12px; height: 52px; border-radius: var(--r-lg); background: var(--text); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; }
.ms-btn:hover { background: #000; }
.ms-mark { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-mark i { width: 9px; height: 9px; display: block; }
.msg { padding: 10px 14px; border-radius: var(--r); margin-bottom: 16px; text-align: left; font-size: 13.5px; border: 1px solid; }
.msg.error { color: #B91C1C; background: var(--danger-soft); border-color: #FECACA; }
.msg.ok { color: var(--brand-dark); background: var(--brand-soft); border-color: #CBE5D0; }

/* kabuk */
header.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.top-inner .logo { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; margin: 0; }
.brand-name { font-weight: 700; letter-spacing: -.2px; }
.brand-sub { color: var(--muted); font-size: 12.5px; }
.spacer { flex: 1; }
.me { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
nav.tabs { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; }
nav.tabs button { border: 0; background: none; padding: 10px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
nav.tabs button.active { color: var(--text); border-bottom-color: var(--brand); }
main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card + .card { margin-top: 16px; }
.card-head { padding: 14px 16px; border-bottom: 1px solid var(--line2); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.card-head h2 { font-size: 15px; margin: 0; }
.card-body { padding: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input[type=text], input[type=email], input[type=search], select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); min-width: 0; }
input:focus, select:focus { outline: 2px solid rgba(73,157,88,.3); border-color: var(--brand); }
.btn { height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }

/* tablo */
.table-wrap { overflow: auto; max-height: calc(100vh - 260px); }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line2); text-align: left; vertical-align: middle; }
thead th { position: sticky; top: 0; background: var(--surface2); z-index: 2; font-size: 12.5px; color: var(--muted); font-weight: 600; }
tbody tr:hover td { background: #FCFCFD; }
td.c, th.c { text-align: center; }
th.mod { min-width: 120px; }
th.mod .mt { color: var(--text); font-size: 13px; }
th.mod .bulk { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.sticky-col { position: sticky; left: 0; background: var(--panel); z-index: 1; }
thead .sticky-col { z-index: 3; background: var(--surface2); }
.user-cell .n { font-weight: 600; }
.user-cell .e { color: var(--muted); font-size: 12.5px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.badge.admin { background: var(--violet-soft); color: var(--violet); }
.badge.off { background: var(--danger-soft); color: var(--danger); }
.badge.src { background: var(--hover); color: var(--muted); font-weight: 600; }
.badge.lock { background: var(--warn-soft); color: var(--warn); }

/* anahtar */
.sw { position: relative; display: inline-block; width: 38px; height: 22px; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw span { position: absolute; inset: 0; background: #D4D4D8; border-radius: 999px; transition: .15s; cursor: pointer; }
.sw span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sw input:checked + span { background: var(--brand); }
.sw input:checked + span::before { transform: translateX(16px); }
.sw input:disabled + span { opacity: .5; cursor: default; }
.sw input:focus-visible + span { outline: 2px solid rgba(73,157,88,.45); outline-offset: 2px; }

.bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; background: var(--brand-soft); border-bottom: 1px solid #CBE5D0; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; }
.row-form input[type=email] { flex: 1 1 240px; }
.row-form input[type=text] { flex: 1 1 180px; }
.audit-action { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1C1C1F; color: #fff; padding: 10px 16px; border-radius: var(--r); font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 50; max-width: calc(100vw - 32px); }
#toast.err { background: #B91C1C; }
@media (max-width: 640px) {
  .brand-sub { display: none; }
  .table-wrap { max-height: none; }
}
.ms-mark .q1 { background: #F25022; } .ms-mark .q2 { background: #7FBA00; } .ms-mark .q3 { background: #00A4EF; } .ms-mark .q4 { background: #FFB900; }
.login-card p.foot { margin: 20px 0 0; }
