/* =============================================
   CloudSuite - Theme
   ============================================= */

/* Fonts */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 400; src: url("../fonts/ibm-plex-sans-latin-400-normal.3160b5c6767eb4c69c78.woff2") format("woff2"), url("../fonts/ibm-plex-sans-latin-400-normal.65b2eda743bf11103476.woff") format("woff"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 500; src: url("../fonts/ibm-plex-sans-latin-500-normal.fcd7b8c3d12375eedc97.woff2") format("woff2"), url("../fonts/ibm-plex-sans-latin-500-normal.4b130dfcfa945eac3e54.woff") format("woff"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 600; src: url("../fonts/ibm-plex-sans-latin-600-normal.24bc59b4b4ad02d1666d.woff2") format("woff2"), url("../fonts/ibm-plex-sans-latin-600-normal.d73e2e25bcd162ae992f.woff") format("woff"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-display: swap; font-weight: 700; src: url("../fonts/ibm-plex-sans-latin-700-normal.cc104bdc19efb9831e65.woff2") format("woff2"), url("../fonts/ibm-plex-sans-latin-700-normal.07479b3959672b80189f.woff") format("woff"); }

/* Variables */
:root {
    --su-primary: #002FA7;
    --su-primary-dark: #00258A;
    --su-bg: #F4F4F5;
    --su-surface: #ffffff;
    --su-muted: #6B7280;
    --su-success: #16a34a;
    --su-error: #dc2626;
    --su-warning: #f59e0b;
    --sidebar-width: 260px;
    --radius: 6px;
    --shadow: 0 1px 2px rgba(15,23,42,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

/* Spinning animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spin 1s linear infinite;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: "IBM Plex Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: var(--su-bg);
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

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

input, textarea, select {
    cursor: default;
}

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }

.brand-icon, .auth-brand-icon { stroke: #002FA7; fill: none; }

.file-icon { font-size: 40px; }

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--su-surface);
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    padding: 20px 16px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--su-primary);
    margin-bottom: 24px;
    padding: 4px 8px;
}

.brand-icon {
    flex-shrink: 0;
}

.brand-text {
    letter-spacing: -0.025em;
}

.sidebar-search {
    display: flex;
    align-items: center;
    background: var(--su-bg);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 16px;
    gap: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sidebar-search svg {
    color: var(--su-muted);
    flex-shrink: 0;
}

.sidebar-search input {
    border: none;
    background: transparent;
    font-size: 13px;
    outline: none;
    flex: 1;
    font-family: inherit;
    color: #0f172a;
}

.sidebar-search input::placeholder {
    color: var(--su-muted);
}

.sidebar-search:focus-within {
    border-color: var(--su-primary);
    box-shadow: 0 0 0 3px rgba(0,47,167,0.08);
}

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

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-top: 5px;
    border-radius: var(--radius);
    color: var(--su-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-nav-item:hover {
    background: #f8fbff;
    color: var(--su-primary);
}

.sidebar-nav-item.active {
    background: #eff6ff;
    color: var(--su-primary);
    font-weight: 700;
}

.sidebar-nav-item.active svg {
    color: var(--su-primary);
}

.sidebar-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--su-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

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

.profile-name {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-top: 8px;
    border: 1px solid currentColor;
    border-radius: var(--radius);
    color: var(--su-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    width: 100%;
}

.logout-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    text-decoration: none;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* App header (top bar in main content) */
.app-header {
    position: static;
    background: var(--su-surface);
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.content-area {
    flex: 1;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.content-area:last-child {
    padding-bottom: 0;
}

/* ===== AUTH PAGES ===== */
.main-header {
    background: var(--su-surface);
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--su-primary);
    text-decoration: none;
    letter-spacing: -0.025em;
}

.logo:hover { text-decoration: none; }

.auth-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.auth-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    width: 100%;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 64px;
    color: var(--su-primary);
    margin-bottom: 28px;
    letter-spacing: -0.025em;
    filter: drop-shadow(4px 5px rgba(0,0,0,0.17));
}

.auth-brand svg {
    width: 80px;
    height: 80px;
}

.auth-brand-icon {
    width: 80px;
    height: 80px;
}

.auth-card {
    background: var(--su-surface);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(15,23,42,0.08);
    border: 1px solid #e5e7eb;
    padding: 40px;
    width: 100%;
    max-width: 480px;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
    color: #0f172a;
}

.auth-card > p {
    text-align: center;
    color: var(--su-muted);
    margin-bottom: 28px;
    font-size: 14px;
}

.auth-card .divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--su-muted);
    font-size: 13px;
}

.auth-card .divider::before,
.auth-card .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.input-error {
    border-color: var(--su-error) !important;
}

.input-error:focus {
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
    outline: none;
}

.field-error-text {
    color: var(--su-error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.password-rules {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #1e40af;
}

.password-rules-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.password-rules ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.7;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--su-primary);
    font-weight: 500;
    text-decoration: none;
}

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

.auth-link a {
    color: var(--su-primary);
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--su-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}

.auth-tab:hover {
    color: #0f172a;
}

.auth-tab.active {
    color: var(--su-primary);
    border-bottom-color: var(--su-primary);
    font-weight: 600;
}

.auth-tab-panel {
    display: none;
}

.auth-tab-panel.active {
    display: block;
    animation: fadeIn 0.75s ease;
}

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

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    background: var(--su-surface);
    color: #0f172a;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.5;
}

.btn:hover {
    background: var(--su-bg);
    text-decoration: none;
}

.btn-primary {
    background: var(--su-primary);
    color: #fff;
    border-color: var(--su-primary);
}

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

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

.btn-block {
    display: flex;
    justify-content: center;
    width: 100%;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
    font-size: 16px;
    transition: background 0.15s;
    color: var(--su-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.file-actions .btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-icon:hover {
    background: #eff6ff;
    color: var(--su-primary);
}

.btn-icon.btn-danger:hover {
    background: #fef2f2;
    color: var(--su-error);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: var(--su-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--su-primary);
    box-shadow: 0 0 0 3px rgba(0,47,167,0.08);
}

.input-full {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: var(--su-surface);
}

.input-full:focus {
    outline: none;
    border-color: var(--su-primary);
    box-shadow: 0 0 0 3px rgba(0,47,167,0.08);
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-error {
    background: #fef2f2;
    color: var(--su-error);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* ===== DRIVE LAYOUT ===== */
.drive-layout {
    background: var(--su-surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.drive-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.drive-content.drag-over {
    position: relative;
}

.drop-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(239,246,255,0.95);
    z-index: 50;
    justify-content: center;
    align-items: center;
    border: 3px dashed var(--su-primary);
    border-radius: var(--radius);
}

.drive-content.drag-over .drop-overlay {
    display: flex;
}

.drop-overlay-content {
    text-align: center;
    color: var(--su-primary);
}

.drop-overlay-content svg {
    margin-bottom: 12px;
    opacity: 0.7;
}

.drop-overlay-content p {
    font-size: 16px;
    font-weight: 600;
}

.drop-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--su-muted);
    padding: 6px 12px;
    border: 1px dashed #d1d5db;
    border-radius: var(--radius);
    background: var(--su-bg);
    user-select: none;
    pointer-events: none;
}

.drive-content.drag-over .empty-state {
    opacity: 0.3;
}

.drive-content.drag-over .file-grid {
    opacity: 0.3;
    pointer-events: none;
}

.drive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 12px;
}

.breadcrumb {
    font-size: 14px;
    color: var(--su-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--su-muted);
    transition: color 0.15s;
}

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

.toolbar-actions {
    display: flex;
    gap: 8px;
}

.drive-forms {
    padding: 0 20px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    margin-top: 8px;
}

.inline-form input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}

.inline-form input[type="text"]:focus {
    outline: none;
    border-color: var(--su-primary);
    box-shadow: 0 0 0 3px rgba(0,47,167,0.08);
}

.inline-form input[type="file"] {
    font-size: 14px;
}

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--su-muted);
    margin: 16px 0 10px;
    font-weight: 600;
}

