* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f5f7;
  color: #2d2d2d;
  min-height: 100vh;
  padding: 30px 20px;
}

/* ── Layout ── */
.container {
  max-width: 100%;
  margin: 0 auto;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  
}

.container.wide {
  max-width: 100%;
}

/* ── Header ── */
.header {
  background: #1e2b3c;
  color: white;
  padding: 24px 28px;
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}

.header p {
  opacity: 0.6;
  font-size: 0.83rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.15s;
}

.nav-link:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-link.logout { border-color: rgba(220,80,60,0.4); color: rgba(255,150,140,0.9); }
.nav-link.logout:hover { background: rgba(220,80,60,0.15); }
.nav-link.admin-tab { border-color: rgba(255,200,60,0.4); color: rgba(255,220,100,0.95); }
.nav-link.admin-tab:hover { background: rgba(255,200,60,0.1); }

/* ── Login Page ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f4f5f7;
  padding: 20px;
}

.login-container {
  max-width: 400px;
  width: 100%;
}

.login-container .header {
  text-align: center;
  padding: 32px 28px 24px;
  border-radius: 10px 10px 0 0;
}

.login-container .header h1 {
  font-size: 1.35rem;
  margin-bottom: 6px;
}

.login-container .header p {
  font-size: 0.82rem;
  opacity: 0.55;
}

.login-note {
  text-align: center;
  padding: 14px 28px 24px;
  font-size: 0.78rem;
  color: #aaa;
}

/* ── Leave Balance Cards ── */
.balance-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px 28px 6px;
}

.balance-card {
  background: #f8f9fb;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.balance-card.casual {
  border-left: 3px solid #3b82f6;
}

.balance-card.sick {
  border-left: 3px solid #64748b;
}

.balance-card h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 4px;
}

.balance-number {
  font-size: 1.9rem;
  font-weight: 700;
  color: #1e2b3c;
  line-height: 1;
}

.balance-card p {
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 2px;
}

.balance-card-text { flex: 1; }

/* ── Form ── */
form {
  padding: 20px 28px 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input, select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e4e8;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.15s;
  outline: none;
  color: #2d2d2d;
  background: #fff;
}

input:focus, select:focus {
  border-color: #3b82f6;
}

.readonly-field {
  background: #f8f9fb !important;
  color: #999 !important;
  cursor: not-allowed;
  border-color: #eee !important;
}

.days-display {
  background: #f0f4ff;
  border: 1px solid #c7d7ff;
  border-radius: 6px;
  padding: 9px 12px;
  margin-bottom: 16px;
  color: #3b5bdb;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-submit {
  width: 100%;
  padding: 11px;
  background: #1e2b3c;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.02em;
}

.btn-submit:hover { background: #2d3f57; }
.btn-submit:active { background: #17202d; }

/* ── Alerts ── */
.alert {
  margin: 16px 28px 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.alert.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert a { color: inherit; font-weight: bold; }

/* ── Section Headings ── */
h2 {
  padding: 18px 28px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1px solid #f0f0f0;
}

/* ── Request Cards ── */
.request-card {
  margin: 0 28px 12px;
  border: 1px solid #e8eaed;
  border-left: 4px solid #e8eaed;
  border-radius: 8px;
  
}

.request-card.approved { border-left-color: #22c55e; }
.request-card.declined { border-left-color: #ef4444; }
.request-card.under-review { border-left-color: #f59e0b; }

.request-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8f9fb;
  border-bottom: 1px solid #e8eaed;
}

.request-details {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 18px;
}

.request-details p {
  font-size: 0.83rem;
  color: #666;
}

.leave-type {
  font-weight: 700;
  font-size: 0.83rem;
}

.leave-type.casual { color: #3b82f6; }
.leave-type.sick   { color: #64748b; }

/* ── Status Badges ── */
.status-badge {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.under-review {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fde68a;
}

.status-badge.approved {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-badge.rejected,
.status-badge.declined {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── Admin Table ── */
.table-wrapper {
  padding: 0 28px 20px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.admin-table th {
  background: #f8f9fb;
  padding: 9px 11px;
  text-align: left;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  border-bottom: 2px solid #e8eaed;
}

.admin-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #f3f4f6;
  color: #444;
}

.admin-table tr:hover td { background: #f8f9fb; }

/* ── Balance Pills ── */
.balance-pill {
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.balance-pill.casual { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.balance-pill.sick   { background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; }

/* ── Empty State ── */
.empty-state {
  padding: 28px;
  text-align: center;
  color: #bbb;
  font-size: 0.88rem;
}

/* ── Inline Admin Form ── */
.inline-form {
  padding: 0 28px 20px;
}

.form-row.four-col {
  grid-template-columns: 2fr 2fr 1fr 1fr;
}

.btn-small {
  width: auto;
  padding: 9px 20px;
  font-size: 0.85rem;
  margin-top: 6px;
}

/* ── Section note ── */
.section-note {
  padding: 0 28px 10px;
  font-size: 0.82rem;
  color: #aaa;
}

/* ── Manager Calendar ── */
.calendar-wrapper {
  padding: 0 28px 10px;
  overflow-x: auto;
}

.calendar-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 700px;
  width: 100%;
}

.calendar-table .emp-name-header {
  text-align: left;
  padding: 8px 14px;
  background: #f8f9fb;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  border: 1px solid #e8eaed;
  min-width: 150px;
  position: sticky;
  left: 0;
  z-index: 2;
}

.calendar-table th {
  padding: 7px 4px;
  text-align: center;
  font-weight: 600;
  font-size: 0.7rem;
  color: #888;
  border: 1px solid #e8eaed;
  background: #f8f9fb;
  min-width: 26px;
  width: 26px;
}

.calendar-table th.weekend-header {
  background: #fafafa;
  color: #ccc;
}

.calendar-table th.today-header {
  background: #1e2b3c;
  color: white;
}

.calendar-table .emp-name {
  padding: 7px 14px;
  font-weight: 600;
  font-size: 0.83rem;
  white-space: nowrap;
  border: 1px solid #e8eaed;
  position: sticky;
  left: 0;
  background: white;
  z-index: 1;
}

.cal-cell {
  text-align: center;
  border: 1px solid #f0f0f0;
  height: 26px;
  width: 26px;
  font-size: 0.72rem;
}

.cal-cell.weekend  { background: #fafafa; }
.cal-cell.today    { box-shadow: inset 0 0 0 2px #1e2b3c; }
.cal-cell.approved { background: #e0e7ff; color: #3730a3; font-weight: bold; }
.cal-cell.pending  { background: #fefce8; color: #854d0e; font-weight: bold; }

.calendar-legend {
  display: flex;
  gap: 20px;
  padding: 12px 28px 16px;
  font-size: 0.8rem;
  color: #666;
  border-top: 1px solid #f0f0f0;
}

.legend-item { display: flex; align-items: center; gap: 7px; }

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-dot.approved    { background: #e0e7ff; border: 1px solid #c7d2fe; }
.legend-dot.pending     { background: #fefce8; border: 1px solid #fde68a; }
.legend-dot.weekend-dot { background: #fafafa; border: 1px solid #e8eaed; }

/* ── Footer Link ── */
.footer-link {
  padding: 16px 28px;
  text-align: center;
  border-top: 1px solid #f0f0f0;
}

.footer-link a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
}

.footer-link a:hover { text-decoration: underline; }
