@import url('https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Oswald:wght@400;500;600;700&family=Open+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary:       #CC0000;
  --primary-dark:  #AA0000;
  --primary-light: #EE2222;
  --secondary:     #1A1A1A;
  --accent:        #FAA307;
  --bg:            #F2F2F2;
  --white:         #FFFFFF;
  --green:         #2D9E5F;
  --green-dark:    #1D7A45;
  --red:           #D62828;
  --gray:          #9E9E9E;
  --gray-light:    #E8E8E8;
  --gray-dark:     #555555;
  --text:          #1E1E1E;
  --text-light:    #666666;
  --border:        #D8D8D8;
  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 4px 24px rgba(0,0,0,0.09);
  --shadow-md:     0 8px 36px rgba(0,0,0,0.15);
  --font-h:        'Oswald', 'Arial Black', Arial, sans-serif;
  --font-b:        'Open Sans', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-b);
  font-size: 17px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-h);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.3px;
}

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

/* ======================== HEADER ======================== */
.site-header {
  background: var(--secondary);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo img {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.header-logo-text {
  font-family: var(--font-h);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1.5px;
  line-height: 1.1;
}

.header-logo-text span {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 3px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links .nav-page-link {
  color: rgba(255,255,255,0.82);
  font-size: 15px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  transition: all .2s;
  white-space: nowrap;
}

.nav-links .nav-page-link:hover { color: #fff; background: rgba(255,255,255,0.12); }

.nav-links .btn-nav-cta {
  background: var(--primary);
  color: var(--white) !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  transition: background .2s;
}

.nav-links .btn-nav-cta:hover { background: var(--primary-dark); }

.nav-links .btn-nav-festa {
  background: linear-gradient(135deg, #b8860b 0%, #D4A800 50%, #b8860b 100%);
  color: #1a0a00 !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .5px;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(212,168,0,.45), 0 2px 6px rgba(0,0,0,.4);
  transition: box-shadow .2s, transform .15s, background .2s;
  white-space: nowrap;
}

.nav-links .btn-nav-festa:hover {
  box-shadow: 0 0 18px rgba(212,168,0,.7), 0 2px 8px rgba(0,0,0,.5);
  transform: translateY(-1px);
  background: linear-gradient(135deg, #D4A800 0%, #ffe066 50%, #D4A800 100%);
  color: #1a0a00 !important;
}

.nav-user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.nav-user-name {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.nav-role-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.role-master-badge { background: linear-gradient(135deg,#FAA307,#CC0000); color: #fff; }
.role-admin-badge  { background: rgba(67,97,238,.25); color: #93AAFF; }

.nav-logout {
  color: rgba(255,255,255,0.45) !important;
  font-size: 14px;
  padding: 7px 10px;
  transition: color .2s;
}
.nav-logout:hover { color: rgba(255,255,255,0.75) !important; }

/* ======================== HERO ======================== */
.hero {
  background: linear-gradient(135deg, #111 0%, #330000 55%, #CC0000 100%);
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.hero::before {
  content: '🏀';
  position: absolute;
  font-size: 340px;
  opacity: 0.04;
  right: -60px;
  top: -60px;
  line-height: 1;
  pointer-events: none;
}

.hero-logo {
  height: 130px;
  width: auto;
  margin-bottom: 24px;
  filter: drop-shadow(0 8px 28px rgba(204,0,0,0.55));
}

.hero h1 {
  font-size: clamp(30px, 6vw, 62px);
  color: var(--white);
  margin-bottom: 14px;
  text-shadow: 0 2px 14px rgba(0,0,0,0.5);
}

.hero h1 span { color: var(--accent); }

.hero p {
  font-size: clamp(16px, 2.5vw, 21px);
  color: rgba(255,255,255,0.82);
  max-width: 580px;
  margin: 0 auto 36px;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ======================== BUTTONS ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-b);
  font-size: 17px;
  font-weight: 700;
  padding: 14px 26px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
  white-space: nowrap;
  min-height: 52px;
  letter-spacing: 0.2px;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 18px rgba(204,0,0,.38);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 6px 22px rgba(204,0,0,.48);
  transform: translateY(-1px);
  color: var(--white);
}

.btn-secondary { background: var(--secondary); color: var(--white); }
.btn-secondary:hover:not(:disabled) { background: #333; color: var(--white); transform: translateY(-1px); }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary); color: var(--white); }

.btn-outline-white { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.65); }
.btn-outline-white:hover:not(:disabled) { background: var(--white); color: var(--secondary); }

.btn-green { background: var(--green); color: var(--white); box-shadow: 0 4px 16px rgba(45,158,95,.32); }
.btn-green:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); color: var(--white); }

.btn-confirmed { background: var(--green-dark); color: var(--white); }
.btn-confirmed:hover:not(:disabled) { background: #155C35; color: var(--white); }

.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover:not(:disabled) { background: #B52020; color: var(--white); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--gray-dark); border: 1.5px solid var(--gray-light); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: rgba(204,0,0,.05); }

.btn-ghost-red:hover:not(:disabled) { border-color: var(--red); color: var(--red); background: rgba(214,40,40,.05); }

.btn-sm  { font-size: 14px; padding: 8px 16px; min-height: 38px; }
.btn-lg  { font-size: 19px; padding: 17px 34px; min-height: 58px; border-radius: 12px; }
.btn-full { width: 100%; }

/* ======================== LAYOUT ======================== */
.container    { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 520px;  margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section-title    { font-size: clamp(22px,4vw,34px); color: var(--secondary); margin-bottom: 8px; }
.section-subtitle { color: var(--text-light); font-size: 17px; margin-bottom: 36px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* ======================== PAGE HEADER ======================== */
.page-header { background: var(--secondary); padding: 36px 24px; }
.page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-header h1 { font-size: clamp(22px,4vw,34px); color: var(--white); margin-bottom: 4px; }
.page-header p  { color: rgba(255,255,255,.65); font-size: 15px; }

/* ======================== CARDS ======================== */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }

/* ======================== EVENTS ======================== */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.event-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  border-left: 6px solid var(--primary);
}

.event-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.event-card.recurrence-weekly  { border-left-color: #4361EE; }
.event-card.recurrence-monthly { border-left-color: #7B2D8B; }
.event-card.recurrence-once    { border-left-color: var(--green); }

.event-card-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--gray-light);
}

.event-title {
  font-family: var(--font-h);
  font-size: 21px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 10px;
  line-height: 1.2;
}

.event-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.badge-orange  { background: rgba(204,0,0,.12); color: var(--primary); }
.badge-green   { background: rgba(45,158,95,.12); color: var(--green-dark); }
.badge-blue    { background: rgba(67,97,238,.12); color: #4361EE; }
.badge-purple  { background: rgba(123,45,139,.12); color: #7B2D8B; }
.badge-gray    { background: var(--gray-light); color: var(--gray-dark); }

.event-card-body { padding: 18px 22px; }

.event-info-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.event-info-item { display: flex; align-items: flex-start; gap: 11px; font-size: 16px; }

.event-info-icon { font-size: 20px; width: 24px; text-align: center; flex-shrink: 0; margin-top: 1px; }

.event-info-text { flex: 1; }
.event-info-text strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}

.event-desc {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--gray-light);
}

.event-confirmations {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 16px;
  padding: 11px 14px;
  background: rgba(45,158,95,.07);
  border-radius: 8px;
}

.confirmations-count { font-weight: 800; color: var(--green); font-size: 22px; }

.event-card-footer { padding: 0 22px 20px; display: flex; flex-direction: column; gap: 10px; }

.event-admin-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ======================== FORMS ======================== */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 40px;
  margin: 44px auto;
}

.form-logo { text-align: center; margin-bottom: 24px; }
.form-logo img { height: 80px; width: auto; }

.form-title    { font-size: clamp(22px,4vw,30px); color: var(--secondary); text-align: center; margin-bottom: 6px; }
.form-subtitle { color: var(--text-light); text-align: center; margin-bottom: 28px; font-size: 15px; }

.form-group { margin-bottom: 22px; }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-label .req { color: var(--primary); margin-left: 3px; }

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-b);
  font-size: 17px;
  color: var(--text);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(204,0,0,.11);
}

.form-input::placeholder { color: var(--gray); }

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 46px;
}

.form-textarea { min-height: 100px; resize: vertical; }

.form-hint  { font-size: 13px; color: var(--text-light); margin-top: 5px; }

.form-error { font-size: 14px; color: var(--red); margin-top: 6px; display: none; }
.form-error.show { display: block; }

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

.form-divider {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin: 18px 0;
  position: relative;
}
.form-divider::before,
.form-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 28px);
  height: 1px;
  background: var(--gray-light);
}
.form-divider::before { left: 0; }
.form-divider::after  { right: 0; }

/* ======================== INFO BOX ======================== */
.info-box {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  margin-bottom: 22px;
  border-left: 4px solid;
  line-height: 1.55;
}
.info-box-orange { background: rgba(204,0,0,.08); border-color: var(--primary); color: #7A0000; }
.info-box-blue   { background: rgba(67,97,238,.08); border-color: #4361EE; color: #1A3A8F; }
.info-box-green  { background: rgba(45,158,95,.08); border-color: var(--green); color: #124D2E; }
.info-box-gray   { background: var(--gray-light); border-color: var(--gray); color: var(--gray-dark); }

/* ======================== ADMIN PANEL ======================== */
.admin-user-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
  transition: box-shadow .2s;
}
.admin-user-card:hover { box-shadow: var(--shadow-md); }

.admin-user-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.admin-user-info h3 { font-size: 19px; color: var(--secondary); margin-bottom: 5px; }
.admin-user-info p  { font-size: 14px; color: var(--text-light); }

.role-select {
  font-family: var(--font-b);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 24px;
  border: 2px solid var(--border);
  background: var(--white);
  cursor: pointer;
  color: var(--text);
  transition: border-color .2s;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.role-select:focus { outline: none; border-color: var(--primary); }
.role-select.is-admin { border-color: #4361EE; color: #3251C8; background-color: rgba(67,97,238,.06); }

/* ======== PERMISSION DOTS (BOLINHAS) ======== */
.permissions-section {
  border-top: 1px solid var(--gray-light);
  padding-top: 16px;
}

.permissions-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 13px;
}

.permissions-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.perm-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 24px;
  border: 2px solid transparent;
  transition: all .18s;
  user-select: none;
  font-size: 14px;
  font-weight: 600;
}

.perm-dot.clickable { cursor: pointer; }
.perm-dot.clickable:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.12); }

.perm-dot.on  { background: rgba(45,158,95,.10); border-color: var(--green); color: var(--green-dark); }
.perm-dot.off { background: var(--gray-light); border-color: var(--border); color: var(--gray); }

.dot-circle {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background .18s;
}
.perm-dot.on  .dot-circle { background: var(--green); box-shadow: 0 0 0 3px rgba(45,158,95,.22); }
.perm-dot.off .dot-circle { background: var(--gray); }

/* ======================== TOAST ======================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  padding: 16px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  transition: transform .32s cubic-bezier(.34,1.4,.64,1);
  max-width: 92vw;
  text-align: center;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--green); color: #fff; }
.toast-error   { background: var(--red); color: #fff; }
.toast-info    { background: var(--secondary); color: #fff; }

/* ======================== MODAL ======================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.58);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 460px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal h2 { font-size: 22px; margin-bottom: 10px; }
.modal p  { font-size: 16px; color: var(--text-light); margin-bottom: 26px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ======================== EMPTY STATE ======================== */
.empty-state { text-align: center; padding: 72px 24px; }
.empty-state-icon { font-size: 70px; margin-bottom: 18px; opacity: .45; }
.empty-state h3 { font-size: 22px; color: var(--gray-dark); margin-bottom: 8px; }
.empty-state p  { font-size: 16px; color: var(--text-light); max-width: 380px; margin: 0 auto 24px; }

/* ======================== ABOUT CARDS ======================== */
.about-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 22px; }

.about-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.about-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.about-card-icon { font-size: 46px; margin-bottom: 14px; }
.about-card h3   { font-size: 19px; margin-bottom: 7px; color: var(--secondary); }
.about-card p    { font-size: 15px; color: var(--text-light); }

/* ======================== FOOTER ======================== */
.site-footer { background: var(--secondary); color: rgba(255,255,255,.65); padding: 44px 24px; text-align: center; margin-top: auto; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-logo { height: 56px; margin-bottom: 16px; opacity: .88; }
.footer-links { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin: 16px 0; list-style: none; }
.footer-links a { color: rgba(255,255,255,.55); font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 13px; opacity: .45; margin-top: 12px; }

/* ======================== ADMIN STATS ======================== */
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 28px;
  box-shadow: var(--shadow);
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card .stat-val { font-size: 36px; font-family: var(--font-h); font-weight: 700; color: var(--primary); }
.stat-card .stat-lbl { font-size: 14px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* ======================== RESPONSIVE ======================== */
@media (max-width: 768px) {
  .header-logo-text { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 26px 18px; margin: 20px auto; }
  .page-header-inner { flex-direction: column; align-items: flex-start; }
  .hero { padding: 56px 20px; }
  .section { padding: 44px 0; }
  .container { padding: 0 16px; }
  .admin-user-header { flex-direction: column; }
  .modal-actions { flex-direction: column-reverse; }
  .modal { padding: 28px 20px; max-height: calc(100vh - 32px); }
  .modal-overlay { padding: 16px; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .events-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-logo { height: 90px; }
  .btn-lg { font-size: 17px; padding: 15px 24px; }
  .stats-row { flex-direction: column; }
}

/* ======================== HIERARCHY CARDS ======================== */
.hierarchy-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px;
  margin-bottom: 16px;
  transition: box-shadow .2s, transform .2s;
  border-left: 5px solid var(--gray);
}
.hierarchy-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.hierarchy-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hierarchy-name {
  font-family: var(--font-h);
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hierarchy-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

.hierarchy-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
}

/* ======================== PERMISSION GROUPS ======================== */
.perm-group { margin-bottom: 20px; }
.perm-group:last-child { margin-bottom: 0; }
.perm-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.perm-group-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--text-light);
  white-space: nowrap;
}
.perm-group-badge {
  font-size: 15px;
  flex-shrink: 0;
}
.perm-group-line { flex: 1; height: 1.5px; background: var(--border); border-radius: 2px; }

.perm-group-dots { margin-bottom: 14px; }
.perm-group-dots:last-child { margin-bottom: 0; }
.perm-group-dots-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-light);
  margin-bottom: 8px;
}

/* ======================== PERMISSION TOGGLE ROWS ======================== */
.perm-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 12px;
  border: 2px solid var(--gray-light);
  cursor: pointer;
  transition: all .18s;
  user-select: none;
  gap: 16px;
  margin-bottom: 10px;
}
.perm-toggle-row:hover { border-color: var(--primary); background: rgba(204,0,0,.03); }
.perm-toggle-row.active { border-color: var(--green); background: rgba(45,158,95,.06); }

.perm-toggle-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.perm-toggle-icon { font-size: 26px; flex-shrink: 0; width: 34px; text-align: center; }

.perm-toggle-label { font-size: 16px; font-weight: 700; color: var(--secondary); margin-bottom: 2px; }
.perm-toggle-desc  { font-size: 13px; color: var(--text-light); }

.perm-toggle-switch {
  width: 52px;
  height: 30px;
  border-radius: 15px;
  background: var(--gray-light);
  position: relative;
  flex-shrink: 0;
  transition: background .18s;
}
.perm-toggle-switch::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  top: 4px;
  left: 4px;
  transition: left .18s;
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
}
.perm-toggle-row.active .perm-toggle-switch { background: var(--green); }
.perm-toggle-row.active .perm-toggle-switch::after { left: 26px; }

/* ======================== COLOR PICKER ======================== */
.color-picker-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.color-option {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all .15s;
  flex-shrink: 0;
  outline: none;
}
.color-option:hover  { transform: scale(1.18); box-shadow: 0 4px 12px rgba(0,0,0,.22); }
.color-option.selected { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(0,0,0,.18); transform: scale(1.12); }

/* ======================== HIERARCHY MODAL ======================== */
.modal-lg {
  max-width: 600px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.modal-header h2 { font-size: 22px; margin: 0; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--gray);
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s;
  line-height: 1;
}
.modal-close:hover { color: var(--red); }

/* ======================== ADMIN USER CARD (NOVO) ======================== */
.admin-hierarchy-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
}

.hierarchy-select {
  font-family: var(--font-b);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--white);
  cursor: pointer;
  color: var(--text);
  transition: border-color .2s;
  width: 100%;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}
.hierarchy-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(204,0,0,.11); }

@media (max-width: 768px) {
  .perm-toggle-row { padding: 13px 14px; gap: 10px; }
  .perm-toggle-icon { font-size: 22px; width: 28px; }
  .perm-toggle-label { font-size: 15px; }
  .modal-lg { max-width: 100%; }
}
