/* ============================================
   ÁGUA - Sistema de Gestão de Água
   Design Minimalista com Font Awesome
   ============================================ */

:root {
    /* Cores primárias - Azul e Laranja (Parmalat) */
    --primary: #0066cc;
    --primary-light: #e6f2ff;
    --primary-dark: #004499;
    --accent: #FF8C00;
    --accent-light: #ffe6cc;
    --accent-dark: #cc7000;
    --success: #28a745;
    --success-light: #e8f5e9;
    --danger: #dc3545;
    --danger-light: #ffebee;
    --warning: #ffc107;
    --warning-light: #fff8e1;
    --info: #17a2b8;
    --info-light: #e0f7fa;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border-radius: 6px;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-700);
    background-color: var(--gray-50);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: var(--primary);
    border-bottom: 4px solid var(--accent);
    box-shadow: var(--box-shadow-lg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--gray-900);
}

.navbar-brand .logo {
    height: 60px;
    width: 60px;
    padding: 8px;
    background: white;
    border-radius: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: contain;
    transition: all 0.3s ease;
}

.navbar-brand .app-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--gray-900);
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.navbar-menu a {
    text-decoration: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.navbar-menu a.active {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
}

/* Menu Toggle Button (Hamburger) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    z-index: 1001;
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle i {
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: absolute;
}

.menu-toggle.active i.bi-list {
    opacity: 0;
    transform: rotate(-90deg) scale(0.8);
}

.menu-toggle.active i.bi-x-lg {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.menu-toggle i.bi-x-lg {
    opacity: 0;
    transform: rotate(90deg) scale(0.8);
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.navbar-user .user-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 20px;
}

.navbar-user .user-link:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.navbar-user .user-name {
    font-weight: 600;
    min-width: 100px;
}

.navbar-user .user-perfil {
    background-color: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.navbar-user .btn-logout {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.navbar-user .btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
body.autenticado {
    padding-top: 80px;
}

.main-container {
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

main {
    padding: 2rem 0;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.page-header h1 {
    font-size: 28px;
    color: var(--gray-900);
    margin: 0;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn, button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    background-color: var(--gray-200);
    color: var(--gray-700);
    min-height: 44px;
}

.btn:hover, button:hover {
    background-color: var(--gray-300);
    transform: translateY(-2px);
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}

.btn-accent:hover {
    background-color: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-info {
    background-color: var(--info);
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 12px;
    min-height: auto;
}

.btn-block {
    width: 100%;
}

/* ============================================
   FILTERS
   ============================================ */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.input-filter {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    flex: 1;
    min-width: 150px;
    min-height: 44px;
    transition: all 0.2s ease;
}

.input-filter:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

@media (max-width: 768px) {
    .filters {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .input-filter {
        width: 100%;
    }
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.input-form {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, rgba(0, 102, 204, 0.05), rgba(255, 140, 0, 0.05));
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--primary);
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0;
    transition: color 0.2s ease;
}

.btn-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   TABLES
   ============================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table thead {
    background: var(--primary);
    border-bottom: 2px solid var(--accent);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    overflow-x: auto;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background-color: var(--success-light);
    color: #1b5e20;
}

.badge-danger {
    background-color: var(--danger-light);
    color: #b71c1c;
}

.badge-warning {
    background-color: var(--warning-light);
    color: #f57f17;
}

.badge-info {
    background-color: var(--info-light);
    color: #00838f;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.badge-accent {
    background-color: var(--accent-light);
    color: var(--accent-dark);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-success {
    background-color: var(--success-light);
    color: #1b5e20;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background-color: var(--danger-light);
    color: #b71c1c;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background-color: var(--warning-light);
    color: #f57f17;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background-color: var(--info-light);
    color: #00838f;
    border-left: 4px solid var(--info);
}

/* ============================================
   LOADING
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--gray-500);
}

.loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 1rem;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
        justify-content: center;
    }

    /* Mobile Menu Drawer */
    .menu-toggle {
        display: flex !important;
    }

    .navbar-menu {
        position: fixed;
        left: 0;
        top: 70px;
        width: 280px;
        background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
        flex-direction: column;
        gap: 0;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: 4px 0 12px rgba(0,0,0,0.2);
        border-radius: 0;
    }

    .navbar-menu.active {
        transform: translateX(0);
    }

    .navbar-menu li {
        width: 100%;
    }

    .navbar-menu a {
        padding: 16px;
        border-radius: 0;
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        justify-content: flex-start;
    }

    .navbar-menu a:hover {
        background-color: rgba(255, 255, 255, 0.15);
        padding-left: 20px;
    }

    /* Menu Overlay */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .navbar-menu.active ~ .menu-overlay {
        display: block;
        opacity: 1;
    }

    .filters {
        flex-direction: column;
    }

    .input-filter {
        min-width: 100%;
    }

    .table th, .table td {
        padding: 0.75rem 0.5rem;
        font-size: 12px;
    }

    .modal-content {
        width: 95%;
        margin: 20% auto;
    }
}

/* ============================================
   DETAIL SECTIONS
   ============================================ */
.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.75rem;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row label {
    font-weight: 600;
    color: var(--gray-700);
    flex: 0 0 40%;
}

.detail-value {
    flex: 1;
    text-align: right;
    color: var(--gray-600);
}

/* ============================================
   DASHBOARD CARD BUTTONS (MOBILE-FIRST)
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--gray-900);
    text-align: center;
    min-height: 160px;
}

.card-button:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 102, 204, 0.15);
}

.card-button .card-icon {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.card-button h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.card-button h3 i {
    color: var(--accent);
    font-size: 18px;
}

.card-button .card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin: 0.5rem 0;
}

.card-button .card-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

/* Quick Summary Section */
.quick-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.quick-summary h2 {
    font-size: 18px;
    margin: 0 0 1rem 0;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
}

.summary-item i {
    font-size: 28px;
    margin-bottom: 0.5rem;
}

.summary-item span {
    font-size: 13px;
    color: var(--gray-600);
    text-align: center;
}

.summary-item strong {
    font-size: 18px;
    color: var(--gray-900);
    display: block;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .card-button {
        min-height: 140px;
        padding: 1rem;
    }

    .card-button .card-icon {
        font-size: 28px;
    }

    .card-button h3 {
        font-size: 14px;
    }

    .card-button .card-value {
        font-size: 20px;
    }
}

/* ============================================
   MOBILE-FIRST RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    html, body {
        font-size: 13px;
    }

    .navbar .container {
        padding: 0.75rem;
    }

    .navbar-brand .app-name {
        font-size: 14px;
    }

    .navbar-menu {
        gap: 0.25rem;
    }

    .navbar-menu a {
        padding: 0.5rem 0.75rem;
        font-size: 12px;
    }

    main {
        padding: 1rem 0;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .page-actions {
        width: 100%;
        gap: 0.5rem;
    }

    .page-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
        font-size: 13px;
        padding: 0.75rem;
    }

    .btn-sm {
        width: auto;
        padding: 0.5rem 0.75rem;
    }

    .input-form, input, select, textarea {
        padding: 0.75rem;
        min-height: 44px;
        font-size: 16px;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 13px;
    }

    .modal-content {
        width: 95%;
        max-width: 100%;
        margin: 20% auto;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .modal-body {
        padding: 1rem;
    }

    .table {
        font-size: 12px;
    }

    .table th {
        padding: 0.75rem;
        font-size: 12px;
    }

    .table td {
        padding: 0.75rem;
    }

    .badge {
        padding: 0.25rem 0.5rem;
        font-size: 10px;
    }

    .alert {
        margin: 0.75rem 0;
        padding: 0.75rem;
        font-size: 12px;
    }

    .loading {
        padding: 1.5rem;
        font-size: 13px;
    }

    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

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

    .card-content h3 {
        font-size: 14px;
    }

    .card-content .card-value {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    html, body {
        font-size: 12px;
    }

    main {
        padding: 0.75rem 0;
    }

    .page-header h1 {
        font-size: 18px;
    }

    .container {
        padding: 0 0.75rem;
    }

    .btn {
        width: 100%;
        font-size: 12px;
        padding: 0.75rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .card-button {
        min-height: 120px;
        padding: 0.75rem;
    }

    .card-button h3 {
        font-size: 12px;
    }

    .card-button .card-value {
        font-size: 18px;
    }

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

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 30% auto;
    }

    .table {
        display: block;
        overflow-x: auto;
    }

    .input-filter {
        width: 100%;
    }
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--gray-900);
    color: white;
    padding: 1.5rem;
    text-align: center;
    border-top: 2px solid var(--primary);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    margin-top: auto;
    width: 100%;
}

footer p {
    margin: 0.25rem 0;
    font-size: 13px;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ============================================
   MODAL DE AÇÕES (DEBITOS)
   ============================================ */
.acoes-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.acao-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    justify-content: flex-start;
}

