/* Force One Hub — Interface visual */

:root {
    --primary: #4285f4;
    --primary-dark: #3367d6;
    --primary-light: #e8f0fe;
    --secondary: #34a853;
    --danger: #ea4335;
    --warning: #fbbc05;
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --border: #dadce0;
    --text: #202124;
    --text-muted: #5f6368;
    --input-bg: #ffffff;
    --chart-bg: #fafbfc;
    --table-stripe: #f8f9fa;
    --sidebar-width: 280px;
    --header-height: 64px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(60,64,67,.15);
    --shadow: 0 2px 8px rgba(60,64,67,.15);
    --shadow-lg: 0 8px 28px rgba(60,64,67,.18);
    --login-gradient: linear-gradient(135deg, #1a73e8 0%, #4f46e5 45%, #7c3aed 100%);
    --login-brand-overlay: rgba(255,255,255,0.08);
    --success-bg: #e6f4ea;
    --danger-bg: #fce8e6;
    --warning-bg: #fff8e1;
    --banner-bg: linear-gradient(135deg, #fff8e1, #e8f0fe);
    --modal-overlay-bg: rgba(0,0,0,0.5);
    --header-bg: rgba(255,255,255,0.85);
    --glass-border: rgba(255,255,255,0.2);
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --primary: #8ab4f8;
    --primary-dark: #669df6;
    --primary-light: rgba(138, 180, 248, 0.12);
    --secondary: #81c995;
    --danger: #f28b82;
    --warning: #fdd663;
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-elevated: #242835;
    --border: #2d3240;
    --text: #e8eaed;
    --text-muted: #9aa0a6;
    --input-bg: #141820;
    --chart-bg: #141820;
    --table-stripe: #1e222d;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
    --shadow: 0 2px 8px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 28px rgba(0,0,0,.5);
    --login-gradient: linear-gradient(135deg, #0d1b2a 0%, #1b263b 50%, #293241 100%);
    --login-brand-overlay: rgba(255,255,255,0.05);
    --success-bg: rgba(129, 201, 149, 0.15);
    --danger-bg: rgba(242, 139, 130, 0.15);
    --warning-bg: rgba(253, 214, 99, 0.1);
    --banner-bg: linear-gradient(135deg, rgba(253,214,99,0.08), rgba(138,180,248,0.08));
    --modal-overlay-bg: rgba(0,0,0,0.72);
    --header-bg: rgba(26, 29, 39, 0.9);
    --glass-border: rgba(255,255,255,0.08);
}

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

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

.hidden { display: none !important; }

/* ─── Loading ───────────────────────────────────────────────────────────── */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg);
    gap: 16px;
}

.loading-screen p {
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.mini-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Login ─────────────────────────────────────────────────────────────── */
.login-screen {
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.theme-toggle-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20;
}

.login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.login-brand-panel {
    background: var(--login-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, var(--login-brand-overlay) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--login-brand-overlay) 0%, transparent 40%);
    pointer-events: none;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 440px;
    color: #fff;
}

.login-brand-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    font-size: 22px;
    font-weight: 700;
}

.login-brand-content h2 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.login-brand-content > p {
    font-size: 16px;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 32px;
}

.login-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
}

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

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--bg);
}

.login-card {
    background: var(--surface);
    padding: 40px 36px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 100%;
}

.login-card-header { margin-bottom: 28px; }

.login-card h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 14px;
}

.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap input { padding-right: 44px; }

.pw-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    padding: 4px;
    line-height: 1;
}

.pw-toggle:hover { opacity: 1; }

.login-footer {
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

/* ─── Tema ──────────────────────────────────────────────────────────────── */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: 18px;
    transition: all var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.05);
}

.theme-icon { line-height: 1; }

/* ─── Header ────────────────────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

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

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

.brand-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.header-center { flex: 1; max-width: 520px; margin: 0 auto; }

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 4px 4px 4px 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon { font-size: 14px; margin-right: 8px; opacity: 0.5; }

.search-box input {
    flex: 1;
    padding: 8px 4px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: var(--bg);
    border-radius: 24px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Layout ────────────────────────────────────────────────────────────── */
