:root {
    --bg-page: #f3f6fb;
    --bg-panel: #ffffff;
    --bg-panel-muted: #f8fafc;
    --border-soft: #d8e1ec;
    --border-strong: #c6d2e1;
    --text-strong: #122033;
    --text-body: #314256;
    --text-muted: #637487;
    --accent: #0f766e;
    --accent-hover: #0b5f59;
    --accent-soft: #d8f2ee;
    --danger: #be123c;
    --danger-soft: #ffe4e6;
    --warning: #b45309;
    --warning-soft: #fef3c7;
    --success: #0f766e;
    --success-soft: #d8f2ee;
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.08);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.10), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg-page) 100%);
    color: var(--text-body);
    font-family: "Inter", sans-serif;
}

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

a:hover {
    color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-strong);
    font-weight: 700;
    letter-spacing: -0.03em;
}

p {
    margin-bottom: 0;
}

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

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

::-webkit-scrollbar-thumb {
    background: #b8c6d6;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a7bb;
}

.app-body {
    padding-bottom: 40px;
}

.app-shell {
    width: min(1380px, calc(100% - 32px));
    margin: 0 auto;
}

.app-header {
    padding: 20px 0 12px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(216, 225, 236, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

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

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #0ea5a1 100%);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.25);
}

.brand-name {
    display: block;
    color: var(--text-strong);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-subtitle {
    display: block;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.security-pill,
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: #fff;
    color: var(--text-body);
    font-size: 0.92rem;
    font-weight: 600;
}

.security-pill {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: rgba(15, 118, 110, 0.15);
}

.layout-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.layout-grid-guest {
    grid-template-columns: minmax(0, 1fr);
}

.sidebar-card,
.page-panel,
.modal-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(216, 225, 236, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.sidebar-card {
    position: sticky;
    top: 20px;
    padding: 24px 18px;
}

.sidebar-brand {
    padding: 0 10px 20px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 20px;
}

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

.sidebar-copy {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-top: 8px;
    line-height: 1.5;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text-body);
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.content-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
}

.alert i {
    font-size: 1rem;
}

.alert-success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(15, 118, 110, 0.16);
}

.alert-danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(190, 18, 60, 0.14);
}

.alert-info {
    color: #0f5ca8;
    background: #e0f2fe;
    border-color: #bae6fd;
}

.page-panel {
    padding: 24px;
}

.hero-panel {
    overflow: hidden;
    position: relative;
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.10) 0%, transparent 68%);
    pointer-events: none;
}

.hero-header,
.section-head,
.download-card,
.drop-panel,
.auth-card {
    position: relative;
    z-index: 1;
}

.hero-header,
.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.hero-actions,
.table-actions,
.mobile-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.meta-card {
    min-width: 180px;
    padding: 14px 16px;
    background: var(--bg-panel-muted);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
}

.meta-label,
.eyebrow,
.section-note,
.page-subtitle,
.modal-note,
.modal-description,
.item-link small,
.mobile-item-main small,
.brand-subtitle {
    color: var(--text-muted);
}

.meta-label,
.eyebrow {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.page-title,
.section-title {
    margin-bottom: 8px;
}

.page-title {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.page-subtitle {
    max-width: 640px;
    font-size: 1rem;
    line-height: 1.6;
}

.section-title {
    font-size: 1.35rem;
}

.modern-breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
}

.modern-breadcrumb .breadcrumb-item {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.modern-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

.modern-breadcrumb .breadcrumb-item a {
    color: var(--text-body);
    font-weight: 600;
}

.modern-breadcrumb .breadcrumb-item.active span {
    color: var(--text-strong);
    font-weight: 700;
}

.btn {
    border-radius: 14px;
    font-weight: 700;
    padding: 0.72rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-outline-secondary {
    color: var(--text-body);
    border-color: var(--border-strong);
    background: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: #eef4fb;
    color: var(--text-strong);
    border-color: #b9c7d7;
}

.btn-outline-danger {
    color: var(--danger);
    border-color: rgba(190, 18, 60, 0.25);
    background: #fff;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.btn-sm {
    padding: 0.56rem 0.8rem;
    border-radius: 12px;
}

.btn-lg {
    padding: 0.95rem 1.4rem;
}

.drop-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    cursor: pointer;
    border: 2px dashed var(--border-strong);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.05), rgba(255, 255, 255, 0.92));
    transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-panel.is-dragging {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.98));
}

.drop-panel-copy {
    display: flex;
    align-items: center;
    gap: 16px;
}

.drop-panel-copy h2 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.drop-panel-copy p {
    color: var(--text-muted);
    line-height: 1.6;
}

.drop-panel:hover {
    border-color: rgba(15, 118, 110, 0.45);
}

.drop-icon,
.download-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.35rem;
}

.upload-queue-panel {
    border: 1px solid rgba(15, 118, 110, 0.14);
}

