@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #1d4ed8;
    --primary-hover: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f97316;
    --background-color: #f3f6fb;
    --surface-color: #ffffff;
    --surface-muted: #eef3fb;
    --surface-strong: #dbe7fb;
    --border-color: #dbe3f1;
    --text-primary: #132238;
    --text-secondary: #59708c;
    --text-muted: #8092a9;
    --cloud-color: #1d4ed8;
    --local-color: #0f766e;
    --shadow-sm: 0 10px 25px -20px rgba(15, 23, 42, 0.35);
    --shadow-md: 0 18px 45px -30px rgba(15, 23, 42, 0.28);
    --shadow-lg: 0 28px 60px -34px rgba(15, 23, 42, 0.28);
    --border-radius: 0.75rem;
    --border-radius-lg: 1.1rem;
    --app-shell-width: 19rem;
    --app-mobile-bar-height: 4.4rem;
}

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

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(243, 246, 251, 0.98)),
        var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body.app-shell-open {
    overflow: hidden;
}

.container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* App Shell */
.app-icon {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
    flex-shrink: 0;
}

.app-shell-mobile-bar,
.app-shell-backdrop {
    display: none;
}

.app-shell-toggle,
.app-shell-close,
.app-shell-mobile-logout {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(219, 227, 241, 0.96);
    border-radius: 0.95rem;
    background-color: rgba(255, 255, 255, 0.94);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.app-shell-toggle:hover,
.app-shell-close:hover,
.app-shell-mobile-logout:hover {
    background-color: var(--surface-muted);
}

.app-shell {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--app-shell-width);
    padding: 1rem;
    z-index: 130;
}

.app-shell-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.05rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 255, 0.96)),
        rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(219, 227, 241, 0.96);
    border-radius: 1.45rem;
    box-shadow: var(--shadow-lg);
}

.app-shell-brand {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.app-shell-brand-mark {
    width: 3.1rem;
    height: 3.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.14), rgba(15, 118, 110, 0.18));
    border: 1px solid rgba(29, 78, 216, 0.14);
    color: var(--primary-color);
    text-decoration: none;
}

.app-shell-brand-mark .app-icon {
    width: 1.35rem;
    height: 1.35rem;
}

.app-shell-brand-copy {
    min-width: 0;
    flex: 1;
}

.app-shell-logo {
    display: block;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.app-shell-caption {
    color: var(--text-secondary);
    font-size: 0.79rem;
    font-weight: 700;
    line-height: 1.35;
}

.app-shell-close {
    display: none;
}

.app-shell-nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
    margin-right: -0.25rem;
}

.app-shell-section {
    display: grid;
    gap: 0.55rem;
}

.app-shell-section + .app-shell-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(219, 227, 241, 0.96);
}

.app-shell-section-label {
    color: var(--text-muted);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.app-shell-nav-list {
    display: grid;
    gap: 0.45rem;
    list-style: none;
}

.app-shell-nav-link {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    border: 1px solid transparent;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.app-shell-nav-link:hover {
    transform: translateY(-1px);
    background-color: rgba(255, 255, 255, 0.94);
    border-color: rgba(29, 78, 216, 0.1);
    box-shadow: var(--shadow-sm);
}

.app-shell-nav-link.active {
    background:
        linear-gradient(135deg, rgba(29, 78, 216, 0.14), rgba(255, 255, 255, 0.96)),
        rgba(255, 255, 255, 0.98);
    border-color: rgba(29, 78, 216, 0.18);
    box-shadow: var(--shadow-md);
}

.app-shell-nav-icon {
    width: 2.45rem;
    height: 2.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0.9rem;
    background-color: rgba(29, 78, 216, 0.08);
    color: var(--primary-color);
}

.app-shell-nav-icon .app-icon {
    width: 1.15rem;
    height: 1.15rem;
}

.app-shell-nav-link.active .app-shell-nav-icon {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
}

.app-shell-nav-copy {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.app-shell-nav-label {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.app-shell-nav-meta {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}

.app-shell-user-card {
    padding: 1rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(219, 227, 241, 0.96);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 247, 255, 0.98));
    box-shadow: var(--shadow-sm);
}

.app-shell-user-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.95rem;
}

.app-shell-user-avatar {
    width: 2.9rem;
    height: 2.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.14), rgba(15, 118, 110, 0.2));
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.app-shell-user-copy {
    min-width: 0;
    flex: 1;
}

