@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f3f7fc;
  --bg-soft: #e8f0f8;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #d6e2ef;
  --text: #15263b;
  --muted: #5f7389;
  --accent: #1f8b7a;
  --accent-2: #3cb39f;
  --warm: #f2a365;
  --danger: #d64557;
  --input: #f7faff;
  --shadow: 0 16px 36px rgba(36, 69, 103, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background: radial-gradient(1000px circle at 8% 6%, #dceafb 0%, #eef5fd 38%, #f5f8fc 100%);
}

.auth-page,
.app-page {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-orb,
.app-bg {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
}

.orb-1 {
  width: 340px;
  height: 340px;
  left: -110px;
  top: -110px;
  background: radial-gradient(circle, rgba(60, 179, 159, 0.24) 0%, rgba(60, 179, 159, 0) 72%);
}

.orb-2 {
  width: 430px;
  height: 430px;
  right: -150px;
  bottom: -150px;
  background: radial-gradient(circle, rgba(242, 163, 101, 0.22) 0%, rgba(242, 163, 101, 0) 74%);
}

.auth-layout {
  min-height: 100vh;
  width: min(1120px, 92%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.brand-panel,
.auth-card,
.sidebar,
.panel-card,
.topbar {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand-panel {
  padding: 44px;
  border-radius: 28px;
  background: linear-gradient(155deg, #ffffff 0%, #f7fbff 100%);
}

.brand-panel h1 {
  margin: 12px 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.brand-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #b4ddd5;
  color: #187665;
  background: #eaf8f4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.simple-list {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.simple-list li {
  padding: 12px 14px;
  background: #f6faff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #38526d;
}

.auth-card {
  padding: 34px;
  border-radius: 24px;
}

.auth-card h2 {
  margin: 0;
  font-size: 30px;
}

.muted {
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.form-stack label,
.entry-grid label,
.report-form label,
.user-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: #4f6580;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c5d7ea;
  background: var(--input);
  color: var(--text);
  padding: 11px 12px;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7cc7ba;
  box-shadow: 0 0 0 3px rgba(60, 179, 159, 0.16);
}

.check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.check input {
  width: auto;
  transform: scale(1.1);
}

.btn {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 11px 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
}

.btn-light {
  color: #2d4764;
  background: linear-gradient(135deg, #f4f9ff 0%, #e9f2fc 100%);
  border: 1px solid #cadcec;
}

.message {
  display: none;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #b8e2d9;
  background: #ebfaf5;
  color: #157a69;
  font-weight: 600;
}

.message.show {
  display: block;
}

.message.error {
  border-color: #efc4ca;
  background: #fff2f4;
  color: #b53c4f;
}

.hint {
  margin-top: 14px;
  font-size: 12px;
  color: #6a7f98;
}

.demo-shell {
  width: min(880px, 95%);
  margin: 24px auto;
  position: relative;
  z-index: 2;
}

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

.demo-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.demo-head h1 {
  margin: 10px 0 4px;
  font-size: 34px;
}

.demo-form {
  margin-top: 14px;
  display: flex;
  align-items: end;
  gap: 10px;
}

.demo-form label {
  display: grid;
  gap: 8px;
  width: min(380px, 100%);
  color: #4f6580;
  font-size: 13px;
}

.app-shell {
  width: min(1420px, 95%);
  margin: 18px auto;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}

.sidebar {
  border-radius: 20px;
  padding: 22px 16px;
  position: sticky;
  top: 14px;
  height: calc(100vh - 32px);
  background: linear-gradient(175deg, #ffffff 0%, #f5faff 100%);
}

.logo-wrap h1 {
  margin: 10px 0 0;
}

.menu {
  margin-top: 22px;
  display: grid;
  gap: 9px;
}

.menu-item {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #385270;
  background: #f8fbff;
  padding: 13px 12px;
  font-weight: 700;
  cursor: pointer;
}

.menu-item.active {
  color: #145f52;
  border-color: #b7ddd5;
  background: linear-gradient(135deg, #e8f8f4 0%, #f2fcf9 100%);
}

.menu-item.danger {
  color: #c03b4e;
  border-color: #efc4cc;
  background: #fff4f6;
}

.content {
  display: grid;
  gap: 8px;
  align-content: start;
  align-items: start;
}

.topbar,
.panel-card {
  border-radius: 16px;
  padding: 14px 16px;
}

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

.topbar h2 {
  margin: 0;
}

.topbar .muted {
  margin: 2px 0 0;
}

.user-box {
  text-align: right;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  background: #f7fbff;
  border-radius: 12px;
  padding: 10px 12px;
}

.panel-section {
  display: none;
}

.panel-section.active {
  display: block;
}

.panel-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.entry-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}

.entry-grid .wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row-tools {
  display: flex;
  gap: 8px;
  width: min(450px, 100%);
}

.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

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

.compact-table table {
  min-width: 800px;
}

.entries-table {
  min-width: 1080px;
}

.entries-table th,
.entries-table td {
  white-space: nowrap;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid #e2ecf5;
  font-size: 12px;
  text-align: left;
  vertical-align: top;
  color: #274462;
}

th {
  font-size: 11px;
  color: #4d6783;
  background: #f2f7fc;
  position: sticky;
  top: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.report-form,
.user-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
}

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

.summary-cards {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
}

.summary-cards article {
  background: linear-gradient(160deg, #ffffff 0%, #f4faff 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.summary-cards p {
  margin: 0;
  color: #5f7791;
  font-size: 12px;
}

.summary-cards strong {
  font-size: 25px;
  margin-top: 6px;
  display: block;
  color: #173556;
}

.charts-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.chart-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fbff;
}

.chart-box h4 {
  margin: 4px 0 10px;
  color: #2f4c6d;
}

canvas {
  width: 100%;
  height: 250px;
  border-radius: 10px;
  background: #f7fbff;
}

.status-pill {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.active {
  background: #e7f7f3;
  border: 1px solid #b7ddd5;
  color: #166b5d;
}

.status-pill.passive {
  background: #fff2f5;
  border: 1px solid #f1c8cf;
  color: #bd3f52;
}

.action-buttons {
  display: flex;
  gap: 6px;
}

.entries-table .action-buttons {
  flex-wrap: nowrap;
}

.small-btn {
  border: 1px solid #c7d9ea;
  border-radius: 8px;
  background: #f5faff;
  color: #345272;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 11px;
}

.danger-btn {
  border-color: #f0c3cc;
  background: #fff3f5;
  color: #be3e52;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(13, 26, 43, 0.32);
  z-index: 50;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(960px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(18, 43, 69, 0.2);
  padding: 14px;
}

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

.modal-head h3 {
  margin: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 10px;
}

.detail-item {
  border: 1px solid #d9e7f4;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
}

.detail-label {
  font-size: 12px;
  color: #5b7390;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 13px;
  color: #1f3d5c;
  font-weight: 600;
}

.app-bg-1 {
  width: 350px;
  height: 350px;
  left: 20%;
  top: -160px;
  background: radial-gradient(circle, rgba(60, 179, 159, 0.22) 0%, rgba(60, 179, 159, 0) 72%);
}

.app-bg-2 {
  width: 460px;
  height: 460px;
  right: -130px;
  bottom: -230px;
  background: radial-gradient(circle, rgba(242, 163, 101, 0.22) 0%, rgba(242, 163, 101, 0) 75%);
}

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

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

  .menu {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
  }

  .entry-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .report-form,
  .user-form {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
}

@media (max-width: 780px) {
  .auth-layout {
    grid-template-columns: 1fr;
    width: 94%;
    padding: 28px 0;
  }

  .brand-panel,
  .auth-card {
    padding: 22px;
  }

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

  .entry-grid,
  .report-form,
  .user-form,
  .summary-cards,
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .menu {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .row-tools {
    width: 100%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  .demo-form {
    flex-direction: column;
    align-items: stretch;
  }
}