.upload-queue-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.upload-queue-item {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    background: var(--bg-panel-muted);
}

.upload-queue-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.upload-queue-head strong {
    display: block;
    color: var(--text-strong);
}

.upload-queue-head span {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.upload-queue-status {
    font-weight: 700;
}

.upload-queue-note {
    margin-top: 10px;
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.92rem;
}

.upload-progress-bar {
    height: 10px;
    background: #dbe8f4;
    border-radius: 999px;
}

.progress-bar {
    background: var(--accent);
}

.app-table {
    margin-bottom: 0;
}

.app-table thead th {
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    padding: 16px 14px;
}

.app-table tbody td {
    padding: 18px 14px;
    border-color: var(--border-soft);
    background: transparent;
    color: var(--text-body);
}

.app-table tbody tr {
    transition: background 0.2s ease;
}

.app-table tbody tr:hover {
    background: rgba(15, 118, 110, 0.03);
}

.item-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.item-link strong,
.mobile-item-main strong {
    display: block;
    color: var(--text-strong);
    word-break: break-word;
}

.item-link small,
.mobile-item-main small {
    display: block;
    margin-top: 4px;
    line-height: 1.4;
}

.item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1rem;
    flex: 0 0 auto;
}

.item-icon-folder {
    background: #fff4d8;
    color: #b45309;
}

.item-icon-file {
    background: #e0f2fe;
    color: #0369a1;
}

.item-icon-neutral {
    background: #eef4fb;
    color: #52677d;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.status-chip-success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(15, 118, 110, 0.12);
}

.status-chip-processing {
    color: #0f5ca8;
    background: #e0f2fe;
    border-color: #bae6fd;
}

.status-chip-danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(190, 18, 60, 0.12);
}

.status-chip-muted {
    color: #516170;
    background: #edf2f7;
    border-color: #d7e0ea;
}

.status-chip-folder {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: rgba(180, 83, 9, 0.12);
}

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

.empty-state i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.empty-state h3 {
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

.mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-item-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border-soft);
    background: var(--bg-panel-muted);
}

.mobile-item-link {
    display: block;
}

.mobile-item-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-item-status {
    margin-top: 14px;
}

.mobile-item-actions {
    margin-top: 14px;
}

.inline-form {
    display: inline-flex;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-label {
    color: var(--text-strong);
    font-weight: 700;
    margin-bottom: 8px;
}

.app-input,
.form-control,
.form-select {
    min-height: 48px;
    border-radius: 14px;
    border-color: var(--border-strong);
    background: #fff;
    color: var(--text-strong);
    box-shadow: none;
}

.app-input:focus,
.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.55);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.modal-card {
    overflow: hidden;
}

.modal-header,
.modal-footer {
    padding: 18px 22px;
    border-color: var(--border-soft);
}

.modal-body {
    padding: 22px;
}

.modal-title {
    margin: 0;
    font-size: 1.1rem;
}

.modal-description {
    margin-bottom: 16px;
    line-height: 1.6;
}

.modal-note {
    margin-bottom: 16px;
    line-height: 1.6;
}

.modal-form-actions {
    margin-top: 16px;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
    gap: 20px;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-body .layout-grid,
.auth-body .app-shell {
    width: min(1180px, calc(100% - 32px));
}

.auth-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
}

.auth-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    width: 100%;
}

.auth-card-copy,
.auth-form-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(216, 225, 236, 0.95);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-md);
}

.auth-trust-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    color: var(--text-body);
    font-weight: 600;
}

.auth-trust-list div {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.auth-trust-list i {
    color: var(--accent);
}

.public-body {
    padding: 24px 0 40px;
}

.public-shell {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.public-download-shell {
    width: min(880px, calc(100% - 32px));
}

.download-panel {
    text-align: center;
}

.download-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 12px;
}

.download-card p {
    max-width: 480px;
    color: var(--text-muted);
    line-height: 1.6;
}

.section-note {
    font-size: 0.92rem;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-card {
        position: static;
    }

    .admin-grid,
    .auth-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-shell,
    .public-shell,
    .auth-body .app-shell {
        width: min(100%, calc(100% - 20px));
    }

    .topbar,
    .page-panel,
    .sidebar-card {
        padding: 18px;
    }

    .topbar,
    .hero-header,
    .section-head,
    .drop-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .hero-meta {
        flex-direction: column;
    }

    .meta-card {
        min-width: 0;
    }

    .drop-panel-copy {
        align-items: flex-start;
    }

    .hero-actions {
        width: 100%;
    }

    .hero-actions .btn,
    .drop-panel .btn,
    .mobile-item-actions .btn,
    .modal-footer .btn {
        width: 100%;
    }

    .mobile-item-actions,
    .table-actions {
        width: 100%;
    }

    .inline-form {
        width: 100%;
    }

    .inline-form .btn {
        width: 100%;
    }
}