.app-shell-user-name {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.app-shell-user-meta {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.app-shell-user-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.app-shell-user-actions .btn {
    flex: 1 1 9rem;
}

.app-shell-role {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    background-color: rgba(15, 118, 110, 0.1);
    color: var(--local-color);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.app-shell-mobile-logo {
    min-width: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo.app-shell-logo {
    font-size: 1.2rem;
}

.logo.app-shell-mobile-logo {
    font-size: 1.08rem;
}

.app-shell ~ .main,
.app-shell ~ .app-footer {
    margin-left: calc(var(--app-shell-width) + 0.75rem);
}

.app-footer {
    margin-top: 1.2rem;
    padding: 0 0 1.8rem;
}

.app-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(219, 227, 241, 0.96);
    border-radius: 1.1rem;
    background-color: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-sm);
}

.app-footer-brand {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.app-footer-note {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

/* Header */
.header {
    background-color: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 0.9rem;
}

.logo {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background-color: rgba(29, 78, 216, 0.08);
}

/* Navigation */
.nav {
    background-color: transparent;
    border-bottom: 1px solid rgba(219, 227, 241, 0.8);
    padding: 0.8rem 0 1rem;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.92);
    border-color: rgba(29, 78, 216, 0.14);
    box-shadow: var(--shadow-sm);
}

/* Main Content */
.main {
    padding: 2.25rem 0 2.5rem;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header > .d-flex {
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header-row {
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.page-title {
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 70ch;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 1.35rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background:
        linear-gradient(180deg, rgba(248, 250, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.card-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

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

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--secondary-color) !important;
}

.btn.uploading {
    position: relative;
    color: transparent !important;
}

.btn.uploading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: button-spin 1s linear infinite;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-info {
    background-color: #0ea5e9;
    color: white;
}

.btn-info:hover {
    background-color: #0284c7;
}

.btn-outline {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--surface-muted);
}

.btn-sm {
    padding: 0.45rem 0.8rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.95rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
    background-color: rgba(255, 255, 255, 0.98);
    color: var(--text-primary);
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.03);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.1);
}

.form-control[type="file"] {
    padding: 0.5rem;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .table {
    min-width: 720px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--surface-color);
}

.table th,
.table td {
    padding: 0.95rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.table th {
    background-color: #f8fbff;
    font-weight: 800;
    color: var(--text-primary);
    font-size: 0.79rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table tr:hover {
    background-color: rgba(29, 78, 216, 0.04);
}

/* File Browser */
.file-browser {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    overflow: visible;
}

.file-browser-empty {
    min-height: 220px;
}

.drive-browser-card,
.drive-browser-card .card-body {
    overflow: visible;
}

.file-browser.drag-over {
    outline: 2px dashed var(--primary-color);
    outline-offset: -6px;
    background-color: rgba(59, 130, 246, 0.06);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    position: relative;
    overflow: visible;
}

.file-item[data-type="folder"],
.file-item.bucket-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-item[data-type="folder"]:hover,
.file-item.bucket-item:hover {
    background-color: rgba(29, 78, 216, 0.05);
    border-left: 3px solid var(--primary-color);
    transform: translateX(2px);
}

.file-item[data-type="file"]:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.file-item.bucket-item:active {
    background-color: rgba(59, 130, 246, 0.1);
    transform: translateX(1px);
}

.bucket-hint {
    font-size: 0.7rem;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-top: 0.25rem;
}

.bucket-item:hover .bucket-hint {
    opacity: 1;
}

.bucket-arrow {
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0;
    transition: all 0.2s ease;
    transform: translateX(-10px);
}

.bucket-item:hover .bucket-arrow {
    opacity: 1;
    transform: translateX(0);
}

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

.file-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    font-size: 1.25rem;
}

.file-icon.folder {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.file-icon.file {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.file-url {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: "JetBrains Mono", monospace;
    word-break: break-all;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.file-item:hover .file-url {
    opacity: 1;
    max-height: 50px;
    margin-top: 0.25rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.breadcrumb-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.breadcrumb-item:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-secondary);
}

.drive-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.75rem;
    background:
        linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(255, 255, 255, 0.96)),
        var(--surface-color);
    border: 1px solid rgba(29, 78, 216, 0.15);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-md);
}

.drive-hero-badge {
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background-color: rgba(15, 118, 110, 0.1);
    color: var(--local-color);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.source-section {
    margin-bottom: 2rem;
}

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

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
}

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

.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.source-card {
    display: block;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    border-radius: 1rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.source-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.source-card-local {
    border-color: rgba(15, 118, 110, 0.18);
}

.source-card-r2 {
    border-color: rgba(29, 78, 216, 0.15);
}

.source-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.source-card-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    background-color: var(--surface-muted);
    font-size: 1.35rem;
}

.source-card-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background-color: rgba(29, 78, 216, 0.1);
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.source-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.source-card-subtitle {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.source-card-meta {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.source-context {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.source-context-icon {
    font-size: 1.2rem;
}

.source-context-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background-color: rgba(29, 78, 216, 0.1);
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
}

.toolbar-card {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 1.05rem;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

.toolbar-card-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.toolbar-search {
    max-width: min(100%, 420px);
}

.action-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: 1px solid;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
    color: #1e40af;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: min(560px, calc(100vw - 2rem));
    width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Progress Bar */
.progress {
    width: 100%;
    height: 0.75rem;
    background-color: var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #60a5fa);
    transition: width 0.5s ease;
    position: relative;
    border-radius: var(--border-radius);
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    max-width: 320px;
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

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

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-none { display: none; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

/* Login Page */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.metric-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-sm);
}

.metric-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 800;
    margin-bottom: 0.45rem;
}

.metric-value {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.metric-note {
    color: var(--text-secondary);
    font-size: 0.83rem;
    margin-top: 0.35rem;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 1.25rem;
    align-items: start;
}

.stack-layout {
    display: grid;
    gap: 1.25rem;
}

.settings-section {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.section-kicker {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.section-heading {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}

.section-copy {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.settings-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.note-panel {
    background: linear-gradient(180deg, rgba(29, 78, 216, 0.07), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(29, 78, 216, 0.12);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
}

.note-panel.compact {
    padding: 0.85rem 1rem;
}

.note-panel h4 {
    margin-bottom: 0.5rem;
    font-size: 0.98rem;
    font-weight: 800;
}

.note-panel p,
.note-panel li {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.7rem;
}

.checkbox-pill {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.9rem;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-pill input {
    margin: 0;
}

.text-danger {
    color: #991b1b;
}

.text-warning {
    color: #92400e;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.info-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.action-menu {
    position: relative;
    z-index: 5;
}

.file-item.menu-open {
    z-index: 90;
}

.file-item.menu-open[data-type="folder"]:hover,
.file-item.menu-open.bucket-item:hover {
    transform: none;
}

.action-menu-trigger {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.96);
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    user-select: none;
}

.action-menu.is-open .action-menu-trigger,
.action-menu-trigger:hover {
    color: var(--text-primary);
    background-color: var(--surface-muted);
}

.action-menu-content {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 220px;
    display: none;
    gap: 0.2rem;
    padding: 0.45rem;
    border-radius: 0.95rem;
    background-color: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 80;
}

.action-menu.is-open .action-menu-content {
    display: grid;
}

.action-menu-item,
.action-menu-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: none;
    border-radius: 0.8rem;
    background-color: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
}

.action-menu-link {
    text-decoration: none;
}

.action-menu-item:hover,
.action-menu-link:hover {
    background-color: var(--surface-muted);
}

.action-menu-item.danger {
    color: #b91c1c;
}

.empty-state {
    padding: 2.2rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.empty-state-actions {
    margin-top: 1.25rem;
    display: flex;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.mono {
    font-family: "JetBrains Mono", monospace;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.22), transparent 32%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.18), transparent 28%),
        linear-gradient(135deg, #f8fbff 0%, #edf5ff 45%, #f3f8ff 100%);
}

.login-form {
    background-color: var(--surface-color);
    padding: 2.15rem;
    border-radius: 1.6rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 430px;
    border: 1px solid rgba(219, 227, 241, 0.92);
}

.login-header {
    margin-bottom: 1.75rem;
    text-align: center;
}

.login-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: -0.04em;
}

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

/* Public Share Pages */
.public-share-body {
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.14), transparent 24%),
        linear-gradient(180deg, rgba(249, 251, 255, 0.98), rgba(239, 245, 252, 0.98)),
        var(--background-color);
}

.public-shell-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background-color: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(219, 227, 241, 0.92);
    box-shadow: var(--shadow-sm);
}

.public-shell-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.6rem;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    color: inherit;
}

.public-brand-mark {
    width: 2.7rem;
    height: 2.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.14), rgba(15, 118, 110, 0.18));
    border: 1px solid rgba(29, 78, 216, 0.14);
    color: var(--primary-color);
    font-size: 1.15rem;
    font-weight: 800;
}

.public-brand-name,
.public-brand-subtitle {
    display: block;
}

.public-brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.public-brand-subtitle {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.public-shell-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(29, 78, 216, 0.14);
    background-color: rgba(255, 255, 255, 0.92);
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.public-share-main {
    padding-top: 2.25rem;
}

.public-share-shell {
    max-width: 1160px;
    margin: 0 auto;
}

.public-share-hero {
    margin-bottom: 1.4rem;
    padding: 1.6rem;
    border-radius: 1.45rem;
    border: 1px solid rgba(29, 78, 216, 0.14);
    background:
        linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(255, 255, 255, 0.96)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.98));
    box-shadow: var(--shadow-lg);
}

.public-share-kicker {
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.public-share-hero-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.public-share-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 118, 110, 0.16);
    color: var(--local-color);
    font-size: 0.86rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.public-share-metrics {
    margin-bottom: 0;
}

.public-share-metric-text {
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.public-share-access-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 1.25rem;
    align-items: start;
}

.public-share-access-card,
.public-share-sidepanel,
.public-share-browser-card {
    box-shadow: var(--shadow-lg);
}

.public-share-sidecard {
    display: block;
}

.public-share-sidepanel {
    min-height: 100%;
}

.public-pin-input {
    min-height: 3.4rem;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    text-align: center;
    font-family: "JetBrains Mono", monospace;
}

.public-share-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.public-share-breadcrumb {
    flex: 1;
    min-width: min(100%, 340px);
    margin-bottom: 0;
    padding: 0.95rem 1rem;
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
}

.public-share-browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.public-share-browser-summary {
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background-color: rgba(29, 78, 216, 0.08);
    color: var(--primary-color);
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.public-share-browser-body {
    padding: 1rem;
}

.public-share-list {
    display: grid;
    gap: 0.7rem;
}

.public-share-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(219, 227, 241, 0.95);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.98));
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.public-share-item:hover {
    transform: translateY(-1px);
    border-color: rgba(29, 78, 216, 0.2);
    box-shadow: var(--shadow-md);
}

.public-share-item-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.public-share-item-icon.folder {
    background-color: rgba(249, 115, 22, 0.12);
    color: var(--warning-color);
}

.public-share-item-icon.file {
    background-color: rgba(29, 78, 216, 0.1);
    color: var(--primary-color);
}

.public-share-item-body {
    min-width: 0;
    flex: 1;
}

.public-share-item-name {
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.public-share-item-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.public-share-item-dot {
    width: 0.22rem;
    height: 0.22rem;
    border-radius: 999px;
    background-color: rgba(89, 112, 140, 0.55);
}

.public-share-item-action {
    flex-shrink: 0;
}

.public-share-empty {
    padding: 2.6rem 1.5rem;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.06), transparent 35%),
        linear-gradient(180deg, rgba(248, 250, 255, 0.96), rgba(255, 255, 255, 0.98));
    border-radius: 1rem;
    border: 1px dashed rgba(29, 78, 216, 0.18);
}

