:root {
    --drive-blue: #1a73e8;
    --drive-blue-soft: #e8f0fe;
    --drive-text: #202124;
    --drive-muted: #5f6368;
    --drive-border: #dfe3e8;
    --drive-surface: #ffffff;
    --drive-bg: #f8fafd;
}

body {
    color: var(--drive-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.navbar {
    min-height: 64px;
}

.navbar-brand .brand-logo {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--drive-blue-soft);
}

.navbar-brand .brand-text span {
    letter-spacing: 0;
}

.drive-profile-menu {
    display: flex;
    align-items: center;
}

.drive-profile-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--drive-text);
    border-radius: 999px;
    padding: 6px 10px 6px 6px;
    min-height: 48px;
}

.drive-profile-button:hover,
.drive-profile-button[aria-expanded="true"] {
    background: #f1f3f4;
    border-color: var(--drive-border);
}

.drive-profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--drive-blue);
    color: #fff;
    font-weight: 700;
    line-height: 1;
}

.drive-profile-avatar.lg {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.drive-profile-meta {
    display: grid;
    line-height: 1.15;
    text-align: left;
}

.drive-profile-name {
    font-size: 14px;
    font-weight: 600;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-profile-role {
    color: var(--drive-muted);
    font-size: 12px;
}

.drive-profile-chevron {
    color: var(--drive-muted);
    font-size: 11px;
}

.drive-profile-dropdown {
    border: 1px solid var(--drive-border);
    border-radius: 14px;
    padding: 8px;
    min-width: 260px;
}

.drive-profile-dropdown .dropdown-item {
    border-radius: 8px;
    padding: 9px 10px;
}

.drive-theme-button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--drive-muted);
}

.drive-theme-button:hover {
    background: #f1f3f4;
    color: var(--drive-text);
}

.auth-page {
    background:
        radial-gradient(circle at 10% 15%, rgba(66, 133, 244, .12), transparent 28%),
        radial-gradient(circle at 85% 20%, rgba(52, 168, 83, .10), transparent 24%),
        var(--drive-bg);
}

.auth-page > .navbar #navbarMain,
.auth-page > .navbar .navbar-toggler,
.auth-page > .navbar .navbar-nav,
.auth-page > .navbar .theme-toggle {
    display: none !important;
}

.auth-page > .navbar {
    box-shadow: none !important;
    border-bottom: 1px solid var(--drive-border);
}

