/* Estilos globales */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --primary: #2a7ae2;
  --primary-dark: #1f5fc0;
  --text: #222;
  --muted: #666;
  --danger: #e74c3c;
  --success: #2d9c4b;
  --border: #dfe3ea;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--primary);
  color: #fff;
}

.brand {
  font-weight: 700;
  color: white;
}

.main-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.main-nav a,
.inline-form button {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.main-nav a:hover,
.inline-form button:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

main {
  padding: 24px;
}

.page-content {
  max-width: 1200px;
  margin: 0 auto;
}

.flash-container {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.flash {
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.flash-success { background: #e6f4ea; color: #1f6f37; }
.flash-error { background: #ffe8e6; color: #a8221f; }

.panel-overview,
.panel-list,
.panel-form,
.panel-detail,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  transition: transform 0.2s ease;
}

.card:hover { transform: translateY(-3px); }

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.button {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f8fafd;
}

th, td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

tr:last-child td { border-bottom: none; }

.filter-form,
.form-grid {
  display: grid;
  gap: 16px;
}

.filter-form {
  align-items: end;
  grid-template-columns: 1fr repeat(4, minmax(120px, 200px));
}

.form-grid label {
  display: grid;
  gap: 8px;
}

input[type="text"],
input[type="email"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfd;
}

textarea { min-height: 120px; resize: vertical; }

button, .button {
  cursor: pointer;
}

.checkbox-field {
  align-items: center;
  display: flex;
  gap: 10px;
}

.alert-cell {
  background: rgba(231, 76, 60, 0.08);
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
}

@media (max-width: 768px) {
  .filter-form {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
}
