<!-----DASHBOARD------>


/* ===== DASHBOARD BUILDER STYLES ===== */
.db-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    min-height: calc(100vh - 180px);
}

.db-widget {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.db-widget:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.db-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #fafbfc;
    border-bottom: 1px solid #e5e7eb;
    cursor: grab;
}

.db-widget-header:active { cursor: grabbing; }

.db-widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}

.db-widget-title i { color: #00a69b; font-size: 14px; }

.db-widget-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.db-widget:hover .db-widget-actions { opacity: 1; }

.db-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: #6b7280;
    font-size: 12px;
    transition: all 0.2s;
}

.db-btn:hover { background: #e5e7eb; color: #1f2937; }
.db-btn.danger:hover { background: #fef2f2; color: #dc2626; }

.db-widget-body {
    padding: 16px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading */
.db-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #9ca3af;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e5e7eb;
    border-top-color: #00a69b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.db-error {
    text-align: center;
    color: #dc2626;
    padding: 20px;
}
.db-error i { font-size: 32px; margin-bottom: 8px; display: block; }
.db-error button {
    margin-top: 12px;
    padding: 6px 16px;
    background: #00a69b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Empty State */
#dbEmptyState {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    color: #6b7280;
    background: white;
    border-radius: 8px;
    margin: 16px;
}

#dbEmptyState i {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 20px;
}

#dbEmptyState h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

#dbEmptyState p {
    font-size: 14px;
    margin-bottom: 24px;
    max-width: 400px;
    line-height: 1.5;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s;
}

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

/* Toolbar buttons */
.db-btn-primary {
    background: #00a69b !important;
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.db-btn-primary:hover { background: #008f86 !important; }

.db-btn-secondary {
    background: white;
    color: #374151;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.db-btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; }

/* Select dropdowns */
.db-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    outline: none;
}

.db-select:focus { border-color: #00a69b; box-shadow: 0 0 0 3px rgba(0,166,155,0.1); }

/* ===== DASHBOARD BUILDER STYLES ===== */

/* Grid Layout */
.db-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: calc(100vh - 180px);
}

/* Widget Card */
.db-widget {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.db-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Widget Header */
.db-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fafbfc 0%, #f3f4f6 100%);
    border-bottom: 1px solid #e5e7eb;
    cursor: grab;
}

.db-widget-header:active {
    cursor: grabbing;
}

.db-widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}

.db-widget-title i {
    color: #00a69b;
    font-size: 15px;
}

.db-widget-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.db-widget:hover .db-widget-actions {
    opacity: 1;
}

.db-btn {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    font-size: 12px;
    transition: all 0.15s;
}

.db-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
    border-color: #d1d5db;
}

.db-btn-danger:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Widget Body */
.db-widget-body {
    padding: 16px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading Spinner */
.db-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #9ca3af;
}

.spinner-icon {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #00a69b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.db-error-state {
    text-align: center;
    color: #dc2626;
    padding: 20px;
}

.db-error-state i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.db-retry-btn {
    margin-top: 12px;
    padding: 8px 20px;
    background: #00a69b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.db-retry-btn:hover {
    background: #008f86;
}

/* Empty State */
#dbEmptyState {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    background: white;
    border-radius: 12px;
    margin: 20px;
    border: 2px dashed #e5e7eb;
}

#dbEmptyState i {
    font-size: 72px;
    color: #d1d5db;
    margin-bottom: 24px;
}

#dbEmptyState h3 {
    font-size: 24px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
}

#dbEmptyState p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 28px;
    line-height: 1.6;
    max-width: 420px;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

/* Toolbar Buttons */
.db-toolbar-btn-primary {
    background: linear-gradient(135deg, #00a69b 0%, #008f86 100%);
    color: white !important;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,166,155,0.25);
}

.db-toolbar-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,166,155,0.35);
}

