/* Users management: centered, compact */
.users-management .card { border-radius: 8px; }
.users-management .d-flex.gap-2 { gap: 0.35rem !important; }
.users-management .btn-sm { padding: 0.25rem 0.5rem; }

/* Google Drive-style file manager */
.drive-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.drive-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.drive-breadcrumb a {
    color: var(--bs-primary);
    text-decoration: none;
}
.drive-breadcrumb a:hover { text-decoration: underline; }
.drive-breadcrumb .separator { color: #5f6368; user-select: none; }
.drive-breadcrumb .current { color: #202124; font-weight: 500; }

.drive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    padding: 0.5rem 0;
}
.drive-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    transition: background .15s, border-color .15s;
    user-select: none;
    position: relative;
}
.drive-item:hover {
    background: rgba(0,0,0,.06);
    border-color: transparent;
}
.drive-item.selected, .drive-item:focus-visible {
    background: rgba(26, 115, 232, 0.08);
    border-color: rgba(26, 115, 232, 0.5);
    outline: none;
}
.drive-item .drive-item-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    flex-shrink: 0;
}
.drive-item .drive-item-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.drive-item .drive-item-name {
    font-size: 0.8125rem;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
    max-width: 100%;
}
.drive-item.folder .drive-item-icon { color: #f9ab00; }
.drive-item.file .drive-item-icon { color: #1a73e8; }
.drive-item[role="button"] { cursor: pointer; }
.drive-item-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; }
.drive-btn { font-size: 0.75rem; padding: 0.25rem 0.5rem; border-radius: 4px; text-decoration: none; white-space: nowrap; }
.drive-btn-view, .drive-btn-edit { background: #1a73e8; color: #fff; }
.drive-btn-view:hover, .drive-btn-edit:hover { color: #fff; opacity: 0.9; }
.drive-btn-qr { background: var(--sus-green, #2d5016); color: #fff; }
.drive-btn-qr:hover { color: #fff; opacity: 0.9; }
.drive-qr-download-btn { font-size: 0.75rem; padding: 0.25rem 0.5rem; }

/* Drop zone for drag-and-drop upload */
.drive-dropzone {
    border: 2px dashed #dadce0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    margin-bottom: 1rem;
    transition: border-color .2s, background .2s;
}
.drive-dropzone.drag-over {
    border-color: #1a73e8;
    background: rgba(26, 115, 232, 0.06);
}
.drive-dropzone p { margin: 0; color: #5f6368; font-size: 0.9rem; }
.drive-dropzone input[type="file"]:not(.drive-file-input-overlay) { display: none; }
.drive-choose-files-wrap { position: relative; cursor: pointer; }
.drive-file-input-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    margin: 0;
    padding: 0;
    font-size: 0;
    min-width: 120px;
    min-height: 38px;
}
.drive-choose-files-label { position: relative; z-index: 1; pointer-events: none; }
.drive-dropzone .dropzone-label {
    cursor: pointer;
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #1a73e8;
    color: #fff;
    border-radius: 6px;
    font-size: 0.875rem;
}
.drive-dropzone .dropzone-label:hover { background: #1557b0; color: #fff; }

/* Context menu */
.drive-context-menu {
    position: fixed;
    z-index: 9999;
    min-width: 180px;
    padding: 0.25rem 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
    list-style: none;
    margin: 0;
    display: none;
}
.drive-context-menu.show { display: block; }
.drive-context-menu li { margin: 0; }
.drive-context-menu a, .drive-context-menu button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: #202124;
    text-decoration: none;
}
.drive-context-menu a:hover, .drive-context-menu button:hover {
    background: rgba(0,0,0,.06);
}
.drive-context-menu .divider {
    height: 1px;
    background: #e8eaed;
    margin: 0.25rem 0;
    padding: 0;
}

/* QR preview modal / section */
.drive-qr-preview {
    text-align: center;
    padding: 1rem;
}
.drive-qr-preview img {
    max-width: 280px;
    height: auto;
    border: 1px solid #e8eaed;
    border-radius: 8px;
}
.drive-qr-download-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--sus-green, #2d5016);
    color: #fff;
    border-radius: 6px;
    font-size: 0.875rem;
    text-decoration: none;
}
.drive-qr-download-btn:hover { color: #fff; opacity: 0.95; }

/* QR Modal */
.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.qr-modal[style*="display: flex"] {
    display: flex !important;
}
.qr-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}
.qr-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.qr-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    background: #f1f3f5;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}
.qr-modal-close:hover {
    background: #e9ecef;
}
.qr-modal-body {
    text-align: center;
}
.qr-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #202124;
}
.qr-modal-image {
    max-width: 100%;
    height: auto;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
}

/* Empty state */
.drive-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #5f6368;
}
