:root {
    --cream: #f7f1e3;
    --tan: #e6d3a3;
    --nav-brown: #3b2a18;
    --brown: #5c3d1e;
    --dark-brown: #2a1b0d;
    --gold: #c7a44c;
    --select-bg: #f2e7d5;
}

html {
    background: var(--nav-brown);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    padding-top: 0px;
    background: var(--cream);
    color: var(--dark-brown);
    transition: opacity 0.25s ease;
}

body.loaded {
    opacity: 1;
}

/* NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 26px 50px;
    background: var(--nav-brown);
    color: white;

    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.nav-links.loading {
    opacity: 0.5;
}

.nav-placeholder {
    margin-left: 30px;
    color: white;
    opacity: 0.35;
    font-weight: 600;
    letter-spacing: 0.4px;
    pointer-events: none;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.troop-name{
    font-weight: bold;
    font-size: 22px;
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.troop-name:hover{
    color: var(--gold);
}

.nav-title {
    font-size: 16px;
    opacity: 0.9;
}

.nav-links a {
    margin-left: 30px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    letter-spacing: 0.4px;
    transition: 0.2s;
}

.nav-links a:hover {
    color: var(--gold);
}

/* HERO */
.hero {
    padding: 150px 20px 70px;
    text-align: center;
    background: linear-gradient(
        rgba(59,42,24,0.85),
        rgba(59,42,24,0.85)
    ),
    url('assets/images/banner/hero.jpeg');
    background-size: cover;
    background-position: 40% center;
    color: white;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.hero p {
    font-size: 20px;
}

/* SECTIONS */
.info-block {
    display: flex;
    gap: 40px;
    padding: 80px 12%;
    align-items: center;
}

.info-block.alt {
    background: var(--tan);
}

.text {
    flex: 1;
}

.text a {
    color: var(--brown);
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}
.text a:hover {
    color: var(--nav-brown);
}
.text h2 {
    margin-bottom: 15px;
    font-size: 28px;
}
.text.full {
    flex: 1 1 100%;
    max-width: 750px;
}

.image-placeholder {
    flex: 1;
    height: 220px;
    background: #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-style: italic;
}
.rotating-image {
    flex: 1;
    height: 220px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.rotating-image .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 2.5s cubic-bezier(0.4, 0.0, 0.2, 1),
                opacity 2.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.rotating-image .slide.next {
    transform: translateX(100%);
}
.rotating-image .slide.active {
    transform: translateX(0%);
}
.rotating-image .slide.exit {
    transform: translateX(-100%);
}

/* CTA */
.cta {
    text-align: center;
    padding: 100px 20px;
}

.cta h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.cta p {
    margin-bottom: 25px;
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--nav-brown);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.4px;
    border: none;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
    background: var(--dark-brown);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(1px);
    background: var(--dark-brown);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* PAYMENTS */
.payment-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    background: white;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-height: 650px; 
    display: flex;
    flex-direction: column;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

#boys-list label,
#girls-list label,
#events-list label {
    display: block;
    padding: 10px;
    margin: 8px 0;
    background: #f4f4f4;
    border-radius: 6px;
    cursor: pointer;
}

#events-list label:hover,
#boys-list label:hover,
#girls-list label:hover {
    background: #ececec;
}

.event-full {
    background: #ffe6e6 !important;
    color: #a33;
    cursor: not-allowed;
    opacity: 0.85;
}
.event-capacity {
    font-size: 12px;
    color: #888;
}

.admin-button.toggle {
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
    transition: all 0.2s ease;
}

.admin-button.toggle.active {
    background: #2c7be5;
    color: white;
    border-color: #2c7be5;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-toggle {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    border-width: 2px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid var(--tan);
    box-sizing: border-box;
    background: white;
    color: var(--dark-brown);
    transition: all 0.15s ease;
    width: 110px;
    text-align: center;
    white-space: nowrap;
}

/* OFF (Recent) */
.admin-toggle:hover {
    background: #f7f1e3;
}

/* ON (All) */
.admin-toggle.active {
    background: var(--tan);
    color: var(--dark-brown);
    border-color: var(--tan);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0px;
    margin: 0px 0 20px;
    width: 100%;
}

#meetingNotes {
    height: 100px;
    resize: none;
    overflow-y: auto;
}

