@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&family=Source+Serif+4:wght@400;600;700&display=swap');

:root {
    --color-primary: #1f3b2c;
    --color-primary-light: #2d5640;
    --color-accent: #1f3b2c;
    --color-accent-strong: #193124;
    --color-accent-soft: #e8f0eb;
    --color-gold: #c8a048;

    --color-bg: #f3f5f2;
    --color-surface: #ffffff;
    --color-border: #d4ddd6;
    --color-border-strong: #bcc9c0;

    --color-text: #1f2937;
    --color-muted: #5f6b63;
    --color-error: #9b2c2c;
    --color-error-bg: #fbe9e7;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 18px;

    --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 16px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.10);

    --transition: all 0.25s ease;
    --font-sans: "Source Sans 3", "Segoe UI", sans-serif;
    --font-serif: "Source Serif 4", "Times New Roman", serif;

    --primary: var(--color-primary);
    --primary-light: var(--color-primary-light);
    --surface: var(--color-surface);
    --border: var(--color-border);
    --text-primary: var(--color-text);
    --text-secondary: var(--color-muted);
    --background: var(--color-bg);
    --error: var(--color-error);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background:
        radial-gradient(circle at top right, rgba(200, 160, 72, 0.12), transparent 55%),
        radial-gradient(circle at 10% 20%, rgba(31, 59, 44, 0.08), transparent 45%),
        var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    letter-spacing: 0;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    color: var(--color-text);
    letter-spacing: 0;
}

main {
    width: 100%;
    max-width: none;
    flex: 1;
    min-height: calc(100vh - 160px);
    padding: 2.25rem clamp(1rem, 2.4vw, 2.5rem) 3rem;
    animation: pageIn 0.6s ease both;
}

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

.navbar {
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-accent);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 1.1rem clamp(1rem, 2vw, 2.25rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.nav-logo {
    height: 58px;
    width: auto;
    flex-shrink: 0;
}

.nav-title {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}

.nav-system {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--color-accent);
    overflow-wrap: anywhere;
}

.nav-subtitle {
    font-size: 0.84rem;
    color: var(--color-muted);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
    align-items: center;
    flex: 1;
}

.nav-link,
.nav-user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    color: var(--color-accent);
    font-weight: 600;
    padding: 0.55rem 0.92rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(31, 59, 44, 0.08);
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    border-color: var(--color-accent);
    background: #f7faf8;
    transform: translateY(-1px);
}

.nav-link.active {
    background: var(--color-accent-soft);
    border-color: rgba(31, 59, 44, 0.28);
}

.nav-user {
    background: rgba(31, 59, 44, 0.08);
    border-color: rgba(31, 59, 44, 0.14);
    box-shadow: none;
}

.nav-link-logout {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
}

.nav-link-logout:hover {
    background: var(--color-accent-strong);
    border-color: var(--color-accent-strong);
    color: #ffffff;
}

.minimal-dashboard {
    width: 100%;
    min-height: 100%;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 1.15rem;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.16rem;
    color: var(--color-muted);
    font-weight: 700;
}

.page-title {
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 2.4vw, 2.25rem);
    font-weight: 700;
    color: var(--text-primary);
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.55rem;
}

.page-user {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(31, 59, 44, 0.10);
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.dashboard-tabs {
    display: inline-flex;
    gap: 0.45rem;
    padding: 0.35rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    border: 1px solid rgba(31, 59, 44, 0.10);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
}

.dashboard-tab {
    min-height: 40px;
    padding: 0.55rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--color-accent);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: var(--transition);
}

.dashboard-tab:hover {
    background: #f7faf8;
}

.dashboard-tab.is-active {
    background: var(--color-accent);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(31, 59, 44, 0.14);
}

.tab-panels {
    width: 100%;
}

.tab-panel {
    min-height: calc(100vh - 315px);
}

.tab-panel[hidden] {
    display: none !important;
}

.upload-section,
.results-section {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(31, 59, 44, 0.10);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
    padding: clamp(1rem, 1.8vw, 1.45rem);
    min-width: 0;
}

