/* ========================================
   SISTEMA DE MEDIO AMBIENTE - ESTILOS
   Basado en el diseño del sistema EDEP
   ======================================== */

/* Importar fuente Nunito desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800&display=swap');

:root {
    --primary-color: #2d8659;
    --primary-dark: #1e5d3f;
    --secondary-color: #16a085;
    --secondary-dark: #0e6b5a;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #1abc9c;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --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;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
}

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

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-bg);
    color: var(--gray-800);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

.admin-container {
    display: block;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    width: 100%;
}

/* Variable CSS para controlar el ancho del sidebar */
:root {
    --sidebar-width: 320px;
    --sidebar-minimized-width: 80px;
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    width: 320px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

/* Scrollbar personalizado para el sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Estado minimizado del sidebar */
.sidebar.minimized {
    width: 80px;
}

.sidebar.minimized .sidebar-header .sidebar-logo,
.sidebar.minimized .sidebar-header .sidebar-subtitle,
.sidebar.minimized .sidebar-user .user-info,
.sidebar.minimized .nav-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.minimized .sidebar-header {
    padding: 20px 10px;
}

.sidebar.minimized .sidebar-user {
    justify-content: center;
    padding: 15px 10px;
}

.sidebar.minimized .nav-link {
    justify-content: center;
    padding: 15px;
}

.sidebar.minimized .nav-link i {
    margin: 0;
}

.sidebar.minimized .nav-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    margin-left: 15px;
    background: var(--gray-800);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Ocultar separador cuando está minimizado */
.sidebar.minimized .sidebar-nav > div[style*="border-bottom"] {
    display: none;
}

/* Botón toggle para minimizar/expandir */
.sidebar-toggle {
    margin-right: 20px;
    position: absolute;
    top: 20px;
    left: 20px;
    width: 30px;
    height: 30px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    color: var(--primary-color);
}

.sidebar-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.sidebar-toggle i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.sidebar.minimized .sidebar-toggle {
    right: -15px;
}

.sidebar.minimized .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-header {
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    transition: padding 0.3s ease;
    position: relative;
}

.sidebar-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-subtitle {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
    font-weight: 300;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-user {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: padding 0.3s ease, justify-content 0.3s ease;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid rgba(255,255,255,0.3);
}

.user-info {
    transition: opacity 0.3s ease, width 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
}

.user-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: white;
}

.user-role {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.3);
}

.sidebar-nav {
    padding: 20px 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
    white-space: nowrap;
}

.nav-link span {
    transition: opacity 0.3s ease, width 0.3s ease;
    overflow: hidden;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: rgba(255,255,255,0.5);
}

.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
    border-left-color: white;
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* ========================================
   CONTENIDO PRINCIPAL
   ======================================== */

.main-content {
    margin-left: var(--sidebar-width) !important;
    padding-left: 0 !important;
    width: calc(100% - var(--sidebar-width)) !important;
    max-width: calc(100vw - var(--sidebar-width)) !important;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
    float: right;
}

.main-content.sidebar-minimized {
    margin-left: var(--sidebar-minimized-width) !important;
    width: calc(100% - var(--sidebar-minimized-width)) !important;
    max-width: calc(100vw - var(--sidebar-minimized-width)) !important;
}

/* Selector CSS puro como respaldo - cuando sidebar tiene clase minimized */
.sidebar.minimized ~ .main-content {
    margin-left: var(--sidebar-minimized-width) !important;
    width: calc(100% - var(--sidebar-minimized-width)) !important;
    max-width: calc(100vw - var(--sidebar-minimized-width)) !important;
}

/* Optimización de espacio cuando el sidebar está minimizado */
.main-content.sidebar-minimized .dashboard-grid,
.sidebar.minimized ~ .main-content .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.main-content.sidebar-minimized .content,
.sidebar.minimized ~ .main-content .content {
    padding: 30px 40px;
}

/* Mejorar el uso del espacio en tablas cuando sidebar está minimizado */
.main-content.sidebar-minimized .table-container,
.sidebar.minimized ~ .main-content .table-container {
    overflow-x: auto;
    width: 100%;
}

.main-content.sidebar-minimized .modern-table,
.sidebar.minimized ~ .main-content .modern-table {
    min-width: 100%;
    width: 100%;
}

