:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f3f4f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f4f6;
  color: #111827;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
}

textarea {
  resize: vertical;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 1rem;
}

.loading-screen,
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  padding: 2rem;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.auth-brand {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #2563eb;
  margin-bottom: 0.5rem;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  background: #2563eb;
  color: #ffffff;
  width: 100%;
}

.secondary-button {
  background: #e5e7eb;
  color: #111827;
  width: 100%;
}

.login-help,
.error-box,
.card {
  border-radius: 18px;
}

.login-help {
  margin-top: 1rem;
  background: #f9fafb;
  padding: 1rem;
  font-size: 0.95rem;
}

.error-box {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

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

.portal-sidebar {
  background: #111827;
  color: white;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.portal-brand {
  font-size: 1.3rem;
  font-weight: 800;
}

.portal-brand-sub {
  color: #9ca3af;
  margin-top: 0.35rem;
}

.portal-nav {
  display: grid;
  gap: 0.75rem;
}

.portal-nav a {
  color: white;
  text-decoration: none;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.portal-main {
  padding: 2rem;
}

.page-header h1 {
  margin: 0;
  font-size: 2rem;
}

.page-header p {
  color: #6b7280;
  margin-top: 0.5rem;
}

.card {
  background: #ffffff;
  padding: 1.25rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.status-card {
  min-height: 120px;
}

.status-label {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.status-value {
  font-size: 1.25rem;
  font-weight: 800;
}

.accent-success {
  border: 2px solid #bbf7d0;
}

.content-grid,
.tickets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-card h2,
.section-title,
.card h2 {
  margin-top: 0;
}

.table-responsive {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.inline-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

.section-header,
.back-row,
.message-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.simple-list {
  padding-left: 1.2rem;
}

.message-list {
  display: grid;
  gap: 1rem;
}

.message-item {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem;
}

.message-item p {
  margin-bottom: 0;
}

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

  .status-grid,
  .content-grid,
  .tickets-grid {
    grid-template-columns: 1fr;
  }
}
