/* ===== Design System Variables ===== */
:root {
    /* Fonts */
    --font-heading: 'Outfit', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

    /* Theme Tokens (Light Mode Default - Green Palette) */
    --primary: #10B981; /* Emerald Green */
    --primary-hover: #059669; /* Forest Green hover */
    --primary-light: #ECFDF5; /* Soft light mint green */
    --primary-rgb: 16, 185, 129;
    
    --bg-page: #F3F5F7; /* Match light minty lavender-grey in inspiracao.png */
    --bg-sidebar: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-subtle: #F4F6F9; /* Light grey for inputs/subtle zones */
    --bg-input: #FFFFFF;
    
    --stroke: #E2E6EC; /* Soft borders */
    --stroke-hover: #CBD5E1;
    --stroke-ctrl: #D1D5DB;
    --stroke-div: #F3F4F6;

    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --text-on-accent: #FFFFFF;

    --success: #10B981;
    --success-bg: #E6F4EA;
    --success-border: #B3E1C5;
    
    --danger: #EF4444;
    --danger-bg: #FCE8E6;
    --danger-border: #F7B5B0;
    
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --warning-border: #FDE68A;

    --info: #0D9488; /* Teal Green */
    --info-bg: #F0FDFA; /* Soft Teal bg */
    --info-border: #CCFBF1; /* Light Teal border */

    /* Styling Properties */
    --r-lg: 24px;
    --r-md: 20px;
    --r-sm: 12px;
    --r-xs: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 16px 40px rgba(112, 144, 176, 0.15);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Dark Mode Token Overrides ===== */
body.dark-theme {
    --bg-page: #0C0F12; /* Clean dark-greenish theme background */
    --bg-sidebar: #12161A;
    --bg-card: #191E24;
    --bg-subtle: #202730;
    --bg-input: #272F3A;

    --stroke: #2A333E;
    --stroke-hover: #3B4756;
    --stroke-ctrl: #3B4756;
    --stroke-div: #212831;

    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    --primary-light: rgba(16, 185, 129, 0.15);

    --success-bg: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.25);

    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.25);

    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(245, 158, 11, 0.25);

    --info-bg: rgba(13, 148, 136, 0.12);
    --info-border: rgba(13, 148, 136, 0.25);

    --shadow-md: 0 8px 30px rgba(0,0,0,0.2);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.3);
}

/* ===== Base Styles ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ===== App Layout Grid (Sidebar + Main) ===== */
.app-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--stroke);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-header {
    padding: 30px 24px;
    border-bottom: 1px solid var(--stroke-div);
}

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

