* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at top left, rgba(34,197,94,0.22), transparent 28%),
              linear-gradient(180deg, #08180F 0%, #07120C 40%, #0D251A 100%);
  color: #F8FAF7;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(34,197,94,0.16), transparent 18%),
              radial-gradient(circle at 85% 15%, rgba(16,185,129,0.12), transparent 18%);
  pointer-events: none;
}
.page-center {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.brand-box {
  width: min(520px, calc(100% - 48px));
  background: rgba(4, 18, 11, 0.84);
  border: 1px solid rgba(34,197,94,0.18);
  border-radius: 24px;
  padding: 48px 36px;
  text-align: center;
  box-shadow: 0 34px 100px rgba(0,0,0,0.24);
}
.brand-logo {
  width: 130px;
  max-width: 100%;
  margin-bottom: 28px;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,0.3));
}
.brand-box h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 14px;
  letter-spacing: -0.03em;
}
.brand-box p {
  color: rgba(248,250,247,0.78);
  line-height: 1.8;
  margin-bottom: 32px;
}
.actions {
  margin-bottom: 18px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: linear-gradient(135deg, #22C55E, #10B981);
  color: #07120C;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(34,197,94,0.26);
}
.note {
  color: rgba(248,250,247,0.72);
  font-size: 14px;
}
.login-page {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #07120C 0%, #0B1E10 45%, #102E18 100%);
}
.login-split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  min-height: 100vh;
  height: 100vh;
}
.login-brand-panel {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(16,185,129,0.18), rgba(7,18,12,0.96));
  padding: 40px;
}
.login-brand-overlay {
  max-width: 420px;
  text-align: center;
}
.login-brand-logo {
  width: 140px;
  margin-bottom: 28px;
}
.login-brand-panel h2 {
  color: #F8FAF7;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin-bottom: 14px;
}
.login-brand-panel p {
  color: rgba(248,250,247,0.82);
  line-height: 1.8;
}
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 24px);
  background: rgba(4, 18, 11, 0.92);
  border: 1px solid rgba(34,197,94,0.16);
  border-radius: 28px;
  padding: 16px;
  box-shadow: 0 40px 110px rgba(0,0,0,0.28);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: auto;
}
.login-card-logo {
  width: 60px;
  margin: 0 auto 12px;
  display: block;
}
.login-card h1 {
  color: #F8FAF7;
  font-size: 1.6rem;
  margin-bottom: 8px;
  text-align: center;
}
.login-card p {
  color: rgba(248,250,247,0.76);
  text-align: center;
  margin-bottom: 12px;
}
.field {
  margin-bottom: 10px;
}
.field label {
  display: block;
  color: rgba(248,250,247,0.72);
  font-size: 0.85rem;
  margin-bottom: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #F8FAF7;
  border-radius: 16px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus {
  border-color: #22C55E;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.12);
}
.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}
.connection-status {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding: 18px;
  background: rgba(255,255,255,0.03);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
}
.connection-status p {
  margin: 0;
  color: rgba(248,250,247,0.85);
}
.app-feedback {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  min-height: 44px;
  line-height: 1.5;
}
.app-feedback.success {
  background: rgba(34,197,94,0.12);
  color: #def7ec;
  border: 1px solid rgba(34,197,94,0.3);
}
.app-feedback.error {
  background: rgba(248,113,113,0.12);
  color: #fee2e2;
  border: 1px solid rgba(248,113,113,0.3);
}
.btn-full {
  width: 100%;
}
.login-error {
  color: #fca5a5;
  text-align: center;
  font-size: 0.95rem;
  min-height: 1.3rem;
  margin-top: 8px;
}

.login-footnote {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.92rem;
  color: rgba(248,250,247,0.64);
  text-align: center;
}
.login-card-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.login-card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  overflow-y: auto;
  padding: 0 2px 0 0;
}
.login-card-body form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-card-body .field input {
  min-height: 44px;
}

.menu-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #07120C 0%, #0B1E10 45%, #102E18 100%);
}
.menu-split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  min-height: 100vh;
  height: 100vh;
}
.menu-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 36px;
}
.menu-card {
  width: 100%;
  max-width: 420px;
  background: rgba(4, 18, 11, 0.92);
  border: 1px solid rgba(34,197,94,0.16);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 40px 110px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.menu-card h1 {
  color: #F8FAF7;
  font-size: clamp(1.9rem, 3vw, 2.3rem);
  margin: 0;
  text-align: center;
}
.menu-card p {
  color: rgba(248,250,247,0.78);
  text-align: center;
  margin: 0;
}
.entity-grid {
  display: grid;
  gap: 14px;
}
.entity-card {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #F8FAF7;
  padding: 18px 20px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 1rem;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.entity-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34,197,94,0.4);
  background: rgba(255,255,255,0.08);
}
.menu-actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  color: #F8FAF7;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn-secondary:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.08);
  border-color: rgba(34,197,94,0.3);
}