.acao-btn i {
    font-size: 18px;
}

.acao-btn.info {
    background-color: var(--info-light);
    color: #00838f;
    border: 1px solid #00838f;
}

.acao-btn.info:hover {
    background-color: #e0f7fa;
    transform: translateX(4px);
}

.acao-btn.success {
    background-color: var(--success-light);
    color: #1b5e20;
    border: 1px solid #1b5e20;
}

.acao-btn.success:hover {
    background-color: #e8f5e9;
    transform: translateX(4px);
}

.acao-btn.warning {
    background-color: var(--warning-light);
    color: #f57f17;
    border: 1px solid #f57f17;
}

.acao-btn.warning:hover {
    background-color: #fff8e1;
    transform: translateX(4px);
}

.acao-btn.danger {
    background-color: var(--danger-light);
    color: #b71c1c;
    border: 1px solid #b71c1c;
}

.acao-btn.danger:hover {
    background-color: #ffebee;
    transform: translateX(4px);
}

/* ============================================
   TARIFA E CÁLCULO (MEDIÇÕES)
   ============================================ */
.tarifa-preview {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), rgba(255, 140, 0, 0.05));
    padding: 1.5rem;
    border-radius: 8px;
}

.tarifa-regra {
    margin-bottom: 1rem;
}

.regra-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.regra-box.success {
    background-color: var(--success-light);
    border-left-color: var(--success);
    color: #1b5e20;
}

