        body {
            margin: 0;
            padding: 70px 0 0;
            font-family: Arial, sans-serif;
            background: #f4f7fb;
            color: #1f2937;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }
        .page-wrap {
            max-width: 1320px;
            margin: 0 auto;
            width: 100%;
            padding: 20px 16px 40px;
            flex: 1;
        }
        .panel {
            background: #fff;
            border: 1px solid #e6ebf2;
            border-radius: 12px;
            box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
            padding: 16px;
            margin-bottom: 14px;
        }
        .title-line {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }
        .title-line h1 { margin: 0; font-size: 1.5rem; color: #0f172a; }
        .title-line h2 { margin: 0; font-size: 1.05rem; color: #1e293b; }
        .subtitle { color: #64748b; margin: 0; font-size: 0.9rem; }
        .controls-grid {
            display: grid;
            grid-template-columns: 1.4fr 0.7fr 0.7fr 0.7fr 0.7fr 0.7fr;
            gap: 10px;
            align-items: end;
        }
        .badge-soft {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: #eaf2ff;
            color: #0b63d8;
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 0.78rem;
            font-weight: 600;
        }
        .badge-soft.loading { background: #fef3c7; color: #b45309; }
        .badge-soft.error { background: #fee2e2; color: #b91c1c; }
        
        /* Accordion Styles */
        .alert-section { margin-bottom: 8px; }
        .alert-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 14px;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            cursor: pointer;
            user-select: none;
            transition: all 0.2s;
        }
        .alert-section-header:hover { background: #eef2f7; border-color: #cbd5e1; }
        .alert-section-header.active { 
            border-radius: 8px 8px 0 0; 
            background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
            border-color: #c7d2fe;
        }
        .alert-section-header h3 {
            margin: 0;
            font-size: 0.9rem;
            font-weight: 600;
            color: #334155;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .alert-section-header .toggle-icon { 
            font-size: 0.7rem; 
            color: #94a3b8;
            transition: transform 0.2s;
        }
        .alert-section-header.active .toggle-icon { transform: rotate(180deg); }
        .alert-section-body {
            display: none;
            padding: 12px 14px;
            background: #fff;
            border: 1px solid #e2e8f0;
            border-top: none;
            border-radius: 0 0 8px 8px;
        }
        .alert-section-body.show { display: block; }
        
        .alert-row {
            display: grid;
            grid-template-columns: 30px 1fr 1fr 1fr;
            gap: 10px;
            align-items: center;
            padding: 6px 0;
            border-bottom: 1px solid #f1f5f9;
        }
        .alert-row:last-child { border-bottom: none; }
        .alert-row label { font-size: 0.82rem; color: #475569; font-weight: 500; }
        .alert-row input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
        .alert-row input[type="number"], .alert-row select {
            padding: 6px 10px;
            font-size: 0.82rem;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            background: #f8fafc;
        }
        .alert-row input[type="number"]:focus, .alert-row select:focus {
            border-color: #6366f1;
            outline: none;
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
        }
        
        /* Table Styles */
        table { width: 100%; border-collapse: collapse; }
        th, td { padding: 8px 6px; border-bottom: 1px solid #e6ebf2; font-size: 0.82rem; text-align: left; }
        th {
            color: #475569;
            font-weight: 600;
            background: #f8fafc;
            position: sticky;
            top: 0;
            cursor: pointer;
            user-select: none;
            white-space: nowrap;
        }
        th:hover { background: #eef2f7; }
        th .sort-icon { margin-left: 3px; font-size: 0.65rem; opacity: 0.4; }
        th.sorted .sort-icon { opacity: 1; color: #6366f1; }
        .table-wrap { max-height: 50vh; overflow: auto; border: 1px solid #e6ebf2; border-radius: 8px; }
        
        .signal-pill {
            border-radius: 999px;
            padding: 2px 8px;
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
        }
        .sig-long { background: #d1fae5; color: #047857; }
        .sig-short { background: #fee2e2; color: #b91c1c; }
        .sig-neutral { background: #f1f5f9; color: #64748b; }
        
        .btn-action {
            border: 1px solid #e2e8f0;
            background: #f8fafc;
            color: #475569;
            border-radius: 6px;
            padding: 4px 8px;
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 3px;
        }
        .btn-action:hover { background: #eef2f7; color: #1e293b; }
        .btn-action.primary { background: #6366f1; color: #fff; border-color: #6366f1; }
        .btn-action.primary:hover { background: #4f46e5; }
        .btn-action.danger { color: #b91c1c; border-color: #fecaca; }
        .btn-action.danger:hover { background: #fee2e2; }
        
        .empty { padding: 24px; text-align: center; color: #94a3b8; }
        .error-row { background: #fef2f2; }
        .tiny { font-size: 0.75rem; color: #94a3b8; }
        
        .info-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 8px;
        }
        .info-bar .stats { display: flex; gap: 12px; font-size: 0.8rem; color: #64748b; }
        .info-bar .stats strong { color: #1e293b; }
        .countdown { font-size: 0.75rem; color: #64748b; font-family: monospace; }
        
        /* History Panel */
        .history-panel { max-height: 200px; overflow-y: auto; }
        .history-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 10px;
            border-bottom: 1px solid #f1f5f9;
            font-size: 0.8rem;
        }
        .history-item:last-child { border-bottom: none; }
        .history-item.unread { background: #fef3c7; }
        .history-item .time { color: #94a3b8; font-size: 0.72rem; min-width: 50px; }
        .history-item .symbol { font-weight: 600; color: #1e293b; min-width: 80px; }
        .history-item .message { flex: 1; color: #475569; }
        .history-item .ack-btn { 
            padding: 2px 6px; 
            font-size: 0.7rem; 
            background: #f1f5f9; 
            border: none; 
            border-radius: 4px; 
            cursor: pointer; 
        }
        .history-item .ack-btn:hover { background: #e2e8f0; }
        
        /* Modal Styles */
        .modal-backdrop {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(15, 23, 42, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }
        .modal-backdrop.show { display: flex; }
        .modal-content {
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
            width: 90%;
            max-width: 600px;
            max-height: 80vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .modal-header {
            padding: 14px 18px;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .modal-header h3 { margin: 0; font-size: 1rem; }
        .modal-close { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; opacity: 0.8; }
        .modal-close:hover { opacity: 1; }
        .modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
        .modal-footer { padding: 12px 18px; background: #f8fafc; border-top: 1px solid #e2e8f0; display: flex; gap: 10px; justify-content: flex-end; }
        
        .condition-builder { margin-top: 12px; }
        .condition-row-modal {
            display: grid;
            grid-template-columns: 80px 1fr 120px 100px 40px;
            gap: 8px;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid #f1f5f9;
        }
        .condition-row-modal:first-child .logic-select { visibility: hidden; }
        .condition-row-modal select, .condition-row-modal input {
            padding: 6px 10px;
            font-size: 0.82rem;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
        }
        .condition-row-modal .remove-cond {
            width: 28px; height: 28px;
            border: none; background: #fee2e2;
            color: #b91c1c; border-radius: 6px;
            cursor: pointer; font-size: 0.8rem;
        }
        .condition-row-modal .remove-cond:hover { background: #fecaca; }
        
        /* Preset Dropdown */
        .preset-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
            padding-bottom: 12px;
            border-bottom: 1px solid #e2e8f0;
        }
        .preset-row label { font-size: 0.85rem; font-weight: 500; color: #475569; }
        .preset-row select { flex: 1; padding: 8px 12px; border-radius: 6px; border: 1px solid #e2e8f0; }
        
        @media (max-width: 1024px) {
            .controls-grid { grid-template-columns: 1fr 1fr 1fr; }
            .alert-row { grid-template-columns: 30px 1fr 1fr; }
        }
        @media (max-width: 640px) {
            .controls-grid { grid-template-columns: 1fr 1fr; }
            .alert-row { grid-template-columns: 30px 1fr; }
            .condition-row-modal { grid-template-columns: 1fr 1fr; }
        }
