/**
 * AquaPrime - Premium Styles
 * Identidade Visual: Azul profundo, azul claro, branco, verde água
 */

:root {
    --ap-primary: #0c4a6e;
    --ap-primary-dark: #082f49;
    --ap-primary-light: #0ea5e9;
    --ap-secondary: #06b6d4;
    --ap-accent: #10b981;
    --ap-accent-light: #34d399;
    --ap-danger: #ef4444;
    --ap-warning: #f59e0b;
    --ap-success: #10b981;
    --ap-info: #3b82f6;
    --ap-dark: #0f172a;
    --ap-gray: #64748b;
    --ap-light: #f1f5f9;
    --ap-white: #ffffff;
    --ap-gradient: linear-gradient(135deg, #0c4a6e 0%, #0ea5e9 50%, #06b6d4 100%);
    --ap-gradient-accent: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --ap-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --ap-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --ap-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --ap-radius: 12px;
    --ap-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ap-gradient);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pulse-bg 15s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='0.05' d='M0,192L48,197.3C96,202,192,213,288,192C384,171,480,117,576,112.7C672,107,768,149,864,165.3C960,181,1056,171,1152,149.3C1248,128,1344,96,1392,80L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
}

@keyframes pulse-bg {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-5%, -5%) rotate(5deg); }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--ap-shadow-xl);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: var(--ap-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.4);
}

.login-logo .logo-icon i {
    font-size: 32px;
    color: white;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--ap-primary-dark);
    margin: 0;
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--ap-gray);
    font-size: 14px;
    margin: 4px 0 0;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-label {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
}

.login-form .form-control {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    transition: var(--ap-transition);
    background: #f8fafc;
}

.login-form .form-control:focus {
    border-color: var(--ap-primary-light);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
    background: white;
}

.login-form .input-icon {
    position: relative;
}

.login-form .input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ap-gray);
    z-index: 2;
}

.login-form .input-icon .form-control {
    padding-left: 44px;
}

.btn-login {
    background: var(--ap-gradient);
    border: none;
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    width: 100%;
    transition: var(--ap-transition);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
    color: white;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login-outline {
    background: transparent;
    border: 2px solid var(--ap-primary-light);
    color: var(--ap-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    width: 100%;
    transition: var(--ap-transition);
}

.btn-login-outline:hover {
    background: rgba(14, 165, 233, 0.08);
    color: var(--ap-primary);
}

/* ===== SIDEBAR PREMIUM ===== */
.main-sidebar {
    background: var(--ap-primary-dark) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.brand-link {
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    padding: 20px 16px !important;
}

.brand-text {
    font-weight: 800 !important;
    font-size: 22px !important;
    letter-spacing: -0.5px;
}

.sidebar .nav-sidebar .nav-item .nav-link {
    border-radius: 10px;
    margin: 2px 12px;
    padding: 12px 16px;
    transition: var(--ap-transition);
    font-weight: 500;
}

.sidebar .nav-sidebar .nav-item .nav-link:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(4px);
}

.sidebar .nav-sidebar .nav-item .nav-link.active {
    background: var(--ap-gradient) !important;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.sidebar .nav-sidebar .nav-item .nav-link i {
    font-size: 16px;
    width: 24px;
    margin-right: 10px;
}

.nav-header {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45) !important;
    padding: 16px 20px 8px !important;
    margin-top: 4px;
}

/* Sidebar scroll — menu longo mantém item ativo visível */
.main-sidebar .sidebar {
    height: calc(100vh - 3.5rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
    scroll-behavior: smooth;
}

.main-sidebar .sidebar::-webkit-scrollbar {
    width: 5px;
}

.main-sidebar .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.main-sidebar .nav-link.active {
    position: relative;
}

.main-sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--ap-accent);
    border-radius: 0 4px 4px 0;
}

/* ===== CONTENT HEADER ===== */
.content-header h1 {
    font-weight: 800;
    font-size: 28px;
    color: var(--ap-primary-dark);
    letter-spacing: -0.5px;
}

.content-header .breadcrumb {
    font-size: 13px;
}

/* ===== KPI CARDS ===== */
.kpi-card {
    background: white;
    border-radius: var(--ap-radius);
    padding: 24px;
    box-shadow: var(--ap-shadow);
    transition: var(--ap-transition);
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--ap-gradient);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ap-shadow-lg);
}

