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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f8f9fa;
  color: #212529;
  min-height: 100vh;
}

/* Nav */
nav {
  background: #2c3e50;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.nav-brand a { color: white; text-decoration: none; font-size: 1.2rem; font-weight: 600; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: #bdc3c7; text-decoration: none; font-size: .95rem; transition: color .2s; }
.nav-links a:hover { color: white; }

/* Main */
main { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1.5rem; font-size: .95rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Headings */
h1 { font-size: 1.6rem; margin-bottom: 1.5rem; color: #1a202c; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; color: #2d3748; }

/* Cards */
.card { background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.1); padding: 1.5rem; margin-bottom: 1.5rem; }

/* Table */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
thead { background: #2c3e50; color: white; }
th { padding: .75rem 1rem; text-align: left; font-weight: 600; font-size: .875rem; }
td { padding: .75rem 1rem; font-size: .9rem; border-bottom: 1px solid #e2e8f0; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f7fafc; }

/* Buttons */
.btn { display: inline-block; padding: .5rem 1rem; border-radius: 6px; font-size: .875rem; font-weight: 500; text-decoration: none; cursor: pointer; border: none; transition: opacity .2s; }
.btn:hover { opacity: .85; }
.btn-primary { background: #3498db; color: white; }
.btn-success { background: #27ae60; color: white; }
.btn-warning { background: #f39c12; color: white; }
.btn-danger  { background: #e74c3c; color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }

/* Form */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: .875rem; font-weight: 500; color: #4a5568; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=number], input[type=date], textarea, select {
  width: 100%; padding: .5rem .75rem; border: 1px solid #cbd5e0; border-radius: 6px;
  font-size: .9rem; background: white; transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 3px rgba(52,152,219,.15); }
textarea { min-height: 80px; resize: vertical; }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input[type=checkbox] { width: auto; }
.field_with_errors input, .field_with_errors select, .field_with_errors textarea { border-color: #e74c3c; }
#error_explanation { background: #fee2e2; border: 1px solid #fca5a5; border-radius: 6px; padding: 1rem; margin-bottom: 1rem; color: #991b1b; }
#error_explanation h2 { color: #991b1b; margin: 0 0 .5rem; }
#error_explanation ul { padding-left: 1.25rem; }

/* Badges */
.badge { display: inline-block; padding: .2rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-secondary { background: #e2e8f0; color: #4a5568; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem; }
.toolbar-right { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.search-box { display: flex; gap: .5rem; }
.search-box input { width: 220px; }

/* Detail layout */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-item { }
.detail-label { font-size: .75rem; font-weight: 600; color: #718096; text-transform: uppercase; letter-spacing: .05em; }
.detail-value { font-size: 1rem; color: #1a202c; margin-top: .15rem; }

/* Actions row */
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.5rem; }
