@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --accent: #e8a33d;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1c1f2a;
  --muted: #6b7280;
  --danger: #dc2626;
  --success: #16a34a;
  --border: #e5e7eb;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 10px rgba(16, 24, 40, .06), 0 2px 4px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 28px rgba(16, 24, 40, .10), 0 4px 10px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

.topbar {
  background: linear-gradient(120deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 0;
  padding: 16px 28px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { font-weight: 800; font-size: 1.15rem; color: #fff; letter-spacing: -.02em; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; }
.topbar nav a {
  color: rgba(255,255,255,.82);
  margin-left: 6px;
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,.14); text-decoration: none; }

.container {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px;
}

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .topbar nav a { margin-left: 0; margin-right: 4px; padding: 6px 10px; }
  .container { margin: 20px auto; padding: 0 14px; }
  h1 { font-size: 1.3rem; }
  .card { padding: 18px; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  transition: box-shadow .2s ease, transform .2s ease;
}

h1 { font-size: 1.6rem; margin-top: 0; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; margin-top: 0; }
h3 { font-weight: 700; }

.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .85rem; color: #374151; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=date], input[type=number], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow);
  transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--text); border: 1.5px solid var(--border); box-shadow: none; }
.btn.secondary:hover { background: #f9fafb; border-color: #d1d5db; color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.btn.small { padding: 7px 14px; font-size: .8rem; }
.btn.success { background: var(--success); }
.btn.success:hover { background: #15803d; }

table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: #f9fafb; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
tr:hover td { background: #fafbff; }

.badge { display:inline-flex; align-items:center; padding: 4px 12px; border-radius: 999px; font-size: .74rem; font-weight:700; letter-spacing: .01em; }
.badge.ok { background:#dcfce7; color:#166534; }
.badge.no { background:#fee2e2; color:#991b1b; }
.badge.warn { background:#fef3c7; color:#92400e; }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .9rem; border: 1px solid transparent; }
.alert.success { background:#f0fdf4; color:#166534; border-color:#bbf7d0; }
.alert.error { background:#fef2f2; color:#991b1b; border-color:#fecaca; }
.alert.info { background:var(--primary-light); color:var(--primary-dark); border-color:#c7d2fe; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.muted { color: var(--muted); font-size: .85rem; }
.actions-row { display:flex; gap:10px; flex-wrap: wrap; }

.table-usuarios {
  table-layout: fixed;
  min-width: 0;
}
.table-usuarios th, .table-usuarios td {
  padding: 10px 8px;
  overflow-wrap: break-word;
}
.table-usuarios select,
.table-usuarios input[type=date] {
  width: 100%;
  padding: 8px 4px;
  font-size: .78rem;
}
.table-usuarios .actions-row { gap: 6px; }
.table-usuarios .actions-row .btn.small { padding: 6px 8px; font-size: .78rem; }

.sort-bar { display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.sort-bar label { margin-bottom:0; font-size:.85rem; white-space:nowrap; }
.sort-bar select { width:auto; min-width:240px; }

.plan-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  background: #fff;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.plan-card.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: var(--shadow-md); }
.plan-card h3 { margin: 4px 0; }
.plan-card .price { font-size: 1.4rem; color: var(--primary); font-weight: 800; }

.login-wrap {
  max-width: 400px;
  margin: 90px auto;
}
@media (max-width: 640px) {
  .login-wrap { margin: 34px auto; }
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
  gap: 16px;
}
.file-grid .thumb {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1/1;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.file-grid .thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.file-grid .thumb img, .file-grid .thumb video { width: 100%; height: 100%; object-fit: cover; }
.file-grid .thumb form { position: absolute; top: 6px; right: 6px; }

/* Carrusel público */
.carousel-page { background:#0b0d14; min-height:100vh; color:#fff; display:flex; flex-direction:column; align-items:center; padding: 34px 12px; font-family: 'Inter','Segoe UI',Arial,sans-serif; }
.carousel-page h1 { color:#fff; font-weight: 800; letter-spacing: -.02em; }
.carousel {
  width: 100%;
  max-width: 640px;
  position: relative;
  background:#000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.carousel .slide { display:none; width:100%; }
.carousel .slide.active { display:block; }
.carousel .slide img, .carousel .slide video { width:100%; max-height: 80vh; object-fit: contain; display:block; margin:0 auto; background:#000; }
.carousel-controls { display:flex; justify-content:space-between; margin-top:16px; width:100%; max-width:640px; }
.carousel-controls .btn.secondary { background: rgba(255,255,255,.08); color:#fff; border-color: rgba(255,255,255,.18); }
.carousel-controls .btn.secondary:hover { background: rgba(255,255,255,.16); }
.carousel-counter { text-align:center; margin-top:12px; color:#9aa4b2; font-size:.85rem; letter-spacing:.03em; }

.qr-box { text-align:center; }
.qr-box img { border: 10px solid #fff; border-radius: 14px; box-shadow: var(--shadow-lg); }
