/* ========================================================
   GPF - GESTOR DE PODA E FAIXA
   DESIGN SYSTEM & CSS CORE (Dark Modern UI)
======================================================== */

:root {
    --bg-main: #0c111d;
    --bg-card: #151d2f;
    --bg-card-hover: #1c263d;
    --bg-card-subtle: #111827;
    --bg-header: #0f1626;
    --bg-sidebar: #0a0e1a;
    
    --border-color: #222f49;
    --border-light: #2d3e5f;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --color-primary: #10b981;        /* Esmeralda / Poda */
    --color-primary-dark: #059669;
    --color-primary-light: #34d399;
    
    --color-warning: #f59e0b;        /* Pendente / Atenção */
    --color-orange: #f97316;         /* Resíduo Pendente */
    --color-danger: #ef4444;         /* Urgente Imediata */
    --color-info: #3b82f6;           /* Linha Viva */
    --color-purple: #8b5cf6;         /* Linha Morta */
    --color-adicional: #a855f7;      /* Adicional em Campo */

    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: #ffffff;
    font-weight: 600;
}

a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary);
}

/* App Layout Grid */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

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

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

.logo-icon {
    font-size: 24px;
    background: rgba(16, 185, 129, 0.15);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    display: block;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--color-primary-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.system-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1px;
    padding: 12px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: #fff;
    border-left: 3px solid var(--color-primary);
}

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

.badge-counter {
    background-color: var(--color-orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-info) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 13px;
}

.user-name {
    font-weight: 600;
    color: #fff;
    font-size: 13px;
    display: block;
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    color: var(--text-dim);
}

.btn-logout {
    font-size: 18px;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}
.btn-logout:hover {
    color: var(--color-danger);
}

/* App Main */
.app-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    height: 64px;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 90;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Alerta em Tempo Real no Header */
.btn-alert-bell {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-2px); }
}

.alert-pulse-badge {
    background-color: #fff;
    color: #b91c1c;
    border-radius: 50%;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 800;
}

.quick-links {
    display: flex;
    gap: 8px;
}

.main-body {
    padding: 24px;
    flex: 1;
}

/* Field Layout (Mobile / Fullscreen) */
.layout-field {
    background-color: #0b0f19;
}
.layout-field .field-topbar {
    height: 56px;
    background-color: #111827;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.field-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.field-logo {
    font-size: 22px;
}
.field-title {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    display: block;
    line-height: 1.1;
}
.field-user {
    font-size: 11px;
    color: var(--text-muted);
}
.field-content {
    height: calc(100vh - 56px);
    position: relative;
}

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

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

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

