:root {
    --font-family: 'Google Sans', 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --color-primary: #1a73e8;
    --color-primary-hover: #1557b0;
    --color-primary-light: #e8f0fe;
    --color-primary-dark: #174ea6;
    --color-text-main: #202124;
    --color-text-sub: #5f6368;
    --color-text-muted: #80868b;
    --color-border: #dadce0;
    --color-border-light: #e8eaed;
    --color-bg-app: #f8fafd;
    --color-bg-card: #ffffff;
    --color-bg-sidebar: #f8fafd;
    --color-danger: #d93025;
    --color-danger-light: #fce8e6;
    --color-success: #188038;
    --color-success-light: #e6f4ea;
    --color-warning: #ea8600;
    --color-warning-light: #fef7e0;
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.15), 0 1px 3px 1px rgba(60,64,67,0.08);
    --shadow-md: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 24px;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    color: var(--color-text-main);
    background-color: var(--color-bg-app);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ---------------- Topbar ---------------- */
.topbar {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 24px;
}

.topbar-left {
    display: flex;
    align-items: center;
    min-width: 200px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 500;
    color: var(--color-text-main);
}

.drive-logo {
    width: 38px;
    height: 34px;
    display: flex;
    align-items: center;
}

.drive-logo-svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    font-family: 'Google Sans', var(--font-family);
    font-size: 21px;
    font-weight: 500;
    color: #444746;
    letter-spacing: -0.2px;
}

.search-bar {
    flex: 1;
    max-width: 720px;
    height: 46px;
    background: #edf2fc;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: background 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.search-bar:focus-within {
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    border-color: var(--color-border);
}

.search-icon {
    background: transparent;
    border: 0;
    font-size: 16px;
    color: var(--color-text-sub);
    cursor: pointer;
    padding: 0;
    margin-right: 12px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--color-text-main);
}

.search-bar input::placeholder {
    color: var(--color-text-sub);
}

.search-clear {
    color: var(--color-text-sub);
    font-size: 14px;
    padding: 4px;
    border-radius: 50%;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-quota-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-bg-app);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--color-text-sub);
    font-weight: 500;
}

.topbar-quota-badge:hover {
    background: #e8eaed;
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #0b57d0;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.user-avatar:hover {
    box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.2);
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 280px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 12px 0;
    z-index: 100;
}

.dropdown-header {
    padding: 8px 18px 12px;
}

.dropdown-header strong {
    display: block;
    font-size: 15px;
    color: var(--color-text-main);
}

.dropdown-email {
    font-size: 13px;
    color: var(--color-text-sub);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-divider {
    height: 1px;
    background: var(--color-border-light);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    font-size: 14px;
    color: var(--color-text-main);
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--color-bg-app);
}

.dropdown-item.text-danger {
    color: var(--color-danger);
}

.dropdown-item.text-danger:hover {
    background: var(--color-danger-light);
}

.role-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
}

.role-pill.owner { background: #e8f0fe; color: #1a73e8; }
.role-pill.admin { background: #fce8e6; color: #d93025; }
.role-pill.recipient { background: #e6f4ea; color: #188038; }

/* ---------------- Layout & Sidebar ---------------- */
.app-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 256px;
    background: var(--color-bg-sidebar);
    border-right: 1px solid var(--color-border);
    padding: 18px 14px 24px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-action {
    margin-bottom: 18px;
}

.btn-new {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    box-shadow: 0 1px 3px rgba(60,64,67,0.15);
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-main);
    transition: box-shadow 0.2s, background 0.2s;
}

.btn-new:hover {
    box-shadow: 0 2px 6px 2px rgba(60,64,67,0.2);
    background: #fafafa;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    color: var(--color-text-main);
    font-weight: 500;
    transition: background 0.15s;
}

.nav-item:hover {
    background: #eaedf2;
}

.nav-item.active {
    background: #c2e7ff;
    color: #001d35;
    font-weight: 600;
}

.nav-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.sidebar-storage {
    margin-top: auto;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.storage-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 8px;
}

.storage-bar {
    height: 8px;
    background: #e0e3e7;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.storage-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.storage-fill.danger {
    background: var(--color-danger);
}

.storage-text {
    font-size: 12px;
    color: var(--color-text-sub);
    margin-bottom: 6px;
}

.storage-link {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
}

.storage-link:hover {
    text-decoration: underline;
}

.main-content {
    flex: 1;
    min-width: 0;
    background: #ffffff;
    padding: 24px 36px;
}

/* ---------------- Drive Container & Toolbar ---------------- */
.drive-container {
    max-width: 1240px;
    margin: 0 auto;
}

.drive-container-narrow {
    max-width: 820px;
    margin: 0 auto;
}

.drive-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb-trail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 400;
    color: var(--color-text-main);
}

.crumb-link {
    color: var(--color-text-main);
}

.crumb-link:hover {
    color: var(--color-primary);
}

.crumb-sep {
    color: var(--color-text-muted);
}

.crumb-current {
    font-weight: 500;
}

.drive-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 18px;
}