.db-toolbar-btn-secondary {
    background: white;
    color: #374151;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.db-toolbar-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Select Dropdowns */
.db-select {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.db-select:focus {
    border-color: #00a69b;
    box-shadow: 0 0 0 3px rgba(0,166,155,0.1);
}

/* Responsive */
@media (max-width: 1200px) {
    .db-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) {
    .db-grid {
        grid-template-columns: 1fr;
    }
    
    .db-widget-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .db-widget-actions {
        opacity: 1; /* Always show on mobile */
    }
}

/* ===== CYBOWATCH DASHBOARD BUILDER v6 - MODERN UI ===== */

/* Grid Layout */
.db-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    min-height: calc(100vh - 140px);
}

/* Widget Card */
.db-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.db-widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,166,155,0.15), 0 4px 12px rgba(0,0,0,0.08);
    border-color: #00a69b;
}

/* Header */
.db-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fafbfc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
    cursor: grab;
}

.db-header:active { cursor: grabbing; }

.db-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.db-title i { color: #00a69b; font-size: 15px; }

.db-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.db-widget:hover .db-actions { opacity: 1; }

/* Action Buttons */
.db-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    color: #64748b;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.db-action-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: scale(1.05);
}

.db-action-btn.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Body */
.db-body {
    padding: 20px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading Spinner */
.db-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #00a69b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Error State */
.db-error {
    text-align: center;
    color: #dc2626;
    padding: 24px;
}

.db-error i { font-size: 36px; margin-bottom: 12px; display: block; }

.db-retry {
    margin-top: 16px;
    padding: 10px 24px;
    background: #00a69b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

.db-retry:hover { background: #008f86; }

/* Empty State */
#dbEmptyState {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    background: white;
    border-radius: 16px;
    margin: 24px;
    border: 2px dashed #cbd5e1;
}

#dbEmptyState i {
    font-size: 72px;
    color: #d1d5db;
    margin-bottom: 24px;
    opacity: 0.6;
}

#dbEmptyState h3 {
    font-size: 26px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

#dbEmptyState p {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 28px;
    line-height: 1.6;
    max-width: 420px;
}

/* ===== TOOLBAR BUTTONS ===== */
.db-toolbar-btn-primary {
    background: linear-gradient(135deg, #00a69b 0%, #008f86 100%) !important;
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,166,155,0.25);
    transition: all 0.2s;
}

.db-toolbar-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,166,155,0.35);
}

.db-toolbar-btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.db-toolbar-btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