.search-info {
    padding: 12px 20px;
    font-size: 14px;
    color: var(--su-muted);
    border-bottom: 1px solid #e5e7eb;
}

.search-info a {
    color: var(--su-primary);
    font-weight: 500;
}

/* ===== FILE GRID ===== */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.file-item {
    background: var(--su-surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    position: relative;
    transition: box-shadow 0.15s, border-color 0.15s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.file-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--su-primary);
}

.file-item:has(.file-checkbox:checked) {
    border-color: var(--su-primary);
    box-shadow: 0 0 0 2px rgba(0,47,167,0.2);
}

.file-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    text-decoration: none;
    color: #0f172a;
    padding: 20px 12px 12px;
    min-height: 140px;
    flex: 1;
}

.file-link:hover {
    text-decoration: none;
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.file-icon svg {
    width: 48px !important;
    height: 48px !important;
}

.file-icon.large {
    width: 56px;
    height: 56px;
}

.file-icon.large svg {
    width: 56px !important;
    height: 56px !important;
}

.file-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    flex-shrink: 0;
}

.file-item .file-link {
    position: relative;
}

.drive-storage-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    background: var(--su-surface);
    border-bottom: 1px solid #e5e7eb;
}

.drive-storage-bar svg {
    width: 18px;
    height: 18px;
}

