:root {
  --bg: #f5f7f7;
  --text: #171d1d;
  --muted-1: #3c4a4a;
  --muted-2: #4c5a5a;
  --muted-3: #7c8a8a;
  --border: #e2e9e9;
  --teal: #1e757c;
  --teal-dark: #135156;
  --teal-bg: #eef4f4;
  --teal-bg-2: #e6f1f2;
  --card-bg: #ffffff;
  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: 'Source Sans 3', sans-serif;
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

h1, h2, .brand-font {
  font-family: 'Archivo', sans-serif;
  letter-spacing: -0.01em;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.wrap-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- App shell header ---------- */

.app-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand-mark {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.app-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.app-nav a {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  color: var(--muted-1);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.app-nav button:hover,
.app-nav a:hover {
  background: var(--teal-bg);
  text-decoration: none;
}

.app-nav .active {
  background: var(--teal-bg-2);
  color: var(--teal-dark);
  font-weight: 700;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-box .who {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.user-box .name {
  font-size: 14px;
  font-weight: 600;
}

.user-box .logout {
  font-size: 12px;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(135deg, #123c40 0%, #1e757c 100%);
  color: #ffffff;
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-eyebrow {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9fd3d6;
}

.hero h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  max-width: 720px;
}

.hero p {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  max-width: 640px;
  color: #d7ebec;
}

/* ---------- Category grid ---------- */

.category-grid {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.category-card {
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.category-card:hover {
  box-shadow: 0 10px 28px rgba(23, 60, 63, 0.12);
  transform: translateY(-2px);
  border-color: #bcd7d9;
  text-decoration: none;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
  background: var(--dot-color, var(--teal));
  flex-shrink: 0;
}

.dot-lg {
  width: 14px;
  height: 14px;
}

.category-card .title {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.category-card .desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted-2);
}

/* ---------- Contacts ---------- */

.contacts-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contacts-section h2 {
  margin: 0;
  font-weight: 800;
  font-size: 24px;
}

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

.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal-bg-2);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.contact-card .name {
  font-weight: 700;
  font-size: 15px;
}

.contact-card .area {
  font-size: 13.5px;
  color: var(--muted-2);
  line-height: 1.4;
}

/* ---------- Category detail / form ---------- */

.category-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.back-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
}

.category-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-heading h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.15;
}

.category-heading .intro {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--muted-1);
  white-space: pre-line;
}

.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 700;
  font-size: 15px;
}

.field .hint {
  font-weight: 400;
  color: var(--muted-3);
  font-size: 0.85em;
}

.field input[type='text'],
.field input[type='email'],
.field input[type='password'],
.field textarea {
  border: 1px solid #cbd8d8;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--text);
  background: #ffffff;
}

.field textarea {
  resize: vertical;
  min-height: 140px;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.form-hint {
  font-size: 13.5px;
  color: var(--muted-3);
}

.btn {
  display: inline-block;
  padding: 13px 26px;
  background: var(--teal);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: var(--teal-dark);
  color: #fff;
  text-decoration: none;
}

.btn.secondary {
  background: transparent;
  color: var(--teal-dark);
  border: 2px solid var(--teal);
  padding: 11px 24px;
}

.btn.secondary:hover {
  background: var(--teal);
  color: #fff;
}

.error-list {
  background: #fdecec;
  border: 1px solid #f2b8b5;
  color: #9b1c1c;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.error-list ul {
  margin: 0;
  padding-left: 20px;
}

.success-banner {
  background: #e4f2ec;
  border: 1px solid #b9e0cc;
  color: #1e6e4a;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-weight: 600;
}

/* ---------- List (Bejegyzéseim) ---------- */

.list-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.list-header h1 {
  margin: 0;
  font-weight: 900;
  font-size: 30px;
}

.list-header .sub {
  font-size: 14px;
  color: var(--muted-3);
}

.list-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-row {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  text-decoration: none;
  color: var(--text);
}

.list-row .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 200px;
}

.list-row .category {
  font-weight: 700;
  font-size: 15.5px;
}

.list-row .excerpt {
  font-size: 14px;
  color: var(--muted-2);
  line-height: 1.45;
}

.list-row .date {
  font-size: 13.5px;
  color: var(--muted-3);
  white-space: nowrap;
}

.status-pill {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill.status-new {
  background: var(--teal-bg);
  color: var(--muted-1);
}

.status-pill.status-in_progress {
  background: #fdf3e3;
  color: #9a6414;
}

.status-pill.status-resolved {
  background: #e4f2ec;
  color: #1e6e4a;
}

.status-pill.status-closed {
  background: #eceff0;
  color: #55605f;
}

.empty-state {
  color: var(--muted-3);
  padding: 20px 0;
}

/* ---------- Login / SSO ---------- */

.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: linear-gradient(160deg, #fbfcfc 0%, #eef4f4 60%, #dcebec 100%);
  padding: 24px;
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(23, 60, 63, 0.1);
  padding: 52px 48px;
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.login-card .app-title {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--text);
}

.login-card .app-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted-1);
}

.btn-ms365 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: var(--text);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ms365:hover {
  background: var(--teal);
}

.ms365-icon {
  display: grid;
  grid-template-columns: 9px 9px;
  grid-template-rows: 9px 9px;
  gap: 2px;
}

.ms365-icon span {
  display: block;
}

.ms365-icon span:nth-child(1) { background: #f25022; }
.ms365-icon span:nth-child(2) { background: #7fba00; }
.ms365-icon span:nth-child(3) { background: #00a4ef; }
.ms365-icon span:nth-child(4) { background: #ffb900; }

.login-note {
  font-size: 13px;
  color: var(--muted-3);
  line-height: 1.5;
}

.login-domain {
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted-3);
}

/* ---------- Footer ---------- */

.app-footer {
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

.app-footer .wrap {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted-3);
}

/* ---------- Generic redirect CTA ---------- */

.redirect-box {
  text-align: center;
  padding: 20px 0 6px;
}

/* ---------- Admin ---------- */

.admin-shell {
  min-height: 100vh;
  background: #f2f5f5;
}

.admin-topbar {
  background: #123c40;
  color: #fff;
  padding: 14px 0;
}

.admin-topbar .wrap {
  max-width: 1100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-topbar a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-family: 'Archivo', sans-serif;
}

.admin-topbar form {
  display: inline;
}

.admin-topbar button.link {
  background: none;
  border: none;
  color: #cfe6e8;
  cursor: pointer;
  font-size: 0.9rem;
}

.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.login-card-admin {
  max-width: 380px;
  margin: 90px auto;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(23, 60, 63, 0.1);
  padding: 36px;
}

.login-card-admin h1 {
  color: var(--text);
  font-size: 1.3rem;
  margin-top: 0;
}

.status-counts {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.status-summary-pill {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--muted-2);
}

.status-summary-pill strong {
  color: var(--text);
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.filter-bar select,
.filter-bar input[type='text'] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.submission-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.submission-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
}

.submission-row .meta {
  flex: 1;
  min-width: 0;
}

.submission-row .meta .top-line {
  font-weight: 600;
  color: var(--text);
}

.submission-row .meta .snippet {
  color: var(--muted-2);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 24px rgba(23, 60, 63, 0.06);
  padding: 28px;
  margin-bottom: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 760px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.kv {
  margin-bottom: 12px;
}

.kv .k {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-3);
}

.kv .v {
  font-size: 1rem;
}

.message-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  white-space: pre-line;
}

.note {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.note:last-child {
  border-bottom: none;
}

.note .author {
  font-weight: 700;
  color: var(--text);
  font-size: 0.9rem;
}

.note .when {
  color: var(--muted-3);
  font-size: 0.78rem;
  margin-left: 6px;
}

form.inline-select {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

form.inline-select select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
}
