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

body {
  margin: 0;
  padding: 0 1.5rem 2.5rem;
  background-color: #f5f6fb;
  min-height: 100vh;
}

body > header,
body > main {
  max-width: 1200px;
  margin: 0 auto;
}

.layout-public > main {
  max-width: 640px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 0;
  gap: 1.5rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.8rem;
}

.brand p {
  margin: 0.3rem 0 0;
  color: #475569;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.app-nav {
  display: flex;
  gap: 0.75rem;
}

.app-nav a {
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: #1e293b;
  font-weight: 600;
}

.app-nav a.active {
  background: #2563eb;
  color: #fff;
}

.admin-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.admin-info {
  text-align: right;
  font-size: 0.9rem;
  color: #4b5565;
}

.link-button {
  border: none;
  background: transparent;
  color: #2563eb;
  font-weight: 600;
  cursor: pointer;
}

main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background-color: #fff;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

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

.metric {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border-radius: 16px;
  padding: 1rem;
}

.metric .label {
  font-size: 0.85rem;
  color: #64748b;
}

.metric .value {
  font-size: 1.8rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.muted {
  color: #64748b;
  margin: 0.25rem 0 0;
}

input,
select,
textarea {
  font: inherit;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #d3daf5;
  min-width: 200px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #2563eb33;
  border-color: #2563eb;
}

button {
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  background-color: #2563eb;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

th {
  color: #475569;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background-color: #f8fafc;
}

tbody tr.selected {
  background-color: #e0edff;
}

.warning {
  background: #fff8e1;
  border-radius: 12px;
  padding: 0.85rem;
  color: #92400e;
}

.status-banner,
.form-status {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #475569;
}

.status-banner[data-type="success"],
.form-status[data-type="success"] {
  color: #15803d;
}

.status-banner[data-type="error"],
.form-status[data-type="error"] {
  color: #dc2626;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: flex-end;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #475569;
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.checkbox input {
  min-width: auto;
}
.plan-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.form-grid .full-width {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

button.secondary {
  background-color: #e2e8f0;
  color: #1e293b;
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-card {
  border-top: 4px solid #2563eb;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.meta-list {
  margin: 0;
  padding: 0;
}

.meta-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed #e2e8f0;
}

.meta-list dt {
  font-weight: 600;
}

.meta-list dd {
  margin: 0;
  text-align: right;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.history ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: #475569;
}

.auth-card {
  text-align: center;
}

.auth-card button {
  width: 100%;
}

.history li {
  margin-bottom: 0.3rem;
}

.table-wrapper button {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  body {
    padding: 0 1rem 2rem;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-info {
    text-align: left;
  }

  input,
  select,
  textarea {
    min-width: 100%;
  }
}

