/* ── SpeakerHub Styles ─────────────────────────────────────────── */

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

:root {
    --bg: #f0f0f0;
    --card-bg: #ffffff;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --text-hint: #9ca3af;
    --border: #e5e7eb;
    --btn-bg: #1a1a1a;
    --btn-text: #ffffff;
    --btn-hover: #333333;
    --link: #1a1a1a;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --error-border: #fecaca;
    --success-bg: #f0fdf4;
    --success-text: #15803d;
    --success-border: #bbf7d0;
    --info-bg: #eff6ff;
    --info-text: #1d4ed8;
    --info-border: #bfdbfe;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
}

html {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Card Container ─────────────────────────────────────────── */

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 460px;
    margin: 40px 16px;
}

.auth-card__title {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.auth-card__subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
}

/* ── Landing page ───────────────────────────────────────────── */

.landing {
    text-align: center;
    padding: 20px;
}

.landing__logo {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.landing__desc {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 340px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.landing__buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Form elements ──────────────────────────────────────────── */

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

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

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: var(--font);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-hint);
}

.form-group input:focus {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.08);
}

.form-hint {
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 4px;
}

.form-link-right {
    display: block;
    text-align: right;
    margin-top: 6px;
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.btn--primary {
    background: var(--btn-bg);
    color: var(--btn-text);
    width: 100%;
}

.btn--primary:hover {
    background: var(--btn-hover);
}

.btn--outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn--outline:hover {
    border-color: var(--text);
    background: rgba(0,0,0,0.02);
}

.btn--dark {
    background: var(--btn-bg);
    color: var(--btn-text);
}

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

/* ── Links ──────────────────────────────────────────────────── */

a {
    color: var(--link);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.15s;
}

a:hover {
    opacity: 0.7;
}

.auth-card__footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-card__footer a {
    font-weight: 700;
}

/* ── Alert / Flash messages ─────────────────────────────────── */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 24px;
    border: 1px solid;
    line-height: 1.5;
}

.alert--error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}

.alert--success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.alert--info {
    background: var(--info-bg);
    color: var(--info-text);
    border-color: var(--info-border);
}

/* ── Password strength meter ────────────────────────────────── */

.password-rules {
    margin-top: 8px;
    padding: 0;
    list-style: none;
}

.password-rules li {
    font-size: 12px;
    color: var(--text-hint);
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.password-rules li::before {
    content: '○';
    font-size: 10px;
}

.password-rules li.valid {
    color: var(--success-text);
}

.password-rules li.valid::before {
    content: '●';
}

/* ── Dashboard layout ───────────────────────────────────────── */

.dashboard {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard__header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard__logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
}

.dashboard__logo:hover { opacity: 1; }

.dashboard__user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-muted);
}

.dashboard__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* ── Navbar ─────────────────────────────────────────────────── */

.nav-right {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(0,0,0,0.04);
    opacity: 1;
}

.nav-link--active {
    color: var(--text);
    font-weight: 700;
}

.nav-separator {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 20px;
}

