/* Wave Emprestimos - Painel Admin */
:root {
    --sidebar-w: 260px;
    --admin-header-h: 60px;
}

.admin-body {
    background: #f0f2f5;
    min-height: 100vh;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-w);
    background: var(--dark);
    color: var(--gray-300);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    padding-top: env(safe-area-inset-top);
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand img { width: 36px; height: 36px; }
.sidebar-brand span { font-weight: 700; color: var(--white); font-size: 1rem; }

.sidebar-nav { padding: 16px 12px; }

.nav-section { margin-bottom: 24px; }
.nav-section-title {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--gray-300);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    min-height: 48px;
}

.nav-item i { width: 20px; text-align: center; font-size: 1rem; }
.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}

.nav-item.active { background: var(--primary); }

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

.admin-header {
    height: var(--admin-header-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    padding-top: env(safe-area-inset-top);
}

.admin-header h1 { font-size: 1.125rem; font-weight: 700; color: var(--dark); }

.admin-content { padding: 24px; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

.admin-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-card-header h2 { font-size: 1.125rem; font-weight: 700; }

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    margin-bottom: 12px;
}

.stat-card .stat-icon.blue { background: rgba(59,130,246,0.1); color: var(--info); }
.stat-card .stat-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-card .stat-icon.orange { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-card .stat-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }

.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--dark); }
.stat-card .stat-label { font-size: 0.8125rem; color: var(--gray-500); }

.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.data-table tr:hover td { background: #fafbfc; }

.mobile-cards { display: none; }

.record-card {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.record-card .record-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.875rem;
}

.record-card .record-row .label { color: var(--gray-500); }
.record-card .record-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-warning { background: rgba(245,158,11,0.15); color: #b45309; }
.badge-info { background: rgba(59,130,246,0.15); color: #1d4ed8; }
.badge-success { background: rgba(16,185,129,0.15); color: #047857; }
.badge-danger { background: rgba(239,68,68,0.15); color: #b91c1c; }
.badge-primary { background: rgba(15,76,129,0.15); color: var(--primary); }
.badge-secondary { background: var(--gray-100); color: var(--gray-500); }

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert > i {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-body {
    flex: 1;
    min-width: 0;
}

.alert-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.alert-vars code,
.alert-var {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: ui-monospace, monospace;
    word-break: break-word;
}

.alert-success { background: rgba(16,185,129,0.1); color: #047857; border: 1px solid rgba(16,185,129,0.2); }
.alert-error { background: rgba(239,68,68,0.1); color: #b91c1c; border: 1px solid rgba(239,68,68,0.2); }
.alert-info { background: rgba(59,130,246,0.1); color: #1d4ed8; border: 1px solid rgba(59,130,246,0.2); }

.btn-float {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: 24px;
    z-index: 200;
    box-shadow: var(--shadow-lg);
}

.qrcode-box {
    text-align: center;
    padding: 32px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    margin: 20px 0;
}

.qrcode-box img { max-width: 280px; margin: 0 auto 16px; border-radius: var(--radius); }

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-dot::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.connected::before { background: var(--success); }
.status-dot.disconnected::before { background: var(--danger); }
.status-dot.connecting::before { background: var(--warning); animation: pulse 1.5s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    background: var(--white);
    border-top: 1px solid var(--gray-100);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--bottom-nav-h);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--gray-500);
    font-size: 0.75rem;
    min-width: 48px;
    min-height: 48px;
    justify-content: center;
}

.bottom-nav a i { font-size: 1.125rem; }
.bottom-nav a.active { color: var(--primary); }

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--dark);
    cursor: pointer;
    width: 48px;
    height: 48px;
}

@media (max-width: 991px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    .bottom-nav { display: block; }
    .data-table-wrap { display: none; }
    .mobile-cards { display: block; }
}

@media (min-width: 992px) {
    .admin-content { padding-bottom: 24px; }
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.auth-card .logo { justify-content: center; margin-bottom: 32px; }
.auth-card h1 { text-align: center; font-size: 1.25rem; margin-bottom: 8px; }
.auth-card .subtitle { text-align: center; color: var(--gray-500); font-size: 0.875rem; margin-bottom: 32px; }

.form-actions { margin-top: 24px; }
.form-actions .btn { width: 100%; }

.balance-display {
    text-align: center;
    padding: 32px;
    background: var(--primary-dark);
    border-radius: var(--radius-lg);
    color: var(--white);
    margin-bottom: 24px;
}

.balance-display .balance-label { font-size: 0.875rem; opacity: 0.9; }
.balance-display .balance-value { font-size: 2.5rem; font-weight: 800; margin-top: 8px; }

/* CMS Conteudo do Site */
.front-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 8px;
}

.front-section-title:first-of-type { margin-top: 0; }

.front-bg-preview {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
    margin-bottom: 16px;
    border: 1px solid var(--gray-300);
}

.front-bg-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.front-bg-empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    gap: 8px;
    font-size: 0.875rem;
}

.front-bg-empty i { font-size: 2rem; opacity: 0.5; }

.front-item-card {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.front-item-card strong {
    display: block;
    margin-bottom: 12px;
    font-size: 0.875rem;
    color: var(--primary);
}

.form-section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary);
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-upload-group small {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.doc-current {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.doc-current img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
}

.doc-upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
    padding: 24px 16px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    background: var(--gray-100);
    cursor: pointer;
    text-align: center;
}

.doc-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.doc-upload-icon { font-size: 2rem; color: var(--primary); }
.doc-upload-text { font-size: 0.875rem; color: var(--gray-700); }

.doc-upload-preview { display: none; width: 100%; max-width: 280px; margin-top: 8px; }
.doc-upload-preview.has-image { display: block; }
.doc-upload-preview img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
}
