/* ========== Base (mobile-first) ========== */
* { box-sizing: border-box }
html, body {
  margin: 0; padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  background: #f6f7fb; color: #111;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block }

/* Container */
.container { max-width: 980px; margin: 20px auto; padding: 0 12px }

/* Header + logo */
header { text-align: center; margin-bottom: 16px }
header h1 { margin: 8px 0 4px; font-size: 1.25rem; line-height: 1.2 }
header p { margin: 0; color: #444; font-size: .95rem }
.site-logo { max-width: 100%; height: auto; max-height: 64px; margin: 0 auto 8px }

/* Cards/sections */
.card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
  padding: 16px; margin: 12px 0; box-shadow: 0 2px 8px rgba(0,0,0,.04)
}
.card h2 { margin: 0 0 10px; font-size: 1.05rem }

/* Form layout — MOBILE FIRST: single column */
label { display:flex; flex-direction:column; gap:6px; font-weight:600; font-size:.95rem }
input[type=text],
input[type=email],
input[type=tel],
input[type=date],
select {
  width: 100%;
  border: 1px solid #cfd3d8; border-radius: 10px; padding: 12px 12px; font: inherit; background:#fff;
}
input:focus, select:focus { outline: 3px solid #e0e7ff; border-color: #6366f1 }

/* Touch-friendly checkboxes */
.checkbox { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.checkbox input[type=checkbox] { width: 20px; height: 20px }

/* File input list */
.file-list { list-style: none; margin: 10px 0 0; padding: 0; }
.file-list li {
  font-size:.95rem; padding:8px; border:1px dashed #cfd3d8; border-radius:8px; margin-bottom:6px; background:#fafafa
}

/* Buttons */
.actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 16px 0 }
button {
  appearance: none; border: none; background: #111; color: #fff;
  border-radius: 12px; padding: 14px 18px; font-weight: 700; cursor: pointer; width: 100%;
}
button.secondary { background: #6b7280 }
button:disabled { opacity: .5; cursor: not-allowed }

/* Footer */
footer.footnote { color:#555; margin-top: 20px; font-size: .9rem; text-align:center }

/* ========== Responsive Upscale ========== */
/* Larger phones / small tablets */
@media (min-width: 480px) {
  header h1 { font-size: 1.35rem }
  .site-logo { max-height: 72px }
}

/* Tablets and up: switch to 2-column layout where appropriate */
@media (min-width: 720px) {
  .container { padding: 0 16px }
  .card { padding: 20px }
  .card h2 { font-size: 1.15rem }
  .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px }
  .actions { grid-template-columns: auto auto; justify-content: flex-start }
  button { width: auto; min-width: 160px }
}

/* Desktops */
@media (min-width: 1024px) {
  header h1 { font-size: 1.6rem }
  .site-logo { max-height: 80px }
}


/* ========== Admin Panel Responsive ========== */

/* Toolbar (filters on dashboard) */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}
.toolbar label {
  flex: 1 1 160px;
}
.toolbar input {
  width: 100%;
  max-width: none;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  font-size: .9rem;
  text-align: left;
}
thead th {
  font-size: .8rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* Mobile: make tables scrollable */
@media (max-width: 720px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Pager (page navigation at bottom) */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.pager a, .pager span {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  font-size: .85rem;
}
.pager .active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Login form card */
.card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card form label {
  font-weight: 600;
}
.card form input[type=password] {
  padding: 10px 12px;
  border: 1px solid #cfd3d8;
  border-radius: 8px;
  font: inherit;
}
