/* ============================================================
   PORTAL CV — GALERIA LEME
   Design System: "Gallery After Hours"

   Dark mode = evening vernissage
   Light mode = white-cube gallery
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

/* ===== Theme Variables ===== */
:root {
    /* Dark theme (default) */
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-elevated: #1a1a1a;
    --bg-hover: #222222;
    --bg-input: #111111;

    --border-primary: #2a2a2a;
    --border-subtle: #1e1e1e;
    --border-focus: #555555;

    --text-primary: #e8e4de;
    --text-secondary: #8a8680;
    --text-tertiary: #5a5754;
    --text-inverse: #0a0a0a;

    --accent: #e8e4de;
    --accent-subtle: rgba(232, 228, 222, 0.08);
    --accent-hover: rgba(232, 228, 222, 0.12);

    --green: #c8e64a;
    --green-subtle: rgba(200, 230, 74, 0.10);
    --green-hover: rgba(200, 230, 74, 0.18);
    --green-muted: #8fa834;

    --success-bg: rgba(200, 230, 74, 0.10);
    --success-text: #c8e64a;
    --success-border: rgba(200, 230, 74, 0.25);

    --error-bg: rgba(176, 42, 42, 0.12);
    --error-text: #e07070;
    --error-border: rgba(176, 42, 42, 0.25);

    --warning-bg: rgba(196, 160, 60, 0.1);
    --warning-text: #d4a83c;

    --badge-blue-bg: rgba(80, 140, 200, 0.12);
    --badge-blue-text: #6aaddf;
    --badge-purple-bg: rgba(140, 80, 180, 0.12);
    --badge-purple-text: #b088d0;

    --spinner-track: #2a2a2a;
    --spinner-head: var(--green, #c8e64a);

    --focus-ring: rgba(200, 230, 74, 0.4);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);

    --logo-filter: invert(1);
    --transition-theme: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.3s ease;

    /* Typography scale */
    --font-display: 'Cormorant Garamond', 'Georgia', serif;
    --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    --size-xs: 0.6875rem;   /* 11px */
    --size-sm: 0.8125rem;   /* 13px */
    --size-base: 0.875rem;  /* 14px */
    --size-md: 0.9375rem;   /* 15px */
    --size-lg: 1.125rem;    /* 18px */
    --size-xl: 1.5rem;      /* 24px */
    --size-2xl: 2rem;       /* 32px */
    --size-3xl: 2.5rem;     /* 40px */
    --size-hero: 3.5rem;    /* 56px */
}

/* ===== Light Theme ===== */
[data-theme="light"] {
    --bg-primary: #fafaf8;
    --bg-secondary: #f2f1ee;
    --bg-elevated: #ffffff;
    --bg-hover: #f5f4f1;
    --bg-input: #ffffff;

    --border-primary: #e2e0db;
    --border-subtle: #ece9e4;
    --border-focus: #32373c;

    --text-primary: #0a0a0a;
    --text-secondary: #7f7f7f;
    --text-tertiary: #aaaaaa;
    --text-inverse: #fafaf8;

    --accent: #0a0a0a;
    --accent-subtle: rgba(10, 10, 10, 0.04);
    --accent-hover: rgba(10, 10, 10, 0.07);

    --green: #6a8a1e;
    --green-subtle: rgba(106, 138, 30, 0.08);
    --green-hover: rgba(106, 138, 30, 0.14);
    --green-muted: #4a6210;

    --success-bg: #f0f5e5;
    --success-text: #4a6210;
    --success-border: #d4e4a8;

    --error-bg: #fdf2f2;
    --error-text: #b02a2a;
    --error-border: #f5d0d0;

    --warning-bg: #fdf8ec;
    --warning-text: #92700c;

    --badge-blue-bg: #eef4fb;
    --badge-blue-text: #1565c0;
    --badge-purple-bg: #f4eef9;
    --badge-purple-text: #7b1fa2;

    --spinner-track: #e2e0db;
    --spinner-head: var(--green, #6a8a1e);

    --focus-ring: rgba(106, 138, 30, 0.3);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);

    --logo-filter: none;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition-theme);
    min-height: 100vh;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

::selection {
    background: var(--accent);
    color: var(--text-inverse);
}

/* Subtle scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ===== Layout ===== */
.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ===== Header ===== */
.header {
    background: var(--bg-primary);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-theme);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 10, 10, 0.85);
}

[data-theme="light"] .header {
    background: rgba(250, 250, 248, 0.85);
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.header__logo {
    display: flex;
    align-items: center;
}

.header__logo img {
    height: 192px;
    filter: var(--logo-filter);
    transition: filter 0.4s ease, opacity 0.2s ease;
}

.header__logo:hover img {
    opacity: 0.7;
}

.header__nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.header__link {
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.25s ease;
    position: relative;
    padding: 4px 0;
}

.header__link:hover {
    color: var(--text-primary);
}

.header__link--active {
    color: var(--text-primary);
    font-weight: 600;
}

.header__link--active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--green);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--green);
    border-radius: 50%;
    background: var(--green-subtle);
    color: var(--green);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 17px;
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--green-subtle), 0 0 20px rgba(200, 230, 74, 0.06);
}

