/* AttendTrack — style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:      #185FA5;
  --blue-lt:   #e6f1fb;
  --blue-dk:   #0c447c;
  --green:     #27500a;
  --green-lt:  #eaf3de;
  --red:       #791f1f;
  --red-lt:    #fcebeb;
  --amber:     #633806;
  --amber-lt:  #faeeda;
  --gray:      #f4f5f7;
  --border:    #e5e7eb;
  --text:      #1a1a2e;
  --muted:     #6b7280;
  --radius:    10px;
  --shadow:    0 1px 6px rgba(0,0,0,.07);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  text-decoration: none;
}
.btn-icon:hover { background: var(--gray); }

/* ── LAYOUT ───────────────────────────────────────────────── */
.page-wrap { max-width: 800px; margin: 0 auto; padding: 1rem; }

/* ── TABS ─────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 2px;
  background: #e5e7eb;
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.tab-btn {
  flex: 1;
  min-width: 70px;
  padding: 8px 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  color: var(--muted);
  border: none;
  background: none;
  white-space: nowrap;
}
.tab-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 14px;
}

/* ── STAT GRID ────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 1rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.stat-num { font-size: 28px; font-weight: 700; color: var(--blue); }
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 500; }

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-pending  { background: var(--amber-lt); color: var(--amber); }
.badge-approved { background: var(--green-lt); color: var(--green); }
.badge-rejected { background: var(--red-lt);   color: var(--red);   }
.badge-present  { background: var(--green-lt); color: var(--green); }
.badge-absent   { background: var(--red-lt);   color: var(--red);   }
.badge-leave    { background: var(--blue-lt);  color: var(--blue);  }

/* ── FORMS ────────────────────────────────────────────────── */
.field, .form-row { margin-bottom: 12px; }
.field label, .form-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
}
input[type=text],
input[type=password],
input[type=date],
input[type=number],
input[type=month],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24,95,165,.1);
}
textarea { min-height: 72px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: all .15s;
}
.btn:hover { background: var(--gray); }
.btn-primary   { background: var(--blue);     color: #fff; border-color: var(--blue);    }
.btn-primary:hover   { background: var(--blue-dk); }
.btn-success   { background: var(--green-lt); color: var(--green); border-color: #c0dd97; }
.btn-success:hover   { background: #c0dd97; }
.btn-danger    { background: var(--red-lt);   color: var(--red);   border-color: #f7c1c1; }
.btn-danger:hover    { background: #f7c1c1; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--gray); }
.btn-sm    { padding: 5px 12px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; margin-top: 8px; }

/* ── ROWS ─────────────────────────────────────────────────── */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f4f5f7;
}
.row:last-child { border-bottom: none; }
.row-name { font-size: 14px; font-weight: 600; }
.row-sub  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row-right { text-align: right; flex-shrink: 0; }

/* ── BALANCE BARS ─────────────────────────────────────────── */
.bal-bar  { height: 6px; background: var(--gray); border-radius: 3px; overflow: hidden; }
.bal-fill { height: 100%; border-radius: 3px; background: var(--blue); transition: width .4s; }
.bal-fill.danger { background: #e24b4a; }
.bal-fill.warn   { background: #ef9f27; }

/* ── CHECK-IN BUTTON ──────────────────────────────────────── */
.checkin-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
  transition: all .2s;
}
.check-in    { background: var(--green-lt); color: var(--green); }
.check-in:hover   { background: #c0dd97; }
.check-out   { background: var(--red-lt);   color: var(--red);   }
.check-out:hover  { background: #f7c1c1; }
.checked-done { background: var(--gray); color: var(--muted); cursor: default; }

/* ── ALERTS ───────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert-success { background: var(--green-lt); color: var(--green); }
.alert-danger  { background: var(--red-lt);   color: var(--red);   }
.alert-info    { background: var(--blue-lt);  color: var(--blue);  }
.alert-warning { background: var(--amber-lt); color: var(--amber); }

/* ── TABLES ───────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid #f4f5f7; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fafafa; }

/* ── PAYROLL INPUTS ───────────────────────────────────────── */
.pr-input {
  width: 85px;
  padding: 5px 7px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}
.pr-input:focus { outline: none; border-color: var(--blue); }

/* ── PROOF TAG ────────────────────────────────────────────── */
.proof-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--amber-lt);
  color: var(--amber);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty { text-align: center; color: var(--muted); padding: 2.5rem; font-size: 14px; }

/* ── HR ───────────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── LOGIN PAGE ───────────────────────────────────────────── */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  gap: 1.5rem;
}
.login-logo { text-align: center; }
.login-logo h1 { font-size: 26px; font-weight: 700; margin-top: 8px; }
.login-logo p  { color: var(--muted); font-size: 14px; }
.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.login-card h2  { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 1.5rem; }
.hint {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--gray);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

/* ── EMPLOYEE MGMT (manager admin) ────────────────────────── */
.emp-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--blue-lt); color: var(--blue-dk);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.emp-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.emp-card:last-child { border-bottom: none; }
.emp-inactive { opacity: .45; }
.tag-active   { background: var(--green-lt); color: var(--green); padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.tag-inactive { background: var(--gray);     color: var(--muted); padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  overflow-y: auto;
  padding: 40px 16px;
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem;
  max-width: 500px;
  margin: 0 auto;
  border: 1px solid var(--border);
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-close {
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--muted); line-height: 1;
}
.section-label {
  font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; margin: 16px 0 8px;
  border-top: 1px solid var(--border); padding-top: 12px;
}
