/* =========================================
   ESTILOS GERAIS DO PLUGIN
   ========================================= */

/* 1. WRAPPER DA PÁGINA */
.clic-dashboard-page-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
    min-height: 80vh;
}

/* 2. BASE DO PAINEL & VARIÁVEIS */
.clic-dashboard {
    /* Paleta de Cores Global */
    --c-azul: #3069b1;       
    --c-azul-claro: #6ea4b7; 
    --c-verde: #50a554;      
    --c-vermelho: #a53237;   
    --c-texto: #2d2d2e;      
    --c-cinza: #acafb4;      
    --c-offwhite: #F2F2F2;   
    --c-branco: #fffffd;     
    
    font-family: inherit;
    color: var(--c-texto);
    width: 100%;
}

/* Tipografia */
.clic-dashboard h2 {
    color: var(--c-azul);
    font-weight: 700;
    border-bottom: 2px solid var(--c-azul);
    padding-bottom: 15px;
    margin-bottom: 30px;
    font-size: 2.2rem;
    line-height: 1.2;
    margin-top: 0;
}

.clic-dashboard h3, .clic-modal h3,
.clic-dashboard h4, .clic-modal h4 {
    color: #2d2d2e; /* Fallback se var nao funcionar fora */
    font-weight: 600;
    margin-bottom: 15px;
    margin-top: 0;
}

/* Links */
.clic-dashboard a {
    color: var(--c-azul);
    text-decoration: none;
    transition: color 0.2s;
}
.clic-dashboard a:hover {
    color: var(--c-azul-claro);
    text-decoration: underline;
}

/* --- 3. ELEMENTOS DE FORMULÁRIO (Base) --- */
.clic-dashboard label,
.clic-modal label {
    font-weight: 600;
    font-size: 14px;
    color: #444;
    margin-bottom: 8px;
    display: block;
}

.clic-dashboard input[type="text"],
.clic-dashboard input[type="password"],
.clic-dashboard input[type="file"],
.clic-dashboard input[type="number"],
.clic-modal input[type="text"],
.clic-modal input[type="password"],
.clic-modal input[type="number"]
{
    width: 100%;
    height: 45px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0 15px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 15px;
    background: #fdfdfd;
    max-width: 100%; /* Garante que não estoure o modal */
}

.clic-dashboard input:focus,
.clic-modal input:focus {
    border-color: #3069b1; /* var(--c-azul) */
    background: #fff;
    outline: none;
}

/* --- 4. BOTÕES --- */
.clic-dashboard .button,
.clic-dashboard button,
.clic-modal .button,
.clic-modal button
{
    display: inline-flex; /* Melhor alinhamento que inline-block */
    justify-content: center;
    align-items: center;
    background-color: #3069b1; /* var(--c-azul) */
    color: #fff;
    border: 1px solid #3069b1;
    padding: 0 20px;
    height: 40px; /* Altura fixa para consistência */
    font-size: 15px;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    line-height: normal;
    text-transform: none;
    text-decoration: none;
}

.clic-dashboard .button:hover,
.clic-dashboard button:hover,
.clic-modal .button:hover,
.clic-modal button:hover {
    background-color: #24528f;
    border-color: #24528f;
    color: #fff;
}

/* Botões Pequenos */
.clic-dashboard .button-small {
    padding: 0 12px !important;
    height: 30px !important;
    font-size: 13px !important;
    margin-left: 8px;
}

/* Botão Danger (Vermelho) */
.button-danger {
    background-color: #fff !important;
    color: #a53237 !important; /* var(--c-vermelho) */
    border: 1px solid #e1e1e1 !important;
}
.button-danger:hover {
    background-color: #a53237 !important;
    color: #fff !important;
    border-color: #a53237 !important;
}

/* --- 5. TABELAS --- */
.clic-dashboard table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 15px;
}

.clic-dashboard table th {
    background-color: #3069b1;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    padding: 15px;
    text-align: left;
}

.clic-dashboard table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #444;
    vertical-align: middle;
}

.clic-dashboard table tr:last-child td {
    border-bottom: none;
}

.clic-dashboard code {
    background-color: #f4f6f8;
    color: #3069b1;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e1e4e8;
    font-family: monospace;
    font-weight: 600;
}