.drive-storage-bar .storage-bar {
    flex: none;
    width: 200px;
    height: 5px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin: 0;
}

.drive-storage-bar .storage-bar-fill {
    height: 100%;
    background: var(--su-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.drive-storage-info {
    font-size: 11px;
    color: var(--su-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.file-type-icon {
    color: #94a3b8;
}

.file-type-icon.icon-image { color: #06b6d4; }
.file-type-icon.icon-video { color: #8b5cf6; }
.file-type-icon.icon-audio { color: #f59e0b; }
.file-type-icon.icon-pdf { color: #ef4444; }
.file-type-icon.icon-word { color: #3b82f6; }
.file-type-icon.icon-excel { color: #22c55e; }
.file-type-icon.icon-ppt { color: #f97316; }
.file-type-icon.icon-archive { color: #a855f7; }
.file-type-icon.icon-code { color: #10b981; }
.file-type-icon.icon-text { color: #64748b; }
.file-type-icon.icon-default { color: #94a3b8; }

.file-name {
    font-size: 13px;
    word-break: break-word;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    font-weight: 500;
    width: 100%;
}

.file-size {
    font-size: 11px;
    color: var(--su-muted);
}

.file-owner {
    font-size: 10px;
    color: var(--su-muted);
    opacity: 0.7;
}

.file-actions {
    display: flex;
    justify-content: center;
    /*gap: 4px;*/
    padding: 6px 6px;
    border-top: 1px solid #e5e7eb;
    background: #fafbfc;
    flex-shrink: 0;
}

/* File checkbox */
.file-checkbox {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 16px;
    height: 16px;
    z-index: 2;
    cursor: pointer;
    accent-color: var(--su-primary);
    opacity: 0;
    transition: opacity 0.15s;
}

.file-checkbox:checked,
.file-item:hover .file-checkbox {
    opacity: 1;
}

.file-item.selected {
    border-color: var(--su-primary);
    background: #f0f4ff;
}

/* Bulk actions floating bar */
.bulk-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #1e293b;
    color: white;
    border-radius: 12px;
    font-size: 13px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.bulk-bar .btn {
    background: rgba(255,255,255,0.12);
    color: white;
    border: none;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
}

.bulk-bar .btn:hover {
    background: rgba(255,255,255,0.22);
}

.bulk-bar .btn-icon {
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
}

.bulk-bar .btn-icon:hover {
    color: white;
}

.bulk-count {
    flex: 1;
    font-weight: 500;
}

/* Upload toast */
.upload-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    z-index: 10000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: slideUp 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.upload-toast-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.folder-item .file-link {
    min-height: 100px;
    flex-direction: column;
}

.folder-item .file-name {
    text-align: center;
}

.file-grid-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    flex-shrink: 0;
    margin: 0 auto;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--su-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.empty-state .empty-icon {
    margin-bottom: 16px;
}

.empty-state p:first-of-type {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state p:last-of-type {
    font-size: 14px;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--su-surface);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    border: 1px solid #e5e7eb;
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* ===== MODAL DROP ZONE ===== */
.modal-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    color: var(--su-muted);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.modal-drop-zone.drag-over {
    border-color: var(--su-primary);
    background: #eff6ff;
    color: var(--su-primary);
}

.modal-drop-zone svg {
    margin-bottom: 8px;
    opacity: 0.5;
}

.modal-drop-zone.drag-over svg {
    opacity: 1;
}

.modal-drop-zone p {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.modal-drop-zone > span {
    font-size: 12px;
    opacity: 0.6;
}

.modal-drop-zone .btn {
    margin-top: 8px;
}

.file-input-hidden {
    display: none;
}

.password-field {
    position: relative;
}

.password-field input {
    width: 100%;
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--su-muted);
    padding: 4px;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: var(--su-primary);
}

.modal-drop-files {
    margin-top: 12px;
    font-size: 13px;
    color: #374151;
    text-align: left;
}

.modal-drop-files .file-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}

.modal-drop-files .file-entry svg {
    opacity: 0.4;
    width: 14px;
    height: 14px;
    margin: 0;
}

/* ===== SHARE CARD ===== */
.share-card {
    text-align: center;
}

.share-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.share-card-header h1 {
    margin: 0;
    font-size: 22px;
}

.share-card .share-info {
    text-align: center;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.share-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 12px 0;
    word-break: break-word;
}

.file-meta {
    font-size: 13px;
    color: var(--su-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.share-url-box {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

/* Share tabs */
.share-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.share-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--su-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.share-tab.active {
    color: var(--su-primary);
    border-bottom-color: var(--su-primary);
}

.share-tab-panel {
    display: none;
}

.share-tab-panel.active {
    display: block;
}

/* Shared users list */
.shared-users {
    margin: 12px 0;
    font-size: 13px;
}

.shared-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: var(--radius);
    margin-top: 4px;
}

.shared-user-item:hover {
    background: #f8fafc;
}

.btn-xs {
    padding: 2px 4px;
    font-size: 11px;
}

/* Autocomplete */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 180px;
    overflow-y: auto;
    z-index: 100;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}

.autocomplete-item:hover {
    background: #f1f5f9;
}

.share-url-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--su-bg);
    font-family: inherit;
}

/* ===== UPLOAD PROGRESS ===== */
.upload-progress {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--su-surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    z-index: 200;
    min-width: 280px;
    font-size: 14px;
}

.upload-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.upload-progress-bar-fill {
    height: 100%;
    background: var(--su-primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress.done .upload-progress-bar-fill {
    background: var(--su-success);
}

/* ===== FOOTER ===== */
.main-footer {
    text-align: center;
    padding: 16px;
    color: var(--su-muted);
    font-size: 13px;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

/* ===== BUTTON TRANSITIONS ===== */
button:not([disabled]) {
    transition: filter 0.12s ease, transform 0.08s ease, background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

button:not([disabled]):hover {
    filter: brightness(0.95);
}

button:not([disabled]):active {
    filter: brightness(0.90);
    transform: translateY(0.5px);
}

.btn-primary:not([disabled]):hover {
    filter: none;
    background: var(--su-primary-dark);
}

button:focus-visible {
    outline: 2px solid rgba(0,47,167,0.185);
    outline-offset: 2px;
}

/* ===== SIDEBAR TOGGLE ===== */
.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    color: #0f172a;
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    position: relative;
    transition: background 0.15s;
}

.sidebar-toggle:hover {
    background: var(--su-bg);
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    position: absolute;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.hamburger-line:nth-child(1) { top: 11px; }
.hamburger-line:nth-child(2) { top: 17px; }
.hamburger-line:nth-child(3) { top: 23px; }

.sidebar-toggle.active .hamburger-line:nth-child(1) {
    top: 17px;
    transform: rotate(45deg);
}

.sidebar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle.active .hamburger-line:nth-child(3) {
    top: 17px;
    transform: rotate(-45deg);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 35;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: inline-flex;
    }
    .app-header {
        padding: 0 16px;
    }
    .app-header h1 {
        font-size: 18px;
    }
    .content-area {
        padding: 16px;
    }
    .drive-toolbar {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
    }
    .drive-content {
        padding: 12px 16px;
    }
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
    .file-item .file-actions {
        top: 4px;
        right: 4px;
    }
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-panels {
        grid-template-columns: 1fr;
    }
    .dashboard-actions {
        gap: 8px;
    }
    .toolbar-actions {
        flex-wrap: wrap;
    }
    .drop-hint {
        display: none;
    }
}

@media (min-width: 1025px) {
    .sidebar-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 12px;
        height: 56px;
    }
    .app-header h1 {
        font-size: 16px;
    }
    .content-area {
        padding: 12px;
    }
    .drive-toolbar {
        padding: 8px 12px;
    }
    .drive-content {
        padding: 8px 12px;
    }
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .auth-card {
        padding: 24px;
    }
    .auth-brand-icon {
        width: 60px;
        height: 60px;
    }
    .auth-brand span {
        font-size: 36px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .suite-card {
        padding: 16px;
    }
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    .btn svg {
        width: 16px;
        height: 16px;
    }
    .modal-content {
        margin: 16px;
        padding: 20px;
    }
}

/* ===== DASHBOARD ===== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.suite-card {
    background: var(--su-surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 14px;
    transition: border-color 0.15s;
    text-decoration: none;
    color: inherit;
}

.suite-card:hover {
    border-color: var(--su-primary);
    text-decoration: none;
}

.suite-card-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.suite-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.suite-card-icon.blue {
    background: #eff6ff;
    color: var(--su-primary);
}

.suite-card-icon.green {
    background: #f0fdf4;
    color: #16a34a;
}

.suite-card-icon.orange {
    background: #fff7ed;
    color: #ea580c;
}

.suite-card-text {
    min-width: 0;
}

.suite-card-title {
    font-weight: 500;
    font-size: 14px;
    color: #0f172a;
}

.suite-card-subtitle {
    font-size: 13px;
    color: var(--su-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-label {
    font-size: 13px;
    color: var(--su-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 0;
    flex: 1;
}

.dashboard-panels .suite-card {
    display: flex;
    flex-direction: column;
    max-height: none;
    min-height: 260px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.panel-title svg {
    color: var(--su-muted);
    width: 15px;
    height: 15px;
}

.panel-empty {
    text-align: center;
    padding: 16px 0;
    color: var(--su-muted);
    font-size: 13px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.panel-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: #0f172a;
    transition: background 0.1s;
}

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

.panel-list-item:hover {
    background: #f8fafc;
    text-decoration: none;
}

.panel-list-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.panel-list-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.panel-list-meta {
    font-size: 11px;
    color: var(--su-muted);
    flex-shrink: 0;
    margin-right: 18px;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* ===== PREVIEW PAGE ===== */
.preview-page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.preview-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.preview-meta {
    font-size: 13px;
    color: var(--su-muted);
    margin-bottom: 16px;
}

.preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    overflow: auto;
    min-height: 400px;
}

.preview-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.preview-video {
    max-width: 100%;
    max-height: 80vh;
}

.preview-audio {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px;
    color: var(--su-muted);
}

.preview-frame {
    width: 100%;
    height: 75vh;
    border: none;
}

.preview-text {
    width: 100%;
    height: 100%;
    min-height: 400px;
    padding: 20px;
    margin: 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: var(--radius);
}

.preview-unsupported {
    text-align: center;
    padding: 60px 20px;
    color: var(--su-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.preview-unsupported p {
    font-size: 15px;
}

/* ===== SETTINGS PAGE ===== */
.settings-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
}

.settings-form {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.settings-form:last-of-type {
    border-bottom: none;
}

.settings-form .btn {
    margin-top: 4px;
}

.storage-bar-container {
    padding: 8px 0;
}

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

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

.storage-info {
    font-size: 13px;
    color: var(--su-muted);
}

/* ===== ADMIN PAGE ===== */
.admin-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: var(--su-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.admin-table td a {
    color: var(--su-primary);
    font-weight: 500;
}

.admin-select {
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--su-surface);
}

.admin-input-sm {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 13px;
}

.admin-input-url {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    font-size: 13px;
    min-width: 200px;
}

.admin-unit {
    font-size: 12px;
    color: var(--su-muted);
    margin: 0 4px;
}

.admin-storage-info {
    font-size: 12px;
    color: var(--su-muted);
    display: block;
    margin-bottom: 4px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: #eff6ff;
    color: var(--su-primary);
}

.perm-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.perm-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--su-primary);
}

/* ===== APP FOOTER ===== */
.app-footer {
    text-align: center;
    padding: 10px 16px;
    font-size: 11px;
    color: var(--su-muted);
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    flex-shrink: 0;
}

.app-footer a {
    color: var(--su-muted);
    text-decoration: none;
}

.app-footer a:hover {
    color: var(--su-primary);
}

.app-footer-sep {
    margin: 0 4px;
    user-select: none;
}

/* ===== CGU ===== */
.cgu-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px 0;
    flex: 1;
}

.cgu-page .suite-card {
    width: 734px;
    height: 822px;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
}
.cgu-content {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 12px;
}

.cgu-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 8px;
    color: #0f172a;
}

.cgu-content h3:first-child {
    margin-top: 0;
}

.cgu-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.cgu-content li {
    margin: 4px 0;
}

.cgu-actions {
    margin-top: 24px;
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
}

/* ===== EDITOR PAGE ===== */
.editor-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--su-surface);
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.editor-filename {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

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

.editor-status {
    font-size: 12px;
    color: var(--su-muted);
    min-width: 80px;
    text-align: right;
}

.editor-status-dirty { color: #f59e0b; }
.editor-status-saving { color: #3b82f6; }
.editor-status-saved { color: #22c55e; }
.editor-status-error { color: #ef4444; }

.editor-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.editor-container .CodeMirror {
    flex: 1;
    height: auto !important;
    font-size: 14px;
    line-height: 1.5;
}

.editor-page {
    margin: -16px -24px;
}

/* ===== OFFICE EDITOR PAGE ===== */
.office-editor-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: -16px -24px;
}

.office-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--su-surface);
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.office-editor-filename {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.office-editor-container {
    flex: 1;
    min-height: 0;
}

/* ===== VISIO ===== */
.visio-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    width: 100%;
}

.visio-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--su-surface);
    border-bottom: 1px solid #e5e7eb;
    gap: 12px;
}

.visio-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: calc(100vh - 49px);
}

.visio-container iframe {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none;
}
