/* 1kbanks Employee Portal — design tokens match the original Next.js build:
   white chrome, warm-paper content area, gold (#C19B5D) accent, IBM Plex type. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #f1eee6;
  --surface: #fbfaf6;
  --white: #ffffff;
  --text: #1b2436;
  --text-muted: #6b6558;
  --hairline: #dad5c7;

  --brass: #c19b5d;
  --brass-strong: #8f6f3d;
  --brass-soft: #f3e9d8;

  --moss: #3f6c51;
  --moss-soft: #e4ede6;

  --rust: #9c3b2e;
  --rust-soft: #f3e4e1;

  --font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'IBM Plex Serif', ui-serif, Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.tabular-nums { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--text-muted); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ---------- App shell: sidebar + topbar + content ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
}
.sidebar-logo { padding: 20px 24px; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.sidebar-cta {
  margin: 0 16px 8px;
  display: block;
  border: 1px solid var(--brass);
  color: var(--brass-strong);
  text-align: center;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
}
.sidebar-cta:hover { background: var(--brass-soft); }

.nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-group { margin-bottom: 16px; }
.nav-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0 12px 4px;
}
.nav-link {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 2px;
}
.nav-link:hover { background: rgba(193, 155, 93, 0.3); color: var(--text); }
.nav-link.active { background: var(--brass-soft); color: var(--brass-strong); font-weight: 500; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-bottom: 1px solid var(--hairline);
  background: var(--white);
  padding: 12px 32px;
}
.user-block { text-align: right; }
.user-name { font-size: 14px; font-weight: 500; }
.user-role { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--brass); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
}
.btn-signout {
  border: 1px solid var(--hairline);
  background: none;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.btn-signout:hover { border-color: var(--brass); color: var(--brass-strong); }

.main-content { flex: 1; padding: 32px; }
.main-content > * + * { margin-top: 32px; }

/* ---------- Hero banner ---------- */
.hero-banner {
  border-radius: 16px;
  padding: 40px 32px;
  color: #fff;
  background: linear-gradient(135deg, #8f6f3d 0%, #c19b5d 55%, #e4c88a 100%);
}
.hero-banner h1 { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.hero-banner p { margin: 8px 0 0; color: rgba(255, 255, 255, 0.85); max-width: 520px; }

/* ---------- Page heading (non-hero pages) ---------- */
.page-heading h1 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.page-heading p { margin: 4px 0 0; font-size: 14px; color: var(--text-muted); }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card { border: 1px solid var(--hairline); border-top: 2px solid var(--brass); background: var(--surface); padding: 20px; }
.stat-card .eyebrow { margin: 0 0 8px; }
.stat-card .value { font-family: var(--font-mono); font-size: 30px; font-weight: 500; }

/* ---------- Panels ---------- */
.panel { border: 1px solid var(--hairline); background: var(--surface); }
.panel-padded { padding: 20px; }
.panel-header {
  border-bottom: 1px solid var(--hairline);
  padding: 16px 20px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}
.panel h2.section-title { font-family: var(--font-display); font-size: 14px; font-weight: 600; margin: 0 0 12px; }

/* ---------- Status badge ("stamp") ---------- */
.status-badge {
  display: inline-block;
  transform: rotate(-2deg);
  border: 1.5px solid;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tone-brass { border-color: var(--brass); color: var(--brass); }
.tone-moss { border-color: var(--moss); color: var(--moss); }
.tone-rust { border-color: var(--rust); color: var(--rust); }
.tone-muted { border-color: var(--hairline); color: var(--text-muted); }

/* ---------- Banners ---------- */
.banner { padding: 8px 12px; font-size: 14px; border: 1px solid; }
.banner-error { border-color: var(--rust); background: var(--rust-soft); color: var(--rust); }
.banner-success { border-color: var(--moss); background: var(--moss-soft); color: var(--moss); }
.banner-info { border-color: var(--brass); background: var(--brass-soft); color: var(--brass-strong); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="tel"], input[type="file"], select, textarea {
  width: 100%;
  border: 1px solid var(--hairline);
  background: var(--bg);
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  border-radius: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); }
textarea { resize: vertical; }
input[type="checkbox"] { width: 16px; height: 16px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }

.btn {
  display: inline-block;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: var(--brass);
}
.btn:hover { background: var(--brass-strong); }
.btn-success { background: var(--moss); }
.btn-success:hover { background: #345a43; }
.btn-danger { background: var(--rust); }
.btn-danger:hover { background: #832f24; }
.btn-link { background: none; border: none; padding: 0; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.link-danger { color: var(--rust); }
.link-brass { color: var(--brass-strong); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
thead tr { border-bottom: 1px solid var(--hairline); }
th {
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
td { padding: 12px 20px; border-bottom: 1px solid var(--hairline); }
tbody tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
ul.list-plain { list-style: none; margin: 0; padding: 0; }
ul.list-plain > li { padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
ul.list-plain > li:last-child { border-bottom: none; }

/* ---------- Login page ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #fff; padding: 16px; }
.login-card { display: flex; width: 100%; max-width: 960px; border-radius: 24px; overflow: hidden; border: 1px solid var(--hairline); box-shadow: 0 20px 40px rgba(0,0,0,0.06); }
.login-video {
  position: relative;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  background: linear-gradient(135deg, #8f6f3d 0%, #c19b5d 55%, #e4c88a 100%);
  color: #fff;
  min-height: 480px;
}
.login-video .play-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
}
.login-video .play-btn::after {
  content: ''; margin-left: 4px;
  border-top: 8px solid transparent; border-bottom: 8px solid transparent;
  border-left: 14px solid rgba(255,255,255,0.8);
}
.login-video .placeholder-tag { position: absolute; top: 24px; right: 24px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.4); }
.login-video .tagline { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.2; }
.login-form { width: 50%; padding: 40px 48px; display: flex; align-items: center; }
@media (max-width: 768px) { .login-video { display: none; } .login-form { width: 100%; } }
.login-form-inner { width: 100%; max-width: 380px; margin: 0 auto; }
.login-logo { display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-logo-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--brass); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 12px; }
.login-form h1 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 16px 0 0; }
.login-form .subtitle { font-size: 14px; color: var(--text-muted); margin: 4px 0 0; }
.login-form form { margin-top: 24px; }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding: 4px 0 12px; }
.login-row .muted-link { color: var(--text-muted); cursor: not-allowed; }
.login-footer { margin-top: 24px; text-align: center; font-size: 14px; color: var(--text-muted); }
.login-form .btn { width: 100%; text-align: center; border-radius: 8px; padding: 10px 12px; }
.login-form input { border-radius: 8px; }

/* ---------- Utility layout ---------- */
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar input[type="text"] { flex: 1; min-width: 220px; }
.max-w-2xl { max-width: 720px; }

/* ---------- HR attendance calendar ---------- */
.cal-table { border-collapse: collapse; font-size: 11px; }
.cal-table th, .cal-table td { border: 1px solid var(--hairline); text-align: center; padding: 4px 3px; }
.cal-table thead th { font-family: var(--font-mono); font-weight: 500; color: var(--text-muted); font-size: 10px; }
.cal-name-col { text-align: left !important; white-space: nowrap; padding: 6px 10px !important; position: sticky; left: 0; background: var(--surface); z-index: 1; font-size: 13px; }
.cal-day-col { width: 26px; min-width: 26px; font-family: var(--font-mono); font-weight: 600; }
.cal-chip { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 3px; font-family: var(--font-mono); font-weight: 600; font-size: 10px; margin-right: 4px; }
.cal-absent, td.cal-absent { background: var(--rust); color: #fff; }
.cal-mm, td.cal-mm { background: #8b8f99; color: #fff; }
.cal-late, td.cal-late { background: var(--rust-soft); color: var(--rust); }
.cal-undertime, td.cal-undertime { background: var(--brass); color: #fff; }
.cal-leave, td.cal-leave { background: var(--moss-soft); color: var(--moss); }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; margin-bottom: 16px; align-items: center; }
