/* ========== RESET E BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e3f0ff 0%, #fff7f0 100%);
    color: #222b3a;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
}

.container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 40px 60px;
}

/* ========== TOP HEADER MODERNO ========== */
.top-header {
    background: linear-gradient(90deg, #2563eb 0%, #eb4504 100%);
    padding: 22px 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.18);
    margin-bottom: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    /* width e height removidos para permitir override local */
    background: transparent;
    border-radius: 50%;
    padding: 5px;
    object-fit: contain;
    filter: brightness(1.1);
    width: 70px;
    max-width: 100%;
    height: auto;
}

.header-title h1 {
    color: white;
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.header-title p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem;
    margin: 2px 0 0 0;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.welcome-text {
    color: white;
    font-size: 1rem;
    font-weight: 400;
}

.welcome-text strong {
    font-weight: 600;
}

.btn-logout {
    background: #ef4444;
    color: white;
    border: none;
    padding: 11px 26px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* ========== CARDS ========== */
.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8eaed;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.card h2 {
    margin-bottom: 25px;
    color: #2563eb;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 3px solid #ef4444;
    padding-bottom: 12px;
    display: inline-block;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card-header h2 {
    border: none;
    margin: 0;
    padding: 0;
}

.card-actions {
    display: flex;
    gap: 10px;
}

/* ========== DASHBOARD HEADER ========== */
.dashboard-header {
    background: linear-gradient(90deg, #2563eb 0%, #eb4504 100%);
    padding: 40px 60px;
    border-radius: 18px;
    margin-bottom: 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.18);
}

.dashboard-info h2 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.dashboard-info p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    margin: 0;
    font-weight: 400;
}

/* ========== ESTATÍSTICAS REDESENHADAS ========== */
.estatisticas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.estatistica-card {
    background: white;
    border-radius: 14px;
    padding: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.estatistica-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.estatistica-borda {
    height: 5px;
    width: 100%;
}

.estatistica-borda.verde {
    background: linear-gradient(90deg, #10b981, #059669);
}

.estatistica-borda.laranja {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.estatistica-borda.vermelho {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.estatistica-borda.azul {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.estatistica-borda.cinza {
    background: linear-gradient(90deg, #6b7280, #4b5563);
}

.estatistica-icon {
    font-size: 3rem;
    text-align: center;
    margin: 25px 0 15px 0;
}

.estatistica-valor {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    color: #1f2937;
}

.estatistica-label {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    color: #374151;
    margin-bottom: 8px;
}

.estatistica-desc {
    font-size: 0.9rem;
    text-align: center;
    color: #6b7280;
    padding: 0 20px 25px 20px;
    font-weight: 400;
}

/* ========== FORMULÁRIOS ========== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #f9fafb;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* ========== BOTÕES ========== */
.btn-primary, .btn-success, .btn-secondary {
    padding: 13px 28px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(55deg, #2563eb, #a24f4b 150%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

/* ========== FILTROS ========== */
.filters {
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #d1d5db;
    background: white;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Todos */
.filter-btn[data-filter="all"] {
    border-color: #2563eb;
    color: #2563eb;
}

.filter-btn[data-filter="all"]:hover,
.filter-btn[data-filter="all"].active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

/* Ativos */
.filter-btn[data-filter="ativo"] {
    border-color: #10b981;
    color: #10b981;
}

.filter-btn[data-filter="ativo"]:hover,
.filter-btn[data-filter="ativo"].active {
    background: #10b981;
    color: white;
    border-color: #10b981;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

/* Inativos */
.filter-btn[data-filter="inativo"] {
    border-color: #6b7280;
    color: #6b7280;
}

.filter-btn[data-filter="inativo"]:hover,
.filter-btn[data-filter="inativo"].active {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
    box-shadow: 0 2px 10px rgba(107, 114, 128, 0.3);
}

/* Expirando */
.filter-btn[data-filter="expirando"] {
    border-color: #f59e0b;
    color: #f59e0b;
}

.filter-btn[data-filter="expirando"]:hover,
.filter-btn[data-filter="expirando"].active {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

/* Expirado */
.filter-btn[data-filter="expirado"] {
    border-color: #ef4444;
    color: #ef4444;
}

.filter-btn[data-filter="expirado"]:hover,
.filter-btn[data-filter="expirado"].active {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

/* ========== TABELAS ========== */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    /* background: linear-gradient(135deg, #667eea, #764ba2); */
    background: linear-gradient(55deg, #2563eb, #a24f4b 150%);
    font-weight: 700;
    color: white;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    transition: all 0.2s;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ========== AÇÕES ========== */
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 8px 14px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-edit {
    background: #f59e0b;
    color: white;
}

.btn-edit:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* ========== STATUS ========== */
.status-ativo {
    color: #10b981;
    font-weight: 700;
}

.status-inativo {
    color: #ef4444;
    font-weight: 700;
}

.status-expirado {
    color: #6b7280;
    font-weight: 700;
}

/* ========== MODAIS ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 35px;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.4s ease;
}

.modal-form {
    max-width: 800px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    margin-bottom: 25px;
    color: #1f2937;
    font-size: 1.6rem;
    font-weight: 700;
    border-bottom: 3px solid #2563eb;
    padding-bottom: 12px;
}

.close {
    color: #9ca3af;
    position: absolute;
    right: 25px;
    top: 25px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #1f2937;
    transform: rotate(90deg);
}

/* ========== NOTIFICAÇÕES ========== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-left: 4px solid #219a52;
}

.notification.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-left: 4px solid #a93226;
}

.notification.info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-left: 4px solid #21618c;
}

.notification.warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-left: 4px solid #d35400;
}

/* ========== MODAL DE CONFIRMAÇÃO ========== */
.confirm-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.confirm-modal-content {
    background: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease;
    overflow: hidden;
}

.confirm-modal-header {
    background: linear-gradient(55deg, #2563eb, #a24f4b 150%);
    color: white;
    padding: 24px;
    text-align: center;
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.confirm-modal-body {
    padding: 35px 25px;
    text-align: center;
    font-size: 1.05rem;
    color: #374151;
    line-height: 1.6;
}

.confirm-modal-body p {
    margin: 0 0 15px 0;
}

.confirm-modal-footer {
    padding: 0 25px 25px 25px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 13px 28px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    min-width: 120px;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.confirm-btn.cancel {
    background: #6b7280;
    color: white;
}

.confirm-btn.cancel:hover {
    background: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.confirm-btn.confirm {
    background: linear-gradient(55deg, #2563eb, #a24f4b 150%);
    color: white;
}

.confirm-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

/* ========== USER INFO ========== */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

/* ========== MODAL DE CONFIRMAÇÃO ========== */
.modal-confirm {
    max-width: 450px;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
}

.confirm-header {
    background: linear-gradient(55deg, #2563eb, #a24f4b 150%);
    color: white;
    padding: 20px 30px;
    text-align: center;
}

.confirm-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.confirm-body {
    padding: 30px;
    text-align: center;
}

.confirm-body p {
    margin: 0;
    font-size: 1rem;
    color: #374151;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 0 30px 30px 30px;
}

.confirm-actions button {
    flex: 1;
    max-width: 150px;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

/* Sistema de Notificações */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    min-width: 300px;
    max-width: 400px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: 500;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========== FOOTER ========== */
.footer {
    background: #ffffff;
    color: #9ca3af;
    text-align: center;
    padding: 25px 20px;
    margin-top: 50px;
    border-top: 3px solid #2563eb
    ;
}

.footer p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
}

.footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.footer a:hover {
    color: #a24f4b;
    text-decoration: underline;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .estatisticas-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sistemas-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        justify-content: center;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .table-container {
        font-size: 0.9rem;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .estatisticas-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .confirm-modal-footer {
        flex-direction: column;
    }
}