:root {
  --bg: #f6efe6;
  --surface: rgba(255, 250, 244, 0.84);
  --text: #1d2430;
  --muted: #667085;
  --line: rgba(29, 36, 48, 0.1);
  --primary: #c96a1b;
  --primary-dark: #8f4410;
  --accent: #104f55;
  --success: #1d7a45;
  --danger: #b42318;
  --warning: #e29a10;
  --shadow: 0 24px 60px rgba(61, 33, 7, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Outfit", sans-serif;
  background: linear-gradient(135deg, #f2e8d8 0%, #f8f4ee 45%, #efe3d0 100%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
  border: none;
}

.background-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.45;
  pointer-events: none;
}

.orb-one {
  width: 360px;
  height: 360px;
  background: rgba(201, 106, 27, 0.28);
  top: -120px;
  right: -80px;
}

.orb-two {
  width: 320px;
  height: 320px;
  background: rgba(16, 79, 85, 0.18);
  bottom: -100px;
  left: -100px;
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
  pointer-events: none;
}

#app {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: calc(100vh - 48px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card,
.panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-form p,
.muted,
.table-wrapper td,
.table-wrapper th,
.simple-brand p {
  color: var(--muted);
}

.simple-auth-card {
  width: min(560px, 100%);
}

.simple-brand {
  text-align: center;
  margin-bottom: 22px;
}

.simple-brand h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 3rem);
}

.auth-card {
  padding: 24px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.tab,
.primary-btn,
.ghost-btn,
.nav-btn,
.table-btn,
.status-badge {
  transition: 0.2s ease;
}

.tab {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  font-weight: 600;
}

.tab.active {
  background: linear-gradient(135deg, var(--primary), #e0a12c);
  color: white;
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.auth-form h2,
.section-title {
  margin: 0;
  font-size: 1.7rem;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(201, 106, 27, 0.2);
  border-color: rgba(201, 106, 27, 0.45);
}

textarea {
  resize: vertical;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.full {
  grid-column: 1 / -1;
}

.primary-btn,
.ghost-btn,
.nav-btn,
.table-btn {
  padding: 13px 18px;
  border-radius: 16px;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  box-shadow: 0 12px 24px rgba(201, 106, 27, 0.24);
}

.primary-btn:hover,
.nav-btn.active,
.table-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn,
.table-btn {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.dashboard-shell {
  display: grid;
  gap: 20px;
}

.topbar,
.section-head,
.profile-overview,
.stat-card,
.action-nav,
.table-actions,
.approval-actions {
  display: flex;
  align-items: center;
}

.topbar,
.panel {
  padding: 22px;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 10px 14px 10px 10px;
}

.profile-chip img,
#profileImage {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(201, 106, 27, 0.35);
  background: #fff;
}

.session-timer {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(16, 79, 85, 0.12);
  color: var(--accent);
  font-weight: 700;
}

.profile-panel {
  display: grid;
  gap: 18px;
}

.profile-overview {
  gap: 16px;
}

.profile-overview h3 {
  margin: 0 0 4px;
}

.stat-card {
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.stat-card strong {
  font-size: 1.8rem;
}

.action-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.nav-btn {
  min-height: 108px;
  padding: 14px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(242, 242, 242, 0.98));
  color: var(--text);
  border: 1px solid rgba(210, 214, 224, 0.95);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.35;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(13, 27, 62, 0.08);
}

.nav-btn.active {
  background: linear-gradient(180deg, #dc0d76, #b90970);
  color: white;
  border-color: transparent;
  box-shadow: 0 18px 38px rgba(220, 13, 118, 0.26);
}

.nav-icon {
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eceef3;
  color: #2d3392;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}

.nav-btn.active .nav-icon {
  background: rgba(255, 255, 255, 0.92);
  color: #c00a73;
}

.nav-text {
  font-weight: 700;
  font-size: 0.92rem;
}

.quick-links-panel {
  display: grid;
  gap: 12px;
}

.quick-links-hero {
  display: block;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #18308e, #3046b4 58%, #223a89);
  color: white;
}

.quick-links-hero h3 {
  margin: 8px 0 6px;
  font-size: 1.3rem;
}

.quick-links-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
}

.content-stack {
  display: grid;
  gap: 20px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.home-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 8px;
}

.home-card-wide {
  grid-column: span 2;
}

.home-card h4,
.home-card p {
  margin: 0;
}

.home-card strong {
  font-size: 1.8rem;
}

.page-section {
  display: grid;
  gap: 18px;
}

.section-head {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-body {
  display: grid;
  gap: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.data-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 14px;
}

.data-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.data-card img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  background: #fff;
}

.meta-list {
  display: grid;
  gap: 10px;
}

.meta-item strong {
  display: block;
  font-size: 0.84rem;
}

.meta-item span {
  color: var(--muted);
  word-break: break-word;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

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

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(29, 36, 48, 0.08);
  vertical-align: top;
}

th {
  color: var(--text);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-actions,
.approval-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.table-btn.danger {
  color: white;
  background: linear-gradient(135deg, #9e1c14, var(--danger));
}

.table-btn.success {
  color: white;
  background: linear-gradient(135deg, #166534, var(--success));
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-pending {
  background: rgba(226, 154, 16, 0.18);
  color: #9b6200;
}

.status-approved {
  background: rgba(29, 122, 69, 0.14);
  color: var(--success);
}

.status-rejected {
  background: rgba(180, 35, 24, 0.14);
  color: var(--danger);
}

.status-review {
  background: rgba(16, 79, 85, 0.14);
  color: var(--accent);
}

.empty-state {
  padding: 26px;
  border-radius: 18px;
  border: 1px dashed rgba(29, 36, 48, 0.2);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
}

.scheme-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.search-box {
  max-width: 360px;
}

#schemePdfViewer {
  margin-bottom: 16px;
}

#schemePdfFrame {
  width: 100%;
  min-height: 75vh;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.remark-note {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(16, 79, 85, 0.08);
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 1024px) {
  .auth-shell {
    justify-content: stretch;
  }
}

@media (max-width: 720px) {
  #app {
    width: min(100% - 20px, 1280px);
    padding-top: 10px;
  }

  .auth-card,
  .topbar,
  .panel {
    padding: 18px;
  }

  .grid.two,
  .tabs {
    grid-template-columns: 1fr;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .profile-chip {
    width: 100%;
    justify-content: flex-start;
  }

  .home-card-wide {
    grid-column: span 1;
  }
}

@media print {
  body {
    background: white;
  }

  .background-orb,
  .background-grid,
  .topbar,
  .action-nav,
  .profile-panel,
  .section-actions,
  .table-actions,
  .approval-actions,
  .ghost-btn,
  .primary-btn,
  .nav-btn {
    display: none !important;
  }

  .panel,
  .table-wrapper {
    box-shadow: none;
    background: white;
    border: none;
  }
}
