:root {
  --deep-blue: #114b7a;
  --ocean-teal: #1d8c8c;
  --sand-light: #e9e3d5;
  --coral-accent: #e57c45;
  --dark-slate: #26343d;
  --bg: #f4f7fa;
  --card: #ffffff;
  --line: #d9e1e8;
  --ink: #23303a;
  --muted: #64748b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 520px at 100% 0%, rgba(29, 140, 140, 0.14), transparent 68%),
    radial-gradient(900px 520px at 0% 100%, rgba(17, 75, 122, 0.12), transparent 70%),
    var(--bg);
}

a {
  color: var(--deep-blue);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: linear-gradient(165deg, #103e66 0%, #114b7a 40%, #0f385c 100%);
  color: #dff3ff;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(10, 22, 35, 0.22);
  border: 1px solid rgba(233, 227, 213, 0.24);
}

.brand-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(17, 75, 122, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(4, 19, 33, 0.24);
}

.brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 7px;
}

.brand-title {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-title .accent {
  color: var(--coral-accent);
}

.sidebar-nav {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #dbf6ff;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
}

.nav-link-item i {
  font-size: 1rem;
}

.nav-link-item > span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sidebar .nav-cascade-toggle {
  width: 100%;
  justify-content: space-between;
  border: 1px solid transparent;
  background: transparent;
  color: #dbf6ff;
  text-align: left;
  box-shadow: none;
  padding: 10px 12px;
}

.sidebar .nav-cascade-toggle:hover {
  filter: none;
}

.nav-link-item:hover,
.nav-link-item.active {
  color: #fff;
  background: rgba(29, 140, 140, 0.25);
  border-color: rgba(233, 227, 213, 0.24);
}

.nav-submenu {
  display: none;
  margin: 2px 0 4px 8px;
  padding-left: 8px;
  border-left: 1px dashed rgba(233, 227, 213, 0.35);
}

.nav-submenu.open {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-sublink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #cde8f8;
  text-decoration: none;
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.nav-sublink:hover,
.nav-sublink.active {
  color: #fff;
  background: rgba(29, 140, 140, 0.22);
  border-color: rgba(233, 227, 213, 0.2);
}

.nav-sublink i {
  font-size: 0.92rem;
}

.sidebar-foot {
  margin-top: auto;
  border: 1px solid rgba(233, 227, 213, 0.24);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 22, 36, 0.2);
  font-size: 0.87rem;
}

.sidebar-foot .logout-link {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid rgba(233, 227, 213, 0.25);
  border-radius: 8px;
}

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

.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--dark-slate);
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.9rem;
}

.container {
  max-width: 100%;
  margin: 0;
  padding: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 26px rgba(15, 32, 51, 0.05);
}

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

.inline {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.inline > * {
  flex: 1;
  min-width: 150px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: #34465a;
  font-size: 0.95rem;
  font-weight: 600;
}

input,
select,
button,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #c5d2df;
  border-radius: 10px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ocean-teal);
  box-shadow: 0 0 0 3px rgba(29, 140, 140, 0.17);
}

button {
  border: none;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(120deg, var(--ocean-teal), #157979);
}

button:hover {
  filter: brightness(0.97);
}

button.secondary {
  background: linear-gradient(120deg, #25384a, #1f2d3d);
}

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

th,
td {
  border-bottom: 1px solid #e5ecf3;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #27384b;
  font-size: 0.92rem;
  font-weight: 800;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(29, 140, 140, 0.15);
  color: #0c6262;
  font-size: 0.82rem;
  font-weight: 700;
}

.error {
  color: #b91c1c;
  margin: 8px 0;
}

.login-wrap {
  max-width: 460px;
  margin: 70px auto;
}

img.preview {
  max-width: 180px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

img.preview-sm {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
  border-radius: 6px;
  border: 1px solid var(--line);
  object-fit: cover;
}

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

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

  .topbar {
    position: relative;
  }
}

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

.stat-card {
  margin: 0;
  border-radius: 14px;
  color: #fff;
  min-height: 122px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card .stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.stat-card .stat-title {
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 0.95;
}

.stat-card .stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  font-size: 1rem;
}

.stat-card .stat-value {
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1;
}

.grad-blue {
  background: linear-gradient(130deg, #114b7a 0%, #1b5f96 100%);
}

.grad-teal {
  background: linear-gradient(130deg, #1d8c8c 0%, #2ba7a7 100%);
}

.grad-coral {
  background: linear-gradient(130deg, #e57c45 0%, #f09567 100%);
}

.grad-slate {
  background: linear-gradient(130deg, #26343d 0%, #3a4e5a 100%);
}

.chart-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 320px;
}

.chart-wrap.chart-wrap-sm {
  height: 280px;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 46px rgba(20, 39, 60, 0.14);
  background: #fff;
}

.login-brand-panel {
  padding: 34px 30px;
  color: #e7f6ff;
  background:
    radial-gradient(420px 220px at 12% 18%, rgba(229, 124, 69, 0.28), transparent 72%),
    radial-gradient(420px 260px at 100% 100%, rgba(29, 140, 140, 0.34), transparent 74%),
    linear-gradient(155deg, #103e66 0%, #114b7a 52%, #0f3759 100%);
}

.login-logo-badge {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.38);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.login-logo-badge img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.login-brand-panel h1 {
  margin: 18px 0 8px;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.login-brand-panel .accent {
  color: var(--coral-accent);
}

.login-brand-panel p {
  margin: 0 0 20px;
  color: #cde8f8;
}

.login-feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
}

.login-feature-list div {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(233, 227, 213, 0.24);
  background: rgba(5, 20, 32, 0.18);
}

.login-form-panel {
  padding: 34px 30px;
}

.login-form-panel h2 {
  margin: 0 0 6px;
  font-size: 1.8rem;
  color: var(--dark-slate);
}

.login-subtitle {
  margin: 0 0 16px;
  color: #64748b;
}

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

  .login-brand-panel,
  .login-form-panel {
    padding: 22px;
  }
}
