/*
 * Monitoring Page V3
 */

.page-content:has(.monitoring-page-v3) nav[aria-label="breadcrumb"],
.page-content:has(.monitoring-page-v3) .page-header {
    display: none;
}

.monitoring-page-v3 {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.mon-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    border-radius: 18px;
    padding: 26px 30px;
    position: relative;
    overflow: hidden;
}

.mon-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.mon-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 12px;
}

.mon-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mon-title i { font-size: 20px; opacity: 0.9; }

.mon-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    margin: 0;
}

.mon-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.mon-info-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* Info Box */
.mon-info-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
}

.mon-info-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #dbeafe;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.mon-info-content {
    flex: 1;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.6;
}

.mon-info-content strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.mon-info-content ul {
    margin: 0;
    padding-left: 18px;
}

.mon-info-content li {
    margin-bottom: 4px;
}

.mon-info-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

/* Stats */
.mon-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.mon-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.mon-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.msi-total { background: #eef2ff; color: #6366f1; }
.msi-fast { background: #dcfce7; color: #16a34a; }
.msi-med { background: #fef3c7; color: #d97706; }
.msi-slow { background: #fee2e2; color: #dc2626; }

.mon-stat-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mon-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #1f2937;
}

.mon-stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Filter */
.mon-filter {
    display: flex;
}

.mon-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0 16px;
    width: 100%;
    max-width: 400px;
    transition: all 0.2s ease;
}

.mon-search:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mon-search i { color: #9ca3af; font-size: 14px; }

.mon-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    background: transparent;
}

.mon-search input::placeholder { color: #9ca3af; }

/* Table */
.mon-table-wrapper {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

.mon-table-container {
    overflow-x: auto;
    max-height: 520px;
    overflow-y: auto;
}

.mon-table-container::-webkit-scrollbar { width: 5px; }
.mon-table-container::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 10px; }

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

.mon-table thead {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 5;
}

.mon-table thead th {
    padding: 13px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    text-align: left;
    white-space: nowrap;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.mon-row td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    vertical-align: middle;
}

.mon-row:hover { background: #fafbff; }

.mon-td-id a {
    font-weight: 700;
    color: #6366f1;
    text-decoration: none;
}

.mon-td-id a:hover { text-decoration: underline; }

.mon-td-service {
    font-weight: 600;
    color: #1f2937;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mon-td-qty { color: #4b5563; font-weight: 600; }
.mon-td-price { color: #1f2937; font-weight: 700; white-space: nowrap; }
.mon-td-date { color: #6b7280; font-size: 12px; white-space: nowrap; }

/* Speed Badge */
.mon-speed-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.speed-fast { background: #dcfce7; color: #16a34a; }
.speed-med { background: #fef3c7; color: #d97706; }
.speed-slow { background: #fee2e2; color: #dc2626; }

/* Footer */
.mon-table-footer {
    padding: 14px 16px;
    border-top: 1px solid #f3f4f6;
    background: #fafbfc;
}

.mon-result-info {
    font-size: 13px;
    color: #6b7280;
}

.mon-result-info strong { color: #6366f1; }

/* Dark Theme */
.dark-theme .mon-stat-card,
.dark-theme .mon-table-wrapper {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme .mon-stat-value { color: #f1f5f9; }
.dark-theme .mon-search { background: #1e293b; border-color: #334155; }
.dark-theme .mon-search input { color: #f1f5f9; }
.dark-theme .mon-table thead, .dark-theme .mon-table thead th { background: #0f172a; color: #94a3b8; border-color: #334155; }
.dark-theme .mon-row td { border-color: #334155; }
.dark-theme .mon-row:hover { background: #334155; }
.dark-theme .mon-td-service { color: #f1f5f9; }
.dark-theme .mon-td-price { color: #f1f5f9; }
.dark-theme .mon-table-footer { background: #0f172a; border-color: #334155; }
.dark-theme .mon-info-box { background: #1e1b4b; border-color: #312e81; }
.dark-theme .mon-info-content { color: #a5b4fc; }
.dark-theme .mon-info-icon { background: #312e81; color: #a5b4fc; }
.dark-theme .mon-header { background: linear-gradient(135deg, #0369a1 0%, #4338ca 100%); }

/* Responsive */
@media (max-width: 768px) {
    .mon-stats { grid-template-columns: repeat(2, 1fr); }
    .mon-header { padding: 22px 20px; border-radius: 14px; }
    .mon-title { font-size: 20px; }
    .mon-search { max-width: 100%; }
    .mon-table-container { max-height: 400px; }
}

@media (max-width: 480px) {
    .mon-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .mon-stat-card { padding: 12px 14px; }
    .mon-stat-value { font-size: 18px; }
}
