/* ERAH kurumsal renkleri: siyah ve altın (ERAH Online ile aynı) */
:root {
  --black: #000001; --gold: #b6985a; --primary: #b6985a; --primary-dark: #9a7d43; --primary-soft: #f5efe2;
  --primary-text: #7a6232; --on-primary: #000001;
  --success: #2b8a3e; --danger: #d63031; --warning: #e67700; --info: #1971c2;
  --bg: #f6f4ef; --card: #ffffff; --text: #1b1b1b; --muted: #6f6a5e; --border: #e7e2d6;
  --sidebar: #000001; --sidebar-text: #cfc7b4; --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 16, 8, .06), 0 4px 12px rgba(20, 16, 8, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--primary-text); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: #fff; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: #f7f3ea; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-dark { background: var(--black); border-color: var(--black); color: var(--gold); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-ghost { border-color: transparent; background: transparent; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; }
.input { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar .input { width: auto; }

/* Giriş */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: radial-gradient(120% 90% at 85% 110%, rgba(182, 152, 90, .28) 0%, rgba(182, 152, 90, 0) 55%), linear-gradient(160deg, #000001 0%, #0d0c0a 60%, #17140e 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; border-right: 3px solid var(--gold); }
.login-hero img { width: 180px; }
.login-hero h1 { font-size: 34px; margin-top: 40px; }
.login-hero p { color: #cfc7b4; max-width: 440px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 22px; margin-bottom: 6px; }
@media (max-width: 800px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { padding: 28px; border-right: 0; border-bottom: 3px solid var(--gold); } .login-hero h1 { font-size: 24px; margin-top: 16px; } }

/* Yerleşim */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 236px; background: var(--sidebar); color: var(--sidebar-text); flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { color: #fff; padding: 16px 18px; border-bottom: 1px solid rgba(182, 152, 90, .22); display: flex; align-items: center; gap: 10px; }
.brand img { width: 92px; }
.brand span { color: var(--gold); font-weight: 600; letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--sidebar-text); padding: 8px 12px; border-radius: 8px; }
.nav a:hover { background: rgba(182, 152, 90, .1); color: #fff; }
.nav a.active { background: var(--gold); color: var(--on-primary); font-weight: 600; }
.nav .section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8a826f; padding: 14px 12px 4px; }
.nav .badge { margin-left: auto; }
.sidebar-user { padding: 12px 16px; border-top: 1px solid rgba(182, 152, 90, .22); font-size: 13px; }
.sidebar-user b { color: #fff; display: block; }
.main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-flex; }
  .main { padding: 14px 16px 60px; }
}

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card h2 { margin-bottom: 12px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .v { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.gold { border-left: 4px solid var(--gold); }
.stat.green { border-left: 4px solid var(--success); }
.stat.red { border-left: 4px solid var(--danger); }
.stat.orange { border-left: 4px solid var(--warning); }
.stat.blue { border-left: 4px solid var(--info); }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); padding: 8px; white-space: nowrap; background: #faf8f3; position: sticky; top: 0; }
table.t td { border-bottom: 1px solid #f0ece2; padding: 7px 8px; vertical-align: middle; }
table.t tr:hover td { background: #fcfaf5; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 24px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eee; color: #444; white-space: nowrap; }
.b-normal { background: #e6f4ea; color: #1e6b31; } .b-fazla { background: #e7f0fb; color: #1864ab; }
.b-eksik { background: #fff3e0; color: #b35c00; } .b-devamsiz, .b-cikis_yok, .b-rejected { background: #fdecec; color: #b42323; }
.b-izin, .b-approved { background: #eef7ee; color: #2b8a3e; } .b-off { background: #f1f3f5; color: #666; }
.b-gorev { background: #f3ecfb; color: #7048a8; } .b-iceride, .b-in { background: #e6f4ea; color: #1e6b31; }
.b-gelmedi, .b-pending, .b-open { background: #fff8e1; color: #8a6d00; } .b-bekleniyor, .b-out { background: #f1f3f5; color: #666; }
.b-away { background: #fff3e0; color: #b35c00; } .b-cancelled { background: #f1f3f5; color: #888; }

/* Vardiya ızgarası */
.sched { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.sched th, .sched td { border-bottom: 1px solid #efeadf; border-right: 1px solid #f3efe6; padding: 4px; min-width: 64px; text-align: center; }
.sched th { background: #faf8f3; position: sticky; top: 0; z-index: 1; }
.sched td.name, .sched th.name { text-align: left; min-width: 180px; position: sticky; left: 0; background: #fff; z-index: 2; }
.sched th.we { background: #f3efe6; }
.sched td.cell { cursor: pointer; }
.sched td.cell:hover { outline: 2px solid var(--gold); outline-offset: -2px; }
.sched td.sel { background: #fff6dd !important; }
.sched .off { color: #999; }
.sched .plan { font-weight: 600; }
.sched .lv { display: block; color: #2b8a3e; font-size: 11px; }
.sched .asg { display: block; color: #7048a8; font-size: 11px; }
.sched .src-plan .plan { color: var(--primary-text); }

/* Takvim */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .h { font-weight: 600; text-align: center; color: var(--muted); font-size: 12px; }
.cal .d { background: #fff; border: 1px solid var(--border); border-radius: 8px; min-height: 96px; padding: 4px 6px; font-size: 12px; }
.cal .d.other { opacity: .45; }
.cal .d.today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal .d .n { font-weight: 700; }
.cal .ev { display: block; border-radius: 4px; padding: 1px 4px; margin-top: 2px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Modal ve bildirimler */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 2000; padding: 40px 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { max-width: 980px; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 16px 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 2100; }
.toast { background: #1b1b1b; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; }
.toast.err { background: var(--danger); }
.map { height: 420px; border-radius: 10px; border: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--primary-soft); border-radius: 99px; padding: 2px 10px; font-size: 12px; }
.punch-box { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.state-big { font-size: 20px; font-weight: 700; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text); border-color: var(--gold); font-weight: 600; }
