* { box-sizing: border-box; }
body {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f4f5f7;
  margin: 0;
  color: #1f2430;
}
header.topbar {
  background: #1f2937;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
header.topbar a { color: #fff; text-decoration: none; }
header.topbar .brand { font-weight: 600; font-size: 1.1em; }
header.topbar nav a { margin-left: 16px; opacity: .9; }
header.topbar nav a:hover { opacity: 1; text-decoration: underline; }

.container { max-width: 1300px; margin: 20px auto; padding: 0 16px; }

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1f2937;
}
.login-box {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  width: 320px;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.login-box h1 { font-size: 1.2em; margin-top: 0; text-align: center; }

label { display: block; font-size: .85em; font-weight: 600; margin: 10px 0 4px; color: #444; }
input[type=text], input[type=password], select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #ccd0d8;
  border-radius: 6px;
  font-size: .95em;
}
textarea { resize: vertical; }

.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: .9em;
  transition: background .15s, transform .1s;
}
.btn:hover { background: #1d4ed8; }
.btn:active { transform: scale(.97); }
.btn.secondary { background: #eef0f3; color: #374151; }
.btn.secondary:hover { background: #e2e5ea; }
.btn.danger { background: #fee2e2; color: #991b1b; }
.btn.danger:hover { background: #fecaca; }
.btn.small { padding: 5px 12px; font-size: .78em; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.toolbar input[type=text] { width: 260px; }

table { width: 100%; border-collapse: collapse; font-size: .88em; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e8eaee; text-align: left; white-space: nowrap; vertical-align: top; }
th { background: #f0f1f4; position: sticky; top: 0; font-size: .82em; text-transform: uppercase; letter-spacing: .03em; color: #555; }
tr:hover td { background: #f8fafc; }
.table-scroll { overflow-x: auto; }

table.compact .sub { color: #8a8f98; font-size: .9em; }
table.compact td { white-space: normal; max-width: 220px; }

.col-actions {
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -6px 0 8px -6px rgba(0,0,0,.08);
  white-space: nowrap;
}
tr:hover .col-actions { background: #f8fafc; }
.col-actions .btn { margin-bottom: 4px; }

.badge { padding: 2px 9px; border-radius: 20px; font-size: .78em; font-weight: 600; }
.badge.normal { background: #e5e7eb; color: #374151; }
.badge.disponible { background: #dcfce7; color: #166534; }
.badge.ocupado { background: #fee2e2; color: #991b1b; }
.badge.revisar { background: #fde68a; color: #92400e; }

.actions a { margin-right: 8px; font-size: .85em; }

.pw-cell { font-family: monospace; display: block; color: #475569; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: .9em; }
.flash.ok { background: #dcfce7; color: #166534; }
.flash.err { background: #fee2e2; color: #991b1b; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.history-item { border-bottom: 1px solid #eee; padding: 10px 0; font-size: .88em; }
.history-item .meta { color: #888; font-size: .85em; }