/* Banner de Alerta Urgente */
.alert-banner-urgente {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(245, 158, 11, 0.15) 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.alert-banner-icon {
    font-size: 26px;
}

.alert-banner-content {
    flex: 1;
    font-size: 14px;
    color: #fff;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

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

.kpi-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

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

.kpi-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1;
}

.kpi-footer {
    font-size: 11px;
    color: var(--text-dim);
}

/* Cores dos KPIs */
.kpi-warning { border-left: 4px solid var(--color-warning); }
.kpi-orange { border-left: 4px solid var(--color-orange); }
.kpi-success { border-left: 4px solid var(--color-primary); }
.kpi-danger { border-left: 4px solid var(--color-danger); }
.kpi-info { border-left: 4px solid var(--color-info); }
.kpi-purple { border-left: 4px solid var(--color-purple); }
.kpi-primary { border-left: 4px solid #10b981; }

/* Grid Dashboard */
.dashboard-split-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .dashboard-split-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Tabelas */
.table-responsive {
    overflow-x: auto;
}

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

.table th {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.badge-lv {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-lm {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-pi {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.badge-orange {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-secondary {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

.badge-status-aberta { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-status-em_execucao { background: rgba(245, 158, 11, 0.2); color: #fde047; }
.badge-status-pendente_recolhimento { background: rgba(249, 115, 22, 0.2); color: #fdba74; }
.badge-status-concluida { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

/* Progress Bar */
.progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--bg-card-hover);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, #34d399 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

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

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

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

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    color: #fff;
}

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

.btn-warning {
    background: linear-gradient(135deg, var(--color-warning) 0%, #d97706 100%);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary-light);
}
.btn-outline-primary:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}
.btn-outline-danger:hover {
    background: var(--color-danger);
    color: #fff;
}

.btn-outline-success {
    background: transparent;
    border: 1px solid #10b981;
    color: #34d399;
}
.btn-outline-success:hover {
    background: #10b981;
    color: #fff;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.text-required::after {
    content: " *";
    color: var(--color-danger);
}

.form-input {
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.form-row {
    display: flex;
    gap: 12px;
}
.col-6 { flex: 1; }
.col-8 { flex: 2; }
.col-4 { flex: 1; }
.row { display: flex; gap: 20px; }

/* Modais */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease-out;
}

.modal-lg {
    max-width: 800px;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

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

.modal-body {
    padding: 24px;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    animation: slideInRight 0.3s ease-out;
    min-width: 280px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-left: 4px solid var(--color-primary); }
.toast-danger { border-left: 4px solid var(--color-danger); }
.toast-warning { border-left: 4px solid var(--color-warning); }

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.activity-icon {
    font-size: 18px;
    padding-top: 2px;
}

.activity-content {
    flex: 1;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 2px;
}

.activity-user {
    font-weight: 600;
    color: #fff;
}

.activity-time {
    color: var(--text-dim);
}

.activity-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.activity-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: var(--color-primary-light);
    margin-top: 4px;
}

/* Auth Page */
.page-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #152238 0%, #0a0e1a 100%);
    padding: 20px;
}

.auth-wrapper {
    width: 100%;
    max-width: 480px;
}

.auth-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 36px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand-icon {
    font-size: 42px;
    margin-bottom: 8px;
}

.auth-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

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

.quick-access-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin: 24px 0 12px;
    text-align: center;
}

.quick-roles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-role {
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

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

/* Extrato Impresso */
@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    .extrato-sheet { box-shadow: none !important; border: none !important; padding: 0 !important; color: #000 !important; }
    .table { color: #000 !important; }
    .table th, .table td { border-color: #ddd !important; }
}

.extrato-sheet {
    background-color: #fff;
    color: #111827;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
}

.extrato-title {
    color: #111827;
    font-size: 20px;
    font-weight: 800;
}
.extrato-sub {
    color: #6b7280;
    font-size: 12px;
}
.extrato-code {
    font-family: monospace;
    font-size: 16px;
    font-weight: 700;
    color: #059669;
}
.extrato-info-box {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
}
.extrato-assinaturas-row {
    display: flex;
    justify-content: space-around;
}
.assinatura-box {
    text-align: center;
    width: 250px;
}
.linha-assinatura {
    border-top: 1px solid #9ca3af;
    margin-bottom: 8px;
}

/* Imagens */
.img-preview-sm {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.img-preview-thumb {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.img-preview-xs {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}
.img-solicitacao-zoom {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid var(--border-color);
}
.solicitacao-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s;
}
.solicitacao-split {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
}
@media (max-width: 768px) {
    .solicitacao-split {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   SISTEMA RESPONSIVO TOTAL — GPF MOBILE & DESKTOP COLLAPSIBLE SIDEBAR
   ========================================================================== */

/* 1. Backdrop para gaveta Mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* 2. Botão Menu Sanduíche (☰) */
.btn-hamburger {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    width: 42px;
    height: 42px;
    padding: 10px 9px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    transition: all 0.2s ease;
}
.btn-hamburger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}
.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #f3f4f6;
    border-radius: 2px;
    transition: all 0.25s ease;
}

/* 3. Botão Toggle no Header (Desktop) */
.btn-toggle-header-desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-toggle-header-desktop:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* 4. Botão Toggle dentro da Sidebar (Desktop ◀ / ▶) */
.btn-toggle-desktop {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-toggle-desktop:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.4);
}

/* 5. Botão Fechar no Mobile (✕) */
.btn-close-mobile {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9ca3af;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.btn-close-mobile:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* 6. Transições da Sidebar */
.app-sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-main {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 7. ESTADO DESKTOP: SIDEBAR RECOLHIDA / ENCOLHIDA (72px) */
@media (min-width: 993px) {
    .app-layout.sidebar-collapsed .app-sidebar {
        width: 72px;
    }
    .app-layout.sidebar-collapsed .app-main {
        margin-left: 72px;
    }
    .app-layout.sidebar-collapsed .brand-logo .logo-text,
    .app-layout.sidebar-collapsed .system-status-indicator,
    .app-layout.sidebar-collapsed .nav-section-title,
    .app-layout.sidebar-collapsed .nav-label,
    .app-layout.sidebar-collapsed .badge-counter,
    .app-layout.sidebar-collapsed .user-info,
    .app-layout.sidebar-collapsed .btn-logout {
        display: none !important;
    }
    .app-layout.sidebar-collapsed .sidebar-header {
        padding: 16px 10px;
        justify-content: center;
    }
    .app-layout.sidebar-collapsed .sidebar-header .brand-logo {
        gap: 0;
    }
    .app-layout.sidebar-collapsed .btn-toggle-desktop {
        position: absolute;
        right: -13px;
        top: 20px;
        background: #1e293b;
        border: 1px solid #3b82f6;
        color: #60a5fa;
        border-radius: 50%;
        width: 26px;
        height: 26px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
        z-index: 105;
    }
    .app-layout.sidebar-collapsed .sidebar-nav {
        padding: 16px 8px;
    }
    .app-layout.sidebar-collapsed .nav-item {
        justify-content: center;
        padding: 12px 0;
        margin-bottom: 6px;
        border-radius: 10px;
    }
    .app-layout.sidebar-collapsed .nav-icon {
        margin: 0;
        font-size: 20px;
    }
    .app-layout.sidebar-collapsed .sidebar-footer {
        padding: 12px 6px;
        justify-content: center;
    }
    .app-layout.sidebar-collapsed .user-profile-badge {
        padding: 0;
        background: transparent;
        border: none;
    }
    .app-layout.sidebar-collapsed .user-avatar {
        margin: 0;
    }
}

/* 8. ESTADO MOBILE & TABLET (Telas <= 992px) */
@media (max-width: 992px) {
    .btn-hamburger {
        display: flex !important;
    }
    .btn-toggle-header-desktop,
    .btn-toggle-desktop {
        display: none !important;
    }
    .btn-close-mobile {
        display: flex !important;
    }

    .app-sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 290px !important;
        max-width: 85vw !important;
        z-index: 99999 !important;
        transform: translateX(-100%);
        box-shadow: none;
    }
    .app-sidebar.sidebar-open-mobile {
        transform: translateX(0) !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.9) !important;
    }

    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
    }

    .app-header {
        padding: 12px 16px;
        height: auto;
        min-height: 60px;
        gap: 12px;
        flex-wrap: wrap;
    }
    .header-breadcrumb {
        font-size: 12px;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 4px;
        flex-wrap: wrap;
    }
    .quick-links {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    .quick-links .btn {
        flex: 1;
        justify-content: center;
        text-align: center;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Empilhamento de Grids e Colunas */
    .row {
        flex-direction: column !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .col-8, .col-4, .col-6, .col-lg-6, .col-lg-8, .col-lg-4, .col-md-6, .col-md-4, .col-md-8, .col-12 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .main-body {
        padding: 16px 12px;
    }
}

/* 9. REFINAMENTOS ESPECÍFICOS PARA SMARTPHONES (<= 768px e <= 576px) */
@media (max-width: 768px) {
    .page-header, .page-header-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    .page-title {
        font-size: 20px !important;
    }
    .page-subtitle {
        font-size: 12px !important;
    }

    /* Tabelas responsivas com toque suave */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
        margin-bottom: 16px;
    }
    .table {
        min-width: 580px;
    }

    /* Cards e Formulários */
    .card {
        padding: 16px !important;
        border-radius: 14px !important;
    }

    /* Modais Fullscreen no Celular */
    .modal-overlay, .modal-custom-overlay {
        padding: 8px !important;
        align-items: flex-end !important;
    }
    .modal-card, .modal-custom-box {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh !important;
        border-radius: 20px 20px 8px 8px !important;
    }
    .modal-header, .modal-custom-header {
        padding: 14px 16px !important;
    }
    .modal-body, .modal-custom-body {
        padding: 16px !important;
    }
    .modal-footer, .modal-custom-footer {
        padding: 14px 16px !important;
        flex-wrap: wrap !important;
    }
    .modal-footer .btn, .modal-custom-footer .btn {
        width: 100% !important;
        margin-bottom: 6px;
    }

    /* Mapa no Celular */
    .map-controls-panel {
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        padding: 12px !important;
    }
    .map-filters-row {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .filter-col {
        width: 100% !important;
        flex: none !important;
    }
    .btn-map-add-point {
        bottom: 24px !important;
        right: 16px !important;
        padding: 12px 18px !important;
        font-size: 13px !important;
    }

    /* Solicitacao split cards */
    .solicitacao-split {
        grid-template-columns: 1fr !important;
    }
    .solicitacao-foto-col {
        max-height: 200px;
    }
    .solicitacao-footer .footer-actions {
        flex-direction: column !important;
    }
    .solicitacao-footer .footer-actions .btn {
        width: 100% !important;
    }
}