.regra-box.info {
    background-color: var(--info-light);
    border-left-color: var(--info);
    color: #00838f;
}

.regra-box i {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.regra-box strong {
    display: block;
    font-size: 14px;
    margin-bottom: 0.25rem;
}

.regra-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.tarifa-detalhes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tarifa-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
}

.tarifa-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 14px;
}

.tarifa-label i {
    font-size: 16px;
    color: var(--primary);
}

.valor-consumo {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.valor {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
}

.tarifa-row.tarifa-total {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 1rem;
    margin-top: 0.5rem;
}

.tarifa-label-total {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.tarifa-label-total i {
    font-size: 18px;
    color: var(--accent);
}

.valor-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

/* ============================================
   PAGE SUBTITLE
   ============================================ */
.page-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0.5rem 0 0 0;
}

/* ============================================
   FILTERS CONTAINER
   ============================================ */
.filters-container {
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.filter-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group i {
    position: absolute;
    left: 1rem;
    color: var(--gray-400);
    pointer-events: none;
}

.filter-group input,
.filter-group select {
    padding-left: 2.5rem;
}

/* ============================================
   TABLE CONTAINER & RESPONSIVE
   ============================================ */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: var(--primary);
    border-bottom: 2px solid var(--accent);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 13px;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table code {
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: var(--primary);
}

.table .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 12px;
    white-space: nowrap;
}

/* ============================================
   CLIENTS CONTAINER (LEGACY - CARD VIEW)
   ============================================ */
.clients-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.client-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.client-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), rgba(255, 140, 0, 0.05));
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.client-info h3 {
    margin: 0;
    font-size: 16px;
    color: var(--gray-900);
    font-weight: 700;
}

.client-number {
    margin: 0.5rem 0 0 0;
    font-size: 12px;
    color: var(--gray-500);
}

.client-details {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
}

.client-actions {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.5rem;
}

.client-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* ============================================
   RESPONSIVE TABLE
   ============================================ */
@media (max-width: 1024px) {
    .table th {
        padding: 0.75rem;
        font-size: 12px;
    }

    .table td {
        padding: 0.75rem;
        font-size: 12px;
    }

    .table th i,
    .table td i {
        margin-right: 0.25rem;
    }
}

