/*
 * Student Portal Styles
 * Primary accent: Pantone 201 (#9E1B32)
 */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --primary:        #9E1B32;
    --primary-dark:   #7a1426;
    --primary-light:  #c4334f;
    --primary-tint:   #fdf0f2;
    --primary-muted:  #f5d6db;

    --text:           #1a1a1a;
    --text-muted:     #6b7280;
    --text-light:     #9ca3af;

    --bg:             #f9fafb;
    --surface:        #ffffff;
    --surface-alt:    #f3f4f6;

    --border:         #e5e7eb;
    --border-focus:   #9E1B32;

    --success:        #166534;
    --success-bg:     #dcfce7;
    --success-border: #86efac;

    --error:          #991b1b;
    --error-bg:       #fee2e2;
    --error-border:   #fca5a5;

    --warning:        #92400e;
    --warning-bg:     #fef3c7;
    --warning-border: #fcd34d;

    --info-bg:        #eff6ff;
    --info-border:    #93c5fd;

    --radius:         6px;
    --radius-sm:      4px;
    --radius-lg:      10px;
    --shadow:         0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:      0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);

    --font:           system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono:      "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

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

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 0.5rem;
}
h1 { font-size: 1.75rem; margin-top: 0; }
h2 { font-size: 1.35rem; margin-top: 1.5rem; }
h3 { font-size: 1.1rem;  margin-top: 1rem; }
h4 { font-size: 1rem; }

p { margin-bottom: 0.75rem; }

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

small { font-size: 0.8125rem; color: var(--text-muted); }

/* ── Layout ────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* ── Header & Nav ──────────────────────────────────────────── */
.site-header {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 200;
}

.nav-bar { width: 100%; }

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 3.5rem;
}

.nav-brand a {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: .01em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    align-items: center;
}

.nav-item { display: flex; align-items: center; }

.nav-link {
    color: rgba(255,255,255,.88);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-link:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
    text-decoration: none;
}

.logout-form { margin: 0; display: flex; }

.logout-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,.5);
    color: rgba(255,255,255,.88);
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s, border-color .15s;
}
.logout-btn:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
    border-color: rgba(255,255,255,.8);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.125rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: 500 0.875rem/1.5 var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }

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

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--surface-alt);
    border-color: #d1d5db;
    color: var(--text);
}

.btn-danger {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
}
.btn-danger:hover {
    background: #7f1d1d;
    border-color: #7f1d1d;
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-warning:hover { background: #78350f; color: #fff; }

.btn-link {
    background: none;
    border-color: transparent;
    color: var(--primary);
    padding-left: 0;
    padding-right: 0;
}
.btn-link:hover { color: var(--primary-dark); text-decoration: underline; }

.btn-small  { padding: 0.3rem 0.75rem; font-size: 0.8125rem; }
.btn-large  { padding: 0.65rem 1.5rem;  font-size: 1rem; }
.btn-full   { width: 100%; justify-content: center; }

/* show/hide password toggle */
.btn-show-hide {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-left: none;
    color: var(--text-muted);
    cursor: pointer;
    font: 0.8125rem var(--font);
    padding: 0 0.625rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    height: 100%;
    transition: background .15s, color .15s;
    white-space: nowrap;
    min-width: 3.25rem;
    flex-shrink: 0;
}
.btn-show-hide:hover { background: var(--border); color: var(--text); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.125rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.form-help {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-input,
.form-select,
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.9375rem;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
    -webkit-appearance: none;
}

.form-select,
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239E1B32' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    padding-right: 2.25rem;
}

.form-input:focus,
.form-select:focus,
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(158,27,50,.12);
}

.form-input[readonly] {
    background: var(--surface-alt);
    color: var(--text-muted);
    cursor: default;
}

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

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.form-subtitle {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

.form-container {
    max-width: 560px;
    margin: 0 auto;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.profile-container {
    max-width: 860px;
    margin: 0 auto;
}

.form-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.form-section h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Password input + show/hide button */
.pw-input-group {
    display: flex;
    align-items: stretch;
    margin-bottom: 0.5rem;
}
.pw-input-group input {
    border-radius: var(--radius) 0 0 var(--radius);
    flex: 1;
    min-width: 0;
}
.pw-input-group input:focus {
    z-index: 1;
    position: relative;
}

/* ── Checkboxes & Radios ────────────────────────────────────── */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    accent-color: var(--primary);
    cursor: pointer;
}

.subject-list { list-style: none; padding: 0; }
.subject-list-item { margin-bottom: 0.35rem; }
.subject-list-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
    padding: 0.25rem 0;
}
.subject-list-item label:hover { color: var(--primary); }

/* ── Subject Groups ─────────────────────────────────────────── */
.subject-group {
    margin-bottom: 1.25rem;
}
.subject-group h3,
.subject-group h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    margin-top: 0;
}

