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

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    
    --brand-blue: #303e87;
    --brand-blue-hover: #26326c;
    
    --accent-gradient: linear-gradient(135deg, #303e87 0%, #4f46e5 100%);
    --accent-color: #303e87;
    --accent-hover: #26326c;
    --success: #10b981;
    --danger: #ef4444;
    --font-title: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background: #f1f5f9;
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header & Navigation */
header {
    background: var(--brand-blue);
    border-bottom: 3px solid #e0a916; /* Detalhe dourado sutil no fundo do cabeçalho */
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: var(--font-title);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* Main Container Layout */
main {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 2rem;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--brand-blue);
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.2rem;
    color: var(--brand-blue);
    font-weight: 800;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.75rem;
}

/* Institutional Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(48, 62, 135, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.6rem;
    border-radius: 6px;
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--brand-blue);
    color: #fff;
    box-shadow: 0 4px 6px rgba(48, 62, 135, 0.15);
}

.btn-primary:hover {
    background: var(--brand-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(48, 62, 135, 0.25);
}

.btn-secondary {
    background: #f8fafc;
    color: var(--text-primary);
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge-inactive {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Two Column Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.dashboard-grid > div {
    min-width: 0;
}

@media (min-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

/* Tables */
.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: #ffffff;
}

th, td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

th {
    font-family: var(--font-title);
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

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

tr:hover td {
    background: #f8fafc;
}

/* Alert Notification Banner */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Custom styles for Voting Option cards */
.voting-option-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.voting-option-card:hover {
    background: #f1f5f9;
    border-color: var(--accent-color);
}

.voting-option-card input[type="radio"] {
    accent-color: var(--accent-color);
    width: 20px;
    height: 20px;
}

/* Mobile Responsive Design Rules */
@media (max-width: 768px) {
    /* Header optimization for mobile */
    .nav-container {
        flex-direction: column;
        gap: 0.85rem;
        padding: 0.75rem 1rem;
        text-align: center;
    }
    
    .logo img {
        height: 38px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 4px;
    }
    
    .nav-user-greeting {
        display: none !important; /* Hide greeting to save space on mobile */
    }

    /* Main container and section titles */
    main {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.5rem;
    }
    
    /* Card padding optimization */
    .card {
        padding: 1.25rem 1rem;
        margin-bottom: 1.25rem;
        border-radius: 8px;
    }
    
    /* Table horizontal scrolling improvements */
    .table-container {
        border-radius: 6px;
        -webkit-overflow-scrolling: touch;
    }
    
    table th, table td {
        padding: 0.75rem 0.85rem;
        font-size: 0.85rem;
    }
    
    /* Buttons sizing */
    .btn {
        padding: 0.6rem 1.1rem;
        font-size: 0.85rem;
        border-radius: 4px;
        width: auto;
    }
    
    /* Form controls layout */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input, .form-textarea, .form-select {
        padding: 0.6rem 0.85rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    /* For extra small mobile screens */
    .dashboard-grid {
        gap: 1rem;
    }
    
    .nav-links {
        gap: 0.35rem;
    }
    
    .nav-link {
        padding: 0.35rem 0.55rem;
        font-size: 0.75rem;
    }
    
    /* Make inline action buttons wrap or stack inside tables */
    td div {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
        gap: 0.35rem !important;
    }
    
    td div .btn, td div form, td div form .btn {
        width: 100% !important;
    }
}