.upload-section {
    display: flex;
    flex-direction: column;
}

.upload-section form {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.results-section {
    display: grid;
    grid-template-rows: auto 1fr;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.section-heading h3 {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.upload-card {
    padding: 1.3rem 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    margin-bottom: 0.9rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfb 100%);
    border: 1px solid rgba(31, 59, 44, 0.10);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.upload-card:hover {
    border-color: rgba(31, 59, 44, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.07);
}

.upload-card.drag-over {
    border-color: var(--primary);
    background: #f4f8f5;
}

.upload-icon {
    min-width: 56px;
    height: 46px;
    padding: 0 0.7rem;
    margin: 0 auto 0.7rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 59, 44, 0.08);
    color: var(--primary);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.upload-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.upload-subtitle {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

#fileInput {
    display: none;
}

.file-list {
    margin-bottom: 1rem;
}

.empty-state {
    border-radius: 14px;
    border: 1px dashed rgba(31, 59, 44, 0.14);
    background: #f9fbfa;
    color: var(--text-secondary);
    text-align: center;
    padding: 0.9rem 1rem;
    font-size: 0.85rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.78rem 0.95rem;
    margin-bottom: 0.65rem;
    background: #ffffff;
    border: 1px solid rgba(31, 59, 44, 0.08);
    border-radius: 14px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.file-icon {
    min-width: 42px;
    height: 38px;
    padding: 0 0.5rem;
    border-radius: 12px;
    background: #f4f8f5;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.file-details {
    min-width: 0;
}

.file-details h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-details p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: #fee2e2;
    color: var(--error);
}

.btn,
.btn-primary,
.btn-process {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.6rem;
    border: none;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    gap: 0.4rem;
}

.btn-primary,
.btn-process {
    background: var(--color-accent);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(31, 59, 44, 0.14);
}

.btn-primary:hover,
.btn-process:hover {
    background: var(--color-accent-strong);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #ffffff;
    color: var(--color-accent);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: #f7faf8;
    border-color: var(--color-accent);
}

.btn-small {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
}

.btn-process {
    width: 100%;
    font-size: 1.05rem;
    margin-top: auto;
}

.btn-process:disabled {
    background: var(--color-muted);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.results-placeholder {
    min-height: 320px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(31, 59, 44, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfb 100%);
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2rem;
}

.results-placeholder p {
    font-family: var(--font-serif);
    color: var(--color-accent);
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.05;
    max-width: 760px;
}

label {
    font-weight: 700;
    color: var(--color-accent);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(31, 59, 44, 0.14);
    background: #ffffff;
}

.status {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
}

.status-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid #f3b5b5;
}

.status-success {
    background: #e8f6ee;
    color: #1f5a39;
    border: 1px solid rgba(31, 90, 57, 0.16);
}

.drawer-toggle {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1080;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.95rem 1rem 0.95rem 0.9rem;
    border: none;
    border-radius: 18px 0 0 18px;
    background: rgba(31, 59, 44, 0.96);
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 700;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
    cursor: pointer;
}

.drawer-toggle:hover {
    background: var(--primary-light);
}

.drawer-toggle-count {
    min-width: 1.85rem;
    height: 1.85rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 0.78rem;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(3px);
    z-index: 1085;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.drawer-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1090;
    width: min(390px, calc(100vw - 1.2rem));
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    border-left: 1px solid rgba(31, 59, 44, 0.10);
    box-shadow: -18px 0 36px rgba(15, 23, 42, 0.14);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.24s ease, visibility 0.24s ease;
}

.drawer-panel.is-open {
    transform: translateX(0);
    visibility: visible;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.95rem;
    border-bottom: 1px solid rgba(31, 59, 44, 0.08);
}

.drawer-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.drawer-meta {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.drawer-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 12px;
    background: #f4f8f5;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.95rem 1rem 1.1rem;
}

.drawer-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.processed-list {
    display: grid;
    gap: 0.65rem;
}

.processed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(31, 59, 44, 0.08);
    background: #fbfdfb;
}

.processed-file {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.processed-method {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    background: rgba(31, 59, 44, 0.08);
    border: 1px solid rgba(31, 59, 44, 0.12);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
}

.processed-empty {
    margin-top: 0.75rem;
    border-radius: 14px;
    border: 1px dashed rgba(31, 59, 44, 0.14);
    background: #f9fbfa;
    color: var(--text-secondary);
    text-align: center;
    padding: 0.9rem 1rem;
    font-size: 0.85rem;
}

footer,
.site-footer {
    background: transparent;
    color: var(--color-muted);
    padding: 1.15rem 0 1.4rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

footer p,
.site-footer {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.login-page {
    min-height: 100vh;
    background: #f1f4f1;
}

.login-shell {
    flex: 1;
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 2.2rem) 1rem;
    display: flex;
    align-items: center;
}

.login-auth-panel {
    width: 100%;
    border-radius: 16px;
    border: 1px solid #d7e0d9;
    background: #ffffff;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.login-logo-wrap {
    width: 92px;
    height: 92px;
    margin: 0 auto 1rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e3e9e4;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.ofs-logo {
    width: 64px;
    height: auto;
}

.login-header {
    text-align: center;
}

.login-header .eyebrow {
    font-size: 0.66rem;
    letter-spacing: 0.1rem;
}

.login-header h1 {
    font-size: clamp(1.4rem, 4.2vw, 1.8rem);
    margin-top: 0.2rem;
    color: var(--color-accent);
}

.login-header p {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.login-form {
    margin-top: 0.85rem;
}

.login-form .btn-primary {
    width: 100%;
    margin-top: 0.6rem;
    min-height: 44px;
}

.login-password-panel {
    display: none;
    border: 1px solid #dfe7e1;
    border-radius: 12px;
    background: #fafcfb;
    padding: 0.9rem;
}

.login-password-panel.is-visible {
    display: block;
}

.login-password-title {
    font-size: 0.92rem;
    color: var(--color-accent);
    margin-bottom: 0.6rem;
}

.login-access-card {
    margin-top: 0.95rem;
    border: 1px solid #dfe7e1;
    border-radius: 12px;
    background: #fafcfb;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.login-access-card h3 {
    color: var(--color-accent);
    font-size: 0.9rem;
    line-height: 1.2;
}

.login-access-list {
    display: grid;
    gap: 0.45rem;
}

.login-access-user {
    border: 1px solid #d8e1da;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.55rem 0.64rem;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    font: inherit;
}

.login-access-user:hover {
    border-color: var(--color-accent);
    background: #f5f9f6;
}

.login-access-user.is-selected {
    border-color: var(--color-accent);
    background: #edf5ef;
}

.login-access-initials {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04rem;
    color: #ffffff;
    background: var(--color-accent);
}

.login-access-meta strong {
    display: block;
    color: var(--color-accent);
    font-size: 0.9rem;
    line-height: 1.2;
}

.login-footer {
    background: transparent;
    border-top: none;
    padding: 0.4rem 1rem 1rem;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #efeae3;
}

::-webkit-scrollbar-thumb {
    background: rgba(15, 61, 62, 0.35);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 61, 62, 0.55);
}

@media (max-width: 900px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        justify-content: flex-start;
        width: 100%;
    }

    .dashboard-tabs {
        width: 100%;
        border-radius: 18px;
        display: grid;
        grid-template-columns: 1fr;
    }

    .tab-panel {
        min-height: 0;
    }

    .results-section {
        min-height: 360px;
    }
}

@media (max-width: 700px) {
    main {
        padding: 2rem 1rem 3rem;
    }

    .nav-container {
        padding: 0.9rem 1rem;
    }

    .nav-links {
        display: grid;
        grid-template-columns: 1fr;
    }

    .drawer-toggle {
        top: auto;
        right: 1rem;
        bottom: 1rem;
        transform: none;
        border-radius: 18px;
    }

    .drawer-panel {
        width: min(390px, calc(100vw - 1.2rem));
    }

    .nav-link,
    .nav-user,
    .btn,
    .btn-primary,
    .btn-process {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