/* ── Timeslot Grid ──────────────────────────────────────────── */
.timeslot-grid-wrapper {
    overflow-x: auto;
    margin: 0.75rem 0;
}

.timeslot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.timeslot-table th {
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 0.625rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.8125rem;
}
.timeslot-table thead th:first-child { background: var(--surface-alt); color: var(--text-muted); }

.timeslot-table tbody th {
    background: var(--surface-alt);
    color: var(--text);
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
    text-align: center;
    border: 1px solid var(--border);
}

.timeslot-table td {
    border: 1px solid var(--border);
    padding: 0.25rem;
    text-align: center;
}

/* timeslot checkbox cell — centered tick */
.timeslot-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin: auto;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s;
}
.timeslot-checkbox input { display: none; }
.timeslot-checkbox .checkmark {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--border);
    border-radius: 3px;
    background: var(--surface);
    position: relative;
    transition: border-color .15s, background .15s;
    /* ensure the pseudo-element tick is centred inside the box */
    display: flex;
    align-items: center;
    justify-content: center;
}
.timeslot-checkbox:not(.disabled):hover .checkmark {
    border-color: var(--primary-light);
    background: var(--primary-tint);
}
.timeslot-checkbox input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}
.timeslot-checkbox input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 3px; top: 0px;
    width: 5px; height: 9px;
    border: 2px solid #fff;
    border-top: none; border-left: none;
    transform: rotate(45deg);
}
.timeslot-checkbox.disabled {
    cursor: not-allowed;
    opacity: .38;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.alert-error   { background: var(--error-bg);   border-color: var(--error-border);   color: var(--error); }
.alert-info    { background: var(--info-bg);     border-color: var(--info-border);    color: #1e40af; }
.alert-warning { background: var(--warning-bg);  border-color: var(--warning-border); color: var(--warning); }

/* ── Dashboard ──────────────────────────────────────────────── */
.dashboard-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.dashboard-header h1 { margin: 0; }
.welcome-message { color: var(--text-muted); font-size: 0.9375rem; margin: 0; }

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

/* ── Stats Cards ────────────────────────────────────────────── */
.stats-section { margin-bottom: 1.75rem; }

.stats-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stats-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.stat-card-accent {
    border-color: var(--primary-muted);
    background: var(--primary-tint);
}
.stat-card-accent .stat-number { color: var(--primary); }

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Tables ─────────────────────────────────────────────────── */
.requests-table-container,
.users-table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.requests-table,
.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.requests-table thead tr,
.users-table thead tr {
    background: var(--primary);
    color: #fff;
}

.requests-table th,
.users-table th {
    padding: 0.65rem 0.875rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: .02em;
    color: #fff;
    border: none;
    white-space: nowrap;
}

.requests-table td,
.users-table td {
    padding: 0.6rem 0.875rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}

.requests-table tbody tr:last-child td,
.users-table tbody tr:last-child td {
    border-bottom: 1px solid var(--border);
}

.requests-table tbody tr:hover,
.users-table tbody tr:hover {
    background: var(--surface-alt);
}

/* archived row */
.row-archived {
    opacity: .6;
    background: var(--surface-alt) !important;
}
.row-archived:hover { opacity: .75; }

/* ── Badges / Status ────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
}
.status-badge.pending   { background: var(--warning-bg);  color: var(--warning); }
.status-badge.matched   { background: var(--success-bg);  color: var(--success); }
.status-badge.cancelled { background: var(--surface-alt); color: var(--text-muted); }
.status-badge.done      { background: var(--info-bg);     color: #1d4ed8; }

.request-type {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.request-type.type-tutor { background: var(--primary-tint);  color: var(--primary); border: 1px solid var(--primary-muted); }
.request-type.type-tutee { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.role-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.role-badge.admin   { background: var(--primary-tint); color: var(--primary); border: 1px solid var(--primary-muted); }
.role-badge.student { background: var(--surface-alt);  color: var(--text-muted); border: 1px solid var(--border); }

.badge-archived {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--surface-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ── Filter Section ─────────────────────────────────────────── */
.filter-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.filter-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-row .form-group {
    margin-bottom: 0;
    min-width: 180px;
}

.filter-toggle {
    display: flex;
    align-items: center;
    padding-bottom: 0.125rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text);
}

.toggle-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.toggle-text { font-weight: 500; }

/* ── Section Header (for dash with inline controls) ─────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.section-header h2 { margin: 0; }

/* ── Timeslots in tables ────────────────────────────────────── */
.timeslots-cell {
    font-size: 0.8125rem;
    color: var(--text-muted);
    max-width: 220px;
}
.timeslot-item { white-space: nowrap; }

/* ── Actions Cell ───────────────────────────────────────────── */
.actions-cell {
    white-space: nowrap;
}

/* ── Status Card (profile status) ──────────────────────────── */
.status-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.status-item:last-child { border-bottom: none; }
.status-label {
    font-weight: 500;
    color: var(--text-muted);
    min-width: 130px;
    font-size: 0.875rem;
}

/* ── Profile Status labels ──────────────────────────────────── */
.status-complete   { color: var(--success); font-weight: 600; }
.status-incomplete { color: var(--error);   font-weight: 600; }

/* ── Info Box ───────────────────────────────────────────────── */
.info-box {
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: var(--radius);
    padding: 1rem 1.125rem;
    margin: 1rem 0;
}
.info-box h3 { color: #1e40af; font-size: 0.9rem; margin-top: 0; margin-bottom: 0.5rem; }
.info-box ul { padding-left: 1.25rem; }
.info-box li { font-size: 0.875rem; color: #1d4ed8; margin-bottom: 0.25rem; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.empty-state p { margin-bottom: 1rem; }

/* ── Danger Zone ────────────────────────────────────────────── */
.danger-zone {
    border-color: var(--error-border) !important;
    background: var(--error-bg) !important;
}
.danger-zone h2 {
    color: var(--error) !important;
    border-bottom-color: var(--error-border) !important;
}
.danger-zone .section-description { color: var(--error); }

.section-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ── Inline Details (change-password expander) ──────────────── */
.inline-details {
    display: inline-block;
    vertical-align: top;
    position: relative;
}
.inline-details summary {
    cursor: pointer;
    list-style: none;
    display: inline-block;
}
.inline-details summary::-webkit-details-marker { display: none; }

.inline-password-form {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 100;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow-md);
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* variant that opens upward — avoids scroll when table is short */
.inline-password-form--above {
    top: auto;
    bottom: calc(100% + 0.35rem);
}

/* row of actions inside the password popup */
.pw-form-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    margin-top: 0.2rem;
}

.form-input-inline {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
    font: inherit;
    transition: border-color .15s;
}
.form-input-inline:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── Show more ──────────────────────────────────────────────── */
.show-more {
    padding: 0.75rem 1rem;
    text-align: right;
    border-top: 1px solid var(--border);
}

/* ── Register / Login layout ────────────────────────────────── */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1.25rem;
}

/* ── Index / Home ───────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 4rem 1.5rem;
}
.hero h1 { font-size: 2.25rem; color: var(--primary); margin-bottom: 0.75rem; }
.hero p   { font-size: 1.0625rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
}
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.feature-card h3 { color: var(--primary); margin-top: 0; font-size: 1rem; }
.feature-card p  { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

/* ── Login / Register forms ─────────────────────────────────── */
.login-container,
.register-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 3rem 1.25rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .filter-row { flex-direction: column; gap: 0.75rem; }
    .filter-row .form-group { min-width: 0; width: 100%; }
    .dashboard-header { flex-direction: column; align-items: flex-start; }
    .dashboard-actions { flex-direction: column; }
    .dashboard-actions .btn { width: 100%; justify-content: center; }
    .inline-password-form { min-width: 280px; }
    .nav-container { padding: 0 0.75rem; }
}