/* Select Dropdowns */
.db-select {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: white;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.db-select:focus {
    border-color: #00a69b;
    box-shadow: 0 0 0 3px rgba(0,166,155,0.1);
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.2s ease-out;
}

.modal-box {
    background: white;
    border-radius: 16px;
    width: 520px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 0 8px;
}

.modal-close:hover { color: #374151; }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Picker Items */
.picker-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.picker-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.picker-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.picker-info {
    flex: 1;
    min-width: 0;
}

.picker-name {
    font-weight: 700;
    font-size: 15px;
    color: #1f2937;
    margin-bottom: 4px;
}

.picker-desc {
    font-size: 12px;
    color: #6b7280;
}

.picker-badge {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 99999;
    font-size: 14px;
    font-weight: 500;
    animation: toastSlideIn 0.3s ease-out;
}

.toast-success { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.toast-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }

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

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Responsive */
@media (max-width: 1024px) {
    .db-grid { grid-template-columns: repeat(6, 1fr); }
    .modal-box { width: 90vw; margin: 20px; }
}

@media (max-width: 768px) {
    .db-grid { grid-template-columns: 1fr; }
    .db-header { flex-wrap: wrap; gap: 8px; }
    .db-actions { opacity: 1; width: 100%; justify-content: flex-end; margin-top: 8px; }
}


/* ============================================
   GRAFANA DASHBOARD - WHITE/LIGHT THEME v2.0
   Drag | Resize | Multi-Tenant | Perfect Grid
   ============================================ */

/* ===== CSS VARIABLES - LIGHT THEME ===== */
:root {
    /* Background Colors */
    --gf-bg: #f4f5f7;
    --gf-surface: #ffffff;
    --gf-panel: #ffffff;
    --gf-panel-hover: #fafbfc;
    
    /* Border Colors */
    --gf-border: #e1e4e8;
    --gf-border-light: #d0d5dd;
    --gf-border-focus: #569af6;
    
    /* Text Colors */
    --gf-text: #1f2937;
    --gf-text-muted: #6b7280;
    --gf-text-light: #9ca3af;
    
    /* Primary/Accent Colors */
    --gf-primary: #3274d9;
    --gf-primary-light: #e8f0fe;
    --gf-accent: #569af6;
    --gf-accent-light: rgba(86, 154, 246, 0.1);
    
    /* Status Colors */
    --gf-success: #16a34a;
    --gf-success-light: #dcfce7;
    --gf-warning: #d97706;
    --gf-warning-light: #fef3c7;
    --gf-danger: #dc2626;
    --gf-danger-light: #fee2e2;
    
    /* UI Elements */
    --gf-radius: 6px;
    --gf-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --gf-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --gf-shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    
    /* Grid System */
    --grid-columns: 24;
    --grid-gap: 12px;
}

/* ===== PAGE CONTAINER ===== */
#page-dashboard {
    background: var(--gf-bg);
    color: var(--gf-text);
    min-height: calc(100vh - 60px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
}

/* ===== HEADER - CLEAN WHITE ===== */
.db-header {
    background: var(--gf-surface);
    border-bottom: 1px solid var(--gf-border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--gf-shadow-sm);
}

.db-title-group h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gf-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.db-title-group h2 i { 
    color: var(--gf-primary); 
    font-size: 16px; 
}

.db-subtitle { 
    margin: 3px 0 0 28px; 
    font-size: 12px; 
    color: var(--gf-text-muted); 
}

/* ===== TOOLBAR ===== */
.db-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Tenant Selector */
.tenant-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 16px;
    border-right: 2px solid var(--gf-border);
    margin-right: 12px;
}

.tenant-selector label {
    font-size: 11px;
    color: var(--gf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.tenant-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--gf-primary-light);
    border: 1px solid var(--gf-border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--gf-primary);
    font-weight: 500;
}

.tenant-badge i { font-size: 11px; }

/* SELECT DROPDOWNS - CLEAN WHITE STYLE */
.db-select {
    background: var(--gf-surface);
    color: var(--gf-text);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius);
    padding: 7px 32px 7px 12px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s ease;
    min-width: 130px;
    font-weight: 400;
}

.db-select:hover { 
    border-color: var(--gf-border-light); 
    background-color: #fafbfc;
}

.db-select:focus { 
    border-color: var(--gf-accent); 
    box-shadow: 0 0 0 3px var(--gf-accent-light); 
}

/* BUTTONS - MODERN WHITE STYLE */
.db-btn {
    background: var(--gf-surface);
    color: var(--gf-text);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius);
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.db-btn:hover { 
    background: #f8f9fa; 
    border-color: var(--gf-border-light); 
    box-shadow: var(--gf-shadow-sm);
}

.db-btn i { font-size: 13px; }

.db-btn-primary {
    background: var(--gf-primary) !important;
    color: white !important;
    border-color: var(--gf-primary) !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(50, 116, 217, 0.25);
}
.db-btn-primary:hover { 
    background: #2563eb !important; 
    box-shadow: 0 4px 12px rgba(50, 116, 217, 0.35); 
    transform: translateY(-1px);
}

/* ============================================
   GRID LAYOUT SYSTEM
   Clean 24-column grid for perfect alignment
   ============================================ */

.db-grid {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: var(--grid-gap);
    padding: 20px;
    min-height: calc(100vh - 140px);
    grid-auto-rows: minmax(30px, auto);
    align-items: start;
    grid-auto-flow: dense;
    max-width: 100%;
}

/* ============================================
   WIDGET/PANEL CARD - WHITE CARD STYLE
   With shadow and subtle borders
   ============================================ */

