:root {
  --brand: #c8203f;
  --brand-dark: #a01a34;
  --brand-light: #fdeef1;
  --text: #222222;
  --muted: #6b6b6b;
  --border: #e2e2e2;
  --bg: #f5f5f7;
  --success: #1e8a4c;
  --danger: #c8203f;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--brand); }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--brand);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar img { height: 32px; display: block; }

.topbar .title {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}

.topbar .spacer { flex: 1; }

.topbar a.logout {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  opacity: 0.9;
  border: 1px solid rgba(255,255,255,0.5);
  padding: 6px 10px;
  border-radius: 20px;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 100px;
}

.centered-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 22px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.brand-header img {
  max-width: 220px;
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 14px;
}

.brand-header h1 {
  font-size: 18px;
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.brand-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 16px;
  color: var(--text);
}

label:first-of-type { margin-top: 0; }

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.file-input-wrap {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  background: #fafafa;
}

.file-input-wrap input[type="file"] {
  width: 100%;
  font-size: 14px;
}

.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.file-preview .thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

button, .btn {
  display: inline-block;
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  margin-top: 20px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:active { background: var(--brand-dark); }

.btn-secondary {
  background: #fff;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}

.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}

.btn-small {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
  margin-top: 0;
}

.links-row {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 13px;
}

.links-row a { text-decoration: none; }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fdeaea;
  color: #a01a2c;
  border: 1px solid #f5c2c2;
}

.alert-success {
  background: #eafaf0;
  color: #1e6b3a;
  border: 1px solid #b9e8c9;
}

.alert-info {
  background: var(--brand-light);
  color: var(--brand-dark);
  border: 1px solid #f3c9d2;
}

.issue-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  position: relative;
}

.issue-card .issue-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.issue-card .remove-issue {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  width: auto;
  margin: 0;
  padding: 0 6px;
  cursor: pointer;
}

.required-star { color: var(--brand); }

.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  padding-top: 16px;
  padding-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}

th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th { background: var(--brand-light); color: var(--brand-dark); }

.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-pending_approval { background: #fff4d9; color: #8a6d00; }
.status-approved { background: #e2f7e9; color: #1e6b3a; }
.status-rejected { background: #fdeaea; color: #a01a2c; }
.status-pending_email { background: #eee; color: #666; }

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 24px 0 10px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
  font-size: 14px;
}

@media (min-width: 640px) {
  .admin-wide { max-width: 900px; }
}