.theme-toggle:hover {
    border-color: var(--green);
    color: var(--green);
    background: var(--green-hover);
    box-shadow: 0 0 12px var(--green-hover), 0 0 30px rgba(200, 230, 74, 0.12);
    transform: scale(1.08);
}

/* Dark theme (default): show sun icon to switch to light */
.theme-toggle .icon-sun { display: inline; }
.theme-toggle .icon-moon { display: none; }

/* Light theme: show moon icon to switch to dark */
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* ===== Language Tabs ===== */
.lang-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-primary);
}

.lang-tab {
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
}

.lang-tab:hover {
    color: var(--text-secondary);
}

.lang-tab--active {
    color: var(--text-primary);
    border-bottom-color: var(--green);
}

/* ===== Language Tabs Row ===== */
.lang-tabs-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 40px 0 0;
}

.lang-tabs-row .lang-tabs {
    margin: 0;
}

.btn--versions {
    margin-bottom: 4px;
    font-size: 10px !important;
    padding: 6px 12px !important;
    letter-spacing: 0.5px !important;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.btn--versions:hover {
    opacity: 1;
}

/* ===== Version History Modal ===== */
.version-modal__content {
    max-width: 540px !important;
    text-align: left !important;
    max-height: 80vh;
    overflow-y: auto;
}

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

.version-modal__title {
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.version-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}

.version-item:last-child {
    border-bottom: none;
}

.version-item__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.version-item__date {
    font-size: var(--size-sm);
    font-weight: 500;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.version-item__meta {
    font-size: var(--size-xs);
    color: var(--text-secondary);
    font-weight: 300;
}

.version-item__sections {
    font-size: var(--size-xs);
    color: var(--text-tertiary);
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    transition: var(--transition-theme);
}

/* Subtle grain texture overlay */
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 48px 40px;
    position: relative;
    z-index: 1;
}

.login-box__logo {
    text-align: center;
    margin-bottom: 12px;
}

.login-box__logo img {
    height: 320px;
    filter: var(--logo-filter);
    transition: filter 0.4s ease;
}

.login-box__subtitle {
    text-align: center;
    color: var(--text-tertiary);
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 48px;
}

.forgot-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: var(--text-tertiary);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--text-primary);
}

.login-box .theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: var(--size-base);
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all 0.25s ease;
    outline: none;
}

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

.form-input:focus {
    border-color: var(--border-focus);
    background: var(--bg-elevated);
}

.form-input:hover:not(:focus) {
    border-color: var(--text-tertiary);
}

textarea.form-input {
    resize: vertical;
    min-height: 72px;
    line-height: 1.6;
}

