/**
 * SM Platform — Core Styles
 * 
 * @package SM_Platform
 * @since 1.0.0
 */

/* =========================================================
   CSS VARIABLES
   ========================================================= */
.sm-platform {
    --sm-primary: #003F87;
    --sm-secondary: #CE1126;
    --sm-accent: #B8860B;
    --sm-bg: #F5F1EB;
    --sm-text: #1A1A2E;
    --sm-text-light: #666;
    --sm-border: #D1D5DB;
    --sm-success: #16A34A;
    --sm-error: #DC2626;
    --sm-warning: #F59E0B;
    --sm-radius: 8px;
    --sm-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --sm-shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

/* =========================================================
   BASE
   ========================================================= */
.sm-platform {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--sm-text);
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.sm-platform *,
.sm-platform *::before,
.sm-platform *::after {
    box-sizing: border-box;
}

.sm-platform h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--sm-primary);
    margin: 0 0 8px;
}

.sm-platform h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
}

.sm-step-desc {
    color: var(--sm-text-light);
    margin: 0 0 24px;
    font-size: 15px;
}

/* =========================================================
   PER-STEP PAGE HEADER
   ========================================================= */
.sm-page-header {
    text-align: center;
    padding-bottom: 2em;
}

.sm-page-headline {
    font-family: 'League Gothic', 'Arial Narrow', Impact, sans-serif;
    font-size: 3.5em;
    color: #075697;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.3em;
    line-height: 1.1;
}

.sm-page-subtext {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
    font-size: 1.2em;
    line-height: 1.4em;
    color: #515354;
    margin: 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================
   STEP PROGRESS BAR
   ========================================================= */
.sm-steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    padding: 0 10px;
}

.sm-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.sm-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #E5E7EB;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sm-step-item.active .sm-step-number {
    background: var(--sm-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 63, 135, 0.15);
}

.sm-step-item.completed .sm-step-number {
    background: var(--sm-success);
    color: #fff;
    font-size: 0;
}

.sm-step-item.completed .sm-step-number::after {
    content: '\2713';
    font-size: 14px;
}

.sm-step-label {
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 6px;
    font-weight: 500;
    white-space: nowrap;
}

.sm-step-item.active .sm-step-label {
    color: var(--sm-primary);
    font-weight: 600;
}

.sm-step-item.completed .sm-step-label {
    color: var(--sm-success);
}

.sm-step-connector {
    flex: 1;
    height: 2px;
    background: #E5E7EB;
    margin: 0 8px;
    margin-bottom: 22px;
    transition: background 0.3s ease;
    min-width: 30px;
    max-width: 80px;
}

.sm-step-connector.completed {
    background: var(--sm-success);
}

/* =========================================================
   FORM STEPS
   ========================================================= */
.sm-form-step {
    display: none;
}

.sm-form-step.active {
    display: block;
    animation: smFadeIn 0.3s ease;
}

@keyframes smFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   FORM FIELDS
   ========================================================= */
.sm-form-row {
    margin-bottom: 20px;
}

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

@media (max-width: 600px) {
    .sm-form-row-half {
        grid-template-columns: 1fr;
    }
}

.sm-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--sm-text);
    margin-bottom: 6px;
}

.sm-required {
    color: var(--sm-secondary);
}

.sm-help {
    font-weight: 400;
    color: var(--sm-text-light);
    font-size: 13px;
}