.nav-email {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Badges ─────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge--role     { background: #f0f0f0; color: var(--text); }
.badge--info     { background: var(--info-bg); color: var(--info-text); }
.badge--success  { background: var(--success-bg); color: var(--success-text); }
.badge--warning  { background: #fffbeb; color: #b45309; }
.badge--error    { background: var(--error-bg); color: var(--error-text); }

/* ── Dashboard main content ─────────────────────────────────── */

.dash-main {
    flex: 1;
    padding: 32px;
    max-width: 1200px;
    min-width: 70%;
    margin: 0 auto;
    width: 100%;
}

.dash-top {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

/* ── Profile card ──────────────────────────────────────────── */

.profile-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.profile-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.profile-card__info {
    flex: 1;
    min-width: 0;
}

.profile-card__name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 2px;
}

.profile-card__affiliation {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-card__location {
    font-size: 13px;
    color: var(--text-hint);
    margin-top: 2px;
}

.profile-card__edit {
    flex-shrink: 0;
}

/* ── Stats row ─────────────────────────────────────────────── */

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 3px solid transparent;
}

.stat-box--total     { border-top-color: #1a1a1a; }
.stat-box--submitted { border-top-color: var(--info-text); }
.stat-box--review    { border-top-color: #b45309; }
.stat-box--accepted  { border-top-color: var(--success-text); }

.stat-box__number {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.stat-box--total .stat-box__number     { color: #1a1a1a; }
.stat-box--submitted .stat-box__number { color: var(--info-text); }
.stat-box--review .stat-box__number    { color: #b45309; }
.stat-box--accepted .stat-box__number  { color: var(--success-text); }

.stat-box__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-hint);
}

/* ── Dashboard section ─────────────────────────────────────── */

.dash-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
}

.dash-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.dash-section__title {
    font-size: 18px;
    font-weight: 700;
}

.dash-section__link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.dash-section__link:hover {
    color: var(--text);
}

/* ── Empty state ───────────────────────────────────────────── */

.dash-empty {
    text-align: center;
    padding: 40px 20px;
}

.dash-empty__icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.dash-empty__title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.dash-empty__text {
    font-size: 14px;
    color: var(--text-muted);
}

/* ── Papers table (compact) ────────────────────────────────── */

.papers-table {
    display: flex;
    flex-direction: column;
}

.papers-table__head {
    display: flex;
    align-items: center;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-hint);
}

.papers-table__row {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: var(--text);
    font-weight: 400;
    transition: background 0.12s;
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 8px;
}

.papers-table__row:hover {
    background: #fafafa;
    opacity: 1;
}

.papers-table__col {
    display: flex;
    align-items: center;
}

.papers-table__col--title {
    flex: 1;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding-right: 16px;
}

.papers-table__col--status { width: 120px; }
.papers-table__col--type   { width: 60px; }
.papers-table__col--date   { width: 100px; font-size: 13px; color: var(--text-hint); }
.papers-table__col--action { width: 32px; justify-content: flex-end; }

.papers-table__paper-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.papers-table__authors {
    font-size: 12px;
    color: var(--text-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.papers-table__arrow {
    color: var(--text-hint);
    font-size: 16px;
    transition: transform 0.15s;
}

.papers-table__row:hover .papers-table__arrow {
    transform: translateX(2px);
    color: var(--text);
}

/* ── Logout button ─────────────────────────────────────────── */

.btn--logout {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    padding: 8px 20px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font);
    transition: all 0.2s;
}

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

/* ── Dynamic list inputs (authors, keywords) ───────────────── */

.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dynamic-list__item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dynamic-list__item input {
    flex: 1;
}

.dynamic-list__num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0f0f0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dynamic-list__remove {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-hint);
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.dynamic-list__remove:hover {
    background: var(--error-bg);
    color: var(--error-text);
}

.dynamic-list__add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text-muted);
    background: none;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 4px;
    align-self: flex-start;
}

.dynamic-list__add:hover {
    border-color: var(--text);
    color: var(--text);
    background: rgba(0,0,0,0.02);
}

.dynamic-list__add-icon {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

/* ── Admin panel ───────────────────────────────────────────── */

.admin-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: #1a1a1a;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

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

.admin-page-header__title {
    font-size: 24px;
    font-weight: 700;
}

.admin-page-header__count {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Admin stats ──────────────────────────────────────────── */

.admin-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-stats__item {
    flex: 1;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    text-align: center;
    border-top: 3px solid var(--border);
}

.admin-stats__item--yes { border-top-color: #15803d; }
.admin-stats__item--no  { border-top-color: #9ca3af; }

.admin-stats__number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.admin-stats__item--yes .admin-stats__number { color: #15803d; }
.admin-stats__item--no  .admin-stats__number { color: #6b7280; }

.admin-stats__label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Admin table ───────────────────────────────────────────── */

.admin-table-wrap {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.admin-table thead {
    background: #fafafa;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-hint);
    white-space: nowrap;
}

.admin-table__th--name {
    min-width: 240px;
}

.admin-table__th--center {
    text-align: center;
}

.admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
    color: var(--text-muted);
    vertical-align: middle;
    font-size: 13px;
}

.admin-table__td--name {
    color: var(--text);
}

.admin-table__td--center {
    text-align: center;
}

.admin-table__row:last-child td {
    border-bottom: none;
}

.admin-table__row:hover td {
    background: #fafafa;
}

/* Speaker name cell */
.speaker-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.speaker-name__full {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.speaker-name__full--incomplete {
    font-style: italic;
    color: var(--text-hint);
    font-weight: 400;
}

.speaker-name__degrees {
    color: var(--text-muted);
    font-weight: 400;
}

.speaker-name__email {
    font-size: 12px;
    color: var(--text-hint);
}

/* Paper count badge */
.paper-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    background: #1a1a1a;
    color: #fff;
}

.paper-count-badge--zero {
    background: #f0f0f0;
    color: var(--text-hint);
}

/* Presentation badge */
.present-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 12px;
}

.present-badge--yes {
    background: var(--success-bg);
    color: var(--success-text);
}

.present-badge--no {
    background: #f5f5f5;
    color: var(--text-hint);
}

.present-badge--na {
    color: var(--text-hint);
}

/* ── Radio group (Yes/No selector) ─────────────────────────── */

.radio-group {
    display: flex;
    gap: 12px;
}

.radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.radio-label:hover {
    border-color: #999;
}

.radio-label:has(input:checked) {
    border-color: #1a1a1a;
    background: #fafafa;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #1a1a1a;
    flex-shrink: 0;
}

.radio-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.radio-hint {
    font-size: 12px;
    color: var(--text-hint);
    margin-left: auto;
}

/* Sort links in admin table */
.admin-table__th--sortable {
    cursor: pointer;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-hint);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.sort-link:hover {
    color: var(--text);
    opacity: 1;
}

.sort-link--active {
    color: var(--text);
}

.sort-arrow {
    font-size: 12px;
    line-height: 1;
}

.paper-title-cell {
    font-size: 13px;
    line-height: 1.4;
}

.file-badge--empty {
    background: #f5f5f5;
    color: var(--text-hint);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
}

/* ── Admin downloads page ──────────────────────────────────── */

.dl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 20px;
    margin-bottom: 24px;
}

.dl-toolbar__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dl-toolbar__selected {
    font-size: 13px;
    color: var(--text-hint);
    font-variant-numeric: tabular-nums;
}

.dl-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

.dl-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #1a1a1a;
}

.admin-table__th--check,
.admin-table__td--check {
    width: 40px;
    text-align: center;
    padding-left: 16px;
    padding-right: 4px;
}

.dl-filesize {
    font-size: 12px;
    color: var(--text-hint);
    font-variant-numeric: tabular-nums;
}

.btn--sm {
    padding: 8px 18px;
    font-size: 13px;
}

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

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
    .dashboard__header {
        height: auto;
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 8px;
    }

    .nav-right {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        justify-content: flex-end;
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 2px;
        order: 2;
    }

    .nav-separator { display: none; }

    .nav-link {
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 13px;
    }

    .dashboard__user {
        order: 1;
        gap: 8px;
    }

    .nav-email { display: none; }

    /* Dashboard content */
    .dash-main {
        padding: 20px 16px;
    }

    .profile-card {
        flex-wrap: wrap;
        padding: 20px;
    }

    .profile-card__edit {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .dash-section {
        padding: 20px 16px;
    }

    /* Table → hide some columns */
    .papers-table__col--type,
    .papers-table__col--date,
    .papers-table__head { display: none; }

    .papers-table__row {
        padding: 12px 8px;
    }

    .papers-table__col--title { flex: 1; }
    .papers-table__col--status { width: auto; }

    .papers-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .paper-card__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .paper-card__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .admin-stats {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px;
        margin: 20px 12px;
    }

    .welcome-card {
        padding: 32px 24px;
    }

    .form-row {
        flex-direction: column;
    }
}

/* ── Profile form extras ────────────────────────────────────── */

.form-row {
    display: flex;
    gap: 16px;
}

.form-group--half {
    flex: 1;
}

.form-section-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-hint);
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.required {
    color: var(--error-text);
}

.form-error {
    display: block;
    font-size: 12px;
    color: var(--error-text);
    margin-top: 4px;
}

.input--error {
    border-color: var(--error-text) !important;
}

/* Select styling */
.form-group select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: var(--font);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-group select:focus {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.08);
}

/* Textarea styling */
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: var(--font);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    resize: vertical;
    min-height: 60px;
    line-height: 1.6;
}

.form-group textarea::placeholder {
    color: var(--text-hint);
}

.form-group textarea:focus {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.08);
}

.form-hint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.char-counter {
    font-size: 12px;
    color: var(--text-hint);
    font-variant-numeric: tabular-nums;
}

/* ── File upload ────────────────────────────────────────────── */

.file-upload {
    position: relative;
}

.file-upload__input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.file-upload__area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.file-upload__area:hover,
.file-upload__area--drag {
    border-color: var(--text);
    background: rgba(0,0,0,0.01);
}

.file-upload__icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.file-upload__text {
    font-size: 14px;
    color: var(--text-muted);
}

.file-upload__cta {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
}

.file-upload__formats {
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 4px;
}

.file-upload__preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafafa;
}

.file-upload__filename {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-upload__filesize {
    font-size: 12px;
    color: var(--text-hint);
}

.file-upload__remove {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-hint);
    padding: 4px;
    line-height: 1;
    transition: color 0.15s;
}

.file-upload__remove:hover {
    color: var(--error-text);
}

/* ── Papers listing ─────────────────────────────────────────── */

.papers-container {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

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

.papers-header__title {
    font-size: 24px;
    font-weight: 700;
}

.papers-header__count {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
}

.papers-empty {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 64px 32px;
    text-align: center;
}

.papers-empty__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.papers-empty__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.papers-empty__text {
    font-size: 14px;
    color: var(--text-muted);
}

.papers-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Paper card ─────────────────────────────────────────────── */

.paper-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.paper-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.paper-card__date {
    font-size: 13px;
    color: var(--text-hint);
}

.paper-card__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 4px;
}

.paper-card__authors {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.paper-card__abstract {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 12px;
}

.paper-card__keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.keyword-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.paper-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.paper-card__file {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.file-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.file-badge--pdf  { background: #fef2f2; color: #b91c1c; }
.file-badge--docx { background: #eff6ff; color: #1d4ed8; }

.paper-card__filename {
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paper-card__filesize {
    font-size: 12px;
    color: var(--text-hint);
    white-space: nowrap;
}

.paper-card__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Small action buttons ──────────────────────────────────── */

.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    border: 1.5px solid #999;
    background: transparent;
    color: var(--text);
    line-height: 1.4;
}

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

.btn-sm--outline {
    /* default is already outline */
}

.btn-sm--danger {
    color: var(--error-text);
    border-color: var(--error-border);
}

.btn-sm--danger:hover {
    background: var(--error-bg);
    border-color: var(--error-text);
}

/* ── Paper count clickable badge ───────────────────────────── */

.paper-count-badge--link {
    cursor: pointer;
    border: none;
    font-family: var(--font);
    transition: transform 0.15s, box-shadow 0.15s;
}

.paper-count-badge--link:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── Modal ──────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay--visible {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.modal__close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-hint);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: all 0.15s;
}

.modal__close:hover {
    background: #f0f0f0;
    color: var(--text);
}

.modal__body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Modal paper card */

.modal-paper {
    padding-bottom: 20px;
}

.modal-paper--border {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal-paper__top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.modal-paper__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
    line-height: 1.4;
}

.modal-paper__authors {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.modal-paper__abstract {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    background: #f9f9f9;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

@media (max-width: 640px) {
    .modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 8px;
    }
    .modal__body {
        padding: 16px;
    }
}
