@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@500;600;700&display=swap');

:root {
    /* Brand Colors — IEQ Design System (emerald/ink), ver
       documentos/IEQ-design-system.md §2.1 */
    --primary: #059669; /* Emerald */
    --primary-dark: #047857;
    --primary-light: #34D399;
    --primary-soft: #D1FAE5; /* Very light emerald background */

    --secondary: #4A607A; /* Ink muted */
    --accent: #2563EB; /* Blue — info/link */

    /* Semantic Colors */
    --success: #059669; /* Emerald */
    --success-bg: #D1FAE5;
    --danger: #DC2626; /* Red */
    --danger-bg: #FEE2E2;
    --warning: #D97706; /* Amber */
    --warning-bg: #FEF3C7;
    --info: #2563EB; /* Blue */
    --info-bg: #DBEAFE;

    /* Neutral Scale */
    --bg-body: #F0F4F8; /* Slate */
    --bg-card: #FFFFFF;
    --bg-sidebar: #1E2A3B; /* Ink */

    /* Text Colors */
    --text-main: #1E2A3B; /* Ink */
    --text-muted: #4A607A; /* Ink muted */
    --text-light: #94A3B8;
    --text-on-dark: #F8FAFC;

    /* Borders & Dividers */
    --border-light: #E2E8F0;
    --border-hover: #CBD5E1;

    /* Metrics */
    --radius-sm: 0.375rem; /* 6px */
    --radius-md: 0.5rem;   /* 8px */
    --radius-lg: 0.75rem;  /* 12px */
    --radius-xl: 1rem;     /* 16px */

    /* Professional Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-float: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

/* Reset & Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

/* Layout Structure */
.container-main {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

@media (max-width: 768px) {
    .container-main {
        flex-direction: column;
    }
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    background: var(--bg-body);
    /* Subtle background pattern */
    background-image: radial-gradient(#E2E8F0 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Page Header */
.page-header {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}

.page-header div {
    display: flex;
    flex-direction: column;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #0F172A; /* Darker slate */
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
}

/* Professional Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    
    /* Clean, floating look */
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    
    position: relative;
    overflow: hidden;
}

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

/* Top accent line for cards */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--bg-body);
    border-color: var(--border-hover);
    color: #0F172A;
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-ativo {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-inativo {
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6); /* Dark slate overlay */
    backdrop-filter: blur(4px);
    padding: 1rem;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 650px;
    position: relative;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-body);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-bg);
    border-color: rgba(16, 185, 129, 0.2);
    color: #065F46;
}

.alert-error {
    background-color: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.2);
    color: #991B1B;
}

/* Data Tables */
.table-responsive {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--bg-body);
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

td {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-main);
    font-size: 0.9rem;
    background: white;
}

tr:hover td {
    background: #F8FAFC;
}

/* Dashboard Specifics */
.lider-dashboard {
    /* Rich Gradient */
    background: linear-gradient(135deg, #1E2A3B 0%, #047857 60%, #059669 100%);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    margin-bottom: 2.5rem;
    color: white;
    box-shadow: 0 20px 25px -5px rgba(4, 120, 87, 0.25);
    position: relative;
    overflow: hidden;
}

/* Decoratve Circle */
.lider-dashboard::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    filter: blur(40px);
}

.lider-dashboard .section-header h2 {
    color: white;
    font-size: 1.75rem;
}

.stats-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.mini-stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.mini-stat-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.mini-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.mini-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Mobile */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        padding-top: 3.5rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header p {
        font-size: 0.85rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .card h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .card p {
        font-size: 0.9rem;
    }
    
    .stats-grid-mini {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px;
        border-radius: 0.375rem;
    }
    
    .btn-small {
        padding: 0.6rem 0.9rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        width: auto;
    }
    
    /* Badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    p {
        font-size: 0.9rem;
    }
    
    /* Grid Layouts */
    .grid-2col {
        grid-template-columns: 1fr;
    }
    
    .grid-3col {
        grid-template-columns: 1fr;
    }
    
    .grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Mini Cards */
    .mini-value {
        font-size: 1.75rem;
    }
    
    .mini-label {
        font-size: 0.8rem;
    }
}

/* Tablet - 768px to 1023px */
@media (min-width: 769px) and (max-width: 1023px) {
    .main-content {
        padding: 1.5rem;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .stats-grid-mini {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        min-height: 44px;
    }
}
