* { box-sizing: border-box; }

.portal-body {
  margin: 0;
  min-height: 100vh;
  padding: 20px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #151a6b 0%, #2a1fa0 55%, #4a3fd0 100%);
  color: #1c1f3a;
}

.portal-wide { width: 100%; max-width: 1100px; margin: 0 auto; }

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 10px 30px;
  border-bottom: 4px solid #f58442;
}

.portal-logo { display: block; height: 150px; width: auto; margin: 0 auto 10px; }
.portal-logo.small { height: 90px; margin: 0; }

.portal-user { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.portal-user span { color: #151a6b; font-weight: 600; }
.portal-user a { color: #2a1fa0; text-decoration: none; font-weight: 600; }
.portal-user a:hover { color: #f58442; }

.portal-subnav { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.portal-subnav a, .portal-subnav [aria-current="page"] {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid #dcdcec;
  border-radius: 10px;
  background: #f6f6fc;
  color: #2a1fa0;
  font-weight: 600;
  text-decoration: none;
}
.portal-subnav a:hover { background: #ecebfa; border-color: #aaa5d8; }
.portal-subnav a:focus-visible { outline: 3px solid #f58442; outline-offset: 2px; }
.portal-subnav [aria-current="page"] { background: #2a1fa0; border-color: #2a1fa0; color: #fff; }

.portal-card {
  background: #fff;
  padding: 35px 40px 40px;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.portal-card.narrow {
  width: 100%;
  max-width: 420px;
  margin: 6vh auto 0;
  border-radius: 20px;
  text-align: center;
}

.portal-card h1 { color: #151a6b; margin: 0 0 10px; }
.portal-card h2 { color: #151a6b; }
.portal-lead { color: #5a5f80; margin: 0 0 30px; }
.portal-empty, .portal-note { color: #5a5f80; }
.portal-note { font-size: 0.9em; margin-top: 25px; }

.portal-error, .portal-ok { padding: 10px 14px; border-radius: 8px; margin: 15px 0; }
.portal-error { background: #fdecea; color: #b3261e; }
.portal-ok { background: #e6f6ee; color: #11693f; }

.portal-form { display: flex; flex-direction: column; text-align: left; gap: 6px; margin-top: 15px; }
.portal-form label { font-weight: 600; color: #151a6b; margin-top: 8px; }
.portal-form input, .admin-row input[type="text"], .admin-row input[type="password"] {
  padding: 11px 12px;
  border: 2px solid #dcdcec;
  border-radius: 8px;
  font-size: 1em;
}
.portal-form input:focus, .admin-row input:focus { outline: none; border-color: #2a1fa0; }

.btn-portal {
  display: inline-block;
  margin-top: 14px;
  padding: 12px 24px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f58442, #e0692a);
  color: #fff;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn-portal:hover { box-shadow: 0 8px 20px rgba(245, 132, 66, 0.4); }
.btn-portal.secondary { background: linear-gradient(135deg, #2a1fa0, #151a6b); margin-top: 0; }
.admin-row .btn-portal { margin-top: 0; padding: 10px 18px; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }

.module-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: 16px;
  background: #f6f6fc;
  border-left: 5px solid #2a1fa0;
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.module-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(42, 31, 160, 0.2); border-left-color: #f58442; }
.module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #e6e4f8;
  color: #2a1fa0;
  transition: background 0.2s, color 0.2s;
}
.module-icon .mrh-icon { width: 28px; height: 28px; }
.module-card:hover .module-icon { background: #2a1fa0; color: #fff; }
.module-card h2 { margin: 10px 0 8px; }
.module-card p { color: #5a5f80; flex: 1; margin: 0 0 18px; }
.module-open { color: #f58442; font-weight: 700; }

.admin-user { border: 1px solid #e3e3ef; border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; }
.admin-user.inactive { opacity: 0.6; }
.admin-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 10px; }
.check { display: inline-flex; align-items: center; gap: 5px; color: #151a6b; }