.db-widget {
    background: var(--gf-panel);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius);
    overflow: hidden;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 120px;
    min-width: 200px;
    box-shadow: var(--gf-shadow-sm);
}

.db-widget:hover {
    border-color: var(--gf-border-light);
    box-shadow: var(--gf-shadow-md);
    z-index: 10;
    transform: translateY(-2px);
}

/* Dragging State */
.db-widget.dragging {
    opacity: 0.95;
    box-shadow: var(--gf-shadow-lg);
    z-index: 1000;
    cursor: grabbing !important;
    transform: rotate(1deg) scale(1.02);
    border-color: var(--gf-accent);
}

.db-widget.drag-over {
    border: 2px dashed var(--gf-accent);
    background: var(--gf-accent-light);
}

/* Resizing State */
.db-widget.resizing {
    outline: 2px solid var(--gf-accent);
    outline-offset: 2px;
}

/* ============================================
   PANEL HEADER - LIGHT GRAY BAR
   ============================================ */

.db-widget-header {
    background: linear-gradient(to bottom, #f8f9fa, #f1f3f5);
    border-bottom: 1px solid var(--gf-border);
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    user-select: none;
    min-height: 42px;
    position: relative;
}

.db-widget-header:active { cursor: grabbing; }

/* Drag indicator dots */
.db-widget-header::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background: repeating-linear-gradient(
        to bottom,
        #cbd5e1 0px,
        #cbd5e1 3px,
        transparent 3px,
        transparent 5px
    );
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: 2px;
}

.db-widget:hover .db-widget-header::before { opacity: 0.6; }

.db-widget-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gf-text);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 10px;
}

.db-widget-title i { 
    color: var(--gf-accent); 
    font-size: 13px; 
    opacity: 0.85; 
}

/* Panel Actions */
.db-widget-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.db-widget:hover .db-widget-actions { opacity: 1; }

.db-widget-actions .db-btn {
    padding: 5px 10px;
    font-size: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--gf-text-muted);
    border-radius: 4px;
}

.db-widget-actions .db-btn:hover { 
    background: #f1f3f5; 
    color: var(--gf-text); 
    border-color: var(--gf-border);
}

.db-widget-actions .db-btn.danger:hover { 
    color: var(--gf-danger); 
    background: var(--gf-danger-light); 
    border-color: #fecaca;
}

/* ============================================
   RESIZE HANDLES - BLUE ACCENT
   ============================================ */

.resize-handle {
    position: absolute;
    background: transparent;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s;
}

.db-widget:hover .resize-handle { opacity: 1; }

/* Corner handle - SE */
.resize-handle-se {
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 55%, var(--gf-accent) 55%);
    border-radius: 0 0 var(--gf-radius) 0;
}

/* Edge handle - E (right) */
.resize-handle-e {
    right: 0;
    top: 25%;
    width: 8px;
    height: 50%;
    cursor: e-resize;
    background: linear-gradient(to right, transparent 40%, var(--gf-accent) 40%, var(--gf-accent) 60%, transparent 60%);
}

/* Edge handle - S (bottom) */
.resize-handle-s {
    bottom: 0;
    left: 25%;
    height: 8px;
    width: 50%;
    cursor: s-resize;
    background: linear-gradient(to bottom, transparent 40%, var(--gf-accent) 40%, var(--gf-accent) 60%, transparent 60%);
}

/* Size tooltip */
.size-indicator {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--gf-text);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    margin-bottom: 6px;
    z-index: 30;
    box-shadow: var(--gf-shadow-sm);
}

.db-widget.resizing .size-indicator { opacity: 1; }

/* ============================================
   PANEL BODY - CLEAN WHITE
   ============================================ */

.db-widget-body {
    padding: 16px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gf-panel);
    overflow: hidden;
    position: relative;
}

/* ============================================
   LOADING STATE - SPINNER
   ============================================ */