.top-bar {
    background: white;
    padding: 20px 30px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title i {
    color: var(--primary-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info-top {
    text-align: right;
    color: var(--gray-600);
}

.user-name {
    font-weight: 600;
    color: var(--gray-800);
}

.user-role-top {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--primary-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--danger-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.content {
    padding: 30px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ========================================
   DASHBOARD CARDS
   ======================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
    width: 100%;
    box-sizing: border-box;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--gray-200);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.card-icon.denuncias { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.card-icon.inspecciones { background: linear-gradient(135deg, #2d8659, #1e5d3f); }
.card-icon.calendario { background: linear-gradient(135deg, #16a085, #0e6b5a); }
.card-icon.reportes { background: linear-gradient(135deg, #27ae60, #229954); }
.card-icon.configuracion { background: linear-gradient(135deg, #34495e, #2c3e50); }

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-800);
}

.card-subtitle {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-800);
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.card-action {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

/* ========================================
   DASHBOARD MEJORADO - DISEÑO MINIMALISTA
   ======================================== */

.dashboard-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.dashboard-main-card {
    background: white;
    border-radius: 16px;
    padding: 35px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
}

.dashboard-main-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.main-card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.main-card-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
}

.main-card-icon.denuncias {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.main-card-info {
    flex: 1;
}

.main-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 5px 0;
}

.main-card-subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin: 0;
}

.main-card-stats {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 25px 0;
    margin: 20px 0;
    background: var(--gray-50);
    border-radius: 12px;
    gap: 15px;
}

.main-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.main-stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.2;
    margin-bottom: 5px;
}

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

.main-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--gray-300);
    flex-shrink: 0;
}

.main-card-action {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.main-card-action .btn {
    width: 100%;
    justify-content: center;
}

/* Estadísticas Adicionales */
.stats-section {
    margin-bottom: 40px;
}

.stats-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-section-title i {
    color: var(--primary-color);
}

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

.stat-box {
    background: white;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

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

.stat-box-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.stat-box-content {
    flex: 1;
}

.stat-box-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.2;
    margin-bottom: 5px;
}

.stat-box-label {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 600;
}

/* Accesos Rápidos */
.quick-access-section {
    margin-bottom: 40px;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.quick-access-item {
    background: white;
    border-radius: 12px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--gray-700);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.quick-access-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}

.quick-access-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.quick-access-item span {
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

/* ========================================
   BOTONES
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

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

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

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

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

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

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

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

.btn-info:hover {
    background: #16a085;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

/* ========================================
   FORMULARIOS
   ======================================== */

.form-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 30px;
    border: 1px solid var(--gray-200);
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(45, 134, 89, 0.12), var(--shadow-md);
    transform: translateY(-1px);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background: var(--gray-50);
    color: var(--gray-500);
    cursor: not-allowed;
    border-color: var(--gray-200);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Input wrapper para iconos */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--gray-400);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 1;
}

.input-wrapper input,
.input-wrapper select {
    padding-left: 45px;
    width: 100%;
}

.input-wrapper input:focus ~ i,
.input-wrapper select:focus ~ i,
.input-wrapper:focus-within i {
    color: var(--primary-color);
}

/* Select styling mejorado */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
}

.input-wrapper select {
    background-position: right 16px center;
    padding-right: 40px;
}

select:hover {
    cursor: pointer;
}

select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232d8659' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* Inputs en config-item */
.config-item input,
.config-item select {
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.config-item input:hover,
.config-item select:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow);
}

.config-item input:focus,
.config-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(45, 134, 89, 0.12), var(--shadow-md);
    transform: translateY(-1px);
}

/* Inputs de tipo time */
input[type="time"] {
    font-size: 1rem;
    padding: 14px 18px;
    cursor: pointer;
}

input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Inputs de tipo number */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Inputs de tipo email */
input[type="email"] {
    text-transform: lowercase;
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder {
    color: var(--gray-400);
    opacity: 1;
}

input:focus::placeholder,
textarea:focus::placeholder {
    opacity: 0.6;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* ========================================
   TABLAS
   ======================================== */

.table-container {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.modern-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.modern-table th {
    padding: 15px 12px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

.modern-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--gray-100);
}

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

.modern-table td {
    padding: 20px;
    vertical-align: middle;
}

/* ========================================
   ESTADOS
   ======================================== */

.estado-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.estado-pendiente {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.estado-en-proceso {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.estado-resuelta {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.estado-rechazada {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* ========================================
   TIPOS DE DENUNCIA
   ======================================== */

.tipo-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tipo-residuos {
    background: #fef3c7;
    color: #78350f;
    border: 1px solid #f59e0b;
}

.tipo-contaminacion-agua {
    background: #dbeafe;
    color: #1e3a8a;
    border: 1px solid #3b82f6;
}

.tipo-contaminacion-aire {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #6366f1;
}

.tipo-ruidos {
    background: #fce7f3;
    color: #831843;
    border: 1px solid #ec4899;
}

.tipo-quema {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #ef4444;
}

.tipo-deforestacion {
    background: #dcfce7;
    color: #14532d;
    border: 1px solid #22c55e;
}

.tipo-derroche-agua {
    background: #cffafe;
    color: #164e63;
    border: 1px solid #06b6d4;
}

.tipo-conexion-ilegal-cloacas {
    background: #fde68a;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.tipo-terreno-abandonado {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #6b7280;
}

.tipo-fauna {
    background: #fce7f3;
    color: #9f1239;
    border: 1px solid #f43f5e;
}

.tipo-otros {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #9ca3af;
}

/* ========================================
   ALERTAS
   ======================================== */

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.alert-success {
    background: #f0fff4;
    color: #2f855a;
    border-color: #9ae6b4;
}

.alert-error {
    background: #fee;
    color: #c53030;
    border-color: #feb2b2;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fcd34d;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #93c5fd;
}

.alert i {
    font-size: 1.2rem;
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: block;
}

.modal-content {
    background: white;
    margin: 2vh auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease;
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid var(--gray-100);
    background: white;
    border-radius: 15px 15px 0 0;
    flex-shrink: 0;
}

.modal-content > form,
.modal-content > div:not(.modal-header) {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 25px 30px;
    flex: 1;
}

/* Scrollbar personalizado para modales */
.modal-content > form::-webkit-scrollbar,
.modal-content > div:not(.modal-header)::-webkit-scrollbar {
    width: 8px;
}

.modal-content > form::-webkit-scrollbar-track,
.modal-content > div:not(.modal-header)::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

.modal-content > form::-webkit-scrollbar-thumb,
.modal-content > div:not(.modal-header)::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.modal-content > form::-webkit-scrollbar-thumb:hover,
.modal-content > div:not(.modal-header)::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close {
    color: var(--gray-400);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: var(--danger-color);
    background: var(--gray-100);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 320px !important;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.minimized {
        width: 80px !important;
    }

    .main-content,
    .main-content.sidebar-minimized,
    .sidebar.minimized ~ .main-content {
        padding-left: 0 !important;
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }

    .sidebar-toggle {
        display: none;
    }

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

    .dashboard-main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dashboard-main-card {
        padding: 25px;
    }

    .main-card-header {
        gap: 15px;
        margin-bottom: 20px;
    }

    .main-card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }

    .main-card-title {
        font-size: 1.3rem;
    }

    .main-card-stats {
        flex-wrap: wrap;
        gap: 10px;
        padding: 20px 15px;
    }

    .main-stat-item {
        min-width: calc(50% - 10px);
    }

    .main-stat-divider {
        display: none;
    }

    .main-stat-number {
        font-size: 1.6rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .stat-box {
        padding: 20px;
        gap: 15px;
    }

    .stat-box-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .stat-box-number {
        font-size: 1.5rem;
    }

    .quick-access-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }

    .quick-access-item {
        padding: 20px 15px;
    }

    .quick-access-item i {
        font-size: 1.8rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1vh auto;
        max-height: 98vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-content > form,
    .modal-content > div:not(.modal-header) {
        padding: 15px 20px;
    }
    
    .top-bar {
        padding: 15px 20px;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .dashboard-main-card {
        padding: 20px;
    }

    .main-card-stats {
        flex-direction: column;
        gap: 15px;
    }

    .main-stat-item {
        width: 100%;
        min-width: 100%;
    }

    .main-stat-divider {
        display: block;
        width: 100%;
        height: 1px;
    }

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

    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .dashboard-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }

    .dashboard-main-card {
        padding: 20px;
    }

    .main-card-stats {
        flex-direction: column;
        gap: 15px;
    }

    .main-stat-item {
        width: 100%;
        min-width: 100%;
    }

    .main-stat-divider {
        display: block;
        width: 100%;
        height: 1px;
    }

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

    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content {
        padding: 20px;
    }
}

/* ========================================
   ANIMACIONES
   ======================================== */

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   UTILIDADES
   ======================================== */

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

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

/* ========================================
   SCROLLBAR PERSONALIZADO
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