select.form-input {
    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='%237f7f7f' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::after {
    opacity: 0.05;
}

.btn--primary {
    background: var(--text-primary);
    color: var(--text-inverse);
    border-color: var(--text-primary);
}

.btn--primary:hover {
    opacity: 0.85;
}

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

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

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

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

.btn--small {
    padding: 8px 16px;
    font-size: var(--size-xs);
    letter-spacing: 1px;
}

.btn--full {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.btn--pdf-update {
    line-height: 1.4;
    text-align: center;
}

.btn__subtitle {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

/* ===== Artist Header ===== */
.artist-header {
    padding: 40px 0 8px;
}

.artist-name {
    font-family: var(--font-display);
    font-size: var(--size-3xl);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 16px;
    line-height: 1.2;
    color: var(--text-primary);
    border-bottom: 2px solid var(--green);
}

.artist-info {
    font-family: var(--font-body);
    font-size: var(--size-base);
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 2px;
    letter-spacing: 0.3px;
}

/* ===== CV Sections ===== */
.cv-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
    transition: var(--transition-theme);
    box-shadow: var(--shadow-sm);
}

.cv-section:hover {
    border-color: var(--border-focus);
}

.cv-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.cv-section__title {
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.cv-section__body {
    padding: 20px 24px;
}

.cv-section__body--editing {
    background: var(--bg-secondary);
}

/* ===== CV Entries (view mode) ===== */
.cv-entry {
    display: flex;
    gap: 20px;
    padding: 6px 0;
    font-size: var(--size-base);
    line-height: 1.7;
}

.cv-entry__year {
    font-family: var(--font-body);
    font-weight: 600;
    min-width: 64px;
    flex-shrink: 0;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.cv-entry__items {
    color: var(--text-secondary);
    font-weight: 300;
}

/* ===== CV Entries (edit mode) ===== */
.edit-entry {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.2s ease;
}

.edit-entry:last-of-type {
    border-bottom: none;
}

.edit-entry:hover {
    background: var(--accent-subtle);
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 2px;
}

.edit-entry__year {
    width: 80px;
    flex-shrink: 0;
}

.edit-entry__items {
    flex: 1;
}

.edit-entry__remove {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    transition: color 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    border-radius: 2px;
}

.edit-entry__remove:hover {
    color: var(--error-text);
    background: var(--error-bg);
}

.edit-actions {
    display: flex;
    gap: 8px;
    padding: 20px 0 0;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle);
    margin-top: 8px;
}

.edit-actions--top {
    padding: 0 0 16px;
    margin-top: 0;
    margin-bottom: 8px;
    border-top: none;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 72px;
    z-index: 10;
    background: var(--bg-secondary);
}

/* ===== Action Bar ===== */
.action-bar {
    display: flex;
    gap: 12px;
    padding: 32px 0 56px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* ===== Account Page ===== */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 24px;
    margin: 20px 0;
    transition: var(--transition-theme);
    box-shadow: var(--shadow-sm);
}

.card__title {
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.assistant-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.2s ease;
}

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

.assistant-name {
    font-size: var(--size-base);
    font-weight: 500;
    color: var(--text-primary);
}

.assistant-email {
    font-size: var(--size-sm);
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ===== Log Entries ===== */
.log-entry {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--size-sm);
    transition: background 0.15s ease;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry__date {
    color: var(--text-tertiary);
    margin-right: 8px;
    font-variant-numeric: tabular-nums;
    font-size: var(--size-xs);
}

.log-entry__user {
    font-weight: 600;
    color: var(--text-primary);
}

.log-entry__action {
    color: var(--text-secondary);
    font-weight: 300;
}

.log-entry__role {
    color: var(--text-tertiary);
    font-size: var(--size-xs);
}

.log-entry__artist {
    color: var(--text-tertiary);
    font-size: var(--size-xs);
    margin-left: 4px;
}

/* ===== Messages ===== */
.message {
    padding: 14px 20px;
    border-radius: 8px;
    font-size: var(--size-sm);
    margin: 16px 0;
    display: none;
    border: 1px solid transparent;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.message--error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
    display: block;
}

.message--success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
    display: block;
}

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 60px;
    color: var(--text-tertiary);
    font-size: var(--size-sm);
    font-weight: 300;
    letter-spacing: 1px;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--spinner-track);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* ===== Admin Page ===== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 32px 0 12px;
}

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    border-color: var(--border-focus);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card__number {
    font-family: var(--font-display);
    font-size: var(--size-hero);
    font-weight: 300;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-card__label {
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-tertiary);
}

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

.card__header .card__title {
    margin-bottom: 0;
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--size-sm);
}

.admin-table th {
    text-align: left;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-primary);
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: var(--text-secondary);
    font-weight: 300;
}

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

.admin-table tr {
    transition: background 0.15s ease;
}

.admin-table tr:hover td {
    background: var(--accent-subtle);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: var(--size-xs);
    font-weight: 500;
    letter-spacing: 0.5px;
}

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

.badge--empty {
    color: var(--text-tertiary);
    background: var(--accent-subtle);
}

.badge--count {
    background: var(--badge-blue-bg);
    color: var(--badge-blue-text);
}

.badge--role {
    background: var(--badge-purple-bg);
    color: var(--badge-purple-text);
    font-size: 10px;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-link {
    color: var(--badge-blue-text);
    font-size: var(--size-xs);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.table-link:hover {
    text-decoration: underline;
}

.credentials-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 20px;
    font-size: var(--size-base);
    font-family: var(--font-body);
}

.credentials-password {
    background: var(--warning-bg);
    color: var(--warning-text);
    padding: 3px 10px;
    border-radius: 2px;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

/* ===== Expandable Cards ===== */
.expandable-card {
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    background: var(--bg-elevated);
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}

.expandable-card:hover {
    border-color: var(--border-focus);
}

.expandable-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: var(--size-base);
}

.expandable-card__header:hover {
    background: var(--accent-subtle);
}

.expandable-card__header strong {
    font-weight: 500;
    letter-spacing: 0.3px;
}

.expandable-card__chevron {
    color: var(--text-tertiary);
    font-size: 10px;
    flex-shrink: 0;
    width: 14px;
    transition: transform 0.3s ease, color 0.2s ease;
}

.expandable-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: var(--size-xs);
}

.expandable-card__id {
    color: var(--text-tertiary);
    margin-right: 4px;
    font-variant-numeric: tabular-nums;
}

