/* Minimal, Professional Design - Apple-inspired */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1d1d1f;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Design tokens */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #d2d2d7;
  --border-soft: #e5e5ea;
  /* Brand color (teal) */
  --primary: #0f766e;
  /* Subtle hover */
  --primary-hover: #0b5f59;
  --success: #34c759;
  --danger: #ff3b30;
  --warning: #ff9f0a;
  --shadow: none;
}

/* Header & Navigation */
header {
  border-bottom: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 30px;
  height: 50px;
  flex-wrap: nowrap;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
}

nav a:hover {
  color: #86868b;
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: calc(100vh - 50px);
  width: 100%;
}

/* Typography */
h1 {
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 16px;
}

h3 {
  font-size: 19px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 12px;
}

p {
  margin-bottom: 12px;
  color: var(--muted);
}

/* Lists */
ul {
  list-style: none;
  margin-bottom: 20px;
}

li {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}

li:last-child {
  border-bottom: none;
}

/* Forms */
form {
  margin-bottom: 30px;
}

form > div {
  margin-bottom: 20px;
}

form > div:last-of-type {
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  max-width: 400px;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #d2d2d7;
  border-radius: 4px;
  background-color: #ffffff;
  color: #1d1d1f;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #86868b;
}

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

/* Buttons */
button,
.button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  background-color: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  width: auto;
  max-width: none;
  margin-top: 0;
  box-shadow: 0 2px 10px rgba(10, 132, 255, 0.18);
}

button:hover,
.button:hover,
input[type="submit"]:hover {
  background-color: var(--primary-hover);
}

button:disabled {
  background-color: #e5e5ea;
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

button:disabled:hover {
  background-color: #d2d2d7;
}

/* Button variants */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(10, 132, 255, 0.18);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 1px 6px rgba(10, 132, 255, 0.14);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
  border-color: #b9b9c0;
  background: #f7f7f8;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-soft);
  box-shadow: none;
  padding: 8px 10px;
}

.btn-ghost:hover { background: rgba(0, 0, 0, 0.04); }

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Messages */
.messages {
  margin-bottom: 20px;
}

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

/* Status indicators */
.status-approved {
  color: var(--success);
}

.status-rejected {
  color: var(--danger);
}

.status-pending {
  color: var(--muted);
}

/* Cards */
.card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.card + .card { margin-top: 14px; }

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-soft);
  color: var(--muted);
  background: #fafafa;
}