/* --- 6. MODAIS (Estrutura Base & Correções) --- */
.clic-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: none; /* JS controla o display flex */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.clic-modal {
    background: #fff;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    position: relative;
    animation: slideDown 0.3s ease;
    box-sizing: border-box; /* Garante padding correto */
    text-align: left;
}

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

.clic-modal h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    color: #3069b1; /* var(--c-azul) */
}

.clic-modal-close {
    position: absolute;
    top: 15px; right: 15px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
}
.clic-modal-close:hover { color: #a53237; }

.clic-input-note {
    font-size: 12px;
    color: #666;
    margin-top: -10px;
    margin-bottom: 15px;
    display: block;
}

.clic-modal input[disabled] {
    background-color: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

/* Modal Edit & Delete (Formatação Específica) */
.clic-modal-actions {
    text-align: right;
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px; /* Espaço entre botões */
}

/* Botão Cancelar (Cinza) */
.clic-btn-cancel {
    background: #ccc !important;
    border-color: #ccc !important;
    color: #fff !important;
}
.clic-btn-cancel:hover {
    background: #bbb !important;
    border-color: #bbb !important;
}

.clic-hidden { display: none; }
.clic-text-underline { text-decoration: underline; }
.clic-form-margin { margin-top: 20px; }

/* Modal Danger (Base) */
.clic-modal-danger h3 { color: #a53237; border-bottom-color: #ffdce0; }
.clic-danger-alert { background: #fff5f5; border: 1px solid #ffc9c9; color: #c00; padding: 15px; border-radius: 5px; margin-bottom: 20px; font-size: 14px; line-height: 1.5; }
.clic-confirm-input { border: 2px solid #ddd !important; font-weight: bold; color: #333; }
.clic-confirm-input:focus { border-color: #a53237 !important; }

/* Botão Confirmar Deleção */
.btn-confirm-delete { 
    background-color: #a53237 !important; 
    border-color: #a53237 !important; 
    opacity: 0.5; 
    cursor: not-allowed !important; 
}
.btn-confirm-delete.active { opacity: 1; cursor: pointer !important; }

/* --- 7. FILTROS DA TABELA --- */
.clic-filter-toolbar { display: flex; flex-wrap: wrap; gap: 15px; background: #f9f9f9; padding: 15px; border: 1px solid #e1e1e1; border-radius: 8px; margin-bottom: 15px; align-items: flex-end; }
.clic-filter-group { display: flex; flex-direction: column; flex: 1; min-width: 150px; }
.clic-filter-group label { font-size: 12px; margin-bottom: 5px; color: #555; font-weight: 600; }
.clic-filter-group input, .clic-filter-group select { height: 35px !important; margin-bottom: 0 !important; border: 1px solid #ccc; border-radius: 4px; padding: 0 10px; font-size: 13px; background-color: #fff; box-sizing: border-box; }
.clic-filter-hidden { display: none !important; }

/* ==========================================================================
   ESTILOS ESPECÍFICOS DE TEMPLATE
   ========================================================================== */

/* --- DASHBOARD LIST --- */
.clic-create-class-wrapper {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-left: 4px solid #3069b1;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}
.clic-create-title { width: 100%; margin: 0 0 15px 0; font-size: 16px; font-weight: 600; color: #1d2327; }
.clic-create-form { display: flex; flex-wrap: wrap; gap: 15px; width: 100%; align-items: flex-end; }
.clic-col-title { flex: 2; min-width: 200px; }
.clic-col-code { flex: 1; min-width: 150px; }
.clic-col-btn { flex: 0 0 auto; }
.clic-create-form .clic-input { height: 40px !important; margin-bottom: 0 !important; width: 100%; }
.clic-create-form .clic-input-uppercase { text-transform: uppercase; }
.clic-btn-create { height: 40px !important; padding: 0 25px !important; margin-bottom: 0 !important; display: inline-flex !important; }

.clic-section-header { margin-bottom: 20px; font-size: 20px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.clic-empty-state { padding: 40px; text-align: center; background: #fff; border: 1px dashed #ccc; border-radius: 8px; }
.clic-empty-p-main { font-size: 16px; color: #666; margin-bottom: 10px; }
.clic-empty-p-sub { color: #888; margin: 0; }
.clic-class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }
.clic-class-card {
    background: #fff; border: 1px solid #c3c4c7; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; overflow: hidden;
}
.clic-class-card:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); border-color: #3069b1; }
.clic-class-header { padding: 20px; border-bottom: 1px solid #f0f0f1; background: #fff; }
.clic-class-title { font-size: 18px; font-weight: 700; margin: 0 0 8px 0; color: #3069b1; text-decoration: none; display: block; }
.clic-class-title:hover { color: #6ea4b7; text-decoration: underline; }
.clic-class-meta { font-size: 13px; color: #646970; display: flex; align-items: center; gap: 10px; }
.clic-class-code { background: #f0f0f1; color: #333; padding: 2px 6px; border-radius: 3px; font-family: monospace; font-weight: bold; border: 1px solid #dcdcde; }
.clic-class-body { padding: 15px 20px; background: #f9f9f9; flex-grow: 1; font-size: 13px; color: #50575e; }
.clic-card-stat-row { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.clic-card-author-row { display: flex; align-items: center; gap: 5px; margin-top: 8px; border-top: 1px solid #eee; padding-top: 8px; }
.clic-text-success { color: #50a554; font-weight: bold; }
.clic-icon-mute { color: #aaa; }
.clic-text-mute { font-size: 12px; color: #777; }
.clic-class-footer { padding: 10px 20px; background: #fff; border-top: 1px solid #f0f0f1; display: flex; justify-content: flex-end; gap: 8px; }
.clic-btn-edit-style { background: #fff !important; border: 1px solid #ccc !important; color: #555 !important; }
.clic-btn-enter { margin-left: 5px; }

/* --- DASHBOARD SINGLE --- */
.clic-dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.clic-single-header-title { margin: 5px 0 10px 0 !important; border: none !important; padding: 0 !important; }
.clic-code-badge { display: inline-flex; align-items: center; background: #f6f7f7; padding: 6px 12px; border-radius: 4px; border: 1px solid #dcdcde; margin-top: 5px; }
.clic-code-badge code { background: none; border: none; padding: 0; color: #3069b1; font-size: 16px; margin-left: 5px; }
.clic-badge-label { font-size: 13px; color: #50575e; }
.clic-alert-lgpd { background-color: #fcf9e8; border-left: 4px solid #f0b849; padding: 15px 20px; margin-bottom: 30px; border-radius: 4px; display: flex; gap: 15px; align-items: start; box-shadow: 0 1px 2px rgba(0,0,0,0.05); color: #3c434a; }
.clic-alert-lgpd h4 { color: #9c6f13; margin-bottom: 5px; font-size: 15px; }
.clic-alert-lgpd p { margin: 0; font-size: 14px; line-height: 1.5; }
.clic-lgpd-icon { font-size: 22px; }
.clic-cards-grid { display: flex; flex-wrap: wrap; gap: 25px; margin-bottom: 40px; }
.clic-card { flex: 1; min-width: 300px; background: #fff; border: 1px solid #c3c4c7; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); border-radius: 0; }
.clic-card-blue-dark { border-top: 4px solid #3069b1; }
.clic-card-blue-light { border-top: 4px solid #6ea4b7; }
.clic-card-green { border-top: 4px solid #50a554; }
.clic-form-mb { margin-bottom: 20px; }
.clic-msg-box { padding: 10px; margin-top: 15px; border-radius: 4px; }
.clic-msg-error { color: red; background: #fdd; }
.clic-msg-success { color: green; background: #dfd; }
.clic-msg-warning { color: orange; background: #fff3cd; }
.clic-csv-instruction { background: #f9f9f9; padding: 15px; border-radius: 4px; border: 1px solid #e5e5e5; margin-bottom: 20px; font-size: 13px; color: #3c434a; line-height: 1.6; }
.clic-csv-details { margin-top: 5px; }
.clic-csv-example { color: #666; font-style: italic; }
.clic-csv-download-wrapper { margin-top: 10px; border-top: 1px solid #e5e5e5; padding-top: 10px; }
.clic-csv-link { color: #3069b1; text-decoration: underline; font-weight: 600; }
.clic-file-input { width: 100%; font-size: 13px; padding-top: 10px; }
.clic-csv-result-header { font-weight: bold; }
.clic-csv-error-wrapper { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,0.1); font-size: 12px; color: #856404; }
.clic-feedback-inline { padding: 10px; margin-bottom: 15px; border-radius: 4px; font-size: 13px; font-weight: 600; }
.clic-feedback-inline.success { background-color: #edfaef; color: #008a20; border: 1px solid #c3e6cb; }
.clic-feedback-inline.error { background-color: #fcf0f1; color: #d63638; border: 1px solid #f8d7da; }
.clic-feedback-inline.warning { background-color: #fff8e5; color: #856404; border: 1px solid #ffeeba; }
.clic-error-list { margin: 5px 0 0 0 !important; padding-left: 20px !important; list-style: disc !important; display: block !important; }
.clic-error-list li { background-color: transparent !important; border: none !important; box-shadow: none !important; padding: 2px 0 !important; margin-bottom: 0 !important; display: list-item !important; color: inherit !important; }
.clic-btn-full { width: 100% !important; display: flex !important; justify-content: center !important; align-items: center !important; text-align: center !important; box-sizing: border-box !important; margin-top: 15px !important; height: 40px !important; }
.clic-btn-csv { background-color: #6ea4b7 !important; border-color: #6ea4b7 !important; color: #fff !important; }
.clic-btn-csv:hover { filter: brightness(0.9); color: #fff !important; }
.clic-btn-green { background-color: #50a554 !important; border-color: #50a554 !important; color: #fff !important; }
.clic-btn-green:hover { filter: brightness(0.9); color: #fff !important; }
.clic-tabs-wrapper { margin-top: 40px; }
.clic-tabs-nav { margin-bottom: 20px; border-bottom: 1px solid #ccc; padding-bottom: 20px; }
.clic-tab-button { background-color: #f4f4f4 !important; color: #555 !important; border: 1px solid #ccc !important; margin-right: 10px; opacity: 0.8; }
.clic-tab-button:hover { opacity: 1; background-color: #e9e9e9 !important; }
.clic-tab-button.active { background-color: #3069b1 !important; color: #fff !important; border-color: #3069b1 !important; opacity: 1; font-weight: 600; }
.clic-empty-table { padding: 30px; text-align: center; color: #666; border: 1px dashed #ccc; }
.clic-date-col { color: #666; }
.clic-table-actions { display: flex; gap: 10px; align-items: center; }
.clic-form-inline { margin: 0 !important; display: flex; align-items: center; gap: 5px; }
.clic-action-input { width: 100px !important; height: 30px !important; padding: 0 5px !important; font-size: 12px !important; margin: 0 !important; }
.clic-action-btn { height: 30px !important; line-height: 1 !important; padding: 0 10px !important; font-size: 12px !important; }
.clic-action-separator { color: #ddd; margin: 0 5px; }
.clic-input-small { width: 100px !important; height: 30px !important; padding: 0 5px !important; font-size: 12px !important; margin: 0 !important; }
.clic-btn-small { height: 30px !important; line-height: 1 !important; padding: 0 10px !important; font-size: 12px !important; }
.clic-row-blocked { background-color: #f9f9f9; opacity: 0.7; }
.clic-row-blocked td { color: #999 !important; }
.clic-row-blocked strong { text-decoration: line-through; color: #888; }
.clic-btn-warning { background-color: #f0b849 !important; border-color: #f0b849 !important; color: #fff !important; }
.clic-btn-warning:hover { background-color: #d9a338 !important; border-color: #d9a338 !important; }
.clic-btn-block-toggle { display: inline-flex !important; align-items: center; gap: 4px; }
.clic-app-badge { background-color: #e9ecef; padding: 4px 8px; border-radius: 12px; font-size: 11px; font-weight: bold; color: #495057; display: inline-block; white-space: nowrap; }

/* Modais Danger (Projeto & Aluno) */
.clic-overlay-high { display: none; z-index: 99999; }
.clic-modal-danger-sm { max-width: 400px; border-top: 4px solid #a53237; }
.clic-title-danger { color: #a53237 !important; margin: 0 0 15px 0 !important; border: none !important; }
.clic-text-body { font-size: 14px; line-height: 1.5; color: #333; margin-bottom: 20px; }
.clic-note-danger { background: #fff5f5; color: #a53237; padding: 5px; border-radius: 4px; display: block; border: 1px solid #fc8181; }
.clic-footer-right { text-align: right; display: flex; justify-content: flex-end; gap: 10px; }
.clic-btn-danger-solid { background-color: #a53237 !important; border-color: #a53237 !important; color: #fff !important; }
.clic-btn-danger-solid:hover { background-color: #a00 !important; border-color: #a00 !important; }