/**
 * [v8.9] Contratos Index - CSS
 * Tema Dark Tech v8.9 ULTRA PREMIUM
 */

/* ============================================
   TOAST CONTAINER
   ============================================ */
#isp-toasts {
    z-index: 9999 !important;
}

.isp-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    background: rgba(30, 30, 50, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.85rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.isp-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.isp-toast-success { border-left: 4px solid #2ecc71; }
.isp-toast-success i { color: #2ecc71; }
.isp-toast-error { border-left: 4px solid #e74c3c; }
.isp-toast-error i { color: #e74c3c; }
.isp-toast-warning { border-left: 4px solid #f39c12; }
.isp-toast-warning i { color: #f39c12; }
.isp-toast-info { border-left: 4px solid #06b6d4; }
.isp-toast-info i { color: #06b6d4; }

/* ============================================
   HEADER
   ============================================ */
.isp-header {
    background: rgba(15, 12, 41, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.isp-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.isp-status-dot.online { background: #2ecc71; box-shadow: 0 0 8px #2ecc71; }

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    display: block;
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.stat-card .label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.stat-card .icon-bg {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-card.card-primary { border-left: 3px solid #4361ee; }
.stat-card.card-success { border-left: 3px solid #2ecc71; }
.stat-card.card-warning { border-left: 3px solid #f39c12; }
.stat-card.card-info { border-left: 3px solid #06b6d4; }

/* ============================================
   PANELS
   ============================================ */
.isp-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.isp-panel-header {
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.isp-panel-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.isp-panel-body {
    padding: 16px 20px;
}

/* ============================================
   FILTER TABS
   ============================================ */
.isp-filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.isp-filter-tab {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.isp-filter-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.isp-filter-tab.active-all,
.isp-filter-tab[data-tab-status="ativo"],
.isp-filter-tab[data-tab-status="suspenso"],
.isp-filter-tab[data-tab-status="cancelado"] {
    background: rgba(67, 97, 238, 0.2);
    border-color: rgba(67, 97, 238, 0.4);
    color: #a5b4fc;
}

/* ============================================
   SEARCH
   ============================================ */
.isp-search-wrap {
    position: relative;
    flex: 1;
    max-width: 350px;
}

.isp-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.isp-search {
    width: 100%;
    padding: 8px 12px 8px 38px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.isp-search:focus {
    outline: none;
    border-color: rgba(67, 97, 238, 0.5);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.isp-search::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

/* ============================================
   FORMS
   ============================================ */
.isp-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.isp-input,
.isp-select,
.isp-textarea {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.isp-input:focus,
.isp-select:focus,
.isp-textarea:focus {
    outline: none;
    border-color: rgba(67, 97, 238, 0.5);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.isp-select option {
    background: #1a1a2e;
    color: #fff;
}

/* ============================================
   TABLE
   ============================================ */
.isp-table-scroll {
    overflow-x: auto;
}

.isp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.isp-table thead {
    background: rgba(255, 255, 255, 0.02);
}

.isp-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.isp-th-sortable {
    cursor: pointer;
    user-select: none;
}

.isp-th-sortable:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.isp-sort-icon {
    font-size: 0.65rem;
    margin-left: 4px;
    opacity: 0.5;
}

.isp-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    vertical-align: middle;
}

.isp-table tbody tr {
    transition: background 0.15s;
}

.isp-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.isp-table tbody tr.cursor-pointer {
    cursor: pointer;
}

/* ============================================
   BADGES & STATUS
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-static { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.badge-unreach { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.badge-dynamic { background: rgba(243, 156, 18, 0.15); color: #f39c12; }
.badge-connect { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.badge-info { background: rgba(67, 97, 238, 0.15); color: #a5b4fc; }
.badge-unknown { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.5); }

.isp-code {
    background: rgba(67, 97, 238, 0.15);
    color: #a5b4fc;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.isp-action-group {
    display: flex;
    gap: 4px;
}

.isp-act-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.isp-act-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.isp-act-btn.btn-view:hover { background: rgba(67, 97, 238, 0.2); color: #a5b4fc; }
.isp-act-btn.btn-edit:hover { background: rgba(243, 156, 18, 0.2); color: #f39c12; }
.isp-act-btn.btn-del:hover { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.isp-act-btn.btn-pdf:hover { background: rgba(220, 53, 69, 0.2); color: #dc3545; }
.isp-act-btn.btn-renew:hover { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.isp-act-btn.btn-cancel:hover { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }

/* ============================================
   MASS ACTIONS BAR
   ============================================ */
#ispMassaBar {
    display: none;
    padding: 10px 16px;
    background: rgba(67, 97, 238, 0.1);
    border-top: 1px solid rgba(67, 97, 238, 0.2);
    border-bottom: 1px solid rgba(67, 97, 238, 0.2);
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#ispMassaBar.visible { display: flex; }

.massa-count {
    font-size: 0.8rem;
    color: #a5b4fc;
    font-weight: 600;
}

/* ============================================
   PAGINATION
   ============================================ */
.isp-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s;
}

.isp-page-link:hover:not(.disabled):not(.isp-active) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.isp-page-link.isp-active {
    background: rgba(67, 97, 238, 0.3);
    color: #a5b4fc;
    font-weight: 600;
}

.isp-page-link.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.isp-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.isp-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.isp-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-isp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-isp-sm { padding: 6px 12px; font-size: 0.75rem; }

.btn-isp-primary { background: rgba(67, 97, 238, 0.8); color: #fff; }
.btn-isp-primary:hover { background: #4361ee; }

.btn-isp-success { background: rgba(46, 204, 113, 0.2); color: #2ecc71; border-color: rgba(46, 204, 113, 0.3); }
.btn-isp-success:hover { background: rgba(46, 204, 113, 0.3); }

.btn-isp-warning { background: rgba(243, 156, 18, 0.2); color: #f39c12; border-color: rgba(243, 156, 18, 0.3); }
.btn-isp-warning:hover { background: rgba(243, 156, 18, 0.3); }

.btn-isp-danger { background: rgba(231, 76, 60, 0.2); color: #e74c3c; border-color: rgba(231, 76, 60, 0.3); }
.btn-isp-danger:hover { background: rgba(231, 76, 60, 0.3); }

.btn-isp-info { background: rgba(6, 182, 212, 0.2); color: #06b6d4; border-color: rgba(6, 182, 212, 0.3); }
.btn-isp-info:hover { background: rgba(6, 182, 212, 0.3); }

/* ============================================
   MODALS
   ============================================ */
.modal-content {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 20px;
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.modal-body { padding: 20px; }

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 20px;
}

.btn-close {
    filter: invert(1);
    opacity: 0.5;
}

.btn-close:hover { opacity: 1; }

.isp-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
}

.isp-modal-icon.success { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.isp-modal-icon.warning { background: rgba(243, 156, 18, 0.15); color: #f39c12; }

/* ============================================
   TABS
   ============================================ */
.isp-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.isp-tab-btn {
    padding: 8px 16px;
    border-radius: 6px 6px 0 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.isp-tab-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.isp-tab-btn.active { color: #a5b4fc; background: rgba(67, 97, 238, 0.15); }

.isp-tab-pane { display: none; }
.isp-tab-pane.active { display: block; }

/* ============================================
   SYNC CHECKPOINTS
   ============================================ */
.sync-checkpoint {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 6px;
}

.sync-checkpoint-label { font-size: 0.8rem; color: rgba(255, 255, 255, 0.8); }

.sync-terminal {
    background: #0a0a14;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    color: #00ff00;
    max-height: 200px;
    overflow-y: auto;
}

/* ============================================
   TOOLBAR
   ============================================ */
.isp-table-toolbar {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.isp-toolbar-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.isp-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ============================================
   COMPACT MODE
   ============================================ */
body.isp-compact .isp-table td,
body.isp-compact .isp-table th {
    padding: 8px 10px;
}

body.isp-compact .stat-card {
    padding: 14px;
}

body.isp-compact .isp-panel-header {
    padding: 10px 14px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .isp-filter-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
    }

    .isp-search-wrap {
        max-width: 100%;
        width: 100%;
    }

    .isp-table {
        font-size: 0.7rem;
    }

    .isp-table th,
    .isp-table td {
        padding: 8px 10px;
    }

    .isp-action-group {
        gap: 2px;
    }

    .isp-act-btn {
        width: 26px;
        height: 26px;
        font-size: 0.65rem;
    }
}