.badge-success { color: #0b6b2a; background: rgba(52, 199, 89, 0.12); border-color: rgba(52, 199, 89, 0.18); }
.badge-warning { color: #7a4b00; background: rgba(255, 159, 10, 0.12); border-color: rgba(255, 159, 10, 0.18); }
.badge-danger { color: #7a0b07; background: rgba(255, 59, 48, 0.12); border-color: rgba(255, 59, 48, 0.18); }

/* Icon-only button/link */
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
  user-select: none;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  text-decoration: none;
}

.icon-btn:active {
  background: rgba(0, 0, 0, 0.06);
}

/* Link-style buttons (subtle) */
.link-button {
  background: none;
  border: none;
  color: var(--primary);
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  display: inline;
  width: auto;
  max-width: none;
  margin: 0;
}

.link-button:hover {
  text-decoration: underline;
  background: none;
  color: #0071e3;
}

.messages .error {
  background-color: rgba(255, 59, 48, 0.08);
  color: #7a0b07;
  border: 1px solid rgba(255, 59, 48, 0.18);
}

.messages .success {
  background-color: rgba(52, 199, 89, 0.10);
  color: #0b6b2a;
  border: 1px solid rgba(52, 199, 89, 0.18);
}

.messages .info {
  background-color: rgba(10, 132, 255, 0.08);
  color: #0a3d80;
  border: 1px solid rgba(10, 132, 255, 0.18);
}

.messages .warning {
  background-color: rgba(255, 159, 10, 0.12);
  color: #7a4b00;
  border: 1px solid rgba(255, 159, 10, 0.18);
}

/* Django form errors (rendered as <ul class="errorlist">) */
ul.errorlist {
  list-style: none;
  padding: 12px 16px;
  margin: 10px 0 0;
  border-radius: 4px;
  background-color: rgba(255, 159, 10, 0.12);
  color: #7a4b00;
  border: 1px solid rgba(255, 159, 10, 0.18);
  font-size: 14px;
}

ul.errorlist li {
  margin: 0;
  padding: 0;
  border: none;
}

/* Sections */
section {
  margin-bottom: 40px;
}

/* Small text */
small {
  font-size: 13px;
  color: #86868b;
}

/* Code */
code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 13px;
  background-color: #f5f5f7;
  padding: 2px 6px;
  border-radius: 3px;
  color: #1d1d1f;
}

/* Divider */
hr {
  border: none;
  border-top: 1px solid #d2d2d7;
  margin: 30px 0;
}

/* Debug/Info boxes */
div[style*="background"] {
  padding: 16px;
  margin: 20px 0;
  border-radius: 4px;
  border: 1px solid #d2d2d7;
}

/* QR Code container */
div[style*="text-align: center"] {
  margin: 20px 0;
}

div[style*="text-align: center"] img {
  max-width: 100%;
  height: auto;
}

/* Inline forms */
form[style*="display: inline"] {
  display: inline;
  margin: 0;
}

form[style*="display: inline"] button {
  margin-left: 10px;
  display: inline;
  width: auto;
  max-width: none;
  margin-top: 0;
}

/* Action group container */
.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
}

.action-group button,
.action-group a,
.action-group span,
.action-group form {
  margin: 0;
}

.action-group p {
  width: 100%;
  margin: 0;
}

/* Spacing utilities */
.mb-20 {
  margin-bottom: 20px;
}

.mt-20 {
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  nav a {
    font-size: 14px;
    white-space: nowrap;
  }

  main {
    padding: 24px 16px;
  }

  h1 {
    font-size: 28px;
    margin-bottom: 16px;
  }

  h2 {
    font-size: 22px;
    margin-bottom: 12px;
  }

  h3 {
    font-size: 18px;
    margin-bottom: 10px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea,
  select {
    max-width: 100%;
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  button,
  .button,
  input[type="submit"] {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
  }

  form {
    margin-bottom: 24px;
  }

  form[style*="display: inline"] {
    display: block !important;
    margin-left: 0 !important;
    margin-top: 8px;
  }

  form[style*="display: inline"] button {
    width: 100%;
    margin-left: 0;
  }

  .action-group {
    flex-direction: column;
    gap: 8px;
  }

  .action-group button,
  .action-group a,
  .action-group span,
  .action-group form {
    width: 100%;
    max-width: 100%;
  }

  .action-group form {
    width: 100%;
  }

  .action-group .link-button {
    width: 100%;
    text-align: left;
  }

  li {
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  section {
    margin-bottom: 32px;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 10px 12px;
    gap: 10px;
  }

  nav a {
    font-size: 13px;
  }

  main {
    padding: 20px 12px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 12px;
  }

  h2 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  h3 {
    font-size: 17px;
    margin-bottom: 8px;
  }

  button,
  .button,
  input[type="submit"] {
    width: 100%;
  }

  form[style*="display: inline"] {
    display: block !important;
    margin-left: 0 !important;
    margin-top: 8px;
  }

  form[style*="display: inline"] button {
    width: 100%;
    margin-left: 0;
  }

  .action-group {
    flex-direction: column;
    gap: 8px;
  }

  .action-group button,
  .action-group a,
  .action-group span,
  .action-group form {
    width: 100%;
    max-width: 100%;
  }

  .action-group form {
    width: 100%;
  }

  .action-group .link-button {
    width: 100%;
    text-align: left;
  }

  .action-group button,
  .action-group .button {
    text-align: center;
  }

  .button-secondary {
    margin-left: 0;
    text-align: center;
  }
}