[data-bs-theme="dark"] {
    --drive-text: #e8eaed;
    --drive-muted: #bdc1c6;
    --drive-border: #3c4043;
    --drive-surface: #202124;
    --drive-bg: #151718;
    --drive-blue-soft: rgba(138, 180, 248, .16);
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .drive-clean-page,
[data-bs-theme="dark"] .auth-page {
    background: var(--drive-bg);
    color: var(--drive-text);
}

[data-bs-theme="dark"] .navbar,
[data-bs-theme="dark"] .drive-sidebar,
[data-bs-theme="dark"] .drive-toolbar,
[data-bs-theme="dark"] .drive-item,
[data-bs-theme="dark"] .drive-activity,
[data-bs-theme="dark"] .drive-details-panel,
[data-bs-theme="dark"] .drive-table-card,
[data-bs-theme="dark"] .auth-card,
[data-bs-theme="dark"] .share-public-card,
[data-bs-theme="dark"] .drive-context-menu,
[data-bs-theme="dark"] .drive-new-menu,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu {
    background: var(--drive-surface) !important;
    color: var(--drive-text);
    border-color: var(--drive-border) !important;
}

[data-bs-theme="dark"] .drive-profile-button:hover,
[data-bs-theme="dark"] .drive-theme-button:hover,
[data-bs-theme="dark"] .drive-new-menu button:hover,
[data-bs-theme="dark"] .drive-context-menu button:hover,
[data-bs-theme="dark"] .drive-item:hover,
[data-bs-theme="dark"] .dropdown-item:hover {
    background: #2b2c2f !important;
}

[data-bs-theme="dark"] .drive-search {
    background: #2b2c2f;
}

[data-bs-theme="dark"] .drive-notification-btn,
[data-bs-theme="dark"] .drive-notification-menu {
    background: var(--drive-surface);
    color: var(--drive-text);
    border-color: var(--drive-border);
}

[data-bs-theme="dark"] .drive-notification-head,
[data-bs-theme="dark"] .drive-details-header,
[data-bs-theme="dark"] .drive-details-tabs,
[data-bs-theme="dark"] .drive-details-preview,
[data-bs-theme="dark"] .drive-details-section {
    border-color: var(--drive-border) !important;
}

[data-bs-theme="dark"] .drive-details-preview {
    background: #1c1e20;
}

[data-bs-theme="dark"] .drive-details-info-label {
    color: #9aa0a6;
}

[data-bs-theme="dark"] .drive-details-info-value {
    color: var(--drive-text);
}

[data-bs-theme="dark"] .drive-details-header h2,
[data-bs-theme="dark"] .drive-details-section h3 {
    color: var(--drive-text);
}

[data-bs-theme="dark"] .drive-comment-text {
    background: #2b2c2f;
    color: var(--drive-text);
}

[data-bs-theme="dark"] .drive-advanced-search-popover {
    background: var(--drive-surface);
    color: var(--drive-text);
    border-color: var(--drive-border);
}

[data-bs-theme="dark"] .drive-comment-input {
    background: #1c1e20;
    color: var(--drive-text);
    border-color: var(--drive-border);
}
[data-bs-theme="dark"] .drive-notification-menu a {
    border-color: #3c4043;
}

[data-bs-theme="dark"] .drive-notification-menu a {
    color: #f1f3f4;
}

[data-bs-theme="dark"] .drive-notification-menu a.unread,
[data-bs-theme="dark"] .drive-item.drag-over,
[data-bs-theme="dark"] .drive-tree-row.drag-over {
    background: rgba(138, 180, 248, .16) !important;
}

[data-bs-theme="dark"] .drive-notification-menu a span,
[data-bs-theme="dark"] .drive-notification-menu a time,
[data-bs-theme="dark"] .drive-notification-empty {
    color: #c9cdd3;
}

[data-bs-theme="dark"] .drive-search input,
[data-bs-theme="dark"] .drive-filter-form select,
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #202124;
    color: var(--drive-text);
    border-color: var(--drive-border);
}

[data-bs-theme="dark"] .btn-light {
    --bs-btn-color: #e8eaed;
    --bs-btn-bg: #2b2c2f;
    --bs-btn-border-color: #3c4043;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: #34363a;
    --bs-btn-hover-border-color: #5f6368;
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: #3c4043;
    --bs-btn-active-border-color: #5f6368;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #d2d6dc;
    --bs-btn-border-color: #5f6368;
    --bs-btn-hover-bg: #34363a;
    --bs-btn-hover-border-color: #8a9099;
}

[data-bs-theme="dark"] .dropdown-item,
[data-bs-theme="dark"] .drive-context-menu button,
[data-bs-theme="dark"] .drive-new-menu button,
[data-bs-theme="dark"] .drive-nav a,
[data-bs-theme="dark"] .drive-tree-link,
[data-bs-theme="dark"] .drive-item h3,
[data-bs-theme="dark"] .drive-header h1,
[data-bs-theme="dark"] .app-page-title h1,
[data-bs-theme="dark"] .app-page-title h4,
[data-bs-theme="dark"] .auth-card h2,
[data-bs-theme="dark"] .share-public-card h4 {
    color: #f1f3f4 !important;
}

[data-bs-theme="dark"] .drive-item p,
[data-bs-theme="dark"] .drive-header p,
[data-bs-theme="dark"] .drive-breadcrumb,
[data-bs-theme="dark"] .drive-breadcrumb a,
[data-bs-theme="dark"] .app-page-title p,
[data-bs-theme="dark"] .auth-switch,
[data-bs-theme="dark"] .auth-copy p,
[data-bs-theme="dark"] .form-label {
    color: #c9cdd3 !important;
}

[data-bs-theme="dark"] .drive-activity-list.detailed strong {
    color: #f1f3f4;
}

[data-bs-theme="dark"] .drive-activity-heading p,
[data-bs-theme="dark"] .drive-activity-list.detailed,
[data-bs-theme="dark"] .drive-activity-empty {
    color: #c9cdd3;
    border-color: #3c4043;
}

