:root {
    --bg: #f4efe7;
    --bg-accent: #ead9c8;
    --text: #201a18;
    --muted: #6b5b54;
    --card: rgba(255, 250, 245, 0.82);
    --line: rgba(32, 26, 24, 0.12);
    --brand: #bf5a36;
    --brand-deep: #7e2f13;
    --ok: #2a7b55;
    --shadow: 0 18px 42px rgba(64, 37, 22, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(191, 90, 54, 0.14), transparent 30%),
        linear-gradient(180deg, var(--bg) 0%, #fbf7f2 100%);
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(32, 26, 24, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(32, 26, 24, 0.035) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.page-shell {
    position: relative;
    width: min(1100px, calc(100% - 24px));
    margin: 0 auto;
    padding: 20px 0 48px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 8px 0 24px;
}

.brand-lockup {
    display: grid;
    gap: 8px;
    justify-items: center;
}

.brand-logo {
    display: block;
    width: min(240px, 100%);
    height: auto;
}

.brand-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.topbar h1,
.hero h2,
.panel h3,
.stat-card strong,
.status-value {
    font-family: Georgia, "Times New Roman", serif;
}

.topbar h1 {
    margin: 0;
    font-size: 2rem;
}

.topbar nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
}

.topbar a {
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--line);
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
}

.nav-user {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--muted);
}

.inline-form {
    margin: 0;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.55);
    color: var(--text);
    border: 1px solid var(--line);
    padding: 10px 14px;
    border-radius: 999px;
}

.active-shift-list {
    gap: 12px;
}

.active-shift-item {
    padding: 0;
}

.active-shift-summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    cursor: pointer;
}

.active-shift-summary::-webkit-details-marker {
    display: none;
}

.active-shift-summary p,
.active-shift-details p {
    margin: 4px 0 0;
    color: var(--muted);
}

.active-shift-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 18px 18px;
    flex-wrap: wrap;
}

.eyebrow {
    margin: 0 0 6px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-deep);
    font-size: 0.74rem;
    font-weight: 700;
}

.hero,
.panel {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    border-radius: 28px;
}

.hero {
    display: grid;
    gap: 20px;
    padding: 24px;
    margin-bottom: 20px;
}

.hero h2 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 0.98;
    max-width: 12ch;
}

.lede {
    margin: 0;
    color: var(--muted);
    max-width: 56ch;
}

.user-label {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.clock-card,
.stat-card,
.history-item,
.chip {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.66);
}

.clock-card {
    padding: 22px;
    border-radius: 24px;
}

.clock-status-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.status-inline {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-mobile {
    display: block;
}

.job-banner,
.helper-copy {
    margin: 0 0 14px;
    color: var(--muted);
}

.status-label {
    margin: 0;
    color: var(--muted);
}

.status-value {
    margin: 0;
    font-size: 1.35rem;
}

.action-row {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.action-form {
    width: 100%;
}

.action-form button {
    width: 100%;
}

.clock-job-picker {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.field-label {
    font-weight: 600;
}

.job-select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.85);
    font: inherit;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 16px;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 700;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.primary-btn {
    background: var(--brand);
    color: white;
}

.secondary-btn {
    background: white;
    color: var(--text);
    border: 1px solid var(--line);
}

.panel {
    padding: 20px;
}

.panel-subsection {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.34);
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-heading h3 {
    margin: 0;
    font-size: 1.4rem;
}

.panel-heading span {
    color: var(--muted);
    font-size: 0.92rem;
}

.compact-heading {
    margin-bottom: 12px;
}

.admin-tabs-panel {
    display: grid;
    gap: 18px;
}

.admin-tabbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 0 0 12px;
    align-items: end;
}

.filter-bar label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.filter-bar input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.85);
    font: inherit;
}

.admin-tab {
    text-decoration: none;
    color: var(--text);
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.55);
    font-weight: 700;
}

.admin-tab-active {
    background: var(--brand);
    color: white;
    border-color: transparent;
}

.jobs-toolbox,
.photographer-pane {
    display: grid;
    gap: 16px;
}

.photographer-list .history-list {
    gap: 10px;
}

.photographer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.photographer-manage-btn {
    min-width: 1.2rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.add-link-btn {
    color: var(--ok);
}

.photographer-card {
    display: grid;
    gap: 4px;
    text-decoration: none;
    color: var(--text);
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.6);
}

.photographer-card span {
    color: var(--muted);
}

.photographer-card-active {
    border-color: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(191, 90, 54, 0.2);
}

.photographer-stats {
    margin-bottom: 16px;
}

.detail-heading-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.hours-edit-block {
    display: flex;
    flex-direction: column;
    justify-items: end;
    gap: 6px;
    align-items: flex-end;
}

.row-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.link-btn {
    appearance: none;
    background: none;
    border: none;
    color: var(--brand-deep);
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-size: 0.9rem;
    text-decoration: underline;
}

.row-actions .link-btn {
    min-width: 1.2rem;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.delete-link-btn {
    color: var(--brand);
}

.admin-dialog {
    width: min(460px, calc(100% - 24px));
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 20px;
    background: #fffaf6;
    box-shadow: var(--shadow);
}

.admin-dialog::backdrop {
    background: rgba(32, 26, 24, 0.32);
}

.history-list,
.stats-grid,
.chips {
    display: grid;
    gap: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-radius: 18px;
    padding: 14px 16px;
}

.history-item-stack {
    align-items: start;
    flex-direction: column;
}

.job-meta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    align-items: center;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.meta-copy {
    color: var(--muted);
    font-size: 0.95rem;
}

.history-item p,
.stat-card span {
    margin: 4px 0 0;
    color: var(--muted);
}

.hours-pill,
.chip {
    padding: 10px 12px;
    border-radius: 999px;
    font-weight: 700;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
    padding: 18px;
    border-radius: 22px;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 2.2rem;
}

.chips {
    grid-template-columns: repeat(auto-fit, minmax(120px, max-content));
}

.chip {
    display: inline-flex;
    justify-content: center;
}

.auth-shell {
    max-width: 480px;
    margin: 3vh auto 0;
}

.auth-card {
    padding: 24px;
}

.auth-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.auth-form label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.85);
    font: inherit;
}

.error-banner {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(191, 90, 54, 0.12);
    color: var(--brand-deep);
    border: 1px solid rgba(191, 90, 54, 0.2);
}

.success-banner {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(42, 123, 85, 0.12);
    color: var(--ok);
    border: 1px solid rgba(42, 123, 85, 0.24);
}

.upload-form {
    max-width: 520px;
}

.admin-job-form {
    max-width: none;
}

.inline-job-editor {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.editor-actions,
.delete-form {
    display: flex;
    align-items: end;
}

.delete-form {
    width: 100%;
    justify-content: flex-end;
}

@media (min-width: 800px) {
    .hero-mobile {
        display: block;
    }

    .hero-admin {
        grid-template-columns: 1.2fr 1fr;
        align-items: stretch;
    }

    .jobs-toolbox {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photographer-pane {
        grid-template-columns: 320px minmax(0, 1fr);
        align-items: start;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 16px, 1100px);
    }

    .topbar {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .hero,
    .panel {
        border-radius: 22px;
    }

    .hero {
        padding: 18px;
    }

    .panel {
        padding: 16px;
    }

    .panel-heading,
    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-row {
        width: 100%;
    }

    button {
        flex: 1 1 100%;
    }
}