.kpi-card.kpi-success::before { background: var(--ap-gradient-accent); }
.kpi-card.kpi-warning::before { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.kpi-card.kpi-danger::before { background: linear-gradient(135deg, #ef4444, #f87171); }
.kpi-card.kpi-info::before { background: linear-gradient(135deg, #3b82f6, #60a5fa); }

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    background: var(--ap-gradient);
    margin-bottom: 16px;
}

.kpi-icon.icon-success { background: var(--ap-gradient-accent); }
.kpi-icon.icon-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.kpi-icon.icon-danger { background: linear-gradient(135deg, #ef4444, #f87171); }
.kpi-icon.icon-info { background: linear-gradient(135deg, #3b82f6, #60a5fa); }

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--ap-dark);
    line-height: 1;
    letter-spacing: -1px;
}

.kpi-label {
    font-size: 13px;
    color: var(--ap-gray);
    font-weight: 600;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.kpi-change.positive { color: var(--ap-success); }
.kpi-change.negative { color: var(--ap-danger); }

/* ===== PREMIUM CARDS ===== */
.card-premium {
    background: white;
    border-radius: var(--ap-radius);
    box-shadow: var(--ap-shadow);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    transition: var(--ap-transition);
}

.card-premium:hover {
    box-shadow: var(--ap-shadow-lg);
}

.card-premium .card-header {
    background: white;
    border-bottom: 1px solid #f1f5f9;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-premium .card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ap-dark);
    margin: 0;
}

.card-premium .card-header h3 i {
    color: var(--ap-primary-light);
    margin-right: 8px;
}

.card-premium .card-body {
    padding: 24px;
}

/* ===== CA BADGE ===== */
.ca-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
}

.ca-badge.excelente {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.ca-badge.atencao {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.ca-badge.alerta {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

/* ===== BUTTONS PREMIUM ===== */
.btn-premium {
    background: var(--ap-gradient);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--ap-transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
    color: white;
}

.btn-premium-success {
    background: var(--ap-gradient-accent);
}

.btn-premium-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    color: white;
}

.btn-premium-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.btn-premium-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
    color: white;
}

.btn-premium-outline {
    background: transparent;
    border: 2px solid var(--ap-primary-light);
    color: var(--ap-primary);
}

.btn-premium-outline:hover {
    background: var(--ap-primary-light);
    color: white;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: none;
    transition: var(--ap-transition);
    cursor: pointer;
}

.btn-icon.btn-edit {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.btn-icon.btn-edit:hover {
    background: #3b82f6;
    color: white;
}

.btn-icon.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.btn-icon.btn-delete:hover {
    background: #ef4444;
    color: white;
}

.btn-icon.btn-view {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.btn-icon.btn-view:hover {
    background: #10b981;
    color: white;
}

/* ===== TABLES PREMIUM ===== */
.table-premium {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-premium thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 2px solid #e2e8f0;
}

.table-premium tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    vertical-align: middle;
}

.table-premium tbody tr {
    transition: var(--ap-transition);
}

.table-premium tbody tr:hover {
    background: #f8fafc;
}

/* ===== MODALS PREMIUM ===== */
.modal-premium .modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: var(--ap-shadow-xl);
    overflow: hidden;
}

.modal-premium .modal-header {
    background: var(--ap-gradient);
    color: white;
    border: none;
    padding: 24px 28px;
}

.modal-premium .modal-header .modal-title {
    font-weight: 700;
    font-size: 18px;
}

.modal-premium .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-premium .modal-body {
    padding: 28px;
}

.modal-premium .modal-footer {
    border: none;
    padding: 16px 28px 24px;
    gap: 8px;
}

.modal-premium .form-label {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
}

.modal-premium .form-control,
.modal-premium .form-select {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    transition: var(--ap-transition);
}

.modal-premium .form-control:focus,
.modal-premium .form-select:focus {
    border-color: var(--ap-primary-light);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* ===== ALERTS ===== */
.alert-premium {
    border: none;
    border-radius: var(--ap-radius);
    padding: 16px 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== STATUS BADGES ===== */
.badge-status {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-status.ativo { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-status.povoado { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.badge-status.abate { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.badge-status.vazio { background: rgba(100, 116, 139, 0.1); color: #475569; }
.badge-status.online { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-status.offline { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

/* ===== TANQUE SELECTOR ===== */
.tanque-selector {
    background: white;
    border-radius: var(--ap-radius);
    padding: 16px 20px;
    box-shadow: var(--ap-shadow);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #f1f5f9;
}

.tanque-selector label {
    font-weight: 700;
    color: var(--ap-primary-dark);
    font-size: 14px;
    white-space: nowrap;
}

.tanque-selector select {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--ap-dark);
    transition: var(--ap-transition);
}

.tanque-selector select:focus {
    border-color: var(--ap-primary-light);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* ===== CAMERA VIEW ===== */
.camera-container {
    background: #0f172a;
    border-radius: var(--ap-radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

.camera-container img,
.camera-container iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.camera-live-badge {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.camera-live-badge .dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== LOADING ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--ap-transition);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--ap-primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== QUICK ACTION BUTTONS ===== */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.quick-action-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: var(--ap-radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--ap-transition);
    font-weight: 600;
    color: var(--ap-dark);
    text-decoration: none;
    flex: 1;
    min-width: 180px;
}

.quick-action-btn:hover {
    border-color: var(--ap-primary-light);
    background: rgba(14, 165, 233, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--ap-shadow);
    color: var(--ap-primary);
}

.quick-action-btn i {
    font-size: 20px;
    color: var(--ap-primary-light);
}

/* ===== FINANCE SUMMARY ===== */
.finance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.finance-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: var(--ap-transition);
}

.finance-item:hover {
    background: white;
    box-shadow: var(--ap-shadow);
}

.finance-item .value {
    font-size: 24px;
    font-weight: 800;
    color: var(--ap-dark);
}

.finance-item .label {
    font-size: 12px;
    color: var(--ap-gray);
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
}

.finance-item.despesa .value { color: var(--ap-danger); }
.finance-item.receita .value { color: var(--ap-success); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .kpi-value { font-size: 24px; }
    .content-header h1 { font-size: 22px; }
    .quick-action-btn { min-width: 100%; }
    .login-card { padding: 32px 24px; margin: 16px; }
}

/* ===== NOTIFICATIONS ===== */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--ap-danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--ap-gray);
}

.empty-state i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.empty-state h4 {
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
}

/* ===== DATA TABLES OVERRIDE ===== */
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
}

.dataTables_wrapper .dataTables_length select {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
}

.page-item.active .page-link {
    background: var(--ap-primary-light);
    border-color: var(--ap-primary-light);
}

/* ===== SWEETALERT CUSTOM ===== */
.swal2-popup {
    border-radius: 20px !important;
    font-family: 'Inter', sans-serif !important;
}

.swal2-title {
    font-weight: 800 !important;
}

.swal2-confirm {
    background: var(--ap-gradient) !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
}

.swal2-cancel {
    border-radius: 10px !important;
    font-weight: 600 !important;
}

/* ===== WATER QUALITY INDICATORS ===== */
.water-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 8px;
}

.water-indicator .indicator-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.water-indicator .indicator-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--ap-dark);
}

.water-indicator .indicator-label {
    font-size: 12px;
    color: var(--ap-gray);
    font-weight: 600;
}

/* ===== FEED TIMELINE ===== */
.feed-timeline {
    position: relative;
    padding-left: 24px;
}

.feed-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.feed-timeline-item {
    position: relative;
    padding: 12px 0;
    padding-left: 20px;
}

.feed-timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ap-primary-light);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--ap-primary-light);
}

.feed-timeline-item .time {
    font-weight: 700;
    color: var(--ap-primary);
    font-size: 14px;
}

.feed-timeline-item .detail {
    font-size: 13px;
    color: var(--ap-gray);
}

/* ===== NAVBAR USER ===== */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ap-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.navbar-user .user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--ap-dark);
}

.navbar-user .user-role {
    font-size: 11px;
    color: var(--ap-gray);
    font-weight: 500;
}

/* ===== WELFARE SCORE ===== */
.welfare-score {
    margin: 16px 0;
}

.welfare-score-value {
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
}

.welfare-score-value.excelente { color: #10b981; }
.welfare-score-value.atencao { color: #f59e0b; }
.welfare-score-value.alerta { color: #ef4444; }

.welfare-label {
    margin-top: 8px;
}

.welfare-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 600;
}

/* ===== WEATHER ===== */
.weather-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.weather-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.weather-item i {
    font-size: 20px;
    color: var(--ap-primary-light);
    margin-bottom: 8px;
}

.weather-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--ap-dark);
}

.weather-label {
    font-size: 11px;
    color: var(--ap-gray);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ===== CYCLE COMPARISON ===== */
.compare-table th {
    background: var(--ap-primary-dark);
    color: white;
    font-size: 12px;
    padding: 12px;
}

.compare-table td {
    padding: 12px;
    font-weight: 600;
    border-bottom: 1px solid #f1f5f9;
}

.compare-table .best-value {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.compare-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ===== PRINT REPORT ===== */
@media print {
    .main-sidebar, .main-header, .main-footer, .quick-actions, .tanque-selector, .btn, .modal { display: none !important; }
    .content-wrapper { margin: 0 !important; }
    .card-premium { box-shadow: none; border: 1px solid #ddd; }
}

.report-header {
    text-align: center;
    padding: 24px;
    background: var(--ap-gradient);
    color: white;
    border-radius: 12px;
    margin-bottom: 24px;
}

.report-header h2 {
    font-weight: 800;
    margin: 0;
}

.report-section {
    margin-bottom: 24px;
}

.report-section h4 {
    font-weight: 700;
    color: var(--ap-primary-dark);
    border-bottom: 2px solid var(--ap-primary-light);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

/* ===== AI PREDICTIONS ===== */
.ai-prediction {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: var(--ap-transition);
}

.ai-prediction:hover {
    transform: translateX(4px);
    box-shadow: var(--ap-shadow);
}

.ai-prediction.critico, .ai-prediction.alerta { background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.2); }
.ai-prediction.atencao { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.2); }
.ai-prediction.info { background: rgba(14,165,233,0.05); border-color: rgba(14,165,233,0.2); }

.ai-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--ap-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.ai-prediction.critico .ai-icon, .ai-prediction.alerta .ai-icon { background: linear-gradient(135deg, #ef4444, #f87171); }
.ai-prediction.gemini { border-left: 3px solid var(--ap-accent); }
.ai-prediction.gemini .ai-icon { background: var(--ap-gradient-accent); }

.ai-content strong { display: block; font-size: 14px; color: var(--ap-dark); }
.ai-content p { font-size: 13px; color: var(--ap-gray); margin: 4px 0 0; }

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    background: #fff;
    display: none;
    justify-content: space-around;
    align-items: stretch;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 32px rgba(15, 23, 42, 0.14);
    z-index: 2147483646;
    border-top: 1px solid #e2e8f0;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    box-sizing: border-box;
}

@media (max-width: 991.98px) {
    .mobile-bottom-nav,
    #aquaprimeMobileNav.is-visible,
    #aquaprimeMobileNav {
        display: flex !important;
    }

    body.hold-transition.sidebar-mini.layout-fixed,
    body.aquaprime-mobile-app,
    body.aquaprime-mobile-view {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .content-wrapper,
    .main-footer,
    .main-header {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .wrapper {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
}

.mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #64748b;
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    padding: 6px 4px;
    min-width: 0;
    flex: 1;
    transition: var(--ap-transition);
    border-radius: 10px;
}

.mob-nav-item i { font-size: 22px; line-height: 1; }
.mob-nav-item span { line-height: 1.1; text-align: center; }
.mob-nav-item:hover,
.mob-nav-item.active {
    color: var(--ap-primary-light);
    background: rgba(14, 165, 233, 0.08);
}

/* PWA Install Sheet (fallback se Swal indisponível) */
.pwa-install-banner {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pwa-install-banner.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.pwa-install-sheet {
    background: #fff;
    border-radius: 24px;
    padding: 24px 20px 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
    position: relative;
}

.pwa-install-sheet-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 20px;
    background: var(--ap-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.pwa-install-sheet h4 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--ap-dark);
}

.pwa-install-sheet p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 18px;
    line-height: 1.5;
}

.pwa-install-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    background: var(--ap-gradient);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 10px;
}

.pwa-install-btn-ghost {
    width: 100%;
    padding: 12px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.pwa-install-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991.98px) {
    body.hold-transition.sidebar-mini.layout-fixed {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .content-wrapper {
        margin-bottom: 0 !important;
        margin-left: 0 !important;
        min-height: calc(100vh - 56px);
        width: 100% !important;
        max-width: 100% !important;
    }

    .content-header {
        padding: 12px 0 8px;
    }

    .content-header h1 {
        font-size: 1.35rem;
    }

    .breadcrumb { font-size: 12px; }

    .tanque-selector {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .tanque-selector label {
        white-space: normal;
    }

    .tanque-selector select,
    .tanque-selector .form-select,
    .tanque-selector .btn {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }

    .kpi-card {
        padding: 16px;
    }

    .kpi-value {
        font-size: 1.5rem !important;
    }

    .investidor-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .investidor-stat {
        background: #f8fafc;
        border-radius: 12px;
        padding: 12px 8px;
        text-align: center;
    }

    .investidor-stat .stat-value {
        font-weight: 800;
        font-size: 16px;
        line-height: 1.2;
        word-break: break-word;
    }

    .investidor-stat .stat-label {
        font-size: 11px;
        color: #64748b;
        margin-top: 4px;
    }

    .investidor-stat.stat-profit .stat-value {
        color: #10b981;
        font-size: 14px;
    }

    .card-premium .card-header h3 {
        font-size: 1rem;
    }

    .campo-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .campo-btn {
        padding: 16px 10px;
    }

    .campo-btn span {
        font-size: 13px;
    }

    .main-sidebar {
        z-index: 100000 !important;
    }

    .main-header {
        z-index: 99990 !important;
        margin-left: 0 !important;
        width: 100% !important;
    }
}

@media (min-width: 992px) {
    .pwa-install-banner {
        align-items: center;
        padding-bottom: 24px;
    }

    .pwa-install-sheet {
        max-width: 380px;
    }
}

/* ===== OFFLINE BADGE ===== */
.offline-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
}

.offline-badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.offline-badge.offline {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
    animation: pulse-offline 2s infinite;
}

@keyframes pulse-offline {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.sync-count {
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    min-width: 20px;
    text-align: center;
}

/* ===== MODO CAMPO ===== */
.campo-header {
    background: white;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--ap-shadow);
    border: 1px solid #f1f5f9;
}

.campo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.campo-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--ap-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.campo-btn i {
    font-size: 36px;
    margin-bottom: 4px;
}

.campo-btn span {
    font-weight: 800;
    font-size: 15px;
    color: var(--ap-dark);
}

.campo-btn small {
    color: var(--ap-gray);
    font-size: 11px;
}

.campo-btn:hover, .campo-btn:active {
    transform: translateY(-4px);
    box-shadow: var(--ap-shadow-lg);
}

.campo-racao i { color: #10b981; }
.campo-racao:hover { border-color: #10b981; background: rgba(16,185,129,0.05); }

.campo-pesagem i { color: #0ea5e9; }
.campo-pesagem:hover { border-color: #0ea5e9; background: rgba(14,165,233,0.05); }

.campo-agua i { color: #06b6d4; }
.campo-agua:hover { border-color: #06b6d4; background: rgba(6,182,212,0.05); }

.campo-mortalidade i { color: #ef4444; }
.campo-mortalidade:hover { border-color: #ef4444; background: rgba(239,68,68,0.05); }

.campo-medicamento i { color: #8b5cf6; }
.campo-medicamento:hover { border-color: #8b5cf6; background: rgba(139,92,246,0.05); }

.campo-estoque i { color: #f59e0b; }
.campo-estoque:hover { border-color: #f59e0b; background: rgba(245,158,11,0.05); }

/* ===== SENSOR LIVE ===== */
.sensor-live-value {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -2px;
}

.sensor-pulse {
    animation: sensor-pulse 2s infinite;
}

@keyframes sensor-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
}
