:root {
  --bg: #f2f6fb;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --text: #10253f;
  --text-soft: #5c738f;
  --line: #dce7f2;
  --primary: #0f766e;
  --primary-strong: #0a5953;
  --danger: #b42318;
  --warning: #b54708;
  --success: #067647;
  --radius: 14px;
  --shadow: 0 10px 35px rgba(17, 48, 82, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background: var(--bg);
}

.background-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(15, 118, 110, 0.2) 0%, transparent 45%),
    radial-gradient(circle at 85% 88%, rgba(14, 116, 144, 0.18) 0%, transparent 38%),
    radial-gradient(circle at 55% 30%, rgba(251, 191, 36, 0.18) 0%, transparent 32%);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
  gap: 22px;
  padding: 18px;
}

.sidebar {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(160deg, #0f766e, #0e7490);
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
}

.brand p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.menu {
  display: grid;
  gap: 7px;
  overflow: auto;
  padding-right: 4px;
}

.menu-item {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.menu-item:hover {
  background: rgba(15, 118, 110, 0.08);
  color: var(--text);
}

.menu-item.active {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(14, 116, 144, 0.1));
  border-color: rgba(15, 118, 110, 0.24);
  color: var(--primary-strong);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.ghost-link {
  text-decoration: none;
  font-size: 0.86rem;
  color: var(--primary);
  font-weight: 700;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.topbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar h2 {
  margin: 0;
  font-size: 1.38rem;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

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

.panel-head h3 {
  margin: 0;
  font-size: 1.06rem;
}

.module-head {
  align-items: flex-start;
}

.module-head p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.85rem;
}

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

.btn,
button,
input,
select,
textarea {
  font-family: inherit;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-strong);
}

.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.btn.ghost:hover {
  background: var(--panel-soft);
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

thead {
  background: #eff5fb;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.88rem;
  vertical-align: top;
}

td.actions {
  min-width: 220px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 4px 8px;
}

.badge.pending {
  background: #fff2cc;
  color: #8f5e00;
}

.badge.success {
  background: #d1fae5;
  color: #065f46;
}

.badge.danger {
  background: #fee4e2;
  color: #912018;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.card .label {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.card .value {
  margin: 8px 0 0;
  font-size: 1.28rem;
  font-weight: 800;
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.settings-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.actions-row {
  display: flex;
  justify-content: flex-start;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 18, 36, 0.52);
  z-index: 10;
  padding: 16px;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: min(940px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px rgba(7, 23, 43, 0.26);
}

.modal-head {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 16px;
}

.form-row {
  display: grid;
  gap: 6px;
}

.form-row label {
  font-weight: 600;
  font-size: 0.86rem;
}

.form-row textarea {
  resize: vertical;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 16px;
  min-width: 220px;
  max-width: 400px;
  background: #0f172a;
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 12;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.actions-inline {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.small-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  font-size: 0.78rem;
  padding: 5px 8px;
  cursor: pointer;
}

.small-btn:hover {
  background: var(--panel-soft);
}

.small-btn.approve {
  border-color: #6ce9b3;
  color: #05603a;
  background: #ecfdf3;
}

.small-btn.reject {
  border-color: #f5b3ae;
  color: #912018;
  background: #fff0ef;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .sidebar {
    max-height: 300px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .module-head {
    flex-direction: column;
  }
}