.filter-pill-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-pill {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    border: 1px solid var(--color-border);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-sub);
    transition: background 0.15s, border-color 0.15s;
}

.filter-pill:hover {
    background: var(--color-bg-app);
}

.filter-pill.active {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    font-weight: 600;
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 17px;
    color: var(--color-text-sub);
    transition: background 0.15s, color 0.15s;
}

.btn-icon:hover {
    background: #eaedf2;
    color: var(--color-text-main);
}

.btn-icon.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* ---------------- File Table (List View) ---------------- */
.drive-table-wrap {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.drive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.drive-table th {
    padding: 12px 18px;
    background: #f8fafd;
    color: var(--color-text-sub);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
}

.drive-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text-main);
    vertical-align: middle;
}

.drive-table tr:last-child td {
    border-bottom: none;
}

.drive-table tr.file-row-item:hover {
    background: #f1f4f9;
}

.file-title-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-main);
    font-weight: 500;
}

.file-title-link:hover .file-name-text {
    color: var(--color-primary);
    text-decoration: underline;
}

.file-name-text {
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 26px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.badge-pdf { background: #ea4335; }
.badge-docx { background: #1a73e8; }
.badge-jpg, .badge-jpeg, .badge-png { background: #f29900; }
.badge-zip { background: #8e24aa; }
.badge-txt { background: #5f6368; }

.owner-pill {
    display: inline-block;
    padding: 3px 10px;
    background: #f1f3f4;
    border-radius: var(--radius-pill);
    font-size: 12px;
    color: var(--color-text-sub);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
}

.status-shared { background: #e8f0fe; color: #1a73e8; }
.status-private { background: #f1f3f4; color: #5f6368; }
.status-active { background: #e6f4ea; color: #188038; }
.status-waiting { background: #fef7e0; color: #ea8600; font-weight: 600; }
.status-revoked, .status-expired { background: #fce8e6; color: #d93025; }

.row-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-sub);
    font-size: 15px;
    transition: background 0.15s, color 0.15s;
}

.btn-action:hover {
    background: #e0e3e7;
    color: var(--color-text-main);
}

.btn-danger-action:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* ---------------- File Grid View ---------------- */
.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.drive-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.15s;
}

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

.card-preview-area {
    height: 120px;
    background: #f1f4f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid var(--color-border-light);
}

.card-preview-symbol {
    font-size: 42px;
    opacity: 0.6;
}

.card-file-type {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
}

.card-body {
    padding: 12px 14px;
    flex: 1;
}

.card-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.card-title:hover {
    color: var(--color-primary);
}

.card-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.card-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
}

/* ---------------- Folders Grid ---------------- */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 8px 0;
}

.folder-card-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.folder-card-item:hover {
    background: #f8fafd;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.folder-icon {
    font-size: 26px;
}

.folder-details {
    flex: 1;
    min-width: 0;
}

.folder-name {
    display: block;
    font-size: 14px;
    color: var(--color-text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-count {
    font-size: 12px;
    color: var(--color-text-muted);
}

.folder-arrow {
    font-size: 18px;
    color: var(--color-text-muted);
}

/* ---------------- Buttons & Cards ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}

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

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 1px 3px rgba(26,115,232,0.4);
}

.btn-outline {
    background: #ffffff;
    border-color: var(--color-border);
    color: var(--color-text-main);
}

.btn-outline:hover {
    background: var(--color-bg-app);
    border-color: #c0c4c9;
}

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

.btn-danger:hover {
    background: #b3261e;
}

.btn-success {
    background: var(--color-success) !important;
    color: #ffffff !important;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 24px;
}

.card-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 14px;
}

.card-header h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 500;
    color: var(--color-text-main);
}

.page-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-header-bar h2 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 400;
}

.header-with-badge {
    display: flex;
    align-items: center;
    gap: 14px;
}

.text-muted { color: var(--color-text-sub); margin: 0; font-size: 13px; }
.text-danger-notice { color: var(--color-danger); font-size: 14px; line-height: 1.6; }
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }

/* ---------------- Form Elements ---------------- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-sub);
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--color-text-main);
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

.form-row {
    display: flex;
    gap: 16px;
}

.col-6 { flex: 0 0 calc(50% - 8px); }
.col-12 { flex: 0 0 100%; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.inline-form-group {
    display: flex;
    gap: 12px;
}

.copy-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-copy {
    width: 180px;
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #f8fafd;
    color: var(--color-text-sub);
}

/* ---------------- Upload Dropzone ---------------- */
.upload-dropzone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: #fafbfc;
    padding: 36px 20px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 20px;
}

.upload-dropzone:hover, .upload-dropzone.is-dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    font-size: 44px;
    margin-bottom: 8px;
}

.dropzone-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-main);
    margin-bottom: 4px;
}

.dropzone-hint {
    font-size: 13px;
    color: var(--color-text-muted);
}

.text-primary {
    color: var(--color-primary);
    font-weight: 600;
}

.file-chosen-info {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    border: 1px solid var(--color-primary);
    color: var(--color-primary-dark);
    font-size: 13px;
    font-weight: 600;
}

.upload-specs-card {
    display: flex;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--color-bg-app);
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
}

.spec-label { color: var(--color-text-sub); }
.spec-val { font-weight: 600; color: var(--color-text-main); }

/* ---------------- Fullscreen Drag Overlay ---------------- */
.drag-overlay {
    position: fixed;
    inset: 0;
    background: rgba(32, 33, 36, 0.7);
    backdrop-filter: blur(2px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drag-overlay.visible {
    display: flex;
}

.drag-overlay-card {
    background: #ffffff;
    border: 3px dashed var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 48px 64px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.drag-overlay-icon {
    font-size: 54px;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.drag-overlay-card h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

/* ---------------- Auth (Login / Register) ---------------- */
.auth-header {
    height: 68px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-text {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s, color 0.2s;
}

.btn-text:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.btn-outline {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-primary);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: transparent;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.auth-main {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background: radial-gradient(circle at 10% 20%, rgba(26, 115, 232, 0.08) 0%, transparent 45%),
                radial-gradient(circle at 90% 80%, rgba(52, 168, 83, 0.07) 0%, transparent 45%),
                radial-gradient(circle at 50% 50%, rgba(244, 180, 0, 0.04) 0%, transparent 50%),
                linear-gradient(135deg, #f8fafd 0%, #edf2fc 100%);
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border: 1px solid rgba(218, 220, 224, 0.8);
    border-radius: 24px;
    padding: 44px 38px 36px;
    box-shadow: 0 20px 45px -10px rgba(26, 115, 232, 0.12), 
                0 8px 24px -4px rgba(60, 64, 67, 0.08);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-card:hover {
    box-shadow: 0 24px 50px -8px rgba(26, 115, 232, 0.16), 
                0 10px 28px -2px rgba(60, 64, 67, 0.1);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand-badge {
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(60, 64, 67, 0.08);
    border: 1px solid #edf2fc;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-brand-badge:hover {
    transform: scale(1.08) rotate(3deg);
}

.auth-brand-badge svg {
    width: 44px;
    height: 40px;
}

.auth-card-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1f1f1f;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.auth-sub {
    font-size: 13.5px;
    color: #5f6368;
    line-height: 1.5;
    margin: 0;
}

.auth-role-notice {
    background: #fef7e0;
    border: 1px solid #feefc3;
    color: #845305;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-form {
    margin-bottom: 20px;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #3c4043;
    margin-bottom: 6px;
}

.auth-label-hint {
    font-size: 11.5px;
    color: #80868b;
    font-weight: normal;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-left {
    position: absolute;
    left: 14px;
    color: #80868b;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    user-select: none;
}

.input-with-icon input {
    width: 100%;
    height: 48px;
    border: 1.5px solid #dadce0;
    border-radius: 12px;
    padding: 0 44px 0 44px;
    font-size: 14px;
    color: #202124;
    background-color: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    outline: none;
}

.input-with-icon input:focus {
    background-color: #ffffff;
    border-color: #1a73e8;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #80868b;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 15px;
    transition: color 0.2s, background-color 0.2s;
}

.btn-toggle-password:hover {
    color: var(--color-primary);
    background-color: #f1f3f4;
}

.btn-submit-auth {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.btn-submit-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(26, 115, 232, 0.38);
}

.btn-submit-auth:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.25);
}

.auth-card-footer {
    text-align: center;
    font-size: 13.5px;
    color: #5f6368;
    padding-top: 20px;
    border-top: 1px solid #f1f3f4;
    margin-top: 18px;
}

.auth-card-footer a {
    color: #1a73e8;
    font-weight: 600;
    text-decoration: none;
    margin-left: 5px;
    transition: color 0.2s;
}

.auth-card-footer a:hover {
    color: #1557b0;
    text-decoration: underline;
}

/* ---------------- Flash & Toast Notifications ---------------- */
.flash {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.45;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.25s ease;
}
.flash.error {
    background-color: #fce8e6;
    border: 1px solid #fad2cf;
    color: #c5221f;
}
.flash.error::before {
    content: "⚠️";
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}
.flash.success {
    background-color: #e6f4ea;
    border: 1px solid #ceead6;
    color: #137333;
}
.flash.success::before {
    content: "✓";
    font-size: 15px;
    font-weight: bold;
    line-height: 1;
    flex-shrink: 0;
}

.toast-banner {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: toastSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastSlideDown {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.toast-banner.toast-ok {
    background: #202124;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.toast-banner.toast-error {
    background: #d93025;
    color: #ffffff;
}
.toast-icon {
    font-size: 16px;
}
.toast-text {
    flex: 1;
}
.toast-close {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    opacity: 0.75;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
    display: flex;
    align-items: center;
}
.toast-close:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Preview Viewer ---------------- */
.preview-workspace {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 30px;
}

.preview-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.06);
}

.preview-file-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.btn-back-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--color-text-sub);
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.btn-back-nav:hover {
    background-color: #f1f3f4;
    color: var(--color-text-main);
}

.preview-title-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.preview-filename {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--color-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-download-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #1a73e8;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(26, 115, 232, 0.25);
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-download-action:hover {
    background: #1557b0;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(26, 115, 232, 0.35);
}

/* Save to Drive Acceptance Banner */
.preview-accept-banner {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.banner-icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

.banner-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
}

.banner-text span {
    font-size: 13px;
    color: #94a3b8;
}

.banner-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-save-confirm {
    padding: 8px 18px;
    background: #1a73e8;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, transform 0.15s;
}

.btn-save-confirm:hover {
    background: #1557b0;
    transform: translateY(-1px);
}

.btn-save-dismiss {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.btn-save-dismiss:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Stage container for Image / PDF / Text */
.preview-body {
    width: 100%;
}

.preview-stage {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Image preview stage */
.preview-stage.image-stage {
    height: 75vh;
    min-height: 520px;
    max-height: 850px;
    background: #1a1c1e;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 60%),
        repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(255, 255, 255, 0.015) 19px, rgba(255, 255, 255, 0.015) 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(255, 255, 255, 0.015) 19px, rgba(255, 255, 255, 0.015) 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    position: relative;
}

.preview-image-element {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
    user-select: none;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* PDF stage */
.preview-stage.pdf-stage {
    height: 80vh;
    min-height: 580px;
    background: #ffffff;
    border: 1px solid var(--color-border);
}

.preview-stage.pdf-stage iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Text stage */
.preview-stage.text-stage {
    height: 75vh;
    min-height: 520px;
    background: #ffffff;
    border: 1px solid var(--color-border);
}

.preview-stage.text-stage iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Fallback iframe container */
.preview-frame-container {
    height: 75vh;
    min-height: 520px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.preview-frame-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-locked-card, .preview-unsupported-card {
    text-align: center;
    padding: 48px 24px;
    max-width: 480px;
    margin: 40px auto;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.lock-icon, .unsupported-icon {
    font-size: 50px;
    margin-bottom: 12px;
}

.preview-auth-form {
    margin-top: 20px;
    text-align: left;
}

/* ---------------- Dashboard Stats (Report) ---------------- */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    gap: 16px;
}

.stat-icon {
    font-size: 36px;
}

.stat-content {
    flex: 1;
}

.stat-title {
    display: block;
    font-size: 13px;
    color: var(--color-text-sub);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text-main);
}

.stat-value small {
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 400;
}

.stat-progress-bar {
    height: 6px;
    background: #e0e3e7;
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.stat-progress-fill {
    height: 100%;
    background: var(--color-primary);
}

.stat-progress-fill.danger {
    background: var(--color-danger);
}

.stat-hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ---------------- Delete Confirmation ---------------- */
.delete-confirm-card {
    text-align: center;
    max-width: 480px;
    margin: 40px auto;
    padding: 36px 30px;
}

.delete-icon-box {
    font-size: 48px;
    margin-bottom: 12px;
}

.file-delete-preview {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--color-bg-app);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin: 18px 0;
    text-align: left;
}

.delete-file-meta strong {
    display: block;
    font-size: 14px;
}

.delete-file-meta span {
    font-size: 12px;
    color: var(--color-text-muted);
}

.delete-actions-form {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 24px;
}

/* ---------------- Flash Toasts & Empty States ---------------- */
.toast-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.toast-ok {
    background: var(--color-success-light);
    border: 1px solid #b7e1cd;
    color: #0d652d;
}

.toast-error {
    background: var(--color-danger-light);
    border: 1px solid #f6aea9;
    color: #a50e0e;
}

.toast-close {
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: inherit;
}

.flash.error {
    padding: 12px 16px;
    background: var(--color-danger-light);
    border: 1px solid #f6aea9;
    color: #a50e0e;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
}

.empty-state-card {
    background: #ffffff;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 56px 24px;
    text-align: center;
}

.empty-state-card.small {
    padding: 32px 16px;
}

.empty-icon-circle {
    font-size: 46px;
    margin-bottom: 12px;
}

.empty-state-card h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 500;
}

.empty-state-card p {
    color: var(--color-text-sub);
    font-size: 14px;
    margin: 0 0 20px;
}

.table-responsive {
    overflow-x: auto;
}

.global-footer {
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border-light);
    background: #ffffff;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .sidebar {
        width: 72px;
        padding: 14px 6px;
        align-items: center;
    }
    .btn-new {
        padding: 12px;
        border-radius: 50%;
        min-width: unset;
    }
    .btn-new span {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
        border-radius: 50%;
    }
    .nav-item span:not(.nav-icon) {
        display: none;
    }
    .sidebar-storage {
        display: none;
    }
    .main-content {
        padding: 20px 16px;
    }
    .topbar-quota-badge {
        display: none;
    }
}

/* ---------------- Lời mời chia sẻ (Invitations & Badges) ---------------- */
.nav-badge-alert {
    background-color: var(--color-danger);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    margin-left: auto;
    line-height: 1.2;
}

.topbar-invite-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-danger-light);
    color: var(--color-danger);
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    margin-right: 4px;
}
.topbar-invite-btn:hover {
    background-color: #fad2cf;
    transform: scale(1.05);
}
.invite-bell-icon {
    font-size: 18px;
}
.invite-bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--color-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.invitation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #e8f0fe 0%, #fef7e0 100%);
    border: 1px solid #c2e7ff;
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.invitation-banner-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--color-text-main);
}
.invitation-banner-icon {
    font-size: 24px;
}

.invitation-card-item {
    background: #ffffff;
    border: 1px solid #d2e3fc;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(26,115,232,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}
.invitation-card-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.invitation-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.invitation-card-info {
    flex: 1;
    min-width: 0;
}
.invitation-file-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.invitation-from-text {
    font-size: 12px;
    color: var(--color-text-sub);
    margin-top: 2px;
}
.invitation-card-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background: #f8fafd;
    padding: 6px 10px;
    border-radius: 6px;
}
.invitation-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}
.btn-success {
    background-color: var(--color-success);
    color: #ffffff;
    border: 1px solid var(--color-success);
}
.btn-success:hover {
    background-color: #137333;
}