.expandable-card__body {
    padding: 20px 24px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

/* ===== User Input Row ===== */
.user-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .container { padding: 0 20px; }

    .artist-name {
        font-size: var(--size-xl);
    }

    .cv-entry {
        flex-direction: column;
        gap: 2px;
    }

    .cv-entry__year { min-width: auto; }

    .edit-entry {
        flex-direction: column;
        gap: 8px;
    }

    .edit-entry__year { width: 100%; }
    .edit-entry:hover { margin: 0; padding-left: 0; padding-right: 0; }

    .action-bar { flex-direction: column; }

    .header__nav { gap: 12px; }
    .header__link { font-size: 10px; letter-spacing: 1px; }

    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }

    .admin-table { font-size: var(--size-xs); }
    .admin-table th,
    .admin-table td { padding: 8px 8px; }

    .expandable-card__meta { flex-wrap: wrap; }
    .expandable-card__header { flex-wrap: wrap; gap: 6px; }
    .user-input-row { flex-wrap: wrap; }

    .login-box { padding: 32px 24px; }
    .login-box__logo img { height: 200px; }
    .header__logo img { height: 120px; }

    .stat-card { padding: 16px; }
    .stat-card__number { font-size: var(--size-2xl); }
}

/* ===== Bilingual Sync Reminders ===== */
.cv-section--needs-sync {
    border-color: var(--warning-text);
    border-left: 3px solid var(--warning-text);
}

.sync-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    font-size: var(--size-xs);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--warning-text);
    background: var(--warning-bg);
    border-radius: 4px;
    vertical-align: middle;
}

.lang-tab__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--warning-text);
    background: var(--warning-bg);
    border-radius: 9px;
    vertical-align: middle;
    line-height: 1;
}

/* ===== Artist Selector (Gallery Users) ===== */
.artist-selector {
    padding: 24px 0 0;
    animation: fadeInUp 0.4s ease-out;
}

.artist-selector .form-label {
    margin-bottom: 10px;
}

.artist-selector .form-input {
    max-width: 400px;
    font-size: var(--size-md);
}

/* ===== PDF Top Bar ===== */
.pdf-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 0;
    gap: 16px;
    flex-wrap: wrap;
}

.pdf-top-bar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-status--pending {
    font-size: var(--size-xs);
    color: var(--warning-text);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pdf-status--generating {
    font-size: var(--size-xs);
    color: var(--green);
    font-weight: 500;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.pdf-links .btn {
    border-color: var(--green);
    color: var(--green);
    border-width: 1.5px;
}

[data-theme="light"] .pdf-links .btn {
    --green-btn: #4a7a12;
    border-color: var(--green-btn);
    color: var(--green-btn);
}

.pdf-links .btn:hover {
    background: var(--green-subtle);
    border-color: var(--green);
}

[data-theme="light"] .pdf-links .btn:hover {
    border-color: var(--green-btn, #4a7a12);
    background: rgba(74, 122, 18, 0.08);
}

.pdf-links--empty {
    font-size: var(--size-sm);
    color: var(--text-tertiary);
    font-weight: 300;
}

/* ===== Save Popup ===== */
.save-popup {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.save-popup__content {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 32px 36px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.save-popup__text {
    font-family: var(--font-body);
    font-size: var(--size-md);
    font-weight: 500;
    color: var(--success-text);
    margin-bottom: 20px;
}

.save-popup__reminder {
    font-family: var(--font-body);
    font-size: var(--size-sm);
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 400;
    line-height: 1.6;
}

.save-popup__reminder-en {
    font-family: var(--font-body);
    font-size: var(--size-sm);
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 24px;
    font-weight: 300;
    line-height: 1.6;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Hidden utility ===== */
.hidden { display: none !important; }

/* ===== Page load animation ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.artist-header {
    animation: fadeInUp 0.5s ease-out;
}

.cv-section {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: backwards;
}

.cv-section:nth-child(1) { animation-delay: 0.05s; }
.cv-section:nth-child(2) { animation-delay: 0.1s; }
.cv-section:nth-child(3) { animation-delay: 0.15s; }
.cv-section:nth-child(4) { animation-delay: 0.2s; }
.cv-section:nth-child(5) { animation-delay: 0.25s; }
.cv-section:nth-child(6) { animation-delay: 0.3s; }
.cv-section:nth-child(7) { animation-delay: 0.35s; }
.cv-section:nth-child(8) { animation-delay: 0.4s; }

.card {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: backwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }

.stat-card {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

/* ===== Focus styles for accessibility ===== */
.btn:focus-visible,
.form-input:focus-visible,
.lang-tab:focus-visible,
.theme-toggle:focus-visible {
    outline: 1px solid var(--green);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ===== Print styles ===== */
@media print {
    .header, .action-bar, .theme-toggle, .btn { display: none; }
    body { background: white; color: black; }
    .cv-section { border: 1px solid #ddd; break-inside: avoid; }
}
