:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e2e5ea;
  --primary: #2f6feb;
  --primary-dark: #244fb0;
  --danger-bg: #fdecec;
  --danger-text: #a4292b;
}

* { box-sizing: border-box; }

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

/* --- Login --- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: var(--card);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 360px;
}
.login-card h1 {
  font-size: 1.3rem;
  margin: 0 0 0.25rem;
}
.login-card .subtitle {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}
.login-card label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--muted);
}
.login-card input[type=password] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 1rem;
}
.login-card button {
  width: 100%;
  padding: 0.65rem;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  cursor: pointer;
}
.login-card button:hover { background: var(--primary-dark); }

.alert {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.alert-error { background: var(--danger-bg); color: var(--danger-text); }

/* --- App shell --- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 1.1rem; margin: 0; }
.logout-link { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.logout-link:hover { text-decoration: underline; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* --- Filters --- */
.filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: end;
  margin-bottom: 1rem;
}
.field { display: flex; flex-direction: column; min-width: 150px; }
.field-search { flex: 1 1 220px; }
.field-actions { flex-direction: row; gap: 0.5rem; margin-left: auto; }
.field label { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.3rem; }
.field select, .field input[type=text], .field input[type=date] {
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.filters button, .button-secondary {
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.filters button {
  border: 0;
  background: var(--primary);
  color: white;
}
.filters button:hover { background: var(--primary-dark); }
.button-secondary {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
}
.button-secondary:hover { background: var(--bg); }

.summary {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* --- Table --- */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
}
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
th, td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  background: #fafbfc;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  position: sticky;
  top: 0;
}
tbody tr:hover { background: #f8f9fb; }
td.empty { text-align: center; color: var(--muted); padding: 2rem; }

.status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: #eef0f3;
  color: var(--text);
}
.status-confirmed { background: #e3f6e8; color: #1c7c3f; }
.status-cancelled { background: #fdecec; color: #a4292b; }
.status-provisional { background: #fff4e0; color: #9a6300; }
.status-quotation { background: #eef0f3; color: #52565f; }
.status-no-show { background: #f0f0f0; color: #6b7280; }

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}
.pagination a { color: var(--primary); text-decoration: none; }
.pagination a:hover { text-decoration: underline; }
.per-page-form {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.per-page-form select {
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