.db-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--gf-text-muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gf-border);
    border-top-color: var(--gf-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* Error State */
.db-error {
    text-align: center;
    color: var(--gf-danger);
    padding: 24px;
}

.db-error i { 
    font-size: 40px; 
    margin-bottom: 12px; 
    display: block; 
    opacity: 0.6; 
}

.db-error button {
    margin-top: 14px; 
    padding: 8px 20px; 
    background: var(--gf-danger); 
    color: white; 
    border: none; 
    border-radius: var(--gf-radius); 
    cursor: pointer; 
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.db-error button:hover {
    background: #b91c1c;
}

/* ============================================
   EMPTY STATE - WELCOME SCREEN
   ============================================ */

#dbEmptyState {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    background: var(--gf-panel);
    border: 2px dashed var(--gf-border);
    border-radius: 12px;
    margin: 24px;
    color: var(--gf-text-muted);
    grid-column: 1 / -1;
    box-shadow: var(--gf-shadow-sm);
}

#dbEmptyState i { 
    font-size: 72px; 
    color: var(--gf-border); 
    margin-bottom: 24px; 
    opacity: 0.5; 
}

#dbEmptyState h3 { 
    font-size: 22px; 
    font-weight: 600; 
    color: var(--gf-text); 
    margin: 0 0 12px 0; 
}

#dbEmptyState p { 
    font-size: 14px; 
    margin: 0 0 28px 0; 
    max-width: 420px; 
    line-height: 1.6; 
    color: var(--gf-text-muted);
}

#dbEmptyState .db-btn-primary {
    font-size: 14px;
    padding: 12px 24px;
}

/* ============================================
   MODAL - WHITE OVERLAY
   ============================================ */

.modal-overlay {
    position: fixed; 
    inset: 0;
    background: rgba(107, 114, 128, 0.4);
    backdrop-filter: blur(4px);
    display: flex; 
    align-items: center; 
    justify-content: center;
    z-index: 99999; 
    animation: fadeIn 0.2s ease-out;
}

