:root {
  --navy: #0b2b4c;
  --navy-dark: #071f39;
  --blue: #0f6fb8;
  --green: #6c9b2f;
  --green-dark: #557d22;
  --gold: #f5b23c;
  --white: #ffffff;
  --soft: #f3f7fb;
  --text: #182230;
  --muted: #637083;
  --border: #dce7f2;
  --danger: #b42318;
  --success: #027a48;
  --shadow: 0 24px 70px rgba(11, 43, 76, 0.10);
}

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

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(15, 111, 184, 0.14), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(108, 155, 47, 0.14), transparent 28%),
    linear-gradient(135deg, #eef7ff 0%, #f8fbff 50%, #f3f9ef 100%);
  color: var(--text);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  min-height: 100vh;
  background: transparent;
}

.sidebar {
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #08233f 0%, #0b2b4c 45%, #071f39 100%);
  color: var(--white);
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 14px 0 40px rgba(11, 43, 76, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: var(--white);
  padding: 5px;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.brand strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.brand small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.user-box {
  margin: 18px 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.user-box strong,
.user-box span,
.user-box small {
  display: block;
}

.user-box strong {
  font-size: 1rem;
}

.user-box span,
.user-box small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.side-nav {
  display: grid;
  gap: 9px;
}

.side-nav a {
  padding: 13px 15px;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: 0.2s ease;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  transform: translateX(2px);
}

.main-area {
  min-width: 0;
}

.topbar {
  min-height: 86px;
  margin: 18px 18px 0;
  padding: 20px clamp(18px, 3vw, 34px);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(220, 231, 242, 0.95);
  border-radius: 28px;
  box-shadow: 0 18px 55px rgba(11, 43, 76, 0.08);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 18px;
  z-index: 50;
}

.topbar h1 {
  color: var(--navy);
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.topbar p {
  color: var(--green-dark);
  font-size: 0.92rem;
  font-weight: 800;
}

.menu-btn {
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--navy);
  padding: 10px 13px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}

.content {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 70px;
}

.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(220, 231, 242, 0.95);
  border-radius: 32px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 3vw, 34px);
  margin-bottom: 20px;
}

.card h2,
.card h3 {
  color: var(--navy);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  letter-spacing: -0.045em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.card p {
  color: #526276;
  line-height: 1.75;
}

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

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

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

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

.stat-card,
.module-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(220, 231, 242, 0.95);
  border-radius: 28px;
  box-shadow: 0 20px 55px rgba(11, 43, 76, 0.09);
  padding: 26px;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -40px;
  top: -40px;
  border-radius: 50%;
  background: rgba(108, 155, 47, 0.10);
}

.stat-card strong {
  color: var(--green);
  display: block;
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.stat-card span {
  color: var(--navy);
  font-weight: 900;
  position: relative;
  z-index: 1;
}

.module-card {
  transition: 0.2s ease;
}

.module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 70px rgba(11, 43, 76, 0.13);
}

.module-card h3 {
  color: var(--navy);
  font-size: 1.15rem;
  letter-spacing: -0.035em;
  margin-bottom: 8px;
}

.module-card p {
  color: #526276;
  line-height: 1.7;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  border: 1px solid transparent;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
  transition: 0.2s ease;
  box-shadow: 0 14px 28px rgba(108, 155, 47, 0.20);
}

.btn:hover {
  background: var(--green-dark);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border-color: var(--border);
  box-shadow: none;
}

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

.btn-danger {
  background: var(--danger);
}

.btn-small {
  min-height: 40px;
  padding: 10px 16px;
  font-size: 0.92rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--white);
  box-shadow: 0 20px 55px rgba(11, 43, 76, 0.08);
}

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

th,
td {
  padding: 14px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--navy);
  background: #f4f9ff;
  font-size: 0.9rem;
  font-weight: 900;
}

td {
  color: #344054;
  font-size: 0.94rem;
}

tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 0.78rem;
}

.badge-success {
  color: var(--success);
  background: #ecfdf3;
}