.app-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #07120C 0%, #0B1E10 45%, #102E18 100%);
}
.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}
.app-sidebar {
  background: rgba(4, 18, 11, 0.96);
  border-right: 1px solid rgba(34,197,94,0.16);
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.app-brand {
  text-align: center;
}
.app-brand-logo {
  width: 80px;
  margin-bottom: 18px;
}
.app-sidebar h2 {
  color: #F8FAF7;
  font-size: 1.5rem;
  margin: 0;
}
.sidebar-title {
  color: rgba(248,250,247,0.72);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  margin-bottom: 10px;
}
.app-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.app-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  color: #F8FAF7;
  padding: 14px 18px;
  text-align: left;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.app-nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}
.app-nav-item:hover {
  background: rgba(255,255,255,0.08);
}
.app-nav-item.active {
  background: rgba(34,197,94,0.18);
  border-color: rgba(34,197,94,0.4);
  color: #E9FFF2;
}
.app-nav-item.active svg {
  opacity: 1;
  color: #28C46A;
}
.app-nav-item:focus-visible {
  outline: 2px solid rgba(34,197,94,0.45);
  outline-offset: 3px;
}
.app-sidebar-footer {
  margin-top: auto;
}
.app-main {
  padding: 36px 42px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.app-tag {
  display: inline-flex;
  margin-bottom: 14px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(248,250,247,0.7);
}
.app-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.4rem);
}
.app-toptext {
  color: rgba(248,250,247,0.78);
  max-width: 640px;
  line-height: 1.8;
}
.app-user-card {
  text-align: right;
}
.app-user-label {
  display: block;
  color: rgba(248,250,247,0.7);
  font-size: 0.85rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.app-user-card strong {
  display: block;
  font-size: 1.15rem;
}
.app-connection-summary {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.summary-card {
  background: rgba(10, 44, 24, 0.95);
  border: 1px solid rgba(34,197,94,0.16);
  border-radius: 20px;
  padding: 18px 20px;
}
.summary-label {
  display: block;
  color: rgba(248,250,247,0.75);
  font-size: 0.85rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.summary-card strong {
  display: block;
  color: #f8faf7;
  font-size: 1rem;
  line-height: 1.4;
}
.app-content {
  display: block;
}
.hidden-section {
  display: none;
}
.app-card {
  background: rgba(4, 18, 11, 0.92);
  border: 1px solid rgba(34,197,94,0.14);
  border-radius: 28px;
  padding: 30px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.18);
}
.app-card h2 {
  margin-top: 0;
  font-size: 1.8rem;
}
.app-card p {
  color: rgba(248,250,247,0.78);
  line-height: 1.75;
  margin: 1rem 0 0;
}
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.stat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-card span {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(248,250,247,0.72);
}
.stat-card strong {
  font-size: 1.6rem;
  color: #f8faf7;
}
.app-card-note {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.15);
}
.app-card-note p {
  margin: 0;
  color: rgba(248,250,247,0.85);
  line-height: 1.7;
}
.content-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  padding: 22px;
  min-height: 160px;
}
.content-card h3 {
  margin-top: 0;
}
.content-card p {
  color: rgba(248,250,247,0.8);
  line-height: 1.7;
}
.small-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(34,197,94,0.2);
  background: rgba(34,197,94,0.12);
  color: #D9FCE9;
  font-size: 0.95rem;
}
.upload-form {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}
.upload-form .field {
  margin-bottom: 0;
}
.data-section {
  margin-top: 24px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.preview-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  color: rgba(248,250,247,0.9);
}
.data-table-wrapper {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.data-table th,
.data-table td {
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px;
  text-align: left;
  color: rgba(248,250,247,0.92);
}
.data-table th {
  background: rgba(34,197,94,0.14);
  text-transform: uppercase;
  font-size: 0.85rem;
}
.data-table tbody tr:nth-child(odd) {
  background: rgba(255,255,255,0.03);
}

@media (max-width: 900px) {
  .login-split {
    grid-template-columns: 1fr;
    height: auto;
  }
  .login-brand-panel, .login-form-panel,
  .menu-brand-panel, .menu-panel {
    padding: 16px 14px;
  }
  .login-card, .menu-card {
    max-width: 100%;
    max-height: calc(100vh - 24px);
    padding: 14px 12px;
  }
  .login-card-logo {
    width: 60px;
    margin-bottom: 10px;
  }
  .login-card h1,
  .menu-card h1 {
    font-size: 1.45rem;
  }
  .login-card p,
  .menu-card p {
    margin-bottom: 10px;
  }
  .field input {
    padding: 10px 12px;
  }
  .btn-primary {
    padding: 10px 18px;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    padding: 20px;
  }
  .app-main {
    padding: 24px;
  }
  .app-user-card {
    width: 100%;
    text-align: left;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
}