/* ===== MEETING MODAL CLEANUP ===== */

.meeting-modal {
    max-width: 600px;
}

#scoutModal .event-modal-content {
    max-width: 340px;
    padding: 20px;
}

/* Grid layout */
.meeting-grid {
    display: grid;
    gap: 25px;
    margin-top: 10px;
    grid-template-columns: 1fr;
}

/* Columns */
.meeting-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Labels */
.meeting-col label {
    font-size: 13px;
    font-weight: 700;
    color: #555;
    margin-top: 5px;
}

/* Inputs */
.meeting-col input,
.meeting-col select,
.meeting-col textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Notes box (controlled, not dominant) */
#meetingNotes {
    height: 140px;
    resize: none;
    overflow-y: auto;
}

.tab {
    flex: 1;
    padding: 7px 0;
    border: 1px solid #bbb;
    background: #f2f2f2;
    border-radius: 0;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.tab:first-child {
    border-right: none;
}

.tab.active {
    background: var(--nav-brown);
    color: white;
    border-color: var(--nav-brown);
}

/* Scout grid */
.search-box {
    width: 100%;
    padding: 12px;
    margin-bottom: 0px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 16px;
}

.scout-list {
    border: 1px solid #ddd;
    margin-bottom: 25px;
    height: 420px;
    overflow-y: auto;
    background: white;
}

.scout-list::-webkit-scrollbar {
    width: 8px;
}

.scout-list::-webkit-scrollbar-thumb {
    background: #bbb;
}

.scout-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.scout-row {
    padding: 14px 16px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    transition: background 0.1s;
}

.scout-row:last-child {
    border-bottom: none;
}

.scout-row:hover {
    background: #eeebe2;
}

.scout-row.selected {
    background: var(--select-bg);
    color: var(--dark-brown);
}

.scout-title {
    text-align: center;
    margin-top: 60px;
    margin-bottom: 20px;
    font-size: 26px;
}

.group-note {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-size: 14px;
}

/* Events */
.event-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-left {
    display: flex;
    flex-direction: column;
}

.event-title {
    font-weight: 700;
}

.event-date {
    font-size: 13px;
    color: #666;
}

.event-right {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.event-cost {
    font-weight: 700;
}

.event-type {
    font-size: 13px;
    color: #666;
}

/* Summary / Receipt */
.summary-box {
    border: 1px solid #ddd;
    padding: 25px;
    margin-bottom: 25px;
    background: #fdfcf8;
}

.summary-section {
    margin-bottom: 25px;
}

.summary-header {
    font-weight: 700;
    margin-bottom: 0px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 6px;
}

.summary-content {
    color: #444;
    line-height: 1.6;
    padding-left: 18px;
    padding-right: 8px;
    padding-top: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 12px 12px 12px;
    border-bottom: 1px dashed #ddd;
}

.summary-title {
    font-weight: 600;
}

.summary-meta {
    font-size: 13px;
    color: #666;
}

.summary-right {
    font-weight: 600;
}

.total-box {
    display: flex;
    justify-content: space-between;
    font-size: 22px;
    font-weight: 700;
    padding: 15px 20px;
    border-top: 2px solid #ddd;
    margin-bottom: 2px;
}

.checkout-buttons {
    display: flex;
    justify-content: space-between;
}

.button-row {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
}

.button-row .right {
    margin-left: auto;
}

.payment-error {
    display: none;
    background: #ffe9e6;
    color: #8a1f11;
    border-left: 4px solid #c0392b;
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 6px;
    line-height: 1.6;
}

.payment-error ul {
    margin: 8px 0 0 18px;
}

.payment-error ol {
    margin-top: 10px;
    padding-left: 20px;
}

.payment-error li {
    margin-bottom: 8px;
}

.error-sublist {
    margin-top: 6px;
    padding-left: 20px;
    list-style-type: disc;
}

/* Highlighting */
.highlight {
    background: #f3e3b4;
    padding: 1px 2px;
    border-radius: 2px;
}

/* LOGIN PAGE */
.login-wrapper {
    min-height: calc(100vh - 0px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 120px 20px 40px;
}

/* LOGIN CARD */
.login-container {
    width: 100%;
    max-width: 500px;
    padding: 65px 60px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    text-align: center;
}

.login-container h2 {
    margin-bottom: 30px;
}

.login-container .btn {
    width: 100%;
}

.scout-row:hover .favorite-star {
  opacity: 0.6;
}

.scout-row-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.favorite-star {
  opacity: 0;
  font-size: 18px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
  user-select: none;
}

.scout-row:hover .favorite-star {
  opacity: 0.6;
}

.favorite-star.active {
  opacity: 1;
  color: var(--gold);
}

.favorite-star:hover {
  transform: scale(1.15);
}

.refund-notice {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #f8f3e6;
    border-left: 4px solid var(--gold);
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark-brown);
    border-radius: 4px;
}

#accessCodeInput {
  text-align: center;
  letter-spacing: 2px;
  font-weight: 600;
  text-transform: uppercase;
}

.signup-label{
    margin-top:0px;
    margin-bottom:12px;
    font-weight:600;
    text-align:left;
}
.scout-section .signup-label{
    margin-bottom:6px;
}

.option-group{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.option-card{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 14px;
    background:#f4f4f4;
    border-radius:6px;
    cursor:pointer;
    transition:background 0.15s;
}

.option-card:hover{
    background:#ececec;
}

.option-card input{
    transform:scale(1.2);
    accent-color: var(--nav-brown);
}

.setup-section{
    margin-top:22px;
    padding-top:18px;
    border-top:1px solid #e3e3e3;
}

.signup-help{
    font-size:13px;
    color:#666;
    margin-bottom:10px;
    text-align:left;
}

.scout-input-list{
    display:flex;
    flex-direction:column;
    gap:8px;
}
#scoutList .scout-entry:first-child .remove-scout{
    display:none;
}

.scout-entry{
    display:flex;
    gap:8px;
    align-items:center;
}
.scout-entry input{
    margin-bottom:0;
    flex:1;
}

.remove-scout{
    border:none;
    background:#eee;
    width:36px;
    height:36px;
    border-radius:6px;
    display:flex;
    align-items:center;
    justify-content:center;
    line-height:1;
    cursor:pointer;
    transition:background 0.15s ease;
}

.remove-scout:hover{
    background:#ddd;
}

.add-scout-btn{
    margin-top:10px;
    padding:10px;
    border:2px dashed #ccc;
    background:white;
    border-radius:6px;
    cursor:pointer;
    font-weight:600;
}

.add-scout-btn:hover{
    background:#f7f7f7;
}

/* ADMIN PORTAL */
.admin-link{
    color:#e6d3a3 !important;
    font-weight:700;
    display:inline-flex;
    align-items:center;
    gap:6px;
}

.admin-link:hover{
    color:#f1e3c1 !important;
}

.admin-container{
    display:flex;
    max-width:1100px;
    margin:120px auto 40px auto;
    background:white;
    box-shadow:0 10px 30px rgba(0,0,0,0.1);
    height:650px;
    opacity: 0;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.admin-container.loaded {
    opacity: 1;
}

.admin-title{
    text-align:center;
    font-size:26px;
    font-weight:700;
    margin-bottom:30px;
}

.admin-header .admin-title{
    text-align:left;
    margin:0;
}

.admin-sidebar{
    width:220px;
    border-right:1px solid #ddd;
    background:#fafafa;
}

.admin-tab{
    padding:16px 18px;
    cursor:pointer;
    font-weight:600;
    border-bottom:1px solid #eee;
}

.admin-subtabs {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    margin-bottom: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.admin-subtab{
    flex:1;
    padding:7px 0;
    border:1px solid #bbb;
    background:#f2f2f2;
    font-weight:700;
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:0.6px;
    text-align:center;
    cursor:pointer;
}

.hidden {
    display: none;
}

.admin-subtab:first-child {
    border-right: none;
}

.admin-subtab:last-child {
    border-left: none;
}

.admin-subtab.active{
    background:var(--nav-brown);
    color:white;
    border-color:var(--nav-brown);
}

.admin-tab:hover{
    background:#f2f2f2;
}

.admin-tab.active{
    background:var(--nav-brown);
    color:white;
}

.admin-content{
    flex:1;
    padding:30px 40px 20px 40px;
    display:flex;
    flex-direction:column;
    min-height:0;
    overflow:hidden;
}

.admin-table{
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
}

.admin-table th{
    text-align:left;
    border-bottom:2px solid #ddd;
    padding:10px;
}

.admin-table td{
    padding:10px;
    border-bottom:1px solid #eee;
}

.admin-table tr:hover{
    background:#f9f9f9;
}

.admin-split{
    display:flex;
    gap:20px;
    flex:1;
    min-height:0;
}

.admin-list{
    flex:1;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    padding: 2px;
    box-sizing: border-box;
}

.admin-list.scroll{
    overflow-y:auto;
    border:1px solid #ddd;
    background:white;
    height: 420px;
}

.admin-list-scroll{
    flex: 1;
    min-height: 0;
    overflow-y:auto;
    border:1px solid #ddd;
    background:white;
}

.admin-list-scroll::-webkit-scrollbar{
    width:8px;
}

.admin-list-scroll::-webkit-scrollbar-thumb{
    background:#bbb;
}

.admin-details{
    width:420px;
    flex-shrink:0;
    border-left:1px solid #ddd;
    padding-left:20px;
    padding-right:20px;
    display:flex;
    flex-direction:column;
    box-sizing:border-box;
}

.admin-details-content{
    flex:1;
    overflow-y:auto;
}

.admin-list::-webkit-scrollbar{
    width:8px;
}

.admin-list::-webkit-scrollbar-thumb{
    background:#bbb;
}

.admin-list::-webkit-scrollbar-thumb:hover{
    background:#999;
}

.admin-scout-list{
    border:1px solid #ddd;
    border-radius:6px;
    overflow:hidden;
}

.admin-scout-list{
    border:1px solid #ddd;
    background:white;
    margin-top:8px;
    height:300px;
    overflow-y:auto;
    margin-bottom:16px;
}

.admin-scout-list::-webkit-scrollbar{
    width:8px;
}

.admin-scout-list::-webkit-scrollbar-thumb{
    background:#bbb;
}

.admin-scout-row{
    padding:12px 14px;
    border-bottom:1px solid #eee;
    font-weight:600;
}

.admin-scout-row:last-child{
    border-bottom:none;
}

.admin-scout-row:hover{
    background:#f4f4f4;
}

.admin-scout-row{
    padding:10px 12px;
    border-bottom:1px solid #eee;
}

.admin-scout-row:last-child{
    border-bottom:none;
}

.admin-scout-row:hover{
    background:#f7f7f7;
}

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

.attendance-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    margin-bottom:4px;
    padding-top:4px;
}

.create-event-btn.small{
    width:auto;
    padding:8px 14px;
    margin:0;
}

.create-event-top{
    padding:8px 14px;
    border:none;
    border-radius:6px;
    background:var(--tan);
    color:var(--dark-brown);
    font-size: 13px;
    font-weight:700;
    cursor:pointer;
    transition:all 0.15s ease;
}

.create-event-top:hover{
    background:#d8c18a;
}

.admin-empty{
    padding:12px;
    color:#666;
}

.admin-loading{
    display:flex;
    align-items:center;
    justify-content:center;
    height:120px;
    color:#666;
    font-size:15px;
    font-weight:600;
}

.admin-loading::after{
    content:"";
    width:18px;
    height:18px;
    border:3px solid #ccc;
    border-top-color:var(--nav-brown);
    border-radius:50%;
    margin-left:10px;
    animation:adminSpin 0.8s linear infinite;
}

#scoutResults{
    margin-top:8px;
    border-right:none;
    border-left:none;
}

@keyframes adminSpin{
    to{ transform:rotate(360deg); }
}

/* USERS TABLE */
.admin-table.users th:nth-child(1),
.admin-table.users td:nth-child(1){ width:25%; }

.admin-table.users th:nth-child(2),
.admin-table.users td:nth-child(2){ width:35%; }

.admin-table.users th:nth-child(3),
.admin-table.users td:nth-child(3){ width:20%; }

.admin-table.users th:nth-child(4),
.admin-table.users td:nth-child(4){ width:20%; }

/* SCOUT TABLE */
.admin-table.scouts th:nth-child(1),
.admin-table.scouts td:nth-child(1){ width:50%; }

.admin-table.scouts th:nth-child(2),
.admin-table.scouts td:nth-child(2){ width:25%; }

.admin-table.scouts th:nth-child(3),
.admin-table.scouts td:nth-child(3){ width:25%; }

/* ===== SCOUTS ADMIN TABLE ===== */

.scouts-table-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.scouts-thead {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    gap: 8px;
    border-bottom: 2px solid #ddd;
    font-weight: 700;
    font-size: 13px;
    color: #555;
    flex-shrink: 0;
}

.scouts-tbody {
    flex: 1;
    min-height: 0;
}

.scouts-row {
    display: flex;
    align-items: center;
    padding: 9px 10px;
    gap: 8px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    position: relative;
}

.scouts-row:hover { background: #f9f9f9; }
.scouts-row-inactive { opacity: 0.5; }

.scouts-col { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scouts-col-name   { flex: 5; }
.scouts-col-troop  { flex: 2.5; }
.scouts-col-status { flex: 2.5; }
.scouts-col-actions {
    flex: 0 0 48px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    position: relative;
}

.scouts-dots-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    visibility: hidden;
}
.scouts-row:hover .scouts-dots-btn { visibility: visible; }

.scouts-dropdown {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 1000;
    width: 110px;
    overflow: hidden;
}

.scouts-dd-item {
    display: block;
    width: 110px;
    padding: 9px 14px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    box-sizing: border-box;
}
.scouts-dd-item:hover { background: #f5f5f5; }
.scouts-dd-delete { color: #c0392b; }

.scouts-status-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.scouts-active   { background: #d4edda; color: #155724; }
.scouts-inactive { background: #f8d7da; color: #721c24; }

.scouts-edit-input,
.scouts-edit-select {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    min-width: 0;
}

.scouts-edit-actions { gap: 4px; flex: 0 0 120px; }

.scouts-save-btn,
.scouts-cancel-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.scouts-save-btn   { background: var(--nav-brown); color: white; }
.scouts-cancel-btn { background: #eee; color: #333; }

#adminSearch{
    margin-top: -10px;
    margin-bottom: 22px;
}

/* EVENT CARDS */

.event-card{
    border:1px solid #ddd;
    border-radius:0;
    padding:18px;
    margin-bottom:0;
    background:#fafafa;
    cursor:pointer;
    transition:background 0.15s;
}

.event-card.selected{
    background:#e9e6dc;
}

.event-card:hover{
    background:#f0ede6;
}

.event-card:last-child{
    border-bottom:1px solid #ddd;
}

.event-card-title{
    font-weight:700;
    font-size:18px;
    margin-bottom:6px;
}

.event-meta{
    font-size:13px;
    color:#666;
    margin-bottom:10px;
}

.event-details{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:6px 20px;
    font-size:14px;
}
.event-details-btn{
    margin-top:10px;
    padding:8px 12px;
    border:none;
    background:var(--nav-brown);
    color:white;
    border-radius:4px;
    cursor:pointer;
    font-size:13px;
}

.event-details-btn:hover{
    background:var(--dark-brown);
}

.event-description{
    margin-top:10px;
    font-size:14px;
}

.attendance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    position: relative;
}

.attendance-row .scout-name-label {
    flex: 1;
}

.attendance-row.selected {
    background: #d4edda;
    color: #155724;
}

.attendance-row.tardy {
    background: #fff9c4;
    color: #7a6200;
}

.uniform-btn {
    visibility: hidden;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    padding: 0 6px;
    color: #bbb;
    transition: color 0.15s;
    flex-shrink: 0;
    line-height: 1;
}

.attendance-row:hover .uniform-btn {
    visibility: visible;
}

.uniform-btn.no-uniform {
    visibility: visible;
    color: #e0a800;
}

/* PLC */

.plc-link {
    background: #e6d3a3;
    color: var(--dark-brown) !important;
    padding: 6px 10px;
    border-radius: 4px;
}

/* MODAL */

.event-modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.4);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:2000;
}

.event-modal-content{
    background:white;
    padding:35px 40px;
    width:720px;
    max-width: 90vw;
    box-shadow:0 10px 30px rgba(0,0,0,0.2);
}

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

.event-close{
    font-size:26px;
    cursor:pointer;
    color:#888;
}

#eventDescription{
    resize:vertical;
    max-height:150px;
    min-height:80px;
}

.event-close:hover{
    color:#000;
}

.event-form-error{
    font-size:13px;
    color:#c0392b;
    text-align:center;
    margin-bottom:8px;
    opacity:0;
    max-height:0;
    overflow:hidden;

    transition:opacity 0.3s ease, max-height 0.3s ease;
}

.event-form-error.active{
    opacity:1;
    max-height:20px;
}

/* GRID LAYOUT */

.event-form-grid{
    display:grid;
    grid-template-columns:1fr 1px 1fr;
    gap:35px;
}

.event-col{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.event-divider{
    background:#ddd;
}

/* INPUT CLEANUP */

.event-col input,
.event-col textarea,
.event-col select{
    padding:10px;
    border:1px solid #ccc;
    border-radius:4px;
    font-size:14px;
}

/* CREATE BUTTON */

.create-event-btn{
    margin-top:28px;
    display:block;
    width:220px;
    margin-left:auto;
    margin-right:auto;
    padding:12px 20px;
    border:none;
    border-radius:6px;
    background:var(--tan);
    color:var(--dark-brown);
    font-weight:700;
    cursor:pointer;
    transition:all 0.15s;
}

.create-event-btn:hover{
    background:#d8c18a;
}

.event-form{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.event-form input,
.event-form textarea,
.event-form select{
    padding:10px;
    border:1px solid #ccc;
}

.reg-open{
    color:#2e8b57;
    font-weight:700;
}

.reg-closed{
    color:#c0392b;
    font-weight:700;
}

.access-code-panel{
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:20px;
    padding:60px;
    height:100%;
}

.access-code-label{
    font-size:18px;
    font-weight:700;
}

.access-code-value{
    font-size:42px;
    letter-spacing:6px;
    font-weight:800;
}

.access-code-date{
    font-size:14px;
    color:#666;
}

.access-code-buttons{
    display:flex;
    gap:12px;
}

.access-btn{
    padding:6px 12px;
    font-size:13px;
    font-weight:600;
    border-radius:4px;
    border:1px solid #ccc;
    background:white;
    cursor:pointer;
    transition:background 0.15s ease, border-color 0.15s ease;
}

.access-btn:hover{
    background:#f3f3f3;
    border-color:#bbb;
}

.access-btn.primary{
    border-color:var(--tan);
    background:var(--tan);
    color:var(--dark-brown);
}

.access-btn.primary:hover{
    background:#d8c18a;
}

/* JOIN PAGE */

.join-container{
max-width:900px;
margin:140px auto 60px auto;
background:white;
padding:50px;
box-shadow:0 10px 30px rgba(0,0,0,0.1);
}

.join-title{
text-align:center;
font-size:36px;
margin-bottom:10px;
}

.join-subtitle{
text-align:center;
margin-bottom:40px;
color:#666;
}

.join-section{
margin-bottom:40px;
}

.join-section h2{
margin-bottom:15px;
font-size:24px;
}

.join-list{
margin-left:20px;
line-height:1.7;
}

.join-section p{
margin-bottom:10px;
line-height:1.6;
}

.faq-item{
margin-bottom:18px;
}

.faq-item strong{
display:block;
margin-bottom:4px;
}

/* ROLE DROPDOWN */

.role-dropdown{
    width:100%;
    padding:8px 34px 8px 10px;

    border:1px solid #ccc;
    border-radius:0;

    background-color: var(--cream);
    color: var(--dark-brown);

    font-weight:600;
    font-size:13px;

    cursor:pointer;

    appearance:none;
    -webkit-appearance:none;
    -moz-appearance:none;

    background-image:
        linear-gradient(45deg, transparent 50%, var(--dark-brown) 50%),
        linear-gradient(135deg, var(--dark-brown) 50%, transparent 50%);

    background-position:
        calc(100% - 16px) center,
        calc(100% - 10px) center;

    background-size:6px 6px;
    background-repeat:no-repeat;

    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.role-dropdown:hover{
    background: var(--tan);
    border-color:#bbb;
}

.role-dropdown:focus{
    outline:none;
}

.role-dropdown.updated{
    background:#e8f5e9;
    border-color:#4caf50;
}

.role-dropdown:disabled{
    opacity:0.7;
    cursor:not-allowed;
}

.portal-section{
    margin-bottom:30px;
    padding:20px;
    border:1px solid #ddd;
    background:#fafafa;
}

.portal-section h3{
    margin-bottom:12px;
}

/* PORTAL */

.portal-card {
    background: #fafafa;
    border: 1px solid #ddd;
    padding: 20px;
    width: 100%;
}

.portal-row{
    display:flex;
    justify-content:space-between;
    padding:10px 0;
    border-bottom:1px solid #eee;
    font-size:15px;
}

.portal-row:last-child{
    border-bottom:none;
}

.portal-meta{
    margin-top:15px;
    font-size:13px;
    color:#666;
}

.portal-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.btn-secondary {
    background: var(--tan);
    color: var(--dark-brown);
}

.btn-secondary:hover {
    background: #d8c18a;
}

.portal-note {
    text-align: center;
    font-size: 13px;
    color: #777;
    margin-top: -20px;
    margin-bottom: 20px;
}


/* ===============================
   VIEW ATTENDANCE
================================ */

.att-view-search {
    margin-bottom: 10px;
    margin-top: 10px;
    box-sizing: border-box;
}


.att-scout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-weight: 600;
}

.att-scout-row:last-child { border-bottom: none; }
.att-scout-row:hover { background: #f7f7f7; }
.att-row-selected { background: #f0ede6 !important; }

.att-scout-name { flex: 1; }
.att-scout-badges { display: flex; gap: 6px; }

.att-pct {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}
.att-pct-good  { background: #d4edda; color: #155724; }
.att-pct-mid   { background: #fff3cd; color: #856404; }
.att-pct-low   { background: #f8d7da; color: #721c24; }
.att-pct-na    { background: #e9ecef; color: #6c757d; }

.att-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
    margin-bottom: 14px;
}

.att-detail-header h3 { margin: 0; }

.att-troop-tag {
    background: #f0ede6;
    color: var(--dark-brown);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: capitalize;
}

.att-stat-grid {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.att-stat-card {
    flex: 1;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}

.att-stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 6px;
}

.att-stat-value { margin-bottom: 4px; }

.att-stat-sub {
    font-size: 12px;
    color: #999;
}

.att-events-scroll {
    overflow-y: auto;
    max-height: 320px;
    border: 1px solid #eee;
    border-radius: 6px;
}

.att-type-section { padding: 0; }

.att-type-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    padding: 8px 12px 4px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.att-type-count {
    font-weight: 600;
    color: #aaa;
}

.att-event-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    border-bottom: 1px solid #f4f4f4;
    font-size: 13px;
}

.att-event-row:last-child { border-bottom: none; }

.att-event-name { font-weight: 600; }

.att-event-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #999;
    font-size: 12px;
}

.att-tag {
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

.att-tag-tardy   { background: #fff9c4; color: #7a6200; }

/* ===============================
   BILLING / REFUND UI
================================ */

.reg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
}

.reg-row.reg-refunded {
    opacity: 0.55;
}

.reg-scout-name {
    flex: 1;
    font-weight: 600;
}

.reg-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    white-space: nowrap;
}

.reg-badge-paid    { background: #d4edda; color: #1a7a35; }
.reg-badge-refunded { background: #f0f0f0; color: #888; }

.billing-dots-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    color: #555;
    margin-left: 4px;
    line-height: 1;
}

.billing-dots-btn:hover { background: #eee; }

/* Billing tab list */
.billing-list {
    display: flex;
    flex-direction: column;
    margin-top: 6px;
}

.billing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    gap: 8px;
}

.billing-row:last-child { border-bottom: none; }

.billing-row:hover { background: #f7f7f7; }

.billing-row-main {
    flex: 1;
    min-width: 0;
}

.billing-row-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.billing-row-meta {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.billing-row-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.billing-cost {
    font-weight: 700;
    font-size: 13px;
    min-width: 44px;
    text-align: right;
}

.billing-meta-right {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.billing-refund-event-btn {
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid #c0392b;
    color: #c0392b;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.billing-refund-event-btn:hover {
    background: #fdecea;
}
.att-tag-uniform { background: #fff3e0; color: #e0a800; }