.badge-danger {
  color: var(--danger);
  background: #fef3f2;
}

.badge-info {
  color: var(--blue);
  background: #eef7ff;
}

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

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

label {
  display: block;
  color: var(--navy);
  font-weight: 900;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 15px;
  font: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(15, 111, 184, 0.10);
}

.help {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 5px;
}

.alert {
  border-radius: 22px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-weight: 800;
  box-shadow: 0 16px 40px rgba(11, 43, 76, 0.06);
}

.alert-success {
  color: var(--success);
  background: #ecfdf3;
  border: 1px solid #abefc6;
}

.alert-error {
  color: var(--danger);
  background: #fef3f2;
  border: 1px solid #fecdca;
}

.alert-info {
  color: var(--blue);
  background: #eef7ff;
  border: 1px solid #b8ddff;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 18%, rgba(15, 111, 184, 0.22), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(108, 155, 47, 0.22), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(245, 178, 60, 0.16), transparent 30%),
    linear-gradient(135deg, #eef7ff 0%, #f8fbff 48%, #f3f9ef 100%);
}

.login-page::before {
  content: "";
  position: absolute;
  width: 720px;
  height: 720px;
  left: -260px;
  top: -260px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)),
    radial-gradient(circle, rgba(15, 111, 184, 0.18), transparent 62%);
  pointer-events: none;
}

.login-page::after {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  right: -220px;
  bottom: -220px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.55)),
    radial-gradient(circle, rgba(108, 155, 47, 0.18), transparent 62%);
  pointer-events: none;
}

.login-card {
  width: min(500px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(220, 231, 242, 0.95);
  border-radius: 34px;
  box-shadow: 0 30px 90px rgba(11, 43, 76, 0.16);
  padding: clamp(24px, 4vw, 36px);
  position: relative;
  z-index: 2;
  text-align: center;
  backdrop-filter: blur(14px);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 26px;
  border: 1px solid rgba(15, 111, 184, 0.08);
  pointer-events: none;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.login-logo img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 7px;
  box-shadow: 0 15px 36px rgba(11, 43, 76, 0.12);
}

.login-logo h1 {
  color: var(--navy);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  line-height: 1.05;
  font-size: clamp(1.8rem, 5vw, 2.25rem);
  margin: 0;
}

.login-logo p {
  color: var(--green-dark);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.login-card form {
  position: relative;
  z-index: 1;
  text-align: left;
}

.login-card label {
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.login-card input {
  background: var(--white);
  min-height: 52px;
}

.login-card .btn {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  box-shadow: 0 16px 35px rgba(108, 155, 47, 0.24);
}

.login-card .help {
  text-align: center;
  line-height: 1.5;
}

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

  .sidebar {
    position: fixed;
    left: -310px;
    top: 0;
    width: 285px;
    z-index: 100;
    transition: 0.25s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .menu-btn {
    display: inline-flex;
  }

  .topbar {
    margin: 12px 12px 0;
    border-radius: 24px;
    top: 12px;
  }

  .content {
    width: min(100% - 24px, 1120px);
  }

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

@media (max-width: 680px) {
  .content {
    width: min(100% - 18px, 1120px);
    padding: 18px 0 48px;
  }

  .topbar {
    min-height: 74px;
    margin: 10px 10px 0;
    padding: 15px 12px;
    border-radius: 20px;
    top: 10px;
  }

  .topbar h1 {
    font-size: 1.55rem;
  }

  .topbar p {
    display: none;
  }

  .card,
  .stat-card,
  .module-card {
    border-radius: 22px;
    padding: 20px;
  }

  .stats-grid,
  .grid-2,
  .grid-3,
  .form-row {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .login-page {
    padding: 14px;
  }

  .login-card {
    width: min(100%, 430px);
    border-radius: 28px;
    padding: 24px 20px;
  }

  .login-logo h1 {
    font-size: 1.68rem;
  }

  .login-logo img {
    width: 66px;
    height: 66px;
  }
}