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

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background-color: #fff;
    border-bottom: 2px solid #e0e0e0;
    padding: 15px 0;
    margin-bottom: 30px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    color: #1a73e8;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info .email {
    color: #666;
    font-size: 14px;
}

/* Login Page */
.login-box {
    max-width: 500px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.login-box h1 {
    color: #1a73e8;
    margin-bottom: 10px;
}

.login-box p {
    color: #666;
    margin-bottom: 30px;
}

/* Error Page */
.error-box {
    max-width: 600px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.error-box h1 {
    color: #d32f2f;
    margin-bottom: 10px;
}

.error-message {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Info Box */
.info-box {
    background-color: #e3f2fd;
    border-left: 4px solid #1a73e8;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.info-box h3 {
    margin-bottom: 10px;
    color: #1a73e8;
}

.info-box ul {
    margin-left: 20px;
}

.info-box p {
    margin: 10px 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, opacity 0.3s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #999 !important;
}

.btn-primary {
    background-color: #1a73e8;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #1557b0;
}

.btn-primary:disabled {
    background-color: #ccc;
}

/* Default Groups Section */
.default-groups-section {
    margin: 25px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.default-groups-section h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

#defaultGroupsList {
    position: relative;
    overflow: hidden;
}

/* Theme Upload Section */
.theme-upload-section {
    margin: 25px 0;
    padding: 20px;
    background-color: #fff9e6;
    border: 1px solid #ffd966;
    border-radius: 6px;
}

.theme-upload-section h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

/* Theme Preset Section */
.theme-preset-section {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
}

.theme-preset-header {
    margin-bottom: 12px;
}

.theme-preset-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.theme-preset-images {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.theme-preset-card {
    position: relative;
    cursor: pointer;
    border: 3px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.theme-preset-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
}

.theme-preset-card.selected {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.3);
}

.theme-preset-card img {
    width: 100%;
    height: auto;
    display: block;
}

.theme-preset-card-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: #f8f9fa;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
}

.theme-preset-card.selected .theme-preset-card-label {
    background: #e3f2fd;
    color: #1565c0;
}

.theme-preset-check {
    display: none;
    color: #1a73e8;
    font-weight: 700;
}

.theme-preset-card.selected .theme-preset-check {
    display: inline;
}

.theme-upload-container {
    margin-top: 15px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

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

/* Paste-to-theme composite editor */
.paste-editor {
    margin-top: 12px;
    border: 1px dashed #c0c4cc;
    border-radius: 6px;
    padding: 12px;
    background: #fafbfc;
}

.paste-editor:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.paste-hint {
    font-size: 13px;
    color: #5f6368;
    margin: 0 0 10px;
}

.paste-hint.error {
    color: #dc3545;
}

.paste-canvas {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    cursor: grab;
    touch-action: none; /* let pointer drag work on touch without scrolling */
}

.paste-canvas:active {
    cursor: grabbing;
}

.paste-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.paste-controls label,
.paste-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #3c4043;
}

.paste-controls input[type="color"] {
    width: 40px;
    height: 28px;
    padding: 0;
    border: 1px solid #c0c4cc;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.paste-controls input[type="range"] {
    width: 130px;
}

.circle-preview-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-left: auto; /* push the avatar preview to the right */
}

.circle-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1px solid #d0d3d8;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.circle-preview-label {
    font-size: 11px;
    color: #5f6368;
}

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

.theme-preview {
    margin-top: 15px;
    padding: 15px;
    background-color: white;
    border: 2px solid #dee2e6;
    border-radius: 6px;
}

.theme-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.theme-preview-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-right: auto; /* push action buttons to the right */
}

.btn-download-theme {
    background-color: #1a73e8;
    color: white;
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.btn-download-theme:hover {
    background-color: #1765cc;
}

.btn-remove-theme {
    background-color: #dc3545;
    color: white;
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.btn-remove-theme:hover {
    background-color: #c82333;
}

.theme-preview-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: block;
    margin-bottom: 10px;
}

.theme-image-info {
    font-size: 13px;
    color: #666;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.shared-external-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
}

.preview-section-title {
    font-weight: 600;
    color: #dc3545;
    font-size: 14px;
    margin-bottom: 8px;
}

.preview-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.theme-validation-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.theme-validation-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.theme-validation-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Drive Selection Section */
.drive-selection-section {
    margin: 25px 0;
    padding: 20px;
    background-color: #fff9e6;
    border: 1px solid #ffd966;
    border-radius: 6px;
}

.drive-selection-section h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.drive-selection-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    margin: 8px 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s;
}