.app { display: flex; flex-direction: column; height: 100vh; }

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.nav-list { list-style: none; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.nav-item:hover { background: var(--bg); }
.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-icon { font-size: 16px; }

.file-browser-section { flex: 1; overflow-y: auto; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 12px;
    font-size: 12px;
    padding: 8px;
    background: var(--bg);
    border-radius: var(--radius);
}

.breadcrumb-item {
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}

.breadcrumb-item:hover { color: var(--primary); background: var(--primary-light); }
.breadcrumb-item.active { color: var(--text); font-weight: 600; cursor: default; }
.breadcrumb-item.active:hover { background: transparent; }
.breadcrumb-sep { color: var(--border); padding: 0 2px; }

.file-list { list-style: none; }

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    margin-bottom: 1px;
}

.file-item:hover { background: var(--bg); }
.file-item.selected {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    padding-left: 9px;
}

.file-icon { font-size: 18px; flex-shrink: 0; }

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

.file-size {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.loading-text {
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px;
    display: flex;
    align-items: center;
}

/* ─── Conteúdo ────────────────────────────────────────────────────────────── */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    background: var(--bg);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    color: var(--text-muted);
    text-align: center;
}

.empty-illustration { margin-bottom: 24px; }

.empty-icon-ring {
    font-size: 56px;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: 50%;
    box-shadow: var(--shadow);
    border: 3px solid var(--primary-light);
}

.empty-state h2 {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 22px;
}

.empty-state p {
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.supported-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.format-tag {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ─── Preview ───────────────────────────────────────────────────────────── */
.file-preview { animation: fadeIn 0.3s ease; }

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

.preview-header {
    margin-bottom: 20px;
}

.preview-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.preview-meta { display: flex; gap: 8px; }

.meta-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.metrics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.metric-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
}

.section-header {
    margin-bottom: 14px;
}

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

.preview-table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 420px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: var(--table-stripe);
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    border-bottom: 2px solid var(--border);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table th:hover { background: var(--primary-light); }

.data-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f1f3f4;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tr:hover td { background: var(--table-stripe); }
.data-table tr:nth-child(even) td { background: var(--chart-bg); }
.data-table tr:nth-child(even):hover td { background: var(--table-stripe); }

/* ─── Gráficos ──────────────────────────────────────────────────────────── */
.chart-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-config {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

.config-row { display: flex; flex-direction: column; gap: 6px; }

.config-row label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.config-row select,
.config-row input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    font-family: inherit;
    background: var(--surface);
    transition: border-color 0.2s;
}

.config-row select:focus,
.config-row input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.config-action { justify-content: flex-end; }

.chart-area {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.4s ease;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

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

.export-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.chart-container {
    width: 100%;
    min-height: 480px;
    border-radius: var(--radius);
    background: var(--chart-bg);
    padding: 8px;
}

/* ─── Botões ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-lg { padding: 12px 28px; font-size: 15px; }

.btn-outline {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 14px;
}

.btn-ghost:hover { background: var(--bg); color: var(--danger); }

.btn-sm { padding: 7px 14px; font-size: 13px; }

.btn-full { width: 100%; }

/* ─── Auth (login / cadastro) ───────────────────────────────────────────── */
.login-card-wide { max-width: 440px; }

.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.auth-form { text-align: left; }

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 18px;
}

/* ─── Integrações ───────────────────────────────────────────────────────── */
.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 28px;
}

.integration-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    max-width: 600px;
}

.integration-header {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.integration-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.google-logo { background: var(--bg); border: 1px solid var(--border); }

.integration-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.integration-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.integration-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 16px;
}

.integration-status.connected {
    background: var(--success-bg);
    color: var(--secondary);
}

