body.portal-body {
  background: #f0fdfa;
  font-family: Arial, Helvetica, sans-serif;
  color: #134e4a;
  overflow-x: hidden;
}

.portal-top {
  background: #0f766e;
  color: #fff;
  padding: calc(16px + env(safe-area-inset-top, 0)) 16px 0;
}

.portal-header h1 {
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  margin-bottom: 4px;
  line-height: 1.3;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: #fff;
}

.login-brand {
  text-align: center;
  margin-bottom: 12px;
}

.login-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.portal-header p {
  font-size: 0.875rem;
  opacity: 0.9;
}

.portal-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.portal-nav::-webkit-scrollbar { display: none; }

.portal-nav a {
  color: #ccfbf1;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.portal-nav a.active,
.portal-nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.portal-nav a.portal-nav-logout {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
}

.portal-nav a.portal-nav-logout:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fff;
}

.portal-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 12px calc(32px + env(safe-area-inset-bottom, 0));
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
  max-width: 100%;
}

.btn {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  line-height: 1.2;
  text-align: center;
}

.btn-primary { background: #0f766e; color: #fff; }
.btn-success { background: #059669; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #111827; }

.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
  background:
    linear-gradient(160deg, #ecfdf5 0%, #99f6e4 45%, #5eead4 75%, #0f766e 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  padding: 28px 24px;
  box-sizing: border-box;
  text-align: center;
  box-shadow:
    0 10px 40px rgba(15, 118, 110, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.6);
}

.login-card h1 {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  line-height: 1.25;
  text-align: center;
}

.login-card .login-subtitle {
  margin: 0 0 20px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.login-card form {
  text-align: left;
}

.login-card label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}

.login-card input {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}

.login-card button {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
}

.login-card .login-demo {
  margin: 16px 0 0;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}

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

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-active { background: #dcfce7; color: #166534; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-partial { background: #dbeafe; color: #1e40af; }
.badge-overdue { background: #fee2e2; color: #991b1b; }

@media (max-width: 480px) {
  .portal-content { padding-left: 10px; padding-right: 10px; }
  .card { padding: 14px; }
  .btn { width: 100%; }
}