/* Transfer Jobs */
.transfer-job-list {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.transfer-job-card {
    padding: 1.2rem;
    border-radius: 1.1rem;
    border: 1px solid var(--border-color);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.98));
    box-shadow: var(--shadow-sm);
}

.transfer-job-processing {
    border-color: rgba(245, 158, 11, 0.28);
}

.transfer-job-completed {
    border-color: rgba(16, 185, 129, 0.22);
}

.transfer-job-failed {
    border-color: rgba(239, 68, 68, 0.24);
}

.transfer-job-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.transfer-job-header-main {
    min-width: 0;
    flex: 1;
}

.transfer-job-topline {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

.transfer-job-id {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.transfer-job-message {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.transfer-job-dates {
    min-width: 180px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    display: grid;
    gap: 0.25rem;
}

/* Import Jobs */
.imports-page-actions {
    flex-wrap: wrap;
}

.import-job-actions {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.import-job-actions form {
    margin: 0;
}

.mono-wrap {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.transfer-job-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(300px, 1.2fr);
    gap: 0.9rem;
}

.transfer-job-block {
    padding: 0.95rem 1rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(219, 227, 241, 0.95);
    background-color: rgba(255, 255, 255, 0.86);
}

.transfer-job-block-label {
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.transfer-job-block-title {
    font-size: 0.96rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    word-break: break-word;
}

.transfer-job-block-path {
    color: var(--text-secondary);
    font-size: 0.8rem;
    word-break: break-word;
}

.transfer-job-block-note {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.transfer-job-progress-block {
    background:
        linear-gradient(180deg, rgba(29, 78, 216, 0.04), rgba(255, 255, 255, 0.94));
}

.transfer-job-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.transfer-job-progress-head strong {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.transfer-job-progress-head span {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.transfer-job-progress {
    margin: 0 0 0.75rem;
    height: 0.8rem;
}

.transfer-job-progress.is-complete .progress-bar {
    background: linear-gradient(90deg, var(--success-color), #34d399);
}

.transfer-job-progress.is-complete .progress-bar::after,
.transfer-job-progress.is-failed .progress-bar::after {
    display: none;
}

.transfer-job-progress.is-failed .progress-bar {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.transfer-job-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.transfer-job-error {
    margin-top: 0.8rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.85rem;
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.14);
    color: #b91c1c;
    font-size: 0.84rem;
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 1180px) {
    .app-shell-mobile-bar {
        position: sticky;
        top: 0;
        z-index: 180;
        display: flex;
        align-items: center;
        gap: 0.85rem;
        min-height: var(--app-mobile-bar-height);
        padding: 0.85rem 1rem;
        background-color: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(219, 227, 241, 0.96);
        box-shadow: var(--shadow-sm);
    }

    .app-shell-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background-color: rgba(15, 23, 42, 0.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 160;
    }

    .app-shell {
        width: min(22rem, 92vw);
        padding: 0.75rem;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 170;
    }

    .app-shell-inner {
        border-radius: 1.3rem;
    }

    .app-shell-close {
        display: inline-flex;
        flex-shrink: 0;
    }

    body.app-shell-open .app-shell {
        transform: translateX(0);
    }

    body.app-shell-open .app-shell-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-shell ~ .main,
    .app-shell ~ .app-footer {
        margin-left: 0;
    }

    .page-header-row,
    .drive-hero,
    .section-header,
    .public-shell-header-inner,
    .public-share-hero-row,
    .public-share-toolbar,
    .public-share-browser-header,
    .transfer-job-header,
    .transfer-job-progress-head {
        flex-direction: column;
        align-items: stretch;
    }

    .split-layout,
    .public-share-access-grid,
    .transfer-job-grid {
        grid-template-columns: 1fr;
    }

    .transfer-job-dates {
        min-width: 0;
    }

    .transfer-job-progress-meta {
        align-items: flex-start;
    }

    .action-toolbar {
        width: 100%;
        justify-content: flex-start;
    }

    .toolbar-search {
        max-width: none;
    }
}

@media (max-width: 920px) {
    .container {
        padding: 0 1rem;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-grid,
    .public-share-access-grid {
        grid-template-columns: 1fr;
    }

    .public-share-item,
    .public-share-browser-header {
        flex-direction: column;
        align-items: stretch;
    }

    .action-menu-content {
        left: auto;
        right: 0;
        max-width: min(18rem, calc(100vw - 2rem));
    }
}

@media (max-width: 720px) {
    .container {
        padding: 0 0.85rem;
    }

    .metric-grid,
    .source-grid {
        grid-template-columns: 1fr;
    }

    .public-share-item-action,
    .public-share-item-action .btn {
        width: 100%;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .file-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        gap: 0.35rem;
    }

    .file-url {
        opacity: 1;
        max-height: none;
        margin-top: 0.35rem;
    }

    .toast {
        left: 0.5rem;
        right: 0.5rem;
        top: auto;
        bottom: 0.75rem;
        max-width: none;
    }

    .table {
        font-size: 0.78rem;
    }

    .table-responsive .table,
    .card-body > .table {
        min-width: 640px;
    }

    .card-body > .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        padding: 0.65rem 0.7rem;
    }
}

@media (max-width: 560px) {
    .page-title {
        font-size: 1.55rem;
    }

    .drive-hero,
    .public-share-hero,
    .settings-section,
    .card-header,
    .card-body,
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .public-share-hero,
    .public-share-browser-body {
        padding-top: 1.2rem;
        padding-bottom: 1.2rem;
    }

    .public-share-browser-body {
        padding: 1rem;
    }

    .public-shell-chip {
        align-self: flex-start;
    }

    .btn {
        min-height: 2.65rem;
    }

    .action-toolbar .btn,
    .empty-state-actions .btn,
    .page-header form .btn,
    .app-shell-user-actions .btn {
        width: 100%;
    }

    .app-footer-content {
        padding: 0.95rem 1rem;
    }
}