[data-bs-theme="dark"] .drive-activity-heading > span,
[data-bs-theme="dark"] .drive-activity-list.detailed .drive-activity-row-head {
    background: #202124;
    color: #d2d6dc;
    border-color: #3c4043;
}

[data-bs-theme="dark"] .drive-activity-empty strong {
    color: #f1f3f4;
}

[data-bs-theme="dark"] .drive-activity-list.detailed .drive-activity-row {
    border-bottom-color: #3c4043;
}

[data-bs-theme="dark"] .drive-activity-list.detailed small,
[data-bs-theme="dark"] .drive-activity-list.detailed em {
    color: #aeb4bb;
}

.drive-toast-wrap {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 11000;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 28px));
}

.drive-notice {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 30px;
    align-items: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dfe5ef;
    border-radius: 12px;
    background: #fff;
    color: #202124;
    box-shadow: 0 18px 40px rgba(60,64,67,.18);
}

.drive-notice > i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1a73e8;
}

.drive-notice strong,
.drive-notice span {
    display: block;
    line-height: 1.35;
}

.drive-notice strong {
    margin-bottom: 2px;
    font-size: 13px;
}

.drive-notice span {
    color: #5f6368;
    font-size: 13px;
}

.drive-notice button {
    border: 0;
    background: transparent;
    color: #5f6368;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.drive-notice-success > i {
    background: #e6f4ea;
    color: #137333;
}

.drive-notice-warning > i {
    background: #fef7e0;
    color: #b06000;
}

.drive-notice-danger > i {
    background: #fce8e6;
    color: #c5221f;
}

.drive-dialog-modal .modal-content {
    border: 1px solid #dfe5ef;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(60,64,67,.28);
}

.drive-dialog-modal .modal-body {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    padding: 22px 22px 10px;
}

.drive-dialog-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 20px;
}

.drive-dialog-copy h5 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
}

.drive-dialog-copy p {
    margin: 0;
    color: #5f6368;
    line-height: 1.5;
}

.drive-dialog-copy .form-control {
    margin-top: 12px;
}

.drive-dialog-modal .modal-footer {
    border-top: 0;
    padding: 12px 22px 20px;
}

[data-bs-theme="dark"] .drive-notice,
[data-bs-theme="dark"] .drive-dialog-modal .modal-content {
    background: #202124 !important;
    color: #f1f3f4;
    border-color: #3c4043 !important;
}

[data-bs-theme="dark"] .drive-notice span,
[data-bs-theme="dark"] .drive-notice button,
[data-bs-theme="dark"] .drive-dialog-copy p {
    color: #c9cdd3;
}

[data-bs-theme="dark"] .drive-dialog-icon,
[data-bs-theme="dark"] .drive-notice > i {
    background: rgba(138, 180, 248, .18);
    color: #8ab4f8;
}

[data-bs-theme="dark"] .drive-nav a.active,
[data-bs-theme="dark"] .drive-tree-link.active,
[data-bs-theme="dark"] .drive-nav a:hover,
[data-bs-theme="dark"] .drive-tree-link:hover {
    background: rgba(138, 180, 248, .18) !important;
    color: #d2e3fc !important;
}

[data-bs-theme="dark"] .drive-tree-row:hover {
    background: rgba(255,255,255,.06);
}

[data-bs-theme="dark"] .drive-tree-toggle {
    color: #9aa0a6;
}

[data-bs-theme="dark"] .drive-tree-toggle:hover {
    background: rgba(255,255,255,.1);
    color: #e8eaed;
}

[data-bs-theme="dark"] .drive-tree-link i {
    color: #9aa0a6;
}

[data-bs-theme="dark"] .drive-tree-node.open > .drive-tree-children {
    border-left-color: #3c4043;
}

[data-bs-theme="dark"] .drive-item-icon {
    background: rgba(138, 180, 248, .18);
    color: #8ab4f8;
}

[data-bs-theme="dark"] .drive-item-icon.folder {
    background: rgba(251, 188, 4, .18);
    color: #fdd663;
}

