/* Drive - Design moderne, épuré, compact - 100% opaque */
:root {
    --drive-bg: #0d0d0f;
    --drive-surface: #141417;
    --drive-surface-hover: #1a1a1e;
    --drive-border: #252529;
    --drive-primary: #e11d48;
    --drive-primary-hover: #be123c;
    --drive-warning: #ea580c;
    --drive-text: #fafafa;
    --drive-muted: #71717a;
}

body.drive-app {
    background: var(--drive-bg);
    color: var(--drive-text);
    min-height: 100vh;
}

.drive-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: currentColor;
    vertical-align: middle;
}
.drive-icon-folder {
    color: var(--drive-warning);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M10 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.drive-icon-file {
    color: var(--drive-muted);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3C/svg%3E") center/contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.nav-sidebar-item.active {
    background: var(--drive-surface-hover);
    color: var(--drive-primary);
}

/* Viewer - full screen layout */
#viewerContent {
    display: flex;
    flex-direction: column;
}
#viewerContent > .viewer-fullscreen-wrap {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--drive-bg);
}
#viewerContent > .viewer-fullscreen-wrap iframe.viewer-fullscreen {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    display: block;
}
#viewerContent > .viewer-fullscreen-wrap .viewer-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
#viewerContent > .viewer-scroll-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) {
    #viewerContent > .viewer-scroll-wrap { padding: 1.25rem 1.5rem; }
}

/* Viewer content (doc, sheet, text) */
.viewer-html {
    padding: 0.75rem 1rem;
    background: var(--drive-surface);
    border: 1px solid var(--drive-border);
    border-radius: 8px;
    color: var(--drive-text);
    line-height: 1.5;
    max-width: 900px;
    margin: 0 auto;
    font-size: 0.875rem;
}
.viewer-html table { border-collapse: collapse; width: 100%; }
.viewer-html th,
.viewer-html td { border: 1px solid var(--drive-border); padding: 0.375rem 0.5rem; text-align: left; font-size: 0.8125rem; }
.viewer-html th { background: var(--drive-surface-hover); font-weight: 600; }
.viewer-textarea {
    width: 100%;
    min-height: 50vh;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--drive-text);
    background: var(--drive-surface);
    border: 1px solid var(--drive-border);
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
}
.viewer-save-status.saved { color: #22c55e; }
.viewer-save-status.error { color: #ef4444; }
.drive-empty { color: var(--drive-muted); padding: 0.5rem; font-size: 0.875rem; }
.drive-empty a { color: var(--drive-primary); }
.drive-empty a:hover { text-decoration: underline; }

/* Toast notification */
.drive-toast {
    background: var(--drive-surface);
    border: 1px solid var(--drive-border);
    border-left-width: 4px;
    min-width: 240px;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
.drive-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}
.drive-toast.success {
    border-left-color: #22c55e;
}
.drive-toast.success .drive-toast-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
.drive-toast.error {
    border-left-color: #ef4444;
}
.drive-toast.error .drive-toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.drive-toast .drive-toast-icon svg {
    width: 18px;
    height: 18px;
}
