/**
 * Estilo Global Padronizado - Panel VoIP
 * Aplicado em todas as páginas para manter consistência visual
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0f1419;
    color: #e0e0e0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ==================== HEADER & PAGE LAYOUT ==================== */
.header {
    margin-bottom: 40px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 800px;
    margin-bottom: 20px;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    white-space: nowrap;
    flex-shrink: 0;
}

.header h1 {
    font-size: 2em;
    color: #ffffff;
    margin-bottom: 5px;
    font-weight: 600;
}

.header p {
    color: #a0a0a0;
    font-size: 0.95em;
}

/* ==================== PAGE TITLE ==================== */
.page-title {
    font-size: 2em;
    color: #ffffff;
    margin-bottom: 5px;
    font-weight: 600;
}

.page-subtitle {
    color: #a0a0a0;
    font-size: 0.95em;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
}

.btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ==================== CARDS & CONTAINERS ==================== */
.card {
    background: #1e2329;
    border: 1px solid #353b44;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #4a9eff;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.1);
}

.card-dark {
    background: #0f1419;
    border: 1px solid #353b44;
}

/* ==================== STATS CARDS ==================== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #1e2329;
    border: 1px solid #353b44;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-card:hover {
    border-color: #4a9eff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.1);
}

.stat-icon {
    font-size: 32px;
    min-width: 50px;
    text-align: center;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.75em;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    color: #ffffff;
    font-weight: 700;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #a0a0a0;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    background: #1e2329;
    border: 1px solid #353b44;
    border-radius: 6px;
    padding: 10px 15px;
    color: #e0e0e0;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

select.form-control {
    cursor: pointer;
}

select.form-control option {
    background: #1e2329;
    color: #e0e0e0;
}

/* ==================== SEARCH & FILTERS ==================== */
.toolbar {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    background: #1e2329;
    border: 1px solid #353b44;
    border-radius: 6px;
    padding: 10px 15px;
    gap: 10px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e0e0e0;
    outline: none;
    font-size: 0.95em;
}

.search-box input::placeholder {
    color: #606366;
}

.filter-dropdown,
.date-filter {
    background: #1e2329;
    border: 1px solid #353b44;
    border-radius: 6px;
    padding: 10px 15px;
    color: #e0e0e0;
    cursor: pointer;
    outline: none;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.filter-dropdown:hover,
.date-filter:hover {
    border-color: #4a9eff;
}

.filter-dropdown:focus,
.date-filter:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

/* ==================== TABLES ==================== */
.table-wrapper {
    background: #1e2329;
    border-radius: 6px;
    border: 1px solid #353b44;
    overflow: hidden;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #0f1419;
    padding: 15px;
    text-align: left;
    color: #a0a0a0;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #353b44;
}

td {
    padding: 15px;
    border-bottom: 1px solid #353b44;
    font-size: 0.9em;
}

tr:hover {
    background: #252d36;
}

/* ==================== STATUS BADGES ==================== */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid;
}

.status-success {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border-color: #4caf50;
}

.status-error {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border-color: #f44336;
}

.status-info {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
    border-color: #2196f3;
}

.status-warning {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    border-color: #ff9800;
}

/* ==================== MESSAGES ==================== */
.message {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-success {
    background: #10b981;
    color: white;
}

.message-error {
    background: #ef4444;
    color: white;
}

.message-info {
    background: #3b82f6;
    color: white;
}

.message-warning {
    background: #f59e0b;
    color: white;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    border-bottom: 1px solid #353b44;
}

.tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: #a0a0a0;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab:hover {
    color: #e0e0e0;
}

.tab.active {
    color: #4a9eff;
    border-bottom-color: #4a9eff;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #606366;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1em;
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    background: #0f1419;
    border-top: 1px solid #353b44;
    font-size: 0.9em;
    color: #a0a0a0;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    width: 32px;
    height: 32px;
    background: #1e2329;
    border: 1px solid #353b44;
    border-radius: 4px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.pagination-btn:hover:not(:disabled) {
    background: #353b44;
    border-color: #4a9eff;
    color: #4a9eff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== GRID LAYOUTS ==================== */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.grid-item {
    background: #1e2329;
    border: 1px solid #353b44;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.grid-item:hover {
    border-color: #4a9eff;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.1);
    transform: translateY(-2px);
}

.grid-item-title {
    font-size: 1.1em;
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 10px;
}

.grid-item-subtitle {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-bottom: 15px;
}

/* ==================== UTILITIES ==================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #a0a0a0;
}

.text-success {
    color: #4caf50;
}

.text-error {
    color: #f44336;
}

.text-info {
    color: #2196f3;
}

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

.gap-20 {
    gap: 20px;
}

.rounded {
    border-radius: 8px;
}

/* ==================== CONEXÕES & CONFIG SPECIFIC ==================== */
.info-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.info-item {
    flex: 1;
    min-width: 200px;
}

.info-label {
    font-size: 0.85em;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.info-value {
    color: #e0e0e0;
    font-weight: 500;
    word-break: break-all;
}

.conexoes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.conexao-card {
    background: #1e2329;
    border: 1px solid #353b44;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.conexao-card:hover {
    border-color: #4a9eff;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.1);
    transform: translateY(-2px);
}

.conexao-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #353b44;
}

.conexao-icon {
    font-size: 1.8em;
}

.conexao-titulo {
    font-size: 1.1em;
    color: #ffffff;
    font-weight: 600;
}

.conexao-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    margin-top: 10px;
    text-transform: uppercase;
}

.status-ativo {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid #10b981;
}

.status-inativo {
    background: rgba(239, 68, 68, 0.15);
    color: #f44336;
    border: 1px solid #f44336;
}

.conexao-info {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-top: 10px;
    line-height: 1.6;
}

.vazio {
    background: #1e2329;
    border: 1px solid #353b44;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: #606366;
}

.config-section {
    background: #1e2329;
    border: 1px solid #353b44;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 20px;
}

.config-section h2 {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #4a9eff;
    border-bottom: 1px solid #353b44;
    padding-bottom: 10px;
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
}

.result.success,
.test-result.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #10b981;
}

.result.error,
.test-result.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #f44336;
    color: #f44336;
}

.result pre {
    margin-top: 10px;
    overflow-x: auto;
    color: #e0e0e0;
}

.info-box {
    background: #0f1419;
    border: 1px solid #353b44;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #a0a0a0;
}

.info-box strong {
    color: #4a9eff;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 20px;
    }

    .header-right {
        align-items: flex-start;
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        flex: 1;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.8em;
    }

    th, td {
        padding: 10px;
    }

    .tabs {
        overflow-x: auto;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }

    .conexoes-container {
        grid-template-columns: 1fr;
    }

    .info-row {
        flex-direction: column;
    }
}
