/* ============================================================
   Leave Application — Modern Minimalist Theme
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --c-primary:     #1e3a5f;
  --c-primary-dk:  #162d4a;
  --c-accent:      #2563eb;
  --c-bg:          #eef2f7;
  --c-card:        #ffffff;
  --c-text:        #1e293b;
  --c-muted:       #64748b;
  --c-border:      #dde3ed;
  --c-success-bg:  #ecfdf5;
  --c-success:     #15803d;
  --c-danger-bg:   #fef2f2;
  --c-danger:      #b91c1c;
  --c-info-bg:     #eff6ff;
  --c-info:        #1d4ed8;
  --c-warning-bg:  #fffbeb;
  --c-warning:     #92400e;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 1px 4px rgba(30,58,95,.08), 0 4px 20px rgba(30,58,95,.06);
  --shadow-sm:     0 1px 2px rgba(30,58,95,.05);
  --transition:    .15s ease;
}

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: .9375rem;
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
}

/* ── App header ────────────────────────────────────────────── */
.app-header {
  background: var(--c-primary);
  color: #fff;
  padding: .65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.app-header img { height: 36px; flex-shrink: 0; }
.app-header .sys-title {
  font-size: .9rem;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header .emp-badge {
  font-size: .8rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: .2rem .7rem;
  white-space: nowrap;
}
.btn-logout {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: .3rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition);
}
.btn-logout:hover { background: rgba(255,255,255,.22); color: #fff; text-decoration: none; }

/* ── Steps ribbon ───────────────────────────────────────────── */
.steps-bar {
  background: #f8fafc;
  border-bottom: 1px solid var(--c-border);
  padding: 0;
}
.steps {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
}
.step {
  flex: 1;
  text-align: center;
  padding: .55rem .25rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-muted);
  border-right: 1px solid var(--c-border);
  letter-spacing: .02em;
}
.step:last-child { border-right: none; }
.step.active {
  background: var(--c-primary);
  color: #fff;
}
.step.done {
  background: var(--c-success-bg);
  color: var(--c-success);
}

/* ── Auth page ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
  background: linear-gradient(150deg, #1a3254 0%, #2563eb 100%);
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--c-card);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  overflow: hidden;
}
.auth-card-header {
  background: var(--c-primary);
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  color: #fff;
}
.auth-card-header img { height: 68px; margin-bottom: .85rem; }
.auth-card-header h1 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}
.auth-card-header p {
  font-size: .8rem;
  opacity: .75;
  margin: .25rem 0 0;
}
.auth-card-body { padding: 1.75rem 2rem 2rem; }
.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  color: rgba(255,255,255,.55);
  font-size: .78rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--c-primary);
  margin: 0 0 1.1rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: .45rem;
}

/* ── Form controls ──────────────────────────────────────────── */
.form-label {
  font-size: .775rem;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .3rem;
  display: block;
}
.form-control,
.form-select {
  display: block;
  width: 100%;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: .575rem .85rem;
  font-size: .9rem;
  color: var(--c-text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  outline: none;
}
.form-control[readonly]  { background: #f8fafc; color: var(--c-muted); cursor: default; }
.form-control[disabled]  { background: #f8fafc; opacity: .6; cursor: not-allowed; }
textarea.form-control    { resize: vertical; min-height: 85px; }
.form-hint { font-size: .76rem; color: var(--c-muted); margin-top: .3rem; }
.char-count { font-size: .76rem; color: var(--c-muted); text-align: right; margin-top: .2rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .575rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition), box-shadow var(--transition);
  line-height: 1.4;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--c-primary-dk);
  border-color: var(--c-primary-dk);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30,58,95,.25);
}
.btn-outline {
  background: transparent;
  border-color: var(--c-border);
  color: var(--c-muted);
}
.btn-outline:hover { background: #f8fafc; color: var(--c-text); }
.btn-sm { padding: .375rem .85rem; font-size: .82rem; }
.btn-full { width: 100%; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  border: 1px solid transparent;
  margin-bottom: 1rem;
}
.alert-icon { flex-shrink: 0; margin-top: .05rem; }
.alert-danger  { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #fecaca; }
.alert-success { background: var(--c-success-bg); color: var(--c-success); border-color: #bbf7d0; }
.alert-info    { background: var(--c-info-bg);    color: var(--c-info);    border-color: #bfdbfe; }
.alert-warning { background: var(--c-warning-bg); color: var(--c-warning); border-color: #fde68a; }

/* ── Leave balance table ─────────────────────────────────────── */
.balance-table { width: 100%; font-size: .855rem; border-collapse: collapse; }
.balance-table td { padding: .45rem .15rem; }
.balance-table td:last-child { text-align: right; font-weight: 700; color: var(--c-primary); }
.balance-table tr + tr td { border-top: 1px solid var(--c-border); }
.balance-divider td { padding: .1rem 0 !important; border-top: 2px solid var(--c-border) !important; }
.balance-label { color: var(--c-muted); }

/* ── Declaration box ─────────────────────────────────────────── */
.declaration-box {
  background: #f8fafc;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  font-size: .875rem;
}
.form-check { display: flex; align-items: flex-start; gap: .5rem; }
.form-check-input {
  width: 1rem;
  height: 1rem;
  margin-top: .2rem;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--c-primary);
}
.form-check-label { cursor: pointer; line-height: 1.5; }

/* ── Two-column layout ───────────────────────────────────────── */
.apply-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.25rem;
  max-width: 980px;
  margin: 1.5rem auto;
  padding: 0 1rem 2rem;
}
.apply-sidebar { align-self: start; position: sticky; top: 82px; }
.emp-info-block { margin-bottom: 1rem; }
.emp-info-block .name { font-weight: 700; font-size: .95rem; }
.emp-info-block .idnum { font-size: .8rem; color: var(--c-muted); }

@media (max-width: 720px) {
  .apply-layout { grid-template-columns: 1fr; }
  .apply-sidebar { position: static; }
  .auth-card-body { padding: 1.5rem; }
  .auth-card-header { padding: 1.5rem; }
}

/* ── Data table ──────────────────────────────────────────────── */
.page-wrap {
  max-width: 1060px;
  margin: 1.5rem auto;
  padding: 0 1rem 2rem;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.page-header h1 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.page-header p  { font-size: .82rem; color: var(--c-muted); margin: .1rem 0 0; }

.data-card { padding: 0; }
.data-card .table-wrap { overflow-x: auto; }

table.data-table { width: 100%; border-collapse: collapse; font-size: .855rem; }
table.data-table thead th {
  background: var(--c-primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .75rem 1rem;
  white-space: nowrap;
  border: none;
}
table.data-table tbody td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: #f8fafc; }

.badge-leave {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 700;
  background: var(--c-info-bg);
  color: var(--c-info);
  white-space: nowrap;
}

/* ── Utility ─────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--c-border); margin: 1rem 0; }
.d-flex  { display: flex; }
.d-none  { display: none; }
.gap-2   { gap: .5rem; }
.gap-3   { gap: .75rem; }
.mt-3    { margin-top: .75rem; }
.mb-3    { margin-bottom: .75rem; }
.mb-4    { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.ms-auto { margin-left: auto; }
.w-100   { width: 100%; }
.row { display: flex; flex-wrap: wrap; margin: 0 -.5rem; }
.row > [class^="col"] { padding: 0 .5rem; }
.col-6  { width: 50%; }
.col-12 { width: 100%; }
@media (max-width: 480px) { .col-6 { width: 100%; } }
.form-row { margin-bottom: .85rem; }