[data-bs-theme="dark"] .drive-empty,
[data-bs-theme="dark"] .empty-panel {
    background: #202124;
    border-color: #3c4043;
    color: #c9cdd3;
}

[data-bs-theme="dark"] .drive-empty h2,
[data-bs-theme="dark"] .empty-panel h5 {
    color: #f1f3f4;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .drive-muted,
[data-bs-theme="dark"] .drive-profile-role,
[data-bs-theme="dark"] .drive-profile-chevron {
    color: #c9cdd3 !important;
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--drive-text);
    --bs-table-border-color: var(--drive-border);
    --bs-table-hover-bg: #2b2c2f;
    --bs-table-hover-color: #f1f3f4;
}

[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #2b2c2f;
    --bs-table-color: #d2d6dc;
}

[data-bs-theme="dark"] .table td,
[data-bs-theme="dark"] .table th {
    color: #e8eaed;
}

[data-bs-theme="dark"] .drive-table-card tbody tr:hover,
[data-bs-theme="dark"] .drive-table-card tbody tr:hover > *,
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    background: #2b2c2f !important;
    color: #f1f3f4 !important;
}

[data-bs-theme="dark"] .drive-table-card tbody tr:hover .text-muted,
[data-bs-theme="dark"] .drive-table-card tbody tr:hover small,
[data-bs-theme="dark"] .drive-table-card tbody tr:hover a:not(.btn) {
    color: #d2d6dc !important;
}

[data-bs-theme="dark"] .badge.bg-success {
    color: #ffffff;
}

[data-bs-theme="dark"] input::placeholder,
[data-bs-theme="dark"] textarea::placeholder {
    color: #9aa0a6 !important;
}

.auth-page > .navbar .navbar-collapse {
    justify-content: flex-end;
}

.auth-page > .navbar .navbar-nav.ms-auto {
    margin-left: auto !important;
}

.auth-shell {
    min-height: calc(100vh - 64px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: 48px;
    align-items: center;
    padding: 56px clamp(20px, 6vw, 92px);
}

.auth-copy h1 {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 18px;
}

.auth-copy p {
    color: var(--drive-muted);
    font-size: 18px;
    max-width: 620px;
}

.auth-feature-list {
    display: grid;
    gap: 12px;
    margin-top: 28px;
    max-width: 520px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #3c4043;
    background: rgba(255,255,255,.74);
    border: 1px solid rgba(223,227,232,.8);
    border-radius: 14px;
    padding: 12px 14px;
}

.auth-feature i {
    color: var(--drive-blue);
    width: 20px;
}

.auth-card {
    background: var(--drive-surface);
    border: 1px solid var(--drive-border);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(60, 64, 67, .16);
    padding: 28px;
}

.auth-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-card .form-label {
    font-weight: 600;
    font-size: 13px;
    color: #3c4043;
}

.auth-card .form-control {
    border-radius: 10px;
    min-height: 44px;
}

.auth-card .btn {
    border-radius: 999px;
    min-height: 44px;
    font-weight: 600;
}

.auth-switch {
    color: var(--drive-muted);
    font-size: 14px;
}

.app-page-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.app-page-title h1,
.app-page-title h4 {
    margin: 0 0 4px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0;
}

.app-page-title p,
.app-page-title .text-muted {
    color: var(--drive-muted) !important;
}

.drive-table-card {
    background: #fff;
    border: 1px solid var(--drive-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(60,64,67,.08);
}

.drive-table-card .table {
    margin: 0;
}

.drive-table-card thead th {
    color: var(--drive-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .02em;
    border-bottom-color: var(--drive-border);
}

.drive-table-card tbody tr:hover {
    background: #f8fafd;
}

.empty-panel {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 280px;
    color: var(--drive-muted);
}

.empty-panel i {
    font-size: 42px;
    color: var(--drive-blue);
    margin-bottom: 12px;
}

.share-public-page {
    min-height: 100vh;
    background: var(--drive-bg);
}

.share-public-card {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--drive-border);
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(60,64,67,.14);
    padding: 30px;
}

.share-file-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--drive-blue-soft);
    color: var(--drive-blue);
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px 18px;
    }

    .auth-copy h1 {
        font-size: 34px;
    }

    .auth-copy p {
        font-size: 16px;
    }
}
