/* Güvenli Bordro */
:root {
    --brand: #0f766e;
    --brand-dark: #115e59;
    --brand-soft: #ccfbf1;
    --bg: #f1f5f4;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --red: #b91c1c; --red-bg: #fee2e2;
    --orange: #c2410c; --orange-bg: #ffedd5;
    --yellow: #a16207; --yellow-bg: #fef9c3;
    --green: #15803d; --green-bg: #dcfce7;
    --blue: #1d4ed8; --blue-bg: #dbeafe;
    --gray: #475569; --gray-bg: #f1f5f9;
    --wa: #25d366;
    --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; }
h2 { font-size: 1.3rem; margin: .2em 0 .4em; }
h3 { font-size: 1.05rem; margin: 0 0 .8em; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: .92em; }
pre.msg-preview { white-space: pre-wrap; background: #e7f8ee; border-radius: 10px; padding: 12px; font: inherit; font-size: 14px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mb0 { margin-bottom: 0; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.send-auto { border: 2px solid var(--wa); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.tabs a span { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--gray-bg); color: var(--gray); font-size: .8rem; text-align: center; }
.tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs a.on span { background: rgba(255, 255, 255, .25); color: #fff; }
.send-bar { position: sticky; top: 64px; z-index: 10; border: 2px solid var(--wa); }
.big-count { font-size: 1.15rem; margin-bottom: 4px; }
.btn.big { padding: 14px 22px; font-size: 1.05rem; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.gap, .gap { gap: 8px; }
.wrap-gap { flex-wrap: wrap; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* Kartlar */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.center-page .card { width: 100%; }
.brand { color: var(--brand-dark); margin: .2em 0; }
.brand small { font-size: .55em; color: var(--muted); font-weight: 500; }
.lock-icon { font-size: 44px; line-height: 1; margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid2 > .card, .grid2 > .stack > .card { margin-bottom: 0; }

/* Form */
label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: .92rem; }
label.row { flex-direction: row; font-weight: 400; align-items: flex-start; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
    font: inherit; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: var(--text); width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); flex: none; margin-top: 2px; }
.in-sm { padding: 6px 8px !important; font-size: .9rem !important; max-width: 190px; }
.invalid { border-color: var(--red) !important; background: var(--red-bg) !important; }
fieldset { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid-form .full { grid-column: 1 / -1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px; }
.filters select, .filters input { width: auto !important; flex: 1 1 160px; }
.filters .btn { flex: none; }

/* Butonlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; padding: 12px; }
.btn.sm { padding: 5px 10px; font-size: .82rem; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Uyarılar ve rozetler */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid transparent; }
.alert.success { background: var(--green-bg); color: var(--green); border-color: #bbf7d0; }
.alert.error { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.alert.warning { background: var(--yellow-bg); color: var(--yellow); border-color: #fde68a; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--gray-bg); color: var(--gray); white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); white-space: normal; }
.badge.orange { background: var(--orange-bg); color: var(--orange); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.checks { list-style: none; padding: 0; }
.checks .ok { color: var(--green); }
.checks .bad { color: var(--red); }
.confirm { display: flex; flex-direction: row; gap: 6px; align-items: center; font-weight: 600; margin-top: 4px; }

/* Tablo */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px; white-space: nowrap; }
.table td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: middle; }
.table.compact td { padding: 5px 6px; font-size: .88rem; }
.table tr.st-error td { background: #fff5f5; }
.table tr.st-confirm td { background: #fffaf0; }
.table tr.done td { opacity: .65; }
.table tr.next td { background: #ecfdf5; }
.actions { white-space: nowrap; }
.actions > * { vertical-align: middle; }
details.more { display: inline-block; position: relative; }
details.more summary { list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more .menu { position: absolute; right: 0; top: 110%; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,.12); min-width: 170px; padding: 6px; display: flex; flex-direction: column; }
details.more .menu button { background: none; border: 0; text-align: left; padding: 8px 10px; border-radius: 6px; font: inherit; cursor: pointer; }
details.more .menu button:hover { background: var(--gray-bg); }
details.more .menu .danger { color: var(--red); }
.pager { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.pager a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.pager a.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Yükleme ekranı */
.dropzone { border: 2px dashed #94a3b8; border-radius: var(--radius); padding: 34px 16px; text-align: center; cursor: pointer; background: #f8fafc; font-weight: 600; color: var(--brand-dark); margin: 10px 0; }
.dropzone.over, .dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input { display: none; }
.toolbar { margin: 14px 0 8px; }
.toolbar input[type=search] { max-width: 260px; }
.seg { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 12px; font: inherit; cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; }
.savebar { position: sticky; bottom: 0; background: #fff; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); }
dialog { border: 0; border-radius: var(--radius); width: min(900px, 96vw); max-height: 92vh; padding: 16px; }
dialog::backdrop { background: rgba(15, 23, 42, .55); }
dialog canvas { border: 1px solid var(--line); margin-top: 10px; }

/* Yönetim */
.admin-top { background: var(--brand-dark); color: #fff; position: sticky; top: 0; z-index: 30; }
.admin-top .wrap { min-height: 58px; }
.admin-top .logo { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.admin-top .logo small { opacity: .7; font-weight: 400; }
.admin-nav { display: flex; gap: 2px; }
.admin-nav a { color: #d1fae5; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255, 255, 255, .14); color: #fff; }
.admin-nav .logout { opacity: .8; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; }
.admin-main { padding-top: 20px; padding-bottom: 40px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); font-size: .88rem; }
.stat a { color: inherit; text-decoration: none; display: block; }
.stat span { display: block; font-size: 1.8rem; font-weight: 700; color: var(--text); }
.stat.warn span { color: var(--orange); }

/* Çalışan portalı */
.portal-top { background: var(--brand-dark); color: #fff; }
.portal-top .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 56px; max-width: 760px; gap: 8px; }
.portal-top .logo { font-weight: 700; }
.portal-top .company { font-size: .85rem; opacity: .85; text-align: right; }
.portal-main { max-width: 760px; padding-top: 24px; padding-bottom: 24px; }
.portal-foot { max-width: 760px; text-align: center; padding-bottom: 24px; }
.payslip-list { list-style: none; margin: 12px 0 0; padding: 0; }
.payslip-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.payslip-list li.focus { border-color: var(--brand); background: #f0fdfa; }
.pdf-card { padding: 10px; }
#pdf-pages canvas { display: block; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; }

@media (max-width: 860px) {
    .grid2, .grid-form { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .admin-top .wrap { flex-wrap: wrap; }
    .admin-nav { display: none; width: 100%; flex-direction: column; padding-bottom: 10px; }
    .nav-open .admin-nav { display: flex; }
    h1 { font-size: 1.35rem; }
    .card { padding: 16px; }
}