.sm-platform input[type="text"],
.sm-platform input[type="email"],
.sm-platform input[type="tel"],
.sm-platform input[type="password"],
.sm-platform input[type="number"],
.sm-platform select,
.sm-platform textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--sm-border);
    border-radius: var(--sm-radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--sm-text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.sm-platform input:focus,
.sm-platform select:focus,
.sm-platform textarea:focus {
    border-color: var(--sm-primary);
    box-shadow: 0 0 0 3px rgba(0, 63, 135, 0.1);
}

.sm-platform input.sm-field-invalid,
.sm-platform select.sm-field-invalid,
.sm-platform textarea.sm-field-invalid {
    border-color: var(--sm-error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.sm-field-error {
    display: none;
    font-size: 13px;
    color: var(--sm-error);
    margin-top: 4px;
}

.sm-field-hint {
    font-size: 13px;
    color: var(--sm-text-light);
    margin-top: 4px;
}

/* Password strength */
.sm-password-strength {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    min-height: 18px;
}

.sm-password-strength.weak { color: #DC2626; }
.sm-password-strength.fair { color: #F59E0B; }
.sm-password-strength.good { color: #2563EB; }
.sm-password-strength.strong { color: #16A34A; }
.sm-password-strength.very-strong { color: #059669; }

/* Fieldset */
.sm-fieldset {
    border: 1.5px solid var(--sm-border);
    border-radius: var(--sm-radius);
    padding: 20px;
    margin: 24px 0;
}

.sm-fieldset legend {
    font-size: 15px;
    font-weight: 600;
    padding: 0 8px;
    color: var(--sm-text);
}

.sm-fieldset-desc {
    font-size: 13px;
    color: var(--sm-text-light);
    margin: 0 0 16px;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.sm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--sm-radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    line-height: 1.4;
}

.sm-btn-primary,
.sm-platform .sm-btn-primary,
.sm-platform button.sm-btn-primary,
.sm-platform .sm-form-nav .sm-btn-primary,
.sm-platform button[type="submit"].sm-btn-primary {
    background: #003F87 !important;
    background-color: #003F87 !important;
    color: #fff !important;
    border: none !important;
    border-color: #003F87 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    border-radius: var(--sm-radius) !important;
    margin-bottom: 0 !important;
}

.sm-btn-primary:hover,
.sm-platform .sm-btn-primary:hover,
.sm-platform button[type="submit"].sm-btn-primary:hover {
    background: #002D5E !important;
    background-color: #002D5E !important;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06) !important;
}

.sm-btn-primary:disabled,
.sm-platform .sm-btn-primary:disabled,
.sm-platform button[type="submit"].sm-btn-primary:disabled {
    background: #9CA3AF !important;
    background-color: #9CA3AF !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none !important;
}

.sm-btn-secondary {
    background: transparent;
    color: var(--sm-text-light);
    border: 1.5px solid var(--sm-border);
}

.sm-btn-secondary:hover {
    border-color: var(--sm-text);
    color: var(--sm-text);
}

.sm-btn-outline {
    background: transparent;
    color: var(--sm-primary);
    border: 1.5px solid var(--sm-primary);
}

.sm-btn-outline:hover {
    background: var(--sm-primary);
    color: #fff;
}

.sm-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.sm-btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.sm-btn-arrow {
    font-size: 16px;
}

/* =========================================================
   FORM NAVIGATION
   ========================================================= */
.sm-form-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #F3F4F6;
}

/* =========================================================
   COURSE GRID
   ========================================================= */
.sm-course-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sm-selected-count {
    font-size: 14px;
    color: var(--sm-text-light);
    margin-left: auto;
}

.sm-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.sm-course-card {
    cursor: pointer;
    display: block;
}

.sm-course-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sm-course-card-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1.5px solid var(--sm-border);
    border-radius: var(--sm-radius);
    transition: all 0.2s;
    background: #fff;
    position: relative;
}

.sm-course-card:hover .sm-course-card-inner {
    border-color: var(--sm-primary);
    box-shadow: var(--sm-shadow);
}

.sm-course-card.selected .sm-course-card-inner {
    border-color: var(--sm-primary);
    background: rgba(0, 63, 135, 0.04);
}

.sm-course-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.sm-course-thumb-placeholder {
    background: var(--sm-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-course-thumb-placeholder span {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
}

.sm-course-info {
    flex: 1;
    min-width: 0;
}

.sm-course-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--sm-text);
    line-height: 1.3;
}

.sm-course-desc {
    font-size: 12px;
    color: var(--sm-text-light);
    margin-top: 2px;
}

.sm-course-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--sm-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sm-course-card.selected .sm-course-check {
    background: var(--sm-primary);
    border-color: var(--sm-primary);
    color: #fff;
}

/* =========================================================
   INVITE OPTIONS
   ========================================================= */
.sm-invite-option {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .sm-invite-option {
        grid-template-columns: 1fr;
    }
}

.sm-radio-card {
    cursor: pointer;
    display: block;
}

.sm-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sm-radio-card-inner {
    padding: 16px;
    border: 1.5px solid var(--sm-border);
    border-radius: var(--sm-radius);
    transition: all 0.2s;
    background: #fff;
}

.sm-radio-card:hover .sm-radio-card-inner {
    border-color: var(--sm-primary);
}

.sm-radio-card.active .sm-radio-card-inner {
    border-color: var(--sm-primary);
    background: rgba(0, 63, 135, 0.04);
    box-shadow: 0 0 0 3px rgba(0, 63, 135, 0.1);
}

.sm-radio-card-inner strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.sm-radio-card-inner p {
    font-size: 13px;
    color: var(--sm-text-light);
    margin: 0;
}

.sm-invite-emails {
    margin-bottom: 24px;
}

.sm-parsed-emails {
    margin-top: 12px;
    padding: 12px;
    background: #F9FAFB;
    border-radius: var(--sm-radius);
}

.sm-parsed-emails ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.sm-parsed-emails li {
    padding: 2px 0;
    font-size: 14px;
}

.sm-email-valid::before {
    content: '\2713 ';
    color: var(--sm-success);
}

.sm-email-invalid {
    color: var(--sm-error);
}

.sm-email-invalid::before {
    content: '\2717 ';
}

/* =========================================================
   REGISTRATION SUMMARY
   ========================================================= */
.sm-registration-summary {
    background: #F9FAFB;
    border-radius: var(--sm-radius);
    padding: 20px;
    margin-top: 24px;
}

.sm-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.sm-summary-table td {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #E5E7EB;
}

.sm-summary-table tr:last-child td {
    border-bottom: none;
}

.sm-summary-label {
    font-weight: 600;
    color: var(--sm-text-light);
    width: 140px;
}

.sm-summary-value {
    color: var(--sm-text);
}

/* =========================================================
   SUCCESS STATE
   ========================================================= */
.sm-success-step {
    text-align: center;
}

.sm-success-icon {
    width: 72px;
    height: 72px;
    background: var(--sm-success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.sm-token-display {
    max-width: 500px;
    margin: 30px auto;
    text-align: left;
}

.sm-token-section {
    margin-bottom: 16px;
}

.sm-token-section > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sm-text-light);
    margin-bottom: 6px;
}

.sm-copy-field {
    display: flex;
    gap: 8px;
}

.sm-copy-field input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--sm-border);
    border-radius: var(--sm-radius);
    font-size: 14px;
    font-family: monospace;
    background: #F9FAFB;
    color: var(--sm-text);
}

.sm-copy-btn.sm-copied {
    background: var(--sm-success) !important;
    color: #fff !important;
    border-color: var(--sm-success) !important;
}

.sm-success-actions {
    margin-top: 30px;
}

.sm-success-actions .sm-btn {
    text-decoration: none;
}

/* =========================================================
   NOTICES
   ========================================================= */
.sm-notice {
    padding: 14px 18px;
    border-radius: var(--sm-radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.sm-notice p {
    margin: 0;
}

.sm-notice a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.sm-notice-info {
    background: #EFF6FF;
    border-left: 4px solid var(--sm-primary);
    color: #1E3A5F;
}

.sm-notice-success {
    background: #F0FDF4;
    border-left: 4px solid var(--sm-success);
    color: #14532D;
}

.sm-notice-error {
    background: #FEF2F2;
    border-left: 4px solid var(--sm-error);
    color: #7F1D1D;
}

.sm-notice-warning {
    background: #FFFBEB;
    border-left: 4px solid var(--sm-warning);
    color: #78350F;
}

.sm-error {
    background: #FEF2F2;
    border-left: 4px solid var(--sm-error);
    padding: 14px 18px;
    border-radius: var(--sm-radius);
    color: #7F1D1D;
}

.sm-messages {
    margin-bottom: 20px;
}

/* =========================================================
   LOADING OVERLAY
   ========================================================= */
.sm-loading {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.sm-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #E5E7EB;
    border-top-color: var(--sm-primary);
    border-radius: 50%;
    animation: smSpin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.sm-loading p {
    font-size: 16px;
    color: var(--sm-text-light);
}

/* =========================================================
   TROOP CONFIRMATION BAR (join page)
   ========================================================= */
.sm-troop-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 16px 24px;
    background: #F9FAFB;
    border-radius: var(--sm-radius);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.sm-troop-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sm-troop-bar-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9CA3AF;
    margin-bottom: 2px;
}

.sm-troop-bar-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--sm-text);
}

/* =========================================================
   FORM SECTIONS (join page uses sections instead of steps)
   ========================================================= */
.sm-form-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #F3F4F6;
}

.sm-form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* =========================================================
   CONSENT BOX
   ========================================================= */
.sm-consent-box {
    background: #FFFBEB;
    border: 1.5px solid #FCD34D;
    border-radius: var(--sm-radius);
    padding: 20px;
}

.sm-consent-text {
    font-size: 14px;
    line-height: 1.6;
    color: #78350F;
    margin: 0 0 16px;
}

.sm-consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--sm-text);
}

.sm-consent-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

/* =========================================================
   PRICING BOX
   ========================================================= */
.sm-pricing-box {
    text-align: center;
    padding: 24px;
    background: #F0F7FF;
    border-radius: var(--sm-radius);
    border: 1.5px solid #BFDBFE;
    margin-bottom: 24px;
}

.sm-pricing-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.sm-pricing-dollar {
    font-size: 48px;
    font-weight: 700;
    color: var(--sm-primary);
    line-height: 1;
}

.sm-pricing-cents {
    font-size: 24px;
    font-weight: 700;
    color: var(--sm-primary);
}

.sm-pricing-period {
    font-size: 16px;
    color: var(--sm-text-light);
    margin-left: 4px;
}

.sm-pricing-desc {
    font-size: 14px;
    color: var(--sm-text-light);
    margin: 8px 0 0;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 600px) {
    .sm-platform {
        padding: 10px 0;
    }

    .sm-steps-bar {
        margin-bottom: 24px;
    }

    .sm-step-label {
        font-size: 10px;
    }

    .sm-step-number {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .sm-step-connector {
        min-width: 16px;
        margin: 0 4px;
    }

    .sm-platform h2 {
        font-size: 20px;
    }

    .sm-page-headline {
        font-size: 2.2em;
    }

    .sm-page-subtext {
        font-size: 1em;
    }

    .sm-troop-bar {
        flex-direction: column;
        gap: 12px;
    }

    .sm-course-grid {
        grid-template-columns: 1fr;
    }

    .sm-form-nav {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .sm-form-nav .sm-btn {
        width: 100%;
        justify-content: center;
    }
}

/* =================================================================
   LEADER DASHBOARD
   ================================================================= */

/* Dashboard Header */
.sm-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 0;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 0;
}

.sm-dash-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.sm-dash-subtitle {
    display: block;
    font-size: 15px;
    color: #555;
    margin-bottom: 2px;
}

.sm-dash-region {
    display: block;
    font-size: 13px;
    color: #888;
}

.sm-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sm-badge-active {
    background: #d4edda;
    color: #155724;
}

/* Tab Navigation */
.sm-dash-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sm-dash-tab {
    padding: 14px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.sm-dash-tab:hover {
    color: #1a1a2e;
}

.sm-dash-tab-active {
    color: #003f87;
    border-bottom-color: #003f87;
    font-weight: 600;
}

/* Panels */
.sm-dash-panel {
    display: none;
}

.sm-dash-panel-active {
    display: block;
}

/* Stats Cards */
.sm-dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.sm-stat-card {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.sm-stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #003f87;
    line-height: 1;
    margin-bottom: 6px;
}

.sm-stat-label {
    display: block;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* Sections */
.sm-dash-section {
    margin-bottom: 32px;
}

.sm-dash-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px 0;
}

.sm-dash-section-desc {
    font-size: 14px;
    color: #666;
    margin: 0 0 16px 0;
}

/* Info Grid */
.sm-dash-info-grid {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
}

.sm-info-row {
    display: flex;
    padding: 12px 20px;
    border-bottom: 1px solid #e8e8e8;
}

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

.sm-info-label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
    min-width: 180px;
    flex-shrink: 0;
}

.sm-info-value {
    color: #1a1a2e;
    font-size: 14px;
}

/* Signup Link Box */
.sm-signup-link-box {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.sm-link-row {
    margin-bottom: 12px;
}

.sm-link-row:last-child {
    margin-bottom: 0;
}

.sm-link-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.sm-link-copy-group {
    display: flex;
    gap: 8px;
}

.sm-link-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    font-family: monospace;
}

.sm-link-input-short {
    max-width: 200px;
}

.sm-btn-copy {
    padding: 10px 18px;
    min-width: 80px;
}

.sm-btn-copied {
    background: #27ae60 !important;
    border-color: #27ae60 !important;
    color: #fff !important;
}

/* Token Actions */
.sm-token-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sm-token-note {
    font-size: 13px;
    color: #888;
}

/* Section Toolbar */
.sm-section-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sm-section-toolbar .sm-dash-section-title {
    margin-bottom: 0;
}

/* Search Box */
.sm-search-box {
    max-width: 240px;
}

.sm-search-input {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

/* Tables */
.sm-table-wrap {
    overflow-x: auto;
}

.sm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sm-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e8e8e8;
    background: #f8f9fa;
}

.sm-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.sm-table tbody tr:hover {
    background: #f8f9fa;
}

.sm-scout-name {
    font-weight: 600;
}

/* Status Badges */
.sm-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.sm-status-active {
    background: #d4edda;
    color: #155724;
}

.sm-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.sm-status-pending {
    background: #fff3cd;
    color: #856404;
}

/* Empty State */
.sm-empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px dashed #ccc;
    border-radius: 10px;
}

.sm-empty-text {
    font-size: 16px;
    color: #555;
    margin: 0 0 6px 0;
}

.sm-empty-subtext {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* Course Cards */
.sm-dashboard .sm-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.sm-course-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.sm-course-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.sm-course-thumb {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #e8e8e8;
}

.sm-course-thumb-placeholder {
    background: linear-gradient(135deg, #003f87 0%, #1a5ca8 100%);
}

.sm-course-info {
    padding: 16px;
}

.sm-course-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 6px 0;
}

.sm-course-meta {
    display: block;
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.sm-btn-sm {
    font-size: 13px;
    padding: 6px 14px;
}

.sm-btn-xs {
    font-size: 12px;
    padding: 4px 10px;
}

.sm-btn-outline {
    background: transparent;
    border: 1px solid #003f87;
    color: #003f87;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.sm-btn-outline:hover {
    background: #003f87;
    color: #fff;
}

/* Progress Bar */
.sm-progress-bar-wrap {
    margin-bottom: 12px;
}

.sm-progress-bar {
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.sm-progress-fill {
    height: 100%;
    background: #003f87;
    border-radius: 3px;
    transition: width 0.3s;
}

.sm-progress-text {
    font-size: 12px;
    color: #888;
}

/* Invite Form */
.sm-invite-form {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.sm-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.sm-form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.sm-invite-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sm-invite-status {
    font-size: 14px;
    font-weight: 500;
}

.sm-text-muted {
    color: #aaa;
}

/* Tab Badge */
.sm-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #c0392b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    line-height: 1;
}

/* Approval Notices (on LD topic/lesson pages) */
.sm-approval-notice {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.sm-approval-pending {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.sm-approval-revision {
    background: #fce4cc;
    border: 1px solid #e67e22;
    color: #7a4a1a;
}

.sm-approval-approved {
    background: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

.sm-leader-note {
    background: rgba(255,255,255,0.5);
    border-left: 3px solid #e67e22;
    padding: 8px 14px;
    margin: 10px 0;
    font-style: italic;
}

/* Review Panel */
.sm-review-panel {
    background: #fff;
    border: 2px solid #003f87;
    border-radius: 10px;
    padding: 24px;
    margin-top: 24px;
}

.sm-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.sm-review-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.sm-review-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.sm-review-close:hover {
    color: #333;
}

.sm-review-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.sm-review-meta span {
    margin-right: 4px;
}

.sm-review-content {
    margin-bottom: 20px;
    min-height: 60px;
}

.sm-review-content h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 16px 0 10px 0;
}

.sm-review-content h4:first-child {
    margin-top: 0;
}

.sm-review-item {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.sm-review-item p {
    margin: 6px 0 0 0;
    font-size: 14px;
    color: #555;
}

.sm-review-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.sm-btn-approve {
    background: #27ae60;
    border: 1px solid #27ae60;
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.sm-btn-approve:hover {
    background: #219a52;
}

.sm-btn-revision {
    background: #e67e22;
    border: 1px solid #e67e22;
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.sm-btn-revision:hover {
    background: #cf6d17;
}

.sm-revision-note-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}


/* Danger Button */
.sm-btn-danger {
    background: #c0392b;
    border: 1px solid #c0392b;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.sm-btn-danger:hover {
    background: #a93226;
}

.sm-scout-actions {
    display: flex;
    gap: 6px;
}

/* Form Select */
.sm-form-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

/* Progress Toolbar */
.sm-progress-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Transfer Banner */
.sm-transfer-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 24px;
}

.sm-transfer-banner strong {
    display: block;
    margin-bottom: 12px;
    color: #856404;
}

.sm-transfer-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sm-transfer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255,255,255,0.7);
    padding: 10px 14px;
    border-radius: 6px;
    flex-wrap: wrap;
}

.sm-transfer-actions {
    display: flex;
    gap: 6px;
}



/* Council Signup Form */
.sm-council-signup .sm-form-step {
    max-width: 680px;
    margin: 0 auto;
}

.sm-form-note {
    text-align: center;
    font-size: 14px;
    color: var(--sm-text-light);
    margin-top: 16px;
}

.sm-form-note a {
    color: var(--sm-primary);
    font-weight: 600;
}

.sm-messages-success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 12px 16px;
    border-radius: var(--sm-radius);
    margin-bottom: 16px;
}

.sm-messages-error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 12px 16px;
    border-radius: var(--sm-radius);
    margin-bottom: 16px;
}

/* Council Dashboard */
.sm-council-dashboard .sm-table tfoot td {
    padding: 12px 14px;
    background: #f0f0f0;
}

.sm-council-dashboard .sm-stat-card {
    border-left: 3px solid #003f87;
}

/* Dashboard Responsive */
@media (max-width: 768px) {
    .sm-dash-header {
        flex-direction: column;
        gap: 12px;
    }

    .sm-dash-tabs {
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .sm-dash-tabs::-webkit-scrollbar {
        display: none;
    }

    .sm-dash-tab {
        padding: 12px 14px;
        font-size: 13px;
    }

    .sm-dash-stats {
        grid-template-columns: 1fr 1fr;
    }

    .sm-info-row {
        flex-direction: column;
        gap: 2px;
    }

    .sm-info-label {
        min-width: auto;
    }

    .sm-link-copy-group {
        flex-direction: column;
    }

    .sm-link-input-short {
        max-width: 100%;
    }

    .sm-token-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .sm-section-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .sm-search-box {
        max-width: 100%;
        width: 100%;
    }

    .sm-dashboard .sm-course-grid {
        grid-template-columns: 1fr;
    }

    .sm-invite-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Scout action buttons */
    .sm-scout-actions {
        flex-direction: column;
        gap: 4px;
    }

    /* Review panel */
    .sm-review-panel {
        padding: 16px;
    }

    .sm-review-actions {
        flex-direction: column;
    }

    .sm-review-meta {
        font-size: 12px;
    }

    .sm-review-meta span {
        display: block;
        margin-bottom: 2px;
    }

    /* Progress toolbar */
    .sm-progress-toolbar {
        flex-direction: column;
        width: 100%;
    }

    .sm-form-select {
        width: 100%;
        min-width: auto;
    }

    /* Transfer banner */
    .sm-transfer-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sm-transfer-actions {
        width: 100%;
    }

    .sm-transfer-actions .sm-btn {
        flex: 1;
    }

    /* Tables scroll horizontally on mobile */
    .sm-table-wrap {
        margin: 0 -16px;
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .sm-dash-stats {
        grid-template-columns: 1fr;
    }

    .sm-stat-card {
        padding: 14px;
    }

    .sm-stat-number {
        font-size: 26px;
    }

    .sm-dash-title {
        font-size: 22px;
    }

    .sm-course-card {
        border-radius: 8px;
    }

    .sm-course-thumb {
        height: 120px;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   SCOUT TREATMENT — color-coded dashboards (Scouting America palette)
   Olive #243E2C · Tan #D6CEBD · Red #CE1126 · Parchment #F4F1E8
   ════════════════════════════════════════════════════════════════════════ */

/* ── Stat cards: cycling accent bars, GEMS-style ── */
.sm-dashboard .sm-stat-card {
    border-top: 4px solid #243E2C;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(36, 62, 44, 0.12);
}
.sm-dashboard .sm-stat-card:nth-child(4n+2) { border-top-color: #CE1126; }
.sm-dashboard .sm-stat-card:nth-child(4n+3) { border-top-color: #D6CEBD; }
.sm-dashboard .sm-stat-card:nth-child(4n+4) { border-top-color: #6B8E23; }
.sm-dashboard .sm-stat-number { color: #243E2C; }
.sm-dashboard .sm-stat-card:nth-child(4n+2) .sm-stat-number { color: #CE1126; }

/* ── Status badges: pill treatment in Scout colors ── */
.sm-dashboard .sm-status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.sm-dashboard .sm-status-active {
    background: rgba(107, 142, 35, 0.15);
    color: #3E5622;
    border: 1px solid rgba(107, 142, 35, 0.4);
}
.sm-dashboard .sm-status-inactive,
.sm-dashboard .sm-status-removed {
    background: rgba(206, 17, 38, 0.10);
    color: #CE1126;
    border: 1px solid rgba(206, 17, 38, 0.35);
}
.sm-dashboard .sm-status-pending {
    background: rgba(214, 206, 189, 0.45);
    color: #6B5B2E;
    border: 1px solid #D6CEBD;
}

/* ── Clickable drill rows ── */
.sm-dashboard tr.sm-drill-toggle { cursor: pointer; }
.sm-dashboard tr.sm-drill-toggle:hover { background: #F4F1E8; }
.sm-dashboard tr.sm-drill-toggle.sm-drill-open { background: #F4F1E8; }
.sm-drill-caret {
    display: inline-block;
    color: #CE1126;
    font-size: 11px;
    margin-right: 4px;
    transition: transform 0.15s ease;
}
.sm-drill-open .sm-drill-caret { transform: rotate(90deg); }

/* ── Drill-down panel ── */
.sm-drill-row > td {
    background: #F4F1E8 !important;
    border-left: 4px solid #CE1126;
    padding: 16px !important;
}
.sm-drill-panel {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 14px;
}
@media (max-width: 760px) {
    .sm-drill-panel { grid-template-columns: 1fr; }
}
.sm-drill-card {
    background: #ffffff;
    border: 1px solid #D6CEBD;
    border-radius: 8px;
    padding: 14px 16px;
}
.sm-drill-card h4 {
    margin: 0 0 10px;
    color: #243E2C;
    font-size: 15px;
    border-bottom: 2px solid #D6CEBD;
    padding-bottom: 6px;
}
.sm-drill-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 13px;
    color: #3a3a34;
}
.sm-drill-meta-stack { flex-direction: column; gap: 6px; }
.sm-drill-meta a { color: #CE1126; }
.sm-drill-leader-name {
    font-size: 16px;
    font-weight: 700;
    color: #243E2C;
    margin-bottom: 8px;
}

/* ── Progress bars: red fill on tan track ── */
.sm-drill-progress { margin: 10px 0; }
.sm-drill-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #3a3a34;
    margin-bottom: 4px;
}
.sm-drill-progress-pct { font-weight: 700; color: #CE1126; }
.sm-progress-track {
    height: 8px;
    background: #E7E1D3;
    border-radius: 6px;
    overflow: hidden;
}
.sm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #CE1126, #A30D1E);
    border-radius: 6px;
}

/* ── Mini stat grid inside drill panels ── */
.sm-drill-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}
@media (max-width: 560px) {
    .sm-drill-stats { grid-template-columns: repeat(2, 1fr); }
}
.sm-drill-stat {
    background: #F4F1E8;
    border: 1px solid #E7E1D3;
    border-radius: 6px;
    padding: 8px 6px;
    text-align: center;
}
.sm-drill-stat-num {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: #243E2C;
}
.sm-drill-stat-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6B5B2E;
}

/* ── Rank + badge chips ── */
.sm-rank-chip {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 20px;
    background: #243E2C;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}
.sm-badge-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.sm-badge-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(214, 206, 189, 0.45);
    border: 1px solid #D6CEBD;
    color: #243E2C;
    font-size: 12px;
    font-weight: 600;
}

/* ── Unified dashboard width ──
   Both dashboards cap at the same width and center themselves, so the
   Council and Troop Leader pages render identically regardless of the
   Cornerstone container they sit in (container must be >= this wide). */
.sm-platform.sm-dashboard {
    max-width: 1400px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ── Dashboard tour button (shortcode-embedded, GEMS pattern) ── */
.sm-dash-tour-btn {
    display: inline-block;
    margin-left: 10px;
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    background: #CE1126;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
    vertical-align: middle;
}
.sm-dash-tour-btn:hover {
    background: #A30D1E;
}
