/* Teacher dashboard tabs and the Student Submissions tab (subscribeSchools.html).
   Uses the page's own variables (--green, --cream, --mid, --border, --ink). */

.modal.modal-wide {
    max-width: 980px;
}

.dash-tabs {
    display: none;
    gap: 6px;
    margin: 0 0 22px 0;
    padding: 4px;
    background: var(--cream);
    border-radius: 100px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
}

.dash-tabs.visible {
    display: flex;
}

.dash-tab {
    background: none;
    border: none;
    border-radius: 100px;
    padding: 9px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--mid);
    cursor: pointer;
    white-space: nowrap;
}

.dash-tab .tab-short {
    display: none;
}

/* phones: short tab names so all three fit without scrolling sideways */
@media (max-width: 520px) {
    .dash-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .dash-tab {
        flex: 1;
        padding: 9px 6px;
    }

    .dash-tab .tab-full {
        display: none;
    }

    .dash-tab .tab-short {
        display: inline;
    }
}

.dash-tab.active {
    background: #fff;
    color: var(--green);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.subs-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.subs-toolbar select,
.subs-toolbar input[type="search"] {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    background: #fff;
    outline: none;
    min-width: 0;
}

.subs-toolbar select:focus,
.subs-toolbar input[type="search"]:focus {
    border-color: var(--green);
}

.subs-toolbar input[type="search"] {
    flex: 1 1 200px;
}

.subs-bulk {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    background: var(--cream);
    border-radius: 14px;
    margin-bottom: 12px;
    font-size: 13px;
}

.subs-bulk label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    cursor: pointer;
}

.subs-bulk .spacer {
    flex: 1;
}

#subs-selected-count {
    color: var(--mid);
    min-width: 70px;
}

.subs-status {
    display: none;
    font-size: 13px;
    color: var(--mid);
    margin: 0 0 10px 0;
}

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

.sub-card {
    display: grid;
    grid-template-columns: auto 72px 1fr auto;
    gap: 14px;
    align-items: center;
    background: var(--cream);
    border: 1.5px solid transparent;
    border-radius: 14px;
    padding: 10px 14px;
}

.sub-card.selected {
    border-color: var(--green);
    background: var(--green-light);
}

.sub-check input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sub-thumb {
    width: 72px;
    height: 60px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 26px;
}

.sub-thumb img {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sub-thumb.has-img img {
    display: block;
}

.sub-thumb.has-img span {
    display: none;
}

.sub-info {
    min-width: 0;
}

.sub-student {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-title {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-meta {
    font-size: 12px;
    color: var(--mid);
    margin-top: 2px;
}

.sub-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.subs-more {
    text-align: center;
    margin-top: 14px;
}

.subs-note {
    font-size: 12px;
    color: var(--mid);
    margin: 0 0 10px 0;
}

@media (max-width: 640px) {
    .modal.modal-wide {
        padding: 32px 16px;
    }

    .sub-card {
        grid-template-columns: auto 56px 1fr;
    }

    .sub-thumb {
        width: 56px;
        height: 48px;
    }

    .sub-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

/* ── Teacher Dashboard page (signed-in teachers with a school subscription) ──
   body.dashboard-mode: the sales sections are hidden and #teacher-dashboard shows the dashboard
   blocks moved out of the dialog. html.dashboard-pending: same layout with a "Loading" placeholder
   while sign-in is checked for a teacher who saw the dashboard last time. */

.teacher-dashboard {
    display: none;
    background: var(--cream);
    padding: 110px 24px 64px;
    min-height: 70vh;
}

body.dashboard-mode .teacher-dashboard,
html.dashboard-pending .teacher-dashboard {
    display: block;
}

body.dashboard-mode > section:not(#teacher-dashboard):not(#faq),
body.dashboard-mode > .proof-bar,
html.dashboard-pending body > section:not(#teacher-dashboard):not(#faq),
html.dashboard-pending body > .proof-bar {
    display: none;
}

.teacher-dashboard-head {
    max-width: 980px;
    margin: 0 auto 22px;
}

.teacher-dashboard-head h1 {
    font-family: 'Fraunces', serif;
    font-size: 40px;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--ink);
    margin: 4px 0 6px;
}

.teacher-dashboard-head p {
    color: var(--mid);
    font-size: 15px;
}

/* the panel keeps the dialog's .modal styles (headings, spacing) without being a dialog */
.modal.dashboard-panel {
    max-width: 980px;
    margin: 0 auto;
    max-height: none;
    overflow: visible;
    animation: none;
    box-shadow: 0 8px 32px rgba(15, 26, 15, 0.08);
}

.dashboard-loading {
    color: var(--mid);
    text-align: center;
    padding: 40px 0;
}

body.dashboard-mode .dashboard-loading {
    display: none;
}

@media (max-width: 640px) {
    .teacher-dashboard {
        padding: 90px 12px 40px;
    }

    .teacher-dashboard-head h1 {
        font-size: 30px;
    }

    .modal.dashboard-panel {
        padding: 28px 16px;
        border-radius: 20px;
    }
}

/* ── Change plan (Overview) ── */
.change-plan-open {
    display: inline-block;
    margin-top: 10px;
}

.change-plan {
    background: var(--cream);
    border-radius: 16px;
    padding: 18px;
    margin: 0 0 20px;
}

.change-plan h3 {
    font-family: 'Fraunces', serif;
    font-size: 18px;
    margin-bottom: 6px;
}

.change-plan-intro {
    font-size: 13px;
    color: var(--mid);
    line-height: 1.5;
    margin-bottom: 14px;
}

/* monthly row, then yearly row: Teacher / Classroom / School */
.plan-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.plan-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    color: var(--ink);
}

.plan-option:hover:not(:disabled) {
    border-color: var(--green);
}

.plan-option.selected {
    border-color: var(--green);
    background: var(--green-light);
}

.plan-option.current {
    cursor: default;
    opacity: 0.7;
}

.plan-option-name {
    font-weight: 700;
    font-size: 14px;
}

.plan-option-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
}

.plan-option-meta {
    font-size: 12px;
    color: var(--mid);
}

.plan-option-tag {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--mid);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.change-plan-preview {
    font-size: 14px;
    line-height: 1.5;
    margin: 14px 0 0;
    min-height: 1em;
}

.change-plan-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

@media (max-width: 520px) {
    .plan-options {
        gap: 6px;
    }

    .plan-option {
        padding: 9px 8px;
    }

    .plan-option-name {
        font-size: 12px;
    }

    .plan-option-price {
        font-size: 14px;
    }

    .plan-option-meta,
    .plan-option-tag {
        font-size: 10px;
    }
}