.drive-selection-item:hover {
    border-color: #1a73e8;
    background-color: #f8fcff;
}

.drive-selection-item input[type="checkbox"] {
    margin-top: 3px;
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.drive-selection-info {
    flex: 1;
}

.drive-selection-name {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    font-family: 'Courier New', monospace;
}

.drive-selection-suffix {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background-color: #e8f0fe;
    color: #1a73e8;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.drive-selection-folders {
    margin-top: 6px;
    color: #666;
    font-size: 13px;
}

.section-description {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.default-group-category {
    margin-bottom: 20px;
    position: relative;
    overflow: visible;
}

.default-group-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-weight: bold;
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.default-group-item {
    display: flex;
    align-items: flex-start;
    padding: 10px;
    margin: 5px 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.default-group-item:hover {
    background-color: #f0f0f0;
}

.default-group-item input[type="checkbox"] {
    margin-top: 3px;
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.default-group-info {
    flex: 1;
}

.default-group-email {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.default-group-role {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background-color: #e3f2fd;
    color: #1976d2;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.default-group-description {
    margin-top: 4px;
    color: #666;
    font-size: 13px;
}

.drive-suffix-badge {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 6px;
    background-color: #fff3cd;
    color: #856404;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.btn-secondary {
    background-color: #5f6368;
    color: white;
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger {
    background-color: #d32f2f;
    color: white;
    padding: 6px 12px;
    font-size: 13px;
}

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

/* Forms */
.form-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

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

.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    padding-right: 45px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #1a73e8;
}

.form-group input[type="text"].validating {
    border-color: #ffc107;
}

.form-group input[type="text"].valid {
    border-color: #28a745;
}

.form-group input[type="text"].invalid {
    border-color: #dc3545;
}

.validation-icon {
    position: absolute;
    right: 12px;
    font-size: 20px;
    display: none;
}

.validation-icon.checking {
    display: block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.validation-icon.available {
    display: block;
    color: #28a745;
    animation: fadeIn 0.3s;
}

.validation-icon.available::after {
    content: "✓";
}

.validation-icon.conflict {
    display: block;
    color: #dc3545;
    animation: fadeIn 0.3s;
}

.validation-icon.conflict::after {
    content: "✗";
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

.drive-preview {
    margin-top: 15px;
    padding: 0;
    background-color: transparent;
    border: none;
}

.drive-preview .preview-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.drive-preview-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.drive-preview-list li {
    padding: 0;
    margin: 0;
    position: relative;
}

.drive-preview-list li.preview-placeholder {
    padding: 16px 20px;
    color: #adb5bd;
    font-size: 14px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.drive-preview-list li.preview-drive-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin: 0;
    background: white;
    border: 1.5px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.drive-preview-list li.preview-drive-item:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
    transform: translateY(-1px);
}

.drive-preview-list li.preview-drive-item.required-item {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
    border-color: #90caf9;
}

.drive-preview-list li.preview-drive-item.required-item:hover {
    border-color: #42a5f5;
    box-shadow: 0 2px 8px rgba(66, 165, 245, 0.2);
}

/* Existing drive items (already created — grayed out) */
.drive-preview-list li.preview-drive-item.existing-item {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border-color: #e0e0e0;
    opacity: 0.7;
}

.drive-preview-list li.preview-drive-item.existing-item:hover {
    border-color: #bdbdbd;
    box-shadow: none;
    transform: none;
}

.drive-preview-list li.preview-drive-item.existing-item .drive-name {
    color: #9e9e9e;
    text-decoration: line-through;
}

.drive-preview-list li.preview-drive-item.existing-item:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 0 24 24' width='24'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath fill='%239e9e9e' d='M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z'/%3E%3C/svg%3E");
}

.existing-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #9e9e9e;
    color: white;
}

.drive-preview-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0 14px 0 0;
    flex-shrink: 0;
    accent-color: #1a73e8;
}

.drive-preview-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}

.drive-preview-label .drive-name {
    font-weight: 500;
    color: #212529;
    font-size: 14px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    letter-spacing: 0.3px;
}

.drive-preview-list li.required-item .drive-name {
    color: #1565c0;
    font-weight: 600;
}

.required-badge,
.optional-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: system-ui, -apple-system, sans-serif;
}

.required-badge {
    background-color: #1976d2;
    color: white;
}

.optional-badge {
    background-color: #ff9800;
    color: white;
}

/* Remove old folder icon */
.drive-preview-list li:before {
    content: none;
}

/* Add Google Drive/folder icon using Material Design style */
.drive-preview-list li.preview-drive-item:before {
    content: "";
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 0 24 24' width='24'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath fill='%234285f4' d='M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z'/%3E%3C/svg%3E");
    background-size: 18px 18px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Required items: slightly different color to match card */
.drive-preview-list li.preview-drive-item.required-item:before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 0 24 24' width='24'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath fill='%231565c0' d='M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z'/%3E%3C/svg%3E");
}

.drive-preview-list li.preview-placeholder {
    color: #999;
    font-family: inherit;
}

.drive-preview-list li.preview-placeholder:before {
    content: none;
}

.drive-preview-list .drive-name {
    color: #1a73e8;
    font-weight: 600;
    background-color: #e8f0fe;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

/* Umlaut Notice */
.umlaut-notice {
    margin-top: 10px;
    padding: 12px 15px;
    background-color: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #1a73e8;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

.umlaut-notice code {
    background-color: #bbdefb;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
}

.umlaut-notice .umlaut-rename-item {
    margin-top: 6px;
    padding: 6px 10px;
    background-color: #bbdefb40;
    border-radius: 4px;
}

/* Results */
.result-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.result-box h3 {
    color: #1a73e8;
    margin-bottom: 15px;
}

.result-buttons {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.result-buttons .btn {
    min-width: 200px;
}

.drive-item {
    background-color: #f8f9fa;
    border-left: 4px solid #34a853;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.drive-item h4 {
    color: #333;
    margin-bottom: 5px;
}

.drive-item p {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.drive-item ul {
    margin: 10px 0 0 20px;
    font-size: 14px;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a73e8;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Group Management */
.group-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.group-card h3 {
    color: #1a73e8;
    margin-bottom: 10px;
}

.group-card .group-email {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
    margin: 15px 0;
}

.autocomplete-input {
    width: 100%;
    padding: 10px;
    padding-right: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.autocomplete-input:focus {
    outline: none;
    border-color: #1a73e8;
}

.autocomplete-input.searching {
    border-color: #ffc107;
}

.autocomplete-input.adding {
    border-color: #1a73e8;
    background-color: #f0f8ff;
}

.autocomplete-status {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.autocomplete-status.searching {
    display: block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ffc107;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.autocomplete-status.adding {
    display: block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.autocomplete-item:hover {
    background-color: #f5f5f5;
}

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

.autocomplete-item .user-name {
    font-weight: bold;
    color: #333;
}

.autocomplete-item .user-email {
    font-size: 14px;
    color: #666;
}

.autocomplete-item.no-results {
    cursor: default;
    color: #999;
}

.autocomplete-item.no-results:hover {
    background-color: white;
}

/* Members List */
.members-list {
    margin-top: 15px;
}

.members-list h4 {
    margin-bottom: 10px;
    color: #333;
}

.members-list.loading {
    opacity: 0.6;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin: 5px 0;
    transition: all 0.3s;
}

.member-item.removing {
    opacity: 0.5;
    background-color: #ffebee;
}

.member-item.adding {
    animation: slideIn 0.3s ease-out;
    background-color: #e8f5e9;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.member-info {
    flex: 1;
}

.member-email {
    font-weight: bold;
    color: #333;
}

.member-role {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.members-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.members-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
    line-height: 1.6;
    white-space: pre-line;
}

.message.error strong {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
}

/* Main Content */
.main-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-content h2 {
    color: #333;
    margin-bottom: 20px;
}

/* Validation Messages */
.validation-message {
    margin-top: 10px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

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

.validation-message.checking {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.validation-message.available {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.validation-message.conflict {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Conflict Details */
.conflict-details {
    margin-top: 10px;
    padding: 15px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.conflict-details h4 {
    margin-bottom: 10px;
    color: #856404;
}

.conflict-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.conflict-item {
    padding: 8px;
    margin: 5px 0;
    background-color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.conflict-item::before {
    content: "⚠️";
    margin-right: 8px;
    font-size: 16px;
}

.conflict-item.drive::before {
    content: "📁";
}

.conflict-item.group::before {
    content: "👥";
}

.validation-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* ===================================
   TAB NAVIGATION
   =================================== */

.tab-navigation {
    background: white;
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-navigation .container {
    display: flex;
    gap: 0;
    padding: 0;
}

.tab-btn {
    flex: 0 0 auto;
    padding: 16px 32px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tab-btn:hover {
    background: #f8f9fa;
    color: #212529;
}

.tab-btn.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    background: #f0f7ff;
}

.tab-content {
    display: none !important;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block !important;
}

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

/* ===================================
   FILE SEARCH TOOL STYLES
   =================================== */

.query-help {
    margin-top: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 3px solid #1a73e8;
    border-radius: 4px;
    font-size: 13px;
}

.query-help strong {
    display: block;
    margin-bottom: 8px;
    color: #212529;
}

.query-help ul {
    margin: 8px 0;
    padding-left: 20px;
}

.query-help li {
    margin: 4px 0;
    color: #495057;
}

.query-help code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #d63384;
}

.query-help a {
    display: inline-block;
    margin-top: 8px;
    color: #1a73e8;
    text-decoration: none;
}

.query-help a:hover {
    text-decoration: underline;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1a73e8;
}

.checkbox-label span {
    font-size: 14px;
    color: #212529;
}

.checkbox-label.checkbox-label-sm {
    font-size: 13px;
    font-weight: 400;
}

.folder-tree-preview {
    margin: 10px 12px 0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
    overflow: hidden;
}

.folder-tree-title {
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    padding: 6px 10px;
    border-bottom: 1px solid #e0e0e0;
    background: #f1f3f4;
}

.folder-tree {
    margin: 0;
    padding: 8px 10px;
    max-height: 180px;
    overflow: auto;
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 10.5px;
    line-height: 1.45;
    color: #3c4043;
    white-space: pre;
}

.search-results {
    margin-top: 30px;
}

.results-stats {
    padding: 12px 15px;
    background: #e3f2fd;
    border-left: 4px solid #1a73e8;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #1565c0;
}

.results-content {
    max-height: 600px;
    overflow-y: auto;
}

.result-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    margin: 8px 0;
    background: white;
    border: 1.5px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.result-item:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
    transform: translateY(-1px);
}

.result-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 20px;
}

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

.result-name {
    font-weight: 500;
    color: #212529;
    font-size: 14px;
    margin-bottom: 4px;
    word-break: break-word;
}

.result-name a {
    color: #1a73e8;
    text-decoration: none;
}

.result-name a:hover {
    text-decoration: underline;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
}

.result-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-folder {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-file {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-drive {
    background: #fff3e0;
    color: #e65100;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-results-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.no-results-hint {
    font-size: 14px;
    color: #adb5bd;
}

/* Drive section grouping in search results */
.drive-section {
    margin-bottom: 30px;
}

.drive-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #1a73e8;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 16px;
    color: #212529;
}

.drive-icon {
    font-size: 20px;
}

.drive-count {
    margin-left: auto;
    font-size: 13px;
    color: #6c757d;
    font-weight: normal;
}

.drive-files {
    padding-left: 8px;
}

/* Permission section styles */
.permission-section {
    margin-bottom: 30px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
    border-left: 4px solid #1a73e8;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 17px;
    color: #1565c0;
    font-weight: 600;
}

.section-icon {
    font-size: 22px;
}

.section-count {
    margin-left: auto;
    font-size: 14px;
    font-weight: normal;
    color: #666;
}

.section-description {
    padding: 12px 18px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #495057;
}

.section-description strong {
    color: #212529;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Shared drive item styling */
.shared-drive-item {
    background: linear-gradient(135deg, #fff8e1 0%, #fffbf0 100%);
    border-color: #ffc107;
}

.shared-drive-item:hover {
    border-color: #ff9800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

/* Direct permission badge */
.direct-permission-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: #4caf50;
    color: white;
}

/* Permission role badges */
.permission-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.perm-organizer {
    background: #9c27b0;
    color: white;
}

.perm-file-organizer {
    background: #673ab7;
    color: white;
}

.perm-writer {
    background: #2196f3;
    color: white;
}

.perm-commenter {
    background: #ff9800;
    color: white;
}

.perm-reader {
    background: #607d8b;
    color: white;
}

/* Stats breakdown */
.stats-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.stat-item {
    display: inline-block;
    padding: 4px 12px;
    background: white;
    border-radius: 12px;
    font-size: 13px;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* Highlight items with direct permissions */
.has-direct-permission {
    border-left: 3px solid #4caf50;
}

/* Group membership display */
.group-memberships {
    margin-top: 12px;
    padding: 12px 15px;
    background: #f0f4ff;
    border-left: 4px solid #5e72e4;
    border-radius: 4px;
}

.group-memberships strong {
    display: block;
    margin-bottom: 8px;
    color: #32325d;
}

.group-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.group-badge {
    display: inline-block;
    padding: 4px 12px;
    background: white;
    border: 1px solid #5e72e4;
    border-radius: 16px;
    font-size: 12px;
    color: #5e72e4;
    font-weight: 500;
    cursor: help;
}

.group-badge:hover {
    background: #5e72e4;
    color: white;
}

/* Via badges (direct vs group) */
.via-badge {
    display: inline-block;
    padding: 3px 10px;
    margin-left: 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.via-direct {
    background: #4caf50;
    color: white;
}

.via-group {
    background: #5e72e4;
    color: white;
}

/* Group permission badge for files */
.group-permission-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: #5e72e4;
    color: white;
    cursor: help;
}

/* Highlight items accessed via groups */
.via-group-access {
    border-left: 3px solid #5e72e4;
}

.via-group-access.shared-drive-item {
    background: linear-gradient(135deg, #f0f4ff 0%, #f8f9ff 100%);
}

/* Stat items with different colors */
.stat-direct {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.stat-group {
    background: #f0f4ff;
    border-color: #5e72e4;
    color: #4c51bf;
}

/* Match email input styling to text input for Access Audit */
.form-group input[type="email"] {
    width: 100%;
    padding: 10px;
    padding-right: 45px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: #1a73e8;
}

.form-group input[type="email"]::placeholder {
    color: #999;
}

/* Enhanced form group styling for Access Audit */
#accessAuditForm .form-group {
    margin-bottom: 24px;
}

#accessAuditForm .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #32325d;
    font-size: 14px;
}

#accessAuditForm .form-group small {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 13px;
}

#accessAuditForm input[type="email"],
#accessAuditForm input[type="text"] {
    background: #fff;
}

#accessAuditForm input[type="email"]:hover,
#accessAuditForm input[type="text"]:hover {
    border-color: #a8b8d8;
}

#accessAuditForm input[type="email"]:focus,
#accessAuditForm input[type="text"]:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Enhanced Access Audit Tab Design */
/* Removed duplicate overrides - now uses base .info-box and .form-box styles */

/* Query Help Box Enhancement */
.query-help {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 12px;
    font-size: 13px;
}

.query-help strong {
    display: block;
    margin-bottom: 10px;
    color: #32325d;
    font-size: 14px;
}

.query-help ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.query-help li {
    padding: 6px 0;
    color: #525f7f;
}

.query-help code {
    background: white;
    border: 1px solid #dee2e6;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #e83e8c;
}

.query-help a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.query-help a:hover {
    text-decoration: underline;
}

/* Checkbox Group Enhancement */
.checkbox-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-label:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #1a73e8;
}

.checkbox-label span {
    font-size: 14px;
    color: #525f7f;
    font-weight: 500;
}

/* Button Enhancement - Removed (uses .btn-primary) */

/* Loading Animation - uses base .loading class */

/* Results Container - uses base .result-box or .search-results class */

/* Results Stats - simplified */
.results-stats {
    background: #f5f5f5;
    border-left: 4px solid #1a73e8;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.results-stats strong {
    color: #333;
    font-size: 16px;
}