:root {
    --bg: #f0f2f5;
    --card: #ffffff;
    --primary: #4285f4;
    --primary-hover: #3367d6;
    --danger: #ea4335;
    --success: #34a853;
    --text: #202124;
    --text-light: #5f6368;
    --border: #dadce0;
    --hover-bg: #f1f3f4;
    --radius: 8px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

header {
    background: var(--card);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: baseline;
    gap: 16px;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

header .subtitle {
    font-size: 14px;
    color: var(--text-light);
}

main { padding: 20px; }

/* ── Login ─────────────────── */

.login-container {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 60px;
    flex-wrap: wrap;
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 320px;
    text-align: center;
}

.login-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.login-hint {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
}

.email-badge {
    background: #e8f0fe;
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    margin-bottom: 16px;
    display: inline-block;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

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

.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
    background: var(--hover-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-light);
    border: 1px solid var(--border);
}

.center-msg {
    text-align: center;
    margin-top: 24px;
    color: var(--text-light);
}

/* ── Toolbar ───────────────── */

.toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 0;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.storage-badge {
    font-size: 12px;
    color: var(--primary);
    background: #e8f0fe;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.storage-info {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 12px;
}

/* ── Browser ───────────────── */

.browser-container {
    display: flex;
    gap: 0;
    height: calc(100vh - 160px);
}

.pane {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    flex-wrap: wrap;
}

.crumb {
    cursor: pointer;
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
}

.crumb:hover { background: #e8f0fe; }

.crumb::after { content: " /"; color: var(--text-light); }

.crumb:last-child { font-weight: 600; color: var(--text); cursor: default; }
.crumb:last-child::after { content: ""; }
.crumb:last-child:hover { background: transparent; }

.pane-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-action {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-action:hover {
    background: var(--hover-bg);
}

.btn-action.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
}

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

.select-all-label {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.file-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f1f3f4;
    transition: background 0.15s;
}

.file-item:hover { background: var(--hover-bg); }
.file-item.selected { background: #e8f0fe; }

.file-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.file-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: var(--text-light);
    min-width: 70px;
    text-align: right;
}

.file-item.folder .file-name {
    font-weight: 500;
}

.size-loading {
    color: var(--border);
    font-style: italic;
}

.loading-msg {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 14px;
}

/* ── Transfer controls ─────── */

.transfer-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 16px;
    min-width: 80px;
}

.btn-transfer {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: var(--card);
    color: var(--primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-transfer:hover {
    background: var(--primary);
    color: #fff;
}

.btn-transfer:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Status Panel ──────────── */

.status-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 2px solid var(--primary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 300px;
    display: flex;
    flex-direction: column;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

.status-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.status-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0 4px;
}

.status-close:hover { color: var(--danger); }

#progress-area {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-bar-large {
    flex: 1;
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill-large {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s;
    border-radius: 6px;
}

.progress-text-large {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    min-width: 140px;
    text-align: right;
}

.progress-pct {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-left: auto;
    margin-right: 16px;
}

.transfer-log {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px 12px;
    max-height: 160px;
    font-size: 13px;
    line-height: 1.6;
}

.transfer-log .log-ok { color: var(--success); }
.transfer-log .log-ok::before { content: "OK  "; }
.transfer-log .log-err { color: var(--danger); }
.transfer-log .log-err::before { content: "ERRO  "; }
.transfer-log .log-skip { color: #f9ab00; }
.transfer-log .log-skip::before { content: "PULADO  "; }
.transfer-log .log-folder { color: var(--primary); }
.transfer-log .log-folder::before { content: "PASTA  "; }

/* ── Duplicados Button ──────── */

.btn-dupes {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
}

.btn-dupes:hover {
    background: #ffe0b2;
}

/* ── Modal ─────────────────── */

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

.modal-content {
    background: var(--card);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.dupes-summary {
    padding: 12px 20px;
    background: #fff3e0;
    font-size: 14px;
    color: #e65100;
    font-weight: 500;
}

.dupes-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.dupe-group {
    border-bottom: 2px solid var(--border);
    padding: 12px 20px;
}

.dupe-group-header {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.dupe-group-header .dupe-size {
    font-weight: 400;
    color: var(--text-light);
    font-size: 13px;
}

.dupe-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
}

.dupe-file input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.dupe-file .dupe-label-keep {
    color: var(--success);
    font-size: 11px;
    font-weight: 600;
    background: #e8f5e9;
    padding: 1px 6px;
    border-radius: 4px;
}

.dupe-file .dupe-label-extra {
    color: var(--danger);
    font-size: 11px;
    font-weight: 600;
    background: #fce4ec;
    padding: 1px 6px;
    border-radius: 4px;
}

.dupe-file .dupe-date {
    color: var(--text-light);
    font-size: 12px;
    margin-left: auto;
}

.dupes-actions {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.hidden { display: none; }

/* ── Responsive ────────────── */

@media (max-width: 768px) {
    .browser-container { flex-direction: column; height: auto; }
    .pane { min-height: 300px; }
    .transfer-controls { flex-direction: row; padding: 12px 0; }
}
