/* ============================================================
   Zetrik Theme – ZetrikCloud HRM
   Mac System Settings jaisa: halka sidebar, rang wali icon tile,
   gol button, grouped table. Aankhon ko aaram – sab yahan se badlo.
   ============================================================ */
:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --side: #eceff4;
  --line: #e1e5ec;
  --line-soft: #eef1f5;
  --text: #1f2430;
  --text-2: #555d6b;
  --text-3: #7a8290;
  --blue: #1a66d2;
  --blue-soft: #e8f0fc;
  --green: #1b8a4a;
  --green-soft: #e6f5ec;
  --switch: #34c759;
  --red: #c8372d;
  --red-soft: #fcebea;
  --amber: #9a5b00;
  --amber-soft: #fdf2dc;
  --grey: #5f6775;
  --grey-soft: #eef0f3;
  --purple: #6d3fc0;
  --purple-soft: #f1ebfb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 1px 1px rgba(20, 30, 50, .03);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
.ic { flex-shrink: 0; }
:focus-visible { outline: 3px solid rgba(26, 102, 210, .35); outline-offset: 2px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0;
  background: var(--side);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 14px 10px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(145deg, #2b7be6, #1a56b8);
  color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 17px;
}
.brand-mark.lg { width: 44px; height: 44px; font-size: 21px; border-radius: 11px; }
.brand-name { font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 12.5px; color: var(--text-2); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border-radius: var(--radius-sm);
  color: var(--text); font-size: 14.5px; font-weight: 500;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font-family: inherit;
}
.nav a:hover, .nav-btn:hover { background: rgba(0, 0, 0, .05); text-decoration: none; }
.nav a.active { background: var(--blue); color: #fff; }
.tile {
  width: 24px; height: 24px; border-radius: 6px; color: #fff;
  display: grid; place-items: center; flex-shrink: 0;
}
.nav a.active .tile { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55); }
.nav-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.nav-bottom form { margin: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: rgba(243, 245, 249, .9);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 600; font-size: 15px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.content { padding: 24px; max-width: 1400px; width: 100%; }
.only-mobile, .icon-btn.only-mobile { display: none; }
.backdrop { display: none; }

/* ---------- Page Head ---------- */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Group (card) ---------- */
.group {
  background: var(--panel); border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden;
}
.group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.group-head h3 { font-size: 15px; }
.group-head .actions { margin-left: auto; display: flex; gap: 8px; }
.group-body { padding: 16px; }
.group-title { font-size: 13.5px; color: var(--text-2); font-weight: 500; margin: 0 4px 8px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center;
}
.stat .tile { width: 36px; height: 36px; border-radius: 9px; }
.stat-value { font-size: 22px; font-weight: 600; line-height: 1.2; }
.stat-label { font-size: 13.5px; color: var(--text-2); }

/* ---------- Table (grouped) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left; font-weight: 500; color: var(--text-2); font-size: 13.5px;
  padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 600; background: #fafbfc; border-top: 1px solid var(--line); }
.table.compact td, .table.compact th { padding: 7px 10px; }
.name-cell { display: flex; align-items: center; gap: 10px; }
.name-cell .meta { font-size: 13px; color: var(--text-2); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }

/* ---------- Pills (status hamesha label ke saath) ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-grey { background: var(--grey-soft); color: var(--grey); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-purple { background: var(--purple-soft); color: var(--purple); }

/* ---------- Buttons (gol) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 999px;
  font: 500 14.5px/1 var(--font); cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; text-decoration: none !important;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1558b8; }
.btn-light { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn-light:hover { background: #f6f7f9; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b02f26; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13.5px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { color: var(--blue); border-color: #c9d6ea; }
.icon-btn.danger:hover { color: var(--red); border-color: #efc4c0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=month], input[type=search], input[type=tel], input[type=file], select, textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid #d5dbe4; border-radius: 10px; background: #fff;
  font: 400 14.5px var(--font); color: var(--text);
}
input[type=file] { padding: 6px 10px; }
textarea { height: auto; min-height: 80px; padding: 9px 12px; resize: vertical; }
select {
  appearance: none; padding-right: 32px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555d6b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 102, 210, .15); }
input[readonly] { background: #f6f7f9; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 16px; border-top: 1px solid var(--line-soft); background: #fafbfc; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.filters .field { min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; cursor: pointer; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Apple green switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 42px; height: 25px; border-radius: 999px; background: #d4d8df; position: relative; transition: background .18s; flex-shrink: 0; }
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s;
}
.switch input:checked + .track { background: var(--switch); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(26, 102, 210, .35); }

/* Segmented control (tabs) */
.segmented { display: inline-flex; background: #e6e9ef; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented a, .segmented button {
  padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text);
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.segmented a:hover { text-decoration: none; background: rgba(255, 255, 255, .5); }
.segmented .on { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

/* ---------- Attendance status picker ---------- */
.att-pick { display: inline-flex; gap: 4px; flex-wrap: nowrap; }
.att-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.att-pick label {
  min-width: 36px; height: 30px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line);
  display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-2); background: #fff;
}
.att-pick input:checked + label.s-P { background: var(--green); border-color: var(--green); color: #fff; }
.att-pick input:checked + label.s-A { background: var(--red); border-color: var(--red); color: #fff; }
.att-pick input:checked + label.s-HD { background: #b86e00; border-color: #b86e00; color: #fff; }
.att-pick input:checked + label.s-WO { background: var(--grey); border-color: var(--grey); color: #fff; }
.att-pick input:checked + label.s-HO { background: var(--purple); border-color: var(--purple); color: #fff; }
.att-pick input:checked + label.s-L, .att-pick input:checked + label.s-HL { background: var(--blue); border-color: var(--blue); color: #fff; }
.att-pick input:focus-visible + label { outline: 3px solid rgba(26, 102, 210, .35); }
.time-in { width: 132px !important; height: 32px !important; }

/* Monthly register grid */
.register td, .register th { padding: 5px 4px !important; text-align: center; font-size: 12.5px; min-width: 30px; }
.register td:first-child, .register th:first-child { text-align: left; position: sticky; left: 0; background: #fff; min-width: 180px; padding-left: 12px !important; z-index: 1; }
.register th:first-child { background: #fafbfc; }
.cell { display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: 5px; font-weight: 600; font-size: 11.5px; }
.c-P { background: var(--green-soft); color: var(--green); }
.c-A { background: var(--red-soft); color: var(--red); }
.c-HD { background: var(--amber-soft); color: var(--amber); }
.c-L, .c-HL { background: var(--blue-soft); color: var(--blue); }
.c-WO { background: var(--grey-soft); color: var(--grey); }
.c-HO { background: var(--purple-soft); color: var(--purple); }
.c-none { color: #b4bac4; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); padding: 10px 16px; }
.legend > span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Alerts ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14.5px; border: 1px solid;
}
.alert-success { background: var(--green-soft); color: #14693a; border-color: #c4e6d1; }
.alert-error { background: var(--red-soft); color: #a02c23; border-color: #f2c9c5; }
.alert-info { background: var(--blue-soft); color: #174f9e; border-color: #cddcf5; }
.alert-warning { background: var(--amber-soft); color: #7a4800; border-color: #f0dcb2; }

/* ---------- Avatar ---------- */
.avatar { border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 600; object-fit: cover; flex-shrink: 0; }

/* ---------- Detail list ---------- */
.dl { display: grid; grid-template-columns: 170px 1fr; }
.dl > div { padding: 9px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; }
.dl > div:nth-child(odd) { color: var(--text-2); }
.dl > div:nth-last-child(-n+2) { border-bottom: 0; }

/* ---------- Modal (gol) ---------- */
dialog.modal {
  border: 0; border-radius: 16px; padding: 0; width: min(560px, 94vw);
  box-shadow: 0 20px 60px rgba(15, 25, 45, .25); color: var(--text);
}
dialog.modal.wide { width: min(820px, 94vw); }
dialog.modal::backdrop { background: rgba(20, 28, 40, .35); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 16px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px; max-height: 70vh; overflow-y: auto; }

/* ---------- Empty / blocked ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-2); }
.empty h2 { color: var(--text); margin: 12px 0 6px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--blue-soft); color: var(--blue); display: inline-grid; place-items: center; }
.empty-icon.red { background: var(--red-soft); color: var(--red); }
.empty-row { text-align: center; color: var(--text-2); padding: 28px 12px !important; }
.blocked { text-align: center; }
.blocked h2 { margin: 14px 0 8px; }
.blocked p { color: var(--text-2); }

/* ---------- Auth ---------- */
body.plain { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card { background: #fff; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(20, 30, 50, .08); padding: 28px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn { width: 100%; height: 42px; margin-top: 6px; }

/* ---------- License card ---------- */
.lic-bar { height: 8px; border-radius: 99px; background: var(--grey-soft); overflow: hidden; margin-top: 6px; }
.lic-bar span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.lic-bar.warn span { background: #d98b00; }
.lic-bar.full span { background: var(--red); }

.chart-box { position: relative; height: 240px; padding: 12px 16px; }

/* ---------- Payslip print ---------- */
.slip { background: #fff; max-width: 820px; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.slip-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--text); padding-bottom: 14px; margin-bottom: 16px; }
.slip h2 { font-size: 20px; }
.slip .table td, .slip .table th { padding: 7px 10px; }
.slip-net { display: flex; justify-content: space-between; align-items: center; background: var(--blue-soft); border-radius: 10px; padding: 12px 16px; margin-top: 14px; font-size: 16px; font-weight: 600; }

@media print {
  .sidebar, .topbar, .no-print, .alert { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .slip { border: 0; padding: 0; }
  .group { box-shadow: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .only-mobile, .icon-btn.only-mobile { display: inline-grid; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; background: #f2f4f8; }
  body.side-open .sidebar { transform: none; }
  body.side-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(20, 28, 40, .3); z-index: 40; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .who-name { display: none; }
  .dl { grid-template-columns: 1fr; }
  .dl > div:nth-child(odd) { padding-bottom: 0; border-bottom: 0; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.table .name-cell { white-space: nowrap; }

/* API page */
.code { background: #1f2430; color: #e6e9ef; border-radius: 10px; padding: 14px 16px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; margin: 0 0 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }
.secret-box { background: var(--amber-soft); border: 1px solid #f0dcb2; border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; }
.secret-box .mono { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 4px 0 10px; word-break: break-all; }
.doc h3 { margin: 18px 0 8px; }
.doc h3:first-child { margin-top: 0; }
.doc p, .doc li { max-width: 80ch; }
.method { display: inline-block; min-width: 48px; text-align: center; border-radius: 6px; font-size: 12px; font-weight: 600; padding: 2px 6px; margin-right: 6px; }
.method.get { background: var(--green-soft); color: var(--green); }
.method.post { background: var(--blue-soft); color: var(--blue); }