.logo-icon-wrapper {
    background-color: var(--primary);
    color: var(--text-on-accent);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    border: none;
    background: transparent;
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-menu-item:hover {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
}

.nav-menu-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Sidebar Footer (Avatar & Theme switch) */
.sidebar-footer {
    padding: 24px 20px;
    border-top: 1px solid var(--stroke-div);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px;
}

.user-avatar-wrapper {
    position: relative;
}

.user-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #34D399 100%);
    color: var(--text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}

.user-info-text {
    line-height: 1.35;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Theme Switcher Pill */
.theme-switch-container {
    background-color: var(--bg-subtle);
    border-radius: 30px;
    padding: 4px;
    display: flex;
    gap: 2px;
}

.theme-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 30px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-btn span {
    margin-top: 1px;
}

.theme-btn:hover {
    color: var(--text-primary);
}

.theme-btn.active {
    background-color: var(--bg-sidebar);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ===== Main Content Layout ===== */
.app-main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.app-header {
    height: 76px;
    padding: 0 40px;
    border-bottom: 1px solid var(--stroke-div);
    background-color: var(--bg-sidebar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.breadcrumb-parent {
    color: var(--text-muted);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 600;
}

.title-bar-badge {
    font-size: 10px;
    font-weight: 700;
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.sections-wrapper {
    flex: 1;
    padding: 40px;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
}

/* Section visibility */
.app-section {
    display: none;
    animation: fadeInSection 0.3s ease-in-out;
}

.app-section.active {
    display: block;
}

@keyframes fadeInSection {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Page Footer styling */
.app-footer {
    padding: 24px 40px;
    border-top: 1px solid var(--stroke-div);
    background-color: var(--bg-sidebar);
    color: var(--text-muted);
    font-size: 13px;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1280px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.footer-separator {
    color: var(--stroke);
}

/* ===== Card Styling (Common) ===== */
.fluent-card {
    background-color: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    padding: 32px 40px;
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.fluent-card.compact-card {
    padding: 20px 30px;
}

.fluent-card.card-full {
    padding: 32px;
}

/* ===== SECTION 1: INÍCIO / DASHBOARD DESIGN ===== */
.welcome-banner {
    position: relative;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%); /* Lush green gradient */
    border-radius: var(--r-md);
    padding: 44px;
    color: #FFFFFF;
    margin-bottom: 36px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.22);
}

.welcome-text-side {
    max-width: 60%;
    position: relative;
    z-index: 2;
}

.welcome-text-side h1 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-text-side p {
    font-size: 15px;
    opacity: 0.95;
    line-height: 1.6;
}

.welcome-graphic {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40%;
    z-index: 1;
}

.graphic-element {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.graphic-element.circle-1 {
    width: 250px;
    height: 250px;
    right: -40px;
    top: -50px;
}

.graphic-element.circle-2 {
    width: 150px;
    height: 150px;
    right: 80px;
    bottom: -30px;
}

/* Dashboard Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.module-card {
    background-color: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(16, 185, 129, 0.4);
}

.card-image-header {
    height: 170px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
}

.card-image-header.generator-gradient {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%); /* Mint and forest gradient headers */
}

.card-image-header.validator-gradient {
    background: linear-gradient(135deg, #059669 0%, #064E3B 100%);
}

.card-icon-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background-color: rgba(0, 0, 0, 0.25);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-content-body {
    padding: 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content-body h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.card-content-body p {
    font-size: 14.5px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.6;
    flex: 1;
}

/* ===== Form Controls (Input & Labels) ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--r-sm);
    border: 1px solid var(--stroke);
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14.5px;
    outline: none;
    transition: all var(--transition-fast);
}

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

.form-input.has-error {
    border-color: var(--danger);
    background-color: var(--danger-bg);
}

.form-helper-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    gap: 10px;
    flex-wrap: wrap;
}

.form-hint {
    font-size: 12.5px;
    color: var(--text-muted);
}

.form-error {
    font-size: 12.5px;
    color: var(--danger);
    font-weight: 500;
}

/* Guide zoom modal trigger link */
.guide-link {
    font-size: 12.5px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}
.guide-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ===== Step headers ===== */
.step-header {
    margin-bottom: 28px;
}

.step-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.step-desc {
    color: var(--text-secondary);
    font-size: 14.5px;
}

/* ===== Common Button Styles ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--r-sm);
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-full-width {
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-on-accent);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-card);
    border-color: var(--stroke);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background-color: var(--bg-subtle);
    border-color: var(--stroke-hover);
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--success);
    color: #FFFFFF;
}
.btn-success:hover {
    background-color: #0c9c6d;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.btn-link {
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}
.btn-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ===== SECTION 2: GERADOR DE CSV STYLINGS ===== */

/* Course layout row styling */
.course-layout {
    display: flex;
    gap: 28px;
    align-items: center;
}
.course-form-side {
    flex: 1;
    min-width: 0;
}
.course-image-side {
    flex: 0 0 160px;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.guide-card {
    position: relative;
    width: 160px;
    height: 56px;
    border-radius: var(--r-sm);
    border: 1px solid var(--primary);
    overflow: hidden;
    cursor: zoom-in;
    transition: all var(--transition-fast);
    animation: pulse-border 2.5s infinite;
}

.guide-card:hover {
    animation: none;
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 2px var(--primary-hover);
}

.guide-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter var(--transition-fast);
}

.guide-card:hover .guide-img-thumb {
    filter: brightness(0.4);
}

.guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    opacity: 0.95;
    transition: all var(--transition-fast);
}

.guide-badge {
    position: absolute;
    top: 3px;
    left: 3px;
    background: var(--primary);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    z-index: 5;
    text-transform: uppercase;
}

/* Bulk Assignment Bar (Segmented Pill Layout) */
.role-bulk-bar {
    background-color: var(--bg-subtle);
    border-radius: var(--r-sm);
    padding: 20px;
    border: 1px solid var(--stroke);
    margin-bottom: 24px;
    transition: background-color var(--transition-normal);
}

.role-bulk-title {
    display: block;
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.role-bulk-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-role {
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 30px; /* Modern Pill shapes */
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    transform: scale(1);
    box-shadow: var(--shadow-sm);
}

.btn-role:active {
    transform: scale(0.96);
}

/* Premium Pastel Colors for role pill buttons */
.role-aluno { background-color: rgba(59, 130, 246, 0.12); color: #2563EB; border-color: rgba(59, 130, 246, 0.2); }
.role-aluno:hover { background-color: rgba(59, 130, 246, 0.22); }

.role-professor { background-color: rgba(16, 185, 129, 0.12); color: #059669; border-color: rgba(16, 185, 129, 0.2); }
.role-professor:hover { background-color: rgba(16, 185, 129, 0.22); }

.role-tutor-dist { background-color: rgba(139, 92, 246, 0.12); color: #7C3AED; border-color: rgba(139, 92, 246, 0.2); }
.role-tutor-dist:hover { background-color: rgba(139, 92, 246, 0.22); }

.role-tutor-pres { background-color: rgba(13, 148, 136, 0.12); color: #0F766E; border-color: rgba(13, 148, 136, 0.2); }
.role-tutor-pres:hover { background-color: rgba(13, 148, 136, 0.22); }

.role-editor { background-color: rgba(249, 115, 22, 0.12); color: #EA580C; border-color: rgba(249, 115, 22, 0.2); }
.role-editor:hover { background-color: rgba(249, 115, 22, 0.22); }

.role-coord-curso { background-color: rgba(202, 138, 4, 0.12); color: #A16207; border-color: rgba(202, 138, 4, 0.2); }
.role-coord-curso:hover { background-color: rgba(202, 138, 4, 0.22); }

.role-coord-polo { background-color: rgba(236, 72, 153, 0.12); color: #DB2777; border-color: rgba(236, 72, 153, 0.2); }
.role-coord-polo:hover { background-color: rgba(236, 72, 153, 0.22); }

.role-monitor { background-color: rgba(107, 114, 128, 0.12); color: #4B5563; border-color: rgba(107, 114, 128, 0.2); }
.role-monitor:hover { background-color: rgba(107, 114, 128, 0.22); }

/* Interactive Spreadsheet grid */
.sheet-wrapper {
    overflow-x: auto;
    border-radius: var(--r-sm);
    border: 1px solid var(--stroke);
    background-color: var(--bg-card);
    margin-top: 12px;
    box-shadow: var(--shadow-sm);
}

.sheet {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
    min-width: 1100px;
}

.sheet th {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 2px solid var(--stroke);
}

.sheet td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--stroke-div);
    vertical-align: middle;
}

.sheet tr:hover {
    background-color: var(--bg-subtle);
}

/* Redesigned grid inputs based on layout inspiration */
.cell-input, .cell-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--r-xs);
    border: 1px solid var(--stroke);
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
}

.cell-input::placeholder {
    color: var(--text-muted);
}

.cell-input:focus, .cell-select:focus {
    border-color: var(--primary);
    background-color: var(--bg-input);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.12);
}

.cell-input.has-error, .cell-select.has-error {
    border-color: var(--danger);
    background-color: var(--danger-bg);
    color: var(--danger);
}

/* Subtle Row colors inside table editor based on role */
.sheet tr.row-role-aluno { background-color: rgba(59, 130, 246, 0.05) !important; }
.sheet tr.row-role-professor { background-color: rgba(16, 185, 129, 0.05) !important; }
.sheet tr.row-role-tutor-dist { background-color: rgba(139, 92, 246, 0.05) !important; }
.sheet tr.row-role-tutor-pres { background-color: rgba(13, 148, 136, 0.05) !important; }
.sheet tr.row-role-editor { background-color: rgba(249, 115, 22, 0.05) !important; }
.sheet tr.row-role-coord-curso { background-color: rgba(202, 138, 4, 0.05) !important; }
.sheet tr.row-role-coord-polo { background-color: rgba(236, 72, 153, 0.05) !important; }
.sheet tr.row-role-monitor { background-color: rgba(107, 114, 128, 0.05) !important; }

/* Keep transparent inputs/selects on highlighted rows for elegance */
.sheet tr[class*="row-role-"] td {
    background-color: inherit;
}
.sheet tr[class*="row-role-"] .cell-input:not(:focus),
.sheet tr[class*="row-role-"] .cell-select:not(:focus) {
    background-color: rgba(255, 255, 255, 0.45);
    border-color: rgba(0, 0, 0, 0.04);
}
body.dark-theme .sheet tr[class*="row-role-"] .cell-input:not(:focus),
body.dark-theme .sheet tr[class*="row-role-"] .cell-select:not(:focus) {
    background-color: rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.04);
}

/* Col structure styles */
.col-select { width: 45px; text-align: center; }
.col-name { width: 18%; }
.col-email { width: 22%; }
.col-id { width: 20%; }
.col-grupo { width: 12%; }
.col-papel { width: 16%; }
.col-action { width: 60px; text-align: center; }

.cell-select-col {
    text-align: center;
    vertical-align: middle;
}

.row-selector, #selectAllRows {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.btn-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 16px;
}
.btn-remove:hover {
    background-color: var(--danger-bg);
    color: var(--danger);
}

/* Actions panel under sheet table */
.sheet-actions-bar {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-add-row-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1.5px dashed var(--stroke-ctrl);
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--primary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
    min-width: 180px;
}

.btn-add-row-compact:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

.btn-secondary-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid var(--stroke);
    border-radius: var(--r-sm);
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
    min-width: 180px;
}

.btn-secondary-compact:hover {
    background-color: var(--bg-subtle);
    border-color: var(--stroke-hover);
}

.drag-hint-text {
    width: 100%;
    text-align: center;
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px dashed var(--primary);
    border-radius: var(--r-sm);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
}

.sheet-errors {
    margin-top: 16px;
}
.sheet-error-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--danger);
    background-color: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--r-sm);
    margin-bottom: 6px;
}

/* Completion Info container */
.completion-area {
    margin-top: 24px;
}
.info-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.info-box {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--r-sm);
    background-color: var(--bg-subtle);
    border: 1px solid var(--stroke);
    font-size: 13.5px;
    color: var(--text-secondary);
}
.info-icon {
    font-size: 22px;
    flex-shrink: 0;
}

/* ===== SECTION 3: VALIDADOR DE PLANILHAS STYLINGS ===== */
.upload-header {
    text-align: center;
    margin-bottom: 28px;
}
.page-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.page-desc {
    color: var(--text-secondary);
    font-size: 15px;
}

.upload-zone {
    border: 2px dashed var(--stroke-ctrl);
    border-radius: var(--r-lg);
    padding: 56px 36px;
    text-align: center;
    background-color: var(--bg-subtle);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--primary);
    background-color: var(--primary-light);
    color: var(--primary);
}

.upload-icon {
    color: var(--primary);
}

.upload-text {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-text .highlight-green {
    color: var(--success);
}

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

.expected-format {
    margin-top: 36px;
    border-top: 1px solid var(--stroke-div);
    padding-top: 24px;
}

.expected-format h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.columns-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.col-tag {
    font-family: monospace;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 12px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--stroke);
    border-radius: var(--r-xs);
    color: var(--text-secondary);
}

/* Results view in Validador */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--stroke-div);
    padding-bottom: 20px;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.results-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.results-file {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Dynamic Stats cards modeled directly after Dashboard widgets in inspiracao.png */
.summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-widget-card {
    background-color: var(--bg-card);
    border: 1px solid var(--stroke);
    border-radius: var(--r-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.stat-widget-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-widget-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Coloring stats widget icon circles */
.stat-widget-card.info .stat-widget-icon { background-color: var(--info-bg); color: var(--info); }
.stat-widget-card.ok .stat-widget-icon { background-color: var(--success-bg); color: var(--success); }
.stat-widget-card.err .stat-widget-icon { background-color: var(--danger-bg); color: var(--danger); }
.stat-widget-card.warn .stat-widget-icon { background-color: var(--warning-bg); color: var(--warning); }

.stat-widget-content {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.stat-widget-value {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-widget-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Section titles for validation list elements */
.section-title {
    font-size: 15.5px;
    font-weight: 700;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.section-title.error-title { color: var(--danger); }
.section-title.warning-title { color: var(--warning); }

.errors-list, .warnings-list {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--stroke);
    border-radius: var(--r-sm);
    margin-bottom: 28px;
}

.error-item, .warning-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.45;
    border-bottom: 1px solid var(--stroke-div);
}

.error-item:last-child, .warning-item:last-child {
    border-bottom: none;
}

.error-item { background-color: rgba(239, 68, 68, 0.015); }
.warning-item { background-color: rgba(245, 158, 11, 0.015); }

.error-row-num {
    font-weight: 700;
    color: var(--danger);
    background-color: var(--danger-bg);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    flex-shrink: 0;
    height: 18px;
    display: inline-flex;
    align-items: center;
}

.warning-row-num {
    font-weight: 700;
    color: var(--warning);
    background-color: var(--warning-bg);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    flex-shrink: 0;
    height: 18px;
    display: inline-flex;
    align-items: center;
}

/* Preview validation spreadsheet table */
.preview-wrapper {
    overflow-x: auto;
    border-radius: var(--r-sm);
    border: 1px solid var(--stroke);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
    min-width: 1100px;
}

.preview-table th {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 2px solid var(--stroke);
}

.preview-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--stroke-div);
    color: var(--text-secondary);
}

.preview-table tr:hover {
    background-color: var(--bg-subtle);
}

.row-num {
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-subtle);
    width: 50px;
    text-align: center;
}

/* Table validation highlight cells colors (Elegant pastels) */
.cell-error {
    background-color: var(--danger-bg) !important;
    color: var(--danger) !important;
    font-weight: 600;
}

.cell-dup-email {
    background-color: var(--warning-bg) !important;
    color: var(--warning) !important;
    font-weight: 600;
    position: relative;
}

/* Add indicator badge in duplicates e-mails cells */
.cell-dup-email::after {
    content: attr(data-dup-info);
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9.5px;
    background-color: rgba(245, 158, 11, 0.2);
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
}

/* Legend for cell colors */
.legend-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.legend-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--stroke);
}
.legend-swatch.err-swatch { background-color: var(--danger-bg); }
.legend-swatch.dup-swatch { background-color: var(--warning-bg); }

/* ===== Modal Dialogs (Guide zoom Help) ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 24px;
    animation: fadeInModal 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.modal-content {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: var(--r-md);
    max-width: 800px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUpModal 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
    border: 1px solid var(--stroke);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 20px;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}
.modal-close:hover {
    color: var(--text-primary);
}

.modal-img {
    width: 100%;
    height: auto;
    border-radius: var(--r-sm);
    border: 1px solid var(--stroke);
}

.modal-caption {
    font-size: 13.5px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
}

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

@keyframes slideUpModal {
    from { transform: translateY(20px) scale(0.98); }
    to { transform: translateY(0) scale(1); }
}

/* ===== Drag & Drop Overlay Global Styling ===== */
.drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(12, 12, 18, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    padding: 24px;
}

.drag-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drag-overlay-content {
    background-color: var(--bg-card);
    border: 3px dashed var(--primary);
    border-radius: var(--r-md);
    padding: 48px 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform var(--transition-normal);
    max-width: 480px;
    width: 100%;
    color: var(--text-primary);
}

.drag-overlay.active .drag-overlay-content {
    transform: scale(1);
}

.drag-icon {
    color: var(--primary);
    margin-bottom: 20px;
    animation: bounce 2s infinite ease-in-out;
}

.drag-overlay-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.drag-overlay-content p {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== Toaster notification styling ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-weight: 600;
    color: #FFFFFF;
    animation: toastIn 0.2s cubic-bezier(0.1, 0.9, 0.3, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 250px;
}

.toast.success { background-color: var(--success); }
.toast.error { background-color: var(--danger); }
.toast.exit { animation: toastOut 0.2s cubic-bezier(0.1, 0.9, 0.3, 1) forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(12px) scale(0.95); }
}

/* ===== Responsive Layout Customization ===== */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .app-sidebar {
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--stroke);
    }
    .sidebar-header {
        padding: 20px 24px;
    }
    .sidebar-nav {
        padding: 8px 24px 16px;
    }
    .nav-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 16px 24px;
    }
    .theme-switch-container {
        width: 180px;
    }
    .app-main-content {
        height: auto;
        overflow-y: visible;
    }
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .welcome-text-side {
        max-width: 100%;
    }
    .welcome-graphic {
        display: none;
    }
}

@media (max-width: 768px) {
    .sections-wrapper {
        padding: 24px 16px;
    }
    .course-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .course-image-side {
        display: flex;
        justify-content: center;
        flex: 1;
    }
    .guide-card {
        width: 100%;
        max-width: 320px;
    }
    .summary-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    .results-header div {
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .summary-row {
        grid-template-columns: 1fr;
    }
    .role-bulk-buttons {
        justify-content: center;
    }
}

/* ===== Section Back Bar styles ===== */
.section-back-bar {
    margin-bottom: 24px;
    display: flex;
}
.btn-back {
    padding: 8px 16px;
    font-size: 13.5px;
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