@media (max-width: 768px) {
    body.autenticado {
        padding-top: 90px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
        font-size: 12px;
    }

    .table th {
        padding: 0.5rem;
        font-size: 11px;
        white-space: nowrap;
    }

    .table td {
        padding: 0.5rem;
    }

    .table th i {
        display: none;
    }

    .table .btn-sm {
        padding: 0.375rem 0.5rem;
        font-size: 11px;
    }

    .navbar .container {
        padding: 0.75rem;
    }

    .navbar-brand .logo {
        height: 45px;
        width: 45px;
        padding: 6px;
    }

    .navbar-menu {
        gap: 0.25rem;
    }

    .navbar-menu a {
        padding: 0.5rem;
        font-size: 12px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header h1 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    body.autenticado {
        padding-top: 100px;
    }

    .table {
        min-width: 100%;
        font-size: 11px;
    }

    .table th,
    .table td {
        padding: 0.375rem;
        font-size: 11px;
    }

    .table code {
        font-size: 10px;
        padding: 0.125rem 0.25rem;
    }

    .table .btn-sm {
        padding: 0.25rem 0.375rem;
        font-size: 10px;
    }

    .navbar .container {
        padding: 0.5rem;
    }

    .navbar-brand .logo {
        height: 40px;
        width: 40px;
        padding: 5px;
    }

    .navbar-menu a {
        padding: 0.375rem;
        font-size: 11px;
    }

    .page-header h1 {
        font-size: 18px;
    }

    .filters-container {
        padding: 0.75rem;
    }

    .filter-group {
        width: 100%;
    }

    .input-filter {
        width: 100%;
    }
}

/* ============================================
   DASHBOARD CARD WRAPPER
   ============================================ */
.dashboard-card {
    margin-bottom: 28px;
}

/* ============================================
   DASHBOARD SECTION AS CARD
   ============================================ */
.dashboard-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbfc 100%);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(78, 205, 196, 0.1);
    transition: all 0.3s ease;
}

.dashboard-section:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.dashboard-section h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-section h2 i {
    color: #4ECDC4;
}

/* ============================================
   RESUMO TABLE STYLES
   ============================================ */
.resumo-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.resumo-table thead {
    background: linear-gradient(135deg, #4ECDC4 0%, #3ba89f 100%);
    color: white;
}

.resumo-table th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: white;
}

.resumo-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.resumo-table tbody tr:last-child {
    border-bottom: none;
}

.resumo-table tbody tr:hover {
    background-color: rgba(78, 205, 196, 0.05);
}

.resumo-table td {
    padding: 16px;
    font-size: 14px;
}

.resumo-desc {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #1a1a2e;
}

.resumo-desc i {
    font-size: 18px;
    color: #4ECDC4;
    min-width: 24px;
    text-align: center;
}

.resumo-valor-grande {
    font-size: 18px;
    font-weight: 800;
    color: #4ECDC4;
    text-align: center;
}

.resumo-obs {
    color: #999;
    font-size: 12px;
    font-weight: 500;
    text-align: right;
}

.resumo-pago-row {
    background: linear-gradient(90deg, rgba(81, 207, 102, 0.08) 0%, rgba(81, 207, 102, 0) 100%);
}

.resumo-pago-row .resumo-valor-grande {
    color: #51CF66;
}

.resumo-pago-row .resumo-desc i {
    color: #51CF66;
}

/* Responsive Table */
@media (max-width: 768px) {
    .dashboard-section {
        padding: 20px;
        border-radius: 12px;
    }
    
    .dashboard-section h2 {
        font-size: 16px;
    }
    
    .resumo-table {
        font-size: 12px;
        border-radius: 8px;
    }
    
    .resumo-table th {
        padding: 12px 10px;
        font-size: 10px;
    }
    
    .resumo-table td {
        padding: 12px 10px;
    }
    
    .resumo-desc {
        gap: 8px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .resumo-desc i {
        font-size: 16px;
    }
    
    .resumo-valor-grande {
        font-size: 16px;
        text-align: left;
    }
    
    .resumo-obs {
        font-size: 10px;
        text-align: left;
    }
}

/* ============================================
   FOOTER
   ============================================ */
