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

:root {
  --bg: #f0f2f5;
  --bg2: ##3498db;
  --panel: #2c3e50;
  --panel-overlay: rgba(44, 62, 80, 0.85);
  --text: #34495e;
  --text-light: #ffffff;
  --muted: var(--text);
  --primary: #27ae60;
  --primary-600: #229954;
  --primary-700: #1e8449;
  --secondary: #3498db;
  --green: #27ae60;
  --yellow: #f1c40f;
  --orange: #e67e22;
  --red: #e74c3c;
  --badge-paid: #27ae60;
  --badge-pending: #f1c40f;
  --border: #e0e0e0;
  --shadow: 0 4px 6px rgba(0,0,0,0.1);
  --input-bg: #ffffff;
  --input-text: #34495e;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
}

.sidebar {
  width: 250px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.sidebar .logo {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary);
}

.sidebar .menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar .menu a {
  display: block;
  padding: 12px 15px;
  color: var(--text-light);
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 5px;
  transition: background 0.2s ease, color 0.2s ease;
  font-weight: 600;
}

.sidebar .menu a:hover,
.sidebar .menu a.active {
  background: var(--primary);
  color: #fff;
}

.main-content {
  flex: 1;
  padding: 8px 20px;
  overflow-y: auto;
}

.container { max-width: 1200px; margin: 0 auto; padding: 28px; }
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.3s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.45); }
.subtitle { font-size: 14px; color: #000000 !important; margin-top: 6px; }


.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 18px; }

label { font-size: 13px; color: var(--muted); }
input, select, button, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--input-bg); color: var(--input-text); transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
}
button { cursor: pointer; }
button.primary { background: linear-gradient(180deg, var(--primary) 0%, var(--primary-600) 100%); border-color: var(--primary-700); color: #fff; font-weight: 600; box-shadow: 0 8px 18px rgba(37,99,235,0.25); }
button.primary:hover { filter: brightness(1.06); }
button.warn { background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%); border-color: #b91c1c; color: #fff; font-weight: 600; box-shadow: 0 8px 18px rgba(239,68,68,0.25); }
button.warn:hover { filter: brightness(1.06); }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: var(--running-color); /* Light gray background */
}
.row:hover { background: #fdfdfd; border-color: var(--primary); transform: translateY(-1px); }
.row + .row { margin-top: 10px; }
.row .actions { display:flex; gap:8px; align-items:center; justify-content:flex-end; }
.row .actions button { width: auto; }
.users-edit-form { grid-template-columns: 2fr 2fr 1fr auto; }
.users-edit-form input, .users-edit-form select { padding: 16px 18px; font-size: 16px; }

.progress {
  height: 12px; border-radius: 999px; background: rgba(11,18,32,0.85); border: 1px solid var(--border); overflow: hidden; box-shadow: inset 0 2px 6px rgba(0,0,0,0.35);
}
.progress > .bar { height: 100%; width: 0%; transition: width 0.3s ease; }
.bar.green {
  
}
.bar.yellow {
  background: var(--yellow);
}
.bar.orange { background: var(--orange); }
.bar.red { background: var(--red); }

.row.ended {
  border-color: var(--red);
  background: var(--expired-color);
}
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.0); opacity: 1; }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0.25); opacity: 0.85; }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.0); opacity: 1; }
}
.row.ended .ended-badge {
  animation: pulseGlow 1.2s ease-in-out infinite;
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border-color: var(--red);
}

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); }
.badge.paid { background: rgba(34, 197, 94, 0.12); color: var(--badge-paid); }
.badge.pending { background: rgba(245, 158, 11, 0.12); color: var(--badge-pending); }
.badge.icon { padding: 2px 6px; display:inline-flex; align-items:center; justify-content:center; }
.icon-sm { width: 16px; height: 16px; }
.btn-icon { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px; display:inline-flex; align-items:center; justify-content:center; }
.btn-icon:hover { filter: brightness(0.98); }
.btn-toggle-paid.paid { background: rgba(34, 197, 94, 0.12); border-color: #22c55e; }
.btn-toggle-paid.pending { background: rgba(245, 158, 11, 0.12); border-color: #f59e0b; }
.btn-checkout { background: #fff; }

.flash { padding: 12px; border-radius: 10px; margin-bottom: 12px; box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
flash.ok { background: rgba(34, 197, 94, 0.12); border: 1px solid var(--green); }
flash.err { background: rgba(239, 68, 68, 0.12); border: 1px solid var(--red); }

.footer { margin-top: 24px; font-size: 12px; color: var(--muted); text-align: center; opacity: 0.8; }


/* Menu lateral */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100%;
  background-color: #2c3e50;
  color: #ecf0f1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.sidebar a {
  color: #ecf0f1;
  text-decoration: none;
  margin: 10px 0;
  font-size: 18px;
}
.sidebar a:hover {
  background-color: #34495e;
  padding: 10px;
  border-radius: 5px;
}

/* Conteúdo principal */
.main-content {
  margin-left: 250px;
  padding: 20px;
}

.main-content.full-width {
  margin-left: 0;
}

/* Estilos adicionais para modernização */
body {
  font-family: 'Arial', sans-serif;
  background-color: #f4f4f4;
  color: #555;
}
button.primary {
  background-color: #3498db;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}
button.primary:hover {
  background-color: #2980b9;
}

button.danger {
  background-color: #dc3545;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}
button.danger:hover {
  background-color: #c82333;
}

#toggle-sidebar-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
  width: fit-content;
}

.sidebar.hidden {
  width: 0;
  padding: 20px 0;
  overflow: hidden;
}

.main-content.full-width {
  margin-left: 0;
}

.sidebar {
  transition: width 0.3s ease;
}

.main-content {
  transition: margin-left 0.3s ease;
}

@media (max-width: 768px) {
  .card {
    padding: 15px;
  }

  .main-content {
    margin-left: 0;
    padding: 10px;
  }

  .sidebar {
    display: none;
  }
  .row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .icon-sm { width: 14px; height: 14px; }
  .btn-icon { padding: 5px; }
}

.hidden {
    display: none;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.add-session-btn {
  background-color: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 24px;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.add-session-btn:hover {
  background-color: var(--primary-600);
}

.login-card {
  max-width: 400px;
  margin: 40px auto;
}

.form-group-remember {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.form-group-remember input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.form-group-remember label {
    margin: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  width: 90%;
  max-width: 360px;
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.modal-title { font-weight: 600; }
.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}
.modal-body { font-size: 14px; }

.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display:none; align-items:center; justify-content:center; z-index:1001; }
.confirm-overlay.open { display:flex; }
.confirm { background:#fff; border-radius:12px; padding:16px; width:90%; max-width:360px; box-shadow: var(--shadow); }
.confirm .confirm-title { font-weight:600; margin-bottom:8px; }
.confirm .confirm-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:12px; }
.btn { padding:8px 12px; border-radius:8px; border:1px solid var(--border); background:#fff; }
.btn.primary { background: var(--primary); color:#fff; border-color: var(--primary-700); }
.btn.secondary { background:#fff; }