:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --ink: #18212f;
  --muted: #667085;
  --line: #d9e2ec;
  --brand: #c4242d;
  --brand-dark: #971b23;
  --green: #147d64;
  --amber: #b7791f;
  --blue: #245d9c;
  --shadow: 0 18px 45px rgba(24, 33, 47, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 460px);
}

.brand-panel {
  background:
    linear-gradient(rgba(151, 27, 35, 0.78), rgba(151, 27, 35, 0.88)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1500&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  color: var(--brand);
  font-weight: 900;
  font-size: 30px;
  margin-bottom: 28px;
}

.logo-mark.small {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin: 0;
  font-size: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: currentColor;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-panel h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
}

.intro {
  max-width: 620px;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  line-height: 1.65;
}

.login-card {
  background: var(--surface);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.login-card h2,
.panel h3,
.topbar h2 {
  margin: 0;
}

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-weight: 700;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(196, 36, 45, 0.12);
}

button[type="submit"],
.secondary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.secondary-link {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-2);
  font-weight: 800;
  text-decoration: none;
}

.secondary-button {
  min-height: 38px;
  background: var(--ink);
  font-size: 14px;
}

.ghost-button {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.portal-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--ink);
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.side-brand span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  font-weight: 800;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.content {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.topbar .eyebrow {
  color: var(--brand);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
}

.user-chip span,
.avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.user-chip small {
  display: block;
  color: var(--muted);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 20px;
}

.stat-card span,
.details-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 30px;
}

.stat-card small {
  color: var(--muted);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.clean-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #344054;
}

.timeline,
.item-list {
  display: grid;
  gap: 12px;
}

.timeline-item,
.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 900;
}

.badge.approved,
.badge.present {
  background: rgba(20, 125, 100, 0.12);
  color: var(--green);
}

.badge.pending {
  background: rgba(183, 121, 31, 0.14);
  color: var(--amber);
}

.badge.info {
  background: rgba(36, 93, 156, 0.12);
  color: var(--blue);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.form-panel {
  display: grid;
  gap: 16px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.list-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.profile-header h3,
.profile-header p {
  margin: 0;
}

.profile-header p {
  color: var(--muted);
  margin-top: 4px;
}

.avatar {
  width: 68px;
  height: 68px;
  font-size: 24px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.details-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.details-grid strong {
  display: block;
  margin-top: 4px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
}

@media (max-width: 980px) {
  .login-view,
  .portal-view,
  .two-column {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 46vh;
    padding: 36px;
  }

  .login-card {
    padding: 32px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .stats-grid,
  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .content {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .list-item {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .brand-panel h1 {
    font-size: 38px;
  }
}