.integration-status.disconnected {
    background: var(--danger-bg);
    color: var(--danger);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.connected { background: var(--secondary); }
.status-dot.disconnected { background: var(--danger); }

.integration-email {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.oauth-console-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    line-height: 1.5;
}

.oauth-uri-list {
    margin-top: 8px;
    padding-left: 18px;
    font-size: 11px;
}

.oauth-uri-list code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

.oauth-warning {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.integration-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-badge {
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.nav-item {
    display: flex;
    align-items: center;
}

.google-banner {
    background: var(--banner-bg);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.banner-icon { font-size: 28px; }

.banner-content strong { display: block; margin-bottom: 2px; }
.banner-content p { font-size: 13px; color: var(--text-muted); margin: 0; }

.disabled-section {
    opacity: 0.5;
    pointer-events: none;
}

/* ─── Clientes ────────────────────────────────────────────────────────────── */
.clients-view { animation: fadeIn 0.3s ease; }

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

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

.clients-toolbar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.clients-toolbar input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text);
}

.clients-subtabs { display: flex; gap: 4px; }

.subtab {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}

.subtab.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.client-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.client-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

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

.client-card-icon { font-size: 24px; }

.client-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.client-status.active { background: var(--success-bg); color: var(--secondary); }
.client-status.inactive { background: var(--danger-bg); color: var(--danger); }

.client-card h4 { font-size: 16px; margin-bottom: 4px; }
.client-card-sub { font-size: 13px; color: var(--text-muted); }
.client-card-cnpj { font-size: 12px; color: var(--text-muted); margin: 6px 0; }

.client-card-footer {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

.client-card-actions { margin-top: 12px; }

.empty-mini {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.back-btn { margin-bottom: 16px; }

.client-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.detail-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.detail-card h4 { font-size: 13px; margin-bottom: 8px; color: var(--text-muted); }
.detail-card p { font-size: 14px; line-height: 1.6; }

.detail-section { margin-bottom: 28px; }
.detail-section h3 { font-size: 16px; margin-bottom: 14px; }

.mini-cards { display: flex; flex-wrap: wrap; gap: 10px; }

.mini-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13px;
}

.mini-card strong { display: block; margin-bottom: 2px; }
.mini-card span { color: var(--text-muted); font-size: 12px; }

.text-muted { color: var(--text-muted); font-size: 13px; }

.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 4px; }

.password-field { font-family: monospace; font-size: 12px; }
.btn-show-pw { background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px; }

/* ─── Usuários ───────────────────────────────────────────────────────────── */
.users-view { animation: fadeIn 0.3s ease; }

.users-table-wrap { margin-top: 8px; }

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-cell strong { display: block; font-size: 14px; }
.user-cell small { color: var(--text-muted); font-size: 12px; }

.role-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.role-admin { background: var(--primary-light); color: var(--primary); }
.role-user { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

.table-loading,
.table-empty,
.table-error {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

.table-error { color: var(--danger) !important; }

/* ─── Dashboard ──────────────────────────────────────────────────────────── */
.dashboard-view { animation: fadeIn 0.3s ease; }

.dashboard-welcome { margin-bottom: 24px; }

.welcome-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.welcome-ok { border-left: 4px solid var(--secondary); }
.welcome-warn { border-left: 4px solid var(--warning); }

.welcome-icon { font-size: 28px; flex-shrink: 0; }
.welcome-card strong { display: block; margin-bottom: 4px; }
.welcome-card p { font-size: 13px; color: var(--text-muted); margin: 0; }

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-primary { border-top: 3px solid var(--primary); }
.stat-secondary { border-top: 3px solid var(--secondary); }
.stat-accent { border-top: 3px solid #7c3aed; }
.stat-warn { border-top: 3px solid var(--warning); }

.stat-icon { font-size: 28px; line-height: 1; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 4px; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.dashboard-panel h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.dashboard-chart { min-height: 280px; }

.rank-list { display: flex; flex-direction: column; gap: 10px; }

.rank-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius);
}

.rank-pos {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rank-info { flex: 1; min-width: 0; }
.rank-info strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-info small { color: var(--text-muted); font-size: 12px; }

.rank-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

.alerts-list { display: flex; flex-direction: column; gap: 10px; }

.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--bg);
}

.alert-info { border-left: 3px solid var(--primary); }
.alert-warning { border-left: 3px solid var(--warning); }
.alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}
.alert-warning .alert-dot { background: var(--warning); }

.dashboard-loading,
.dashboard-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.dashboard-error { color: var(--danger); }

/* ─── Modal ─────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 { font-size: 18px; }

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-body { padding: 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.form-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 16px 0 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.form-row-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }

.form-group { flex: 1; min-width: 120px; }
.form-group.flex-2 { flex: 2; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-top: 8px;
    cursor: pointer;
}

/* ─── Responsivo ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar { width: 240px; }
    .user-name { display: none; }
    .login-layout { grid-template-columns: 1fr; }
    .login-brand-panel { display: none; }
    .login-form-panel { padding: 24px 16px; }
}

@media (max-width: 640px) {
    .main-layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .content { padding: 16px; }
    .chart-config { grid-template-columns: 1fr; }
    .metrics-cards { grid-template-columns: repeat(2, 1fr); }
    .header-center { display: none; }
    .form-row { grid-template-columns: 1fr; }
}