.modal-box {
    background: var(--gf-panel);
    border: 1px solid var(--gf-border);
    border-radius: 12px;
    width: 620px; 
    max-width: 95vw;
    max-height: 85vh; 
    overflow-y: auto;
    box-shadow: var(--gf-shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 18px 24px; 
    border-bottom: 1px solid var(--gf-border);
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 { 
    margin: 0; 
    font-size: 17px; 
    font-weight: 600; 
    color: var(--gf-text); 
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close { 
    background: none; 
    border: none; 
    font-size: 26px; 
    cursor: pointer; 
    color: var(--gf-text-muted); 
    line-height: 1; 
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s;
}

.modal-close:hover { 
    color: var(--gf-text); 
    background: #f1f3f5; 
}

.modal-body { 
    padding: 24px; 
}

.modal-footer { 
    padding: 16px 24px; 
    border-top: 1px solid var(--gf-border); 
    text-align: right; 
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Widget Picker Items */
.picker-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
}

.picker-item {
    display: flex; 
    align-items: center; 
    gap: 16px;
    padding: 16px; 
    border: 1px solid var(--gf-border);
    border-radius: 8px; 
    cursor: pointer;
    background: var(--gf-surface); 
    transition: all 0.2s ease;
    box-shadow: var(--gf-shadow-sm);
}

.picker-item:hover { 
    border-color: var(--gf-accent); 
    background: var(--gf-accent-light); 
    transform: translateY(-2px);
    box-shadow: var(--gf-shadow-md);
}

.picker-icon {
    width: 48px; 
    height: 48px; 
    border-radius: 10px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: white; 
    font-size: 20px; 
    flex-shrink: 0;
    background: linear-gradient(135deg, #3274d9, #569af6);
    box-shadow: 0 4px 12px rgba(50, 116, 217, 0.3);
}

.picker-info { 
    flex: 1; 
    min-width: 0; 
}

.picker-name { 
    font-weight: 600; 
    font-size: 14px; 
    color: var(--gf-text); 
    margin-bottom: 4px; 
}

.picker-desc { 
    font-size: 12px; 
    color: var(--gf-text-muted); 
}

/* Category badge in picker */
.picker-item::after {
    content: attr(data-category);
    font-size: 10px;
    font-weight: 600;
    color: var(--gf-text-muted);
    background: #f1f3f5;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   DATA TABLE - CLEAN WHITE TABLE
   ============================================ */

.data-table-wrapper { 
    width: 100%; 
    overflow-x: auto; 
    border-radius: 6px;
    border: 1px solid var(--gf-border);
}

.data-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 13px; 
}

.data-table th {
    background: #f8f9fa; 
    color: var(--gf-text-muted);
    font-weight: 600; 
    text-align: left; 
    padding: 10px 14px;
    border-bottom: 2px solid var(--gf-border); 
    white-space: nowrap;
    font-size: 11px; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.data-table td { 
    padding: 10px 14px; 
    border-bottom: 1px solid #f0f0f0; 
    color: var(--gf-text); 
    font-size: 13px;
    transition: background 0.15s;
}

.data-table tr:hover td { 
    background: #f8f9fa; 
}

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

/* Status Badges - Soft Colors */
.status-badge {
    display: inline-flex; 
    align-items: center;
    gap: 4px;
    padding: 4px 10px; 
    border-radius: 20px;
    font-size: 11px; 
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-active { 
    background: var(--gf-success-light); 
    color: var(--gf-success);
    border: 1px solid #bbf7d0;
}
.status-active::before { background: var(--gf-success); }

.status-disconnected { 
    background: var(--gf-danger-light); 
    color: var(--gf-danger);
    border: 1px solid #fecaca;
}
.status-disconnected::before { background: var(--gf-danger); }

.status-pending { 
    background: var(--gf-warning-light); 
    color: var(--gf-warning);
    border: 1px solid #fde68a;
}
.status-pending::before { background: var(--gf-warning); }

/* Metric Display - Large Numbers */
.metric-display { 
    text-align: center; 
    width: 100%; 
}

.metric-value { 
    font-size: 48px; 
    font-weight: 700; 
    line-height: 1; 
    margin-bottom: 8px; 
    letter-spacing: -2px;
    color: var(--gf-text);
}

.metric-label { 
    font-size: 13px; 
    color: var(--gf-text-muted); 
    text-transform: uppercase; 
    letter-spacing: 1px;
    font-weight: 500;
}

/* Gauge Container */
.gauge-container { 
    text-align: center; 
    width: 100%; 
}

.gauge-svg { 
    max-width: 220px; 
    width: 100%; 
}

.gauge-label { 
    margin-top: 10px; 
    font-size: 13px; 
    color: var(--gf-text-muted); 
    font-weight: 500;
}

/* Agent Summary Box */
.agent-summary {
    font-size: 13px; 
    color: var(--gf-text-muted); 
    margin-bottom: 14px;
    padding: 12px 16px; 
    background: #f8f9fa;
    border-radius: 8px; 
    border-left: 4px solid var(--gf-primary);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.agent-summary strong {
    color: var(--gf-text);
}

/* Clock Display */
.clock-time {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

/* ============================================
   TOAST NOTIFICATIONS - SLIDE IN FROM BOTTOM
   ============================================ */

.toast {
    position: fixed; 
    bottom: 24px; 
    right: 24px;
    display: flex; 
    align-items: center; 
    gap: 10px;
    padding: 14px 22px; 
    border-radius: 8px;
    box-shadow: var(--gf-shadow-lg);
    z-index: 99999; 
    font-size: 14px; 
    font-weight: 500;
    animation: toastSlideIn 0.3s ease-out; 
    color: white;
    border: none;
}

.toast-success { 
    background: linear-gradient(135deg, #16a34a, #15803d); 
}

.toast-error { 
    background: linear-gradient(135deg, #dc2626, #b91c1c); 
}

.toast-warning { 
    background: linear-gradient(135deg, #d97706, #b45309); 
}

.toast-info {
    background: linear-gradient(135deg, #3274d9, #2563eb);
}

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

@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}

@keyframes slideUp { 
    from { transform: translateY(30px); opacity: 0; } 
    to { transform: translateY(0); opacity: 1; } 
}

@keyframes fadeOut { 
    to { opacity: 0; transform: translateY(-10px); } 
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

@media (max-width: 1600px) {
    .db-grid { 
        grid-template-columns: repeat(18, 1fr); 
        gap: 10px;
        padding: 16px;
    }
}

@media (max-width: 1200px) {
    .db-grid { 
        grid-template-columns: repeat(12, 1fr); 
        gap: 8px; 
        padding: 12px; 
    }
    
    .modal-box { 
        width: 95vw; 
    }
}

@media (max-width: 900px) {
    .db-grid { 
        grid-template-columns: repeat(6, 1fr); 
    }
    
    .picker-grid { 
        grid-template-columns: 1fr; 
    }
    
    .tenant-selector { 
        border-right: none; 
        border-bottom: 2px solid var(--gf-border);
        padding-bottom: 12px; 
        margin-bottom: 12px;
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 600px) {
    .db-header { 
        flex-direction: column; 
        align-items: stretch; 
        padding: 12px 16px;
    }
    
    .db-toolbar { 
        justify-content: center; 
        flex-wrap: wrap; 
    }
    
    .db-grid { 
        grid-template-columns: 1fr; 
        padding: 12px;
    }
    
    .db-widget { 
        min-width: auto;
    }
    
    .db-widget-actions { 
        opacity: 1; /* Always show on mobile */ 
    }
    
    .metric-value {
        font-size: 36px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .db-header,
    .db-toolbar,
    .resize-handle,
    .size-indicator,
    .db-widget-actions,
    .toast {
        display: none !important;
    }
    
    .db-grid {
        display: block !important;
        padding: 0;
    }
    
    .db-widget {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 16px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   SCROLLBAR STYLING (Webkit)
   ============================================ */

.db-widget-body::-webkit-scrollbar,
.modal-box::-webkit-scrollbar,
.data-table-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.db-widget-body::-webkit-scrollbar-track,
.modal-box::-webkit-scrollbar-track,
.data-table-wrapper::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 3px;
}

.db-widget-body::-webkit-scrollbar-thumb,
.modal-box::-webkit-scrollbar-thumb,
.data-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.db-widget-body::-webkit-scrollbar-thumb:hover,
.modal-box::-webkit-scrollbar-thumb:hover,
.data-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   SELECTION HIGHLIGHT
   ============================================ */

.db-widget::selection,
.db-widget-body::selection {
    background: var(--gf-accent-light);
    color: var(--gf-text);
}

/* ===== DRAG STATES ===== */
.db-widget.is-dragging {
    opacity: 0.35 !important;
    transform: scale(0.98);
    transition: all 0.2s ease;
}

.db-widget.is-resizing {
    outline: 2px solid var(--gf-accent) !important;
    outline-offset: 3px;
}

/* Ghost element during drag */
.drag-ghost {
    box-shadow: 0 20px 50px rgba(0,0,0,0.25) !important;
    border: 2px solid var(--gf-accent) !important;
    border-radius: 8px !important;
    pointer-events: none !important;
}

/* Placeholder showing drop location */
.drag-placeholder {
    background: linear-gradient(135deg, rgba(86,154,246,0.05), rgba(86,154,246,0.1)) !important;
    border: 2px dashed var(--gf-accent) !important;
    border-radius: 8px !important;
    animation: placeholderPulse 1.5s ease-in-out infinite;
}

@keyframes placeholderPulse {
    0%, 100% { background-color: rgba(86,154,246,0.03); }
    50% { background-color: rgba(86,154,246,0.1); }
}

/* Make cursor obvious on draggable areas */
.db-widget-header {
    cursor: grab;
}
.db-widget-header:active {
    cursor: grabbing !important;
}

/* Resize cursor hints */
.resize-handle-se { cursor: se-resize; }
.resize-handle-e { cursor: e-resize; }
.resize-handle-s { cursor: s-resize; }



