:root {
  --orange: #f47a3c;
  --navy: #142d37;
  --navy-light: #1d3f4c;
  --cream: #fbf6ef;
  --ink: #1f2933;
  --border: #e3dccf;
  --danger: #c0392b;
  --success: #1e8a5f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "DM Sans", Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
}
a {
  color: var(--orange);
  text-decoration: none;
}

.shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.brand small {
  font-weight: 400;
  opacity: 0.7;
  font-size: 11px;
}
.brand-center {
  justify-content: center;
  margin-bottom: 8px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 10px 12px;
  border-radius: 8px;
  color: #d7e2e6;
  font-size: 14px;
}
.nav-link:hover {
  background: var(--navy-light);
  color: #fff;
}
.nav-link.active {
  background: var(--orange);
  color: #fff;
  font-weight: 600;
}
.logout-form button {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #3a5560;
  background: transparent;
  color: #d7e2e6;
  cursor: pointer;
  font: inherit;
}
.logout-form button:hover {
  background: var(--navy-light);
}

.content {
  flex: 1;
  min-width: 0;
  padding: 32px 40px;
  max-width: 1100px;
}
.topline h1 {
  margin: 0 0 20px;
  font-size: 24px;
  color: var(--navy);
}

.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
}
.flash-success {
  background: #e4f5ec;
  color: var(--success);
  border: 1px solid #b9e4cd;
}
.flash-error {
  background: #fbe8e5;
  color: var(--danger);
  border: 1px solid #f1c6bd;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}
.card h2 {
  margin-top: 0;
  font-size: 17px;
  color: var(--navy);
}
.card p.desc {
  color: #5f6b72;
  font-size: 13.5px;
  margin-top: -6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.tile img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #f1ece2;
  display: block;
}
.tile-body {
  padding: 14px;
}
.tile-body h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--navy);
}
.tile-body input[type="file"] {
  font-size: 12.5px;
  max-width: 100%;
}
.tile-body button {
  margin-top: 10px;
}

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--navy);
  font-weight: 600;
}
.field input[type="text"],
.field textarea {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fffaf3;
  color: var(--ink);
}
.field textarea {
  resize: vertical;
}
.hint {
  font-size: 12px;
  color: #8a7c66;
  font-weight: 400;
  margin: 0;
}

.form-actions {
  display: flex;
  gap: 10px;
}
button,
.button-link {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover,
.button-link:hover {
  background: #e06426;
}
button.secondary {
  background: #eee4d3;
  color: var(--navy);
}
button.secondary:hover {
  background: #e3d7bf;
}
button.danger {
  background: var(--danger);
}
button.danger:hover {
  background: #a3341f;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table th,
table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
table th {
  color: var(--navy);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.row-actions {
  display: flex;
  gap: 8px;
}
.row-actions form {
  display: inline;
}
.row-actions button {
  padding: 6px 10px;
  font-size: 12.5px;
}

.service-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.service-tabs a {
  padding: 8px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}
.service-tabs a.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.inline-add {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 18px;
}
.inline-add label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
}
.inline-add input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--navy);
}
.login-card {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
}
.login-card input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
}
.login-card button {
  margin-top: 4px;
  justify-content: center;
}
.login-card .brand span,
.login-card .brand small {
  color: var(--navy);
}

input,
textarea,
select {
  max-width: 100%;
  min-width: 0;
  font: inherit;
}
.card,
.tile,
.tile-body {
  min-width: 0;
  overflow-wrap: anywhere;
}
.card {
  overflow-x: auto;
}
.card input:not([type="checkbox"]):not([type="file"]),
.card textarea {
  width: 100%;
}
.card input[type="password"],
.card input[name="text"] {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #a8501d;
  outline-offset: 3px;
}
.service-tabs a {
  font-size: 12px;
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    width: 100%;
    padding: 16px;
    gap: 15px;
  }
  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .nav-link {
    text-align: center;
    padding: 10px 3px;
    font-size: 11px;
  }
  .sidebar .brand {
    justify-content: center;
  }
  .logout-form {
    align-self: center;
  }
  .logout-form button {
    padding: 8px 25px;
  }
  .content {
    max-width: none;
    padding: 22px 16px;
  }
  .topline h1 {
    font-size: 22px;
  }
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  }
  .card {
    padding: 17px;
  }
  .inline-add {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .inline-add label {
    min-width: 0;
  }
  table {
    min-width: 0;
  }
  table th,
  table td {
    padding: 8px 4px;
  }
  td form {
    flex-wrap: wrap;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .login-card {
    width: min(360px, calc(100% - 32px));
    padding: 24px;
  }
}