@media (max-width: 480px) {
    .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .stat-number { font-size: 1.5rem; }
    h1 { font-size: 1.4rem; }
    .form-container { padding: 1.25rem; }
}

/* ── Misc ───────────────────────────────────────────────────── */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

.no-partner,
.no-actions {
    color: var(--text-light);
    font-size: 0.875rem;
}

.matched-partner-name { font-weight: 500; }

/* small envelope icon link next to the matched partner name */
.mailto-link {
    margin-left: 0.4rem;
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    vertical-align: middle;
}
.mailto-link:hover { color: var(--primary-dark); }

/* ── Print ──────────────────────────────────────────────────── */
@media print {
    .site-header, .dashboard-actions, .form-actions, .actions-cell { display: none; }
}

/* ── Additional styles ──────────────────────────────────────── */

/* Email input with domain suffix */
.email-input-container {
    display: flex;
    align-items: stretch;
}
.email-prefix {
    border-radius: var(--radius) 0 0 var(--radius);
    flex: 1;
    min-width: 0;
}
.email-domain {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Form footer (login/register links) */
.form-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.form-footer a, .link { color: var(--primary); font-weight: 500; }

/* Error text under fields */
.error-text {
    display: block;
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.25rem;
}
.error-list {
    padding-left: 1.25rem;
    margin: 0;
}
.error-list li { font-size: 0.875rem; }

/* Account deleted message */
.alert-info { background: var(--info-bg); border-color: var(--info-border); color: #1e40af; }

/* Profile section h2 overrides inside form-section already handled */
