/* =========================================================
   OPSPORTAL GLOBAL THEME
========================================================= */

:root {
    --ops-bg: #1f2933;
    --ops-sidebar: #1f2933;
    --ops-surface: #24303b;
    --ops-hover: #2b3642;
    --ops-active: #3b82f6;
    --ops-border: #2b3642;
    --ops-text: #e5e7eb;
    --ops-muted: #9ca3af;
}

html, body {
    margin: 0;
    height: 100%;
    background: var(--ops-bg);
    color: var(--ops-text);
    font-family: Segoe UI, Arial, sans-serif;
}

/* =========================================================
   GLOBAL HEADINGS
========================================================= */

h1, h2, h3, h4, h5, h6 {
    color: var(--ops-text);
}


/* =========================================================
   APP LAYOUT
========================================================= */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.content-area {
    flex: 1;
    min-height: 0;
    padding: 24px 30px 30px 30px;
}

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    width: 240px;
    background: var(--ops-sidebar);
    border-right: 1px solid var(--ops-border);
}

.sidebar a {
    text-decoration: none;
}


/* =========================================================
   NAV MENU
========================================================= */

.ops-menu {
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

.ops-menu-item {
    display: flex;
    align-items: center;
    height: 42px;
    padding-left: 22px;
    font-size: 14px;
    color: #cbd5e1;
    border-left: 3px solid transparent;
}

.ops-menu-item:hover {
    background: var(--ops-hover);
    color: white;
}

.ops-menu-item.active {
    background: var(--ops-active);
    color: white;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    height: 60px;
    background: var(--ops-sidebar);
    border-bottom: 1px solid var(--ops-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.portal-title {
    font-size: 16px;
    font-weight: 600;
}


/* =========================================================
   GLOBAL INPUTS
========================================================= */

.search-box,
.ops-input,
.dashboard-search-input,
.login-input,
.ops-textarea {
    background: var(--ops-surface);
    border: 1px solid var(--ops-border);
    color: var(--ops-text);
}

.search-box {
    padding: 6px 10px;
    border-radius: 5px;
}

.ops-input {
    padding: 8px 10px;
    border-radius: 6px;
    width: 350px;
    font-size: 14px;
}

.ops-input::placeholder {
    color: var(--ops-muted);
}

.dashboard-search-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
}

.ops-textarea {
    width: 100%;
    height: 420px;
    border-radius: 6px;
    padding: 12px;
    font-family: Consolas, monospace;
}


/* =========================================================
   STATUS INDICATORS
========================================================= */

.status-dot {
    width: 9px;
    height: 9px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}


/* =========================================================
   CARD SYSTEM
========================================================= */

.card,
.metric-card,
.sql-card,
.search-result-item {
    background: var(--ops-surface);
    border: 1px solid var(--ops-border);
    border-radius: 6px;
}

.metric-card {
    padding: 18px;
}

.sql-card {
    padding: 16px;
    margin-bottom: 14px;
}

.search-result-item {
    padding: 10px 14px;
    margin-bottom: 6px;
}


/* =========================================================
   DASHBOARD GRID
========================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.metric-title {
    font-size: 13px;
    color: var(--ops-muted);
}

.metric-value {
    font-size: 28px;
    font-weight: 600;
    margin-top: 6px;
}


/* =========================================================
   DASHBOARD SEARCH
========================================================= */

.search-results {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.search-result-item {
    padding: 12px;
    display: block;
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: var(--ops-hover);
}

.search-result-type {
    font-size: 11px;
    color: var(--ops-muted);
    margin-bottom: 4px;
}

/* FIXED: no hyperlink styling */

.search-result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ops-text);
    text-decoration: none;
}

/* responsive */

@media (max-width: 1100px) {
    .search-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .search-results {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   BUTTONS
========================================================= */

.ops-btn {
    background: var(--ops-active);
    border: none;
    color: white;
    padding: 7px 14px;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
}

.ops-btn:hover {
    background: #2563eb;
}

.ops-btn-secondary {
    background: var(--ops-hover);
}

.ops-btn-secondary:hover {
    background: #364250;
}


/* =========================================================
   CODE BLOCKS
========================================================= */

pre {
    background: #0f172a;
    border: 1px solid var(--ops-border);
    border-radius: 6px;
    margin-top: 15px;

    padding: 18px;

    width: 100%;
    max-width: 100%;

    overflow: auto; /* remove internal scrolling */

    box-sizing: border-box;

    line-height: 1.45;
}

pre code {
    display: block;

    font-family: Consolas, monospace;
    font-size: 13px;

    /* wrap long SQL lines */
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ensure highlight.js doesn't override wrapping */

pre code.hljs {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* nicer scrollbars for large scripts */

pre::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

pre::-webkit-scrollbar-track {
    background: #0f172a;
}

pre::-webkit-scrollbar-thumb {
    background: #364250;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* =========================================================
   LOGIN PAGE
========================================================= */

.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ops-bg);
}

.login-wrapper {
    width: 400px;
}

.login-card {
    width: 360px;
    padding: 40px;
    background: #26313d;
    border-radius: 8px;
    border: 1px solid var(--ops-border);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

.login-field {
    margin-bottom: 15px;
}

.login-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 4px;
}

.login-input:focus {
    outline: none;
    border-color: var(--ops-active);
}

.login-button {
    width: 100%;
    padding: 10px;
    background: var(--ops-active);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.login-button:hover {
    opacity: 0.9;
}

.login-error {
    margin-top: 15px;
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
}


/* =========================================================
   LOGOUT BUTTON
========================================================= */

.logout-btn {
    margin-left: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #ef4444;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.logout-btn:hover {
    background: #dc2626;
}


/* =========================================================
   AI ASSISTANT
========================================================= */

.ai-response-box {
    background: #0f172a;
    border: 1px solid var(--ops-border);
    border-radius: 6px;
    padding: 18px;
    color: var(--ops-text);
    font-size: 14px;
    line-height: 1.6;
}

.ai-response-box a {
    color: #60a5fa;
    text-decoration: underline;
    font-weight: 500;
}


/* =========================================================
   ADMIN MONITORING
========================================================= */

.monitor-admin-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* center form */

.monitor-create-wrapper {
    display: flex;
    justify-content: center;
}

/* form card */

.monitor-add-card {
    width: 520px;
    padding: 22px;
}

/* form fields */

.form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.form-field label {
    font-size: 12px;
    color: var(--ops-muted);
    margin-bottom: 5px;
}

/* ensure inputs fill card */

.monitor-add-card .ops-input {
    width: 100%;
}

/* two-column row */

.monitor-form-row {
    display: flex;
    gap: 12px;
}

.monitor-form-row .form-field {
    flex: 1;
}

/* add button */

.monitor-add-btn {
    margin-top: 8px;
    width: 100%;
}

/* monitor list */

.monitor-list-card {
    padding: 20px;
}

/* header */

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* table */

.monitor-table {
    width: 100%;
    border-collapse: collapse;
}

.monitor-table th {
    text-align: left;
    color: var(--ops-muted);
    padding: 10px;
}

.monitor-table td {
    padding: 10px;
    border-top: 1px solid var(--ops-border);
}

/* =========================================================
   TABLE TEXT FIX
========================================================= */

.monitor-table td{
    color: var(--ops-text);
}

.monitor-table td a{
    color: #60a5fa;
}

.monitor-table td span{
    color: var(--ops-text);
}

/* url */

.monitor-url {
    max-width: 460px;
    word-break: break-all;
    font-size: 13px;
}

/* status */

.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-ok {
    background: #065f46;
    color: #34d399;
}

.status-fail {
    background: #7f1d1d;
    color: #f87171;
}

.status-unknown {
    background: #1f2937;
    color: #9ca3af;
}

/* response */

.response-ms {
    font-weight: 600;
}

/* messages */

.monitor-message {
    margin-top: 20px;
    padding: 12px;
}

/* =========================================================
   MONITORING MODAL
========================================================= */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.monitor-modal {
    background: var(--ops-surface);
    border: 1px solid var(--ops-border);
    border-radius: 6px;
    width: 900px;
    max-height: 80vh;
    overflow: auto;
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.modal-meta {
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-section {
    margin-top: 10px;
}


/* Clickable monitor rows */

.monitor-row{
cursor:pointer;
transition:background .15s ease;
}

.monitor-row:hover{
background:var(--ops-hover);
}


/* clickable monitor name */

.monitor-link{
color:#60a5fa;
font-weight:500;
text-decoration:none;
}

.monitor-link:hover{
text-decoration:underline;
}


.timeline-item {
display:flex;
gap:14px;
padding:6px 0;
border-left:2px solid var(--ops-border);
padding-left:12px;
}

.timeline-time{
color:var(--ops-muted);
font-size:12px;
min-width:70px;
}

.timeline-text{
font-size:13px;
}

.timeline-fail{
border-left-color:#ef4444;
}

.timeline-retry{
border-left-color:#f59e0b;
}

.timeline-alert{
border-left-color:#3b82f6;
}

.timeline-ok{
border-left-color:#22c55e;
}


/* =========================================================
   MONITOR MODAL GRID LAYOUT
========================================================= */

.monitor-modal-grid{
display:grid;
grid-template-columns:2fr 1fr;
gap:30px;
margin-top:10px;
}

.monitor-left{
display:flex;
flex-direction:column;
}

.monitor-right{
display:flex;
flex-direction:column;
gap:8px;
}

.monitor-graph{
background:#1b2430;
border:1px solid var(--ops-border);
border-radius:6px;
padding:14px;
}

.incident-box{
background:#1b2430;
border:1px solid var(--ops-border);
border-radius:6px;
padding:12px;
margin-top:8px;
}

.incident-title{
font-weight:600;
margin-bottom:4px;
}

.incident-time{
font-size:12px;
color:var(--ops-muted);
}

.ssl-meta{
margin-top:4px;
display:flex;
align-items:center;
gap:10px;
}

/* =========================================================
   DASHBOARD UPCOMING TASKS (COMPACT)
========================================================= */

.dashboard-tasks-card{
padding:12px 16px;
}

.dashboard-tasks-card h3{
margin:0 0 10px 0;
font-size:16px;
}

.dashboard-tasks-card .monitor-table th{
padding:6px 8px;
font-size:12px;
}

.dashboard-tasks-card .monitor-table td{
padding:6px 8px;
font-size:13px;
}

.dashboard-tasks-card .monitor-row{
height:30px;
}

/* ======================================
   INFRASTRUCTURE MODAL
====================================== */

.infra-modal{
width:1000px;
max-width:95vw;
}

.infra-modal-grid{
display:grid;
grid-template-columns: 420px 1fr;
gap:20px;
align-items:start;
}

.infra-notes{
height:360px;
font-family:Consolas, monospace;
}

.infra-notes-view{
margin-top:12px;
background:#0f172a;
border:1px solid var(--ops-border);
border-radius:6px;
padding:14px;
white-space:pre-wrap;
font-family:Consolas, monospace;
font-size:13px;
}

.infra-badge{
padding:4px 10px;
border-radius:4px;
font-size:12px;
font-weight:600;
background:#1f2937;
color:#93c5fd;
}


/* =========================================================
   INFRASTRUCTURE ENVIRONMENT BADGES
========================================================= */

.infra-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

/* Production */

.env-prod {
    background: #7f1d1d;
    color: #f87171;
}

/* Staging */

.env-staging {
    background: #78350f;
    color: #fb923c;
}

/* QA */

.env-qa {
    background: #4c1d95;
    color: #c084fc;
}

/* Dev */

.env-dev {
    background: #1f2937;
    color: #9ca3af;
}

/* Sandbox */

.env-sandbox {
    background: #1e3a8a;
    color: #60a5fa;
}

/* UAT */

.env-uat {
    background: #713f12;
    color: #facc15;
}

/* DR */

.env-dr {
    background: #111827;
    color: #9ca3af;
}

/* SSL certificate warning state */
.status-alert {
    background: rgba(255, 170, 0, 0.15);
    color: #ffb347;
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.metric-card{
cursor:pointer;
transition:transform .08s ease, box-shadow .08s ease;
}

.metric-card:hover{
transform:translateY(-2px);
box-shadow:0 4px 10px rgba(0,0,0,.35);
}

/* ================================
SQL SCRIPTS GRID
================================ */

.page-header {
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:20px;
}

.sql-toolbar {
display:flex;
gap:12px;
align-items:center;
margin-bottom:20px;
}

.sql-toolbar input {
max-width:420px;
flex:1;
}

.sql-grid {
display:grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap:16px;
}

.sql-card {
padding:16px;
display:flex;
flex-direction:column;
min-height:110px;
}

.sql-card-title {
font-size:15px;
font-weight:600;
margin-bottom:6px;
}

.sql-card-desc {
font-size:13px;
color:var(--ops-muted);
flex:1;
}

.sql-card-footer {
margin-top:12px;
display:flex;
gap:6px;
}

/* =====================================
   SQL SCRIPT VIEWER
===================================== */

.sql-script-viewer {
    width: 100%;
    max-width: 100%;
}

/* force highlight.js blocks to wrap */

.sql-script-viewer pre,
.sql-script-viewer pre code,
.sql-script-viewer .hljs {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

/* remove width expansion */

.sql-script-viewer pre code {
    min-width: 0 !important;
}




/* =========================================================
   GLOBAL HEADINGS
========================================================= */

h1, h2, h3, h4, h5, h6 {
    color: var(--ops-text);
}


/* =========================================================
   APP LAYOUT
========================================================= */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.content-area {
    flex: 1;
    min-height: 0;
    padding: 24px 30px 30px 30px;
}

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    width: 240px;
    background: var(--ops-sidebar);
    border-right: 1px solid var(--ops-border);
}

.sidebar a {
    text-decoration: none;
}


/* =========================================================
   NAV MENU
========================================================= */

.ops-menu {
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

.ops-menu-item {
    display: flex;
    align-items: center;
    height: 42px;
    padding-left: 22px;
    font-size: 14px;
    color: #cbd5e1;
    border-left: 3px solid transparent;
}

.ops-menu-item:hover {
    background: var(--ops-hover);
    color: white;
}

.ops-menu-item.active {
    background: var(--ops-active);
    color: white;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    height: 60px;
    background: var(--ops-sidebar);
    border-bottom: 1px solid var(--ops-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.portal-title {
    font-size: 16px;
    font-weight: 600;
}


/* =========================================================
   GLOBAL INPUTS
========================================================= */

.search-box,
.ops-input,
.dashboard-search-input,
.login-input,
.ops-textarea {
    background: var(--ops-surface);
    border: 1px solid var(--ops-border);
    color: var(--ops-text);
}

.search-box {
    padding: 6px 10px;
    border-radius: 5px;
}

.ops-input {
    padding: 8px 10px;
    border-radius: 6px;
    width: 350px;
    font-size: 14px;
}

.ops-input::placeholder {
    color: var(--ops-muted);
}

.dashboard-search-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
}

.ops-textarea {
    width: 100%;
    height: 420px;
    border-radius: 6px;
    padding: 12px;
    font-family: Consolas, monospace;
}


/* =========================================================
   STATUS INDICATORS
========================================================= */

.status-dot {
    width: 9px;
    height: 9px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}


/* =========================================================
   CARD SYSTEM
========================================================= */

.card,
.metric-card,
.sql-card,
.search-result-item {
    background: var(--ops-surface);
    border: 1px solid var(--ops-border);
    border-radius: 6px;
}

.metric-card {
    padding: 18px;
}

.sql-card {
    padding: 16px;
    margin-bottom: 14px;
}

.search-result-item {
    padding: 10px 14px;
    margin-bottom: 6px;
}


/* =========================================================
   DASHBOARD GRID
========================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.metric-title {
    font-size: 13px;
    color: var(--ops-muted);
}

.metric-value {
    font-size: 28px;
    font-weight: 600;
    margin-top: 6px;
}


/* =========================================================
   DASHBOARD SEARCH
========================================================= */

.search-results {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.search-result-item {
    padding: 12px;
    display: block;
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: var(--ops-hover);
}

.search-result-type {
    font-size: 11px;
    color: var(--ops-muted);
    margin-bottom: 4px;
}

/* FIXED: no hyperlink styling */

.search-result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ops-text);
    text-decoration: none;
}

/* responsive */

@media (max-width: 1100px) {
    .search-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .search-results {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   BUTTONS
========================================================= */

.ops-btn {
    background: var(--ops-active);
    border: none;
    color: white;
    padding: 7px 14px;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
}

.ops-btn:hover {
    background: #2563eb;
}

.ops-btn-secondary {
    background: var(--ops-hover);
}

.ops-btn-secondary:hover {
    background: #364250;
}


/* =========================================================
   CODE BLOCKS
========================================================= */

pre {
    background: #0f172a;
    border: 1px solid var(--ops-border);
    border-radius: 6px;
    margin-top: 15px;

    padding: 18px;

    width: 100%;
    max-width: 100%;

    overflow: auto; /* remove internal scrolling */

    box-sizing: border-box;

    line-height: 1.45;
}

pre code {
    display: block;

    font-family: Consolas, monospace;
    font-size: 13px;

    /* wrap long SQL lines */
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* ensure highlight.js doesn't override wrapping */

pre code.hljs {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* nicer scrollbars for large scripts */

pre::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

pre::-webkit-scrollbar-track {
    background: #0f172a;
}

pre::-webkit-scrollbar-thumb {
    background: #364250;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* =========================================================
   LOGIN PAGE
========================================================= */

.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ops-bg);
}

.login-wrapper {
    width: 400px;
}

.login-card {
    width: 360px;
    padding: 40px;
    background: #26313d;
    border-radius: 8px;
    border: 1px solid var(--ops-border);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

.login-field {
    margin-bottom: 15px;
}

.login-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 4px;
}

.login-input:focus {
    outline: none;
    border-color: var(--ops-active);
}

.login-button {
    width: 100%;
    padding: 10px;
    background: var(--ops-active);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.login-button:hover {
    opacity: 0.9;
}

.login-error {
    margin-top: 15px;
    color: #ff6b6b;
    font-size: 14px;
    text-align: center;
}


/* =========================================================
   LOGOUT BUTTON
========================================================= */

.logout-btn {
    margin-left: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #ef4444;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.logout-btn:hover {
    background: #dc2626;
}


/* =========================================================
   AI ASSISTANT
========================================================= */

.ai-response-box {
    background: #0f172a;
    border: 1px solid var(--ops-border);
    border-radius: 6px;
    padding: 18px;
    color: var(--ops-text);
    font-size: 14px;
    line-height: 1.6;
}

.ai-response-box a {
    color: #60a5fa;
    text-decoration: underline;
    font-weight: 500;
}


/* =========================================================
   ADMIN MONITORING
========================================================= */

.monitor-admin-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* center form */

.monitor-create-wrapper {
    display: flex;
    justify-content: center;
}

/* form card */

.monitor-add-card {
    width: 520px;
    padding: 22px;
}

/* form fields */

.form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.form-field label {
    font-size: 12px;
    color: var(--ops-muted);
    margin-bottom: 5px;
}

/* ensure inputs fill card */

.monitor-add-card .ops-input {
    width: 100%;
}

/* two-column row */

.monitor-form-row {
    display: flex;
    gap: 12px;
}

.monitor-form-row .form-field {
    flex: 1;
}

/* add button */

.monitor-add-btn {
    margin-top: 8px;
    width: 100%;
}

/* monitor list */

.monitor-list-card {
    padding: 20px;
}

/* header */

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* table */

.monitor-table {
    width: 100%;
    border-collapse: collapse;
}

.monitor-table th {
    text-align: left;
    color: var(--ops-muted);
    padding: 10px;
}

.monitor-table td {
    padding: 10px;
    border-top: 1px solid var(--ops-border);
}

/* =========================================================
   TABLE TEXT FIX
========================================================= */

.monitor-table td{
    color: var(--ops-text);
}

.monitor-table td a{
    color: #60a5fa;
}

.monitor-table td span{
    color: var(--ops-text);
}

/* url */

.monitor-url {
    max-width: 460px;
    word-break: break-all;
    font-size: 13px;
}

/* status */

.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-ok {
    background: #065f46;
    color: #34d399;
}

.status-fail {
    background: #7f1d1d;
    color: #f87171;
}

.status-unknown {
    background: #1f2937;
    color: #9ca3af;
}

/* response */

.response-ms {
    font-weight: 600;
}

/* messages */

.monitor-message {
    margin-top: 20px;
    padding: 12px;
}

/* =========================================================
   MONITORING MODAL
========================================================= */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.monitor-modal {
    background: var(--ops-surface);
    border: 1px solid var(--ops-border);
    border-radius: 6px;
    width: 900px;
    max-height: 80vh;
    overflow: auto;
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.modal-meta {
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-section {
    margin-top: 10px;
}


/* Clickable monitor rows */

.monitor-row{
cursor:pointer;
transition:background .15s ease;
}

.monitor-row:hover{
background:var(--ops-hover);
}


/* clickable monitor name */

.monitor-link{
color:#60a5fa;
font-weight:500;
text-decoration:none;
}

.monitor-link:hover{
text-decoration:underline;
}


.timeline-item {
display:flex;
gap:14px;
padding:6px 0;
border-left:2px solid var(--ops-border);
padding-left:12px;
}

.timeline-time{
color:var(--ops-muted);
font-size:12px;
min-width:70px;
}

.timeline-text{
font-size:13px;
}

.timeline-fail{
border-left-color:#ef4444;
}

.timeline-retry{
border-left-color:#f59e0b;
}

.timeline-alert{
border-left-color:#3b82f6;
}

.timeline-ok{
border-left-color:#22c55e;
}


/* =========================================================
   MONITOR MODAL GRID LAYOUT
========================================================= */

.monitor-modal-grid{
display:grid;
grid-template-columns:2fr 1fr;
gap:30px;
margin-top:10px;
}

.monitor-left{
display:flex;
flex-direction:column;
}

.monitor-right{
display:flex;
flex-direction:column;
gap:8px;
}

.monitor-graph{
background:#1b2430;
border:1px solid var(--ops-border);
border-radius:6px;
padding:14px;
}

.incident-box{
background:#1b2430;
border:1px solid var(--ops-border);
border-radius:6px;
padding:12px;
margin-top:8px;
}

.incident-title{
font-weight:600;
margin-bottom:4px;
}

.incident-time{
font-size:12px;
color:var(--ops-muted);
}

.ssl-meta{
margin-top:4px;
display:flex;
align-items:center;
gap:10px;
}

/* =========================================================
   DASHBOARD UPCOMING TASKS (COMPACT)
========================================================= */

.dashboard-tasks-card{
padding:12px 16px;
}

.dashboard-tasks-card h3{
margin:0 0 10px 0;
font-size:16px;
}

.dashboard-tasks-card .monitor-table th{
padding:6px 8px;
font-size:12px;
}

.dashboard-tasks-card .monitor-table td{
padding:6px 8px;
font-size:13px;
}

.dashboard-tasks-card .monitor-row{
height:30px;
}

/* ======================================
   INFRASTRUCTURE MODAL
====================================== */

.infra-modal{
width:1000px;
max-width:95vw;
}

.infra-modal-grid{
display:grid;
grid-template-columns: 420px 1fr;
gap:20px;
align-items:start;
}

.infra-notes{
height:360px;
font-family:Consolas, monospace;
}

.infra-notes-view{
margin-top:12px;
background:#0f172a;
border:1px solid var(--ops-border);
border-radius:6px;
padding:14px;
white-space:pre-wrap;
font-family:Consolas, monospace;
font-size:13px;
}

.infra-badge{
padding:4px 10px;
border-radius:4px;
font-size:12px;
font-weight:600;
background:#1f2937;
color:#93c5fd;
}


/* =========================================================
   INFRASTRUCTURE ENVIRONMENT BADGES
========================================================= */

.infra-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

/* Production */

.env-prod {
    background: #7f1d1d;
    color: #f87171;
}

/* Staging */

.env-staging {
    background: #78350f;
    color: #fb923c;
}

/* QA */

.env-qa {
    background: #4c1d95;
    color: #c084fc;
}

/* Dev */

.env-dev {
    background: #1f2937;
    color: #9ca3af;
}

/* Sandbox */

.env-sandbox {
    background: #1e3a8a;
    color: #60a5fa;
}

/* UAT */

.env-uat {
    background: #713f12;
    color: #facc15;
}

/* DR */

.env-dr {
    background: #111827;
    color: #9ca3af;
}

/* SSL certificate warning state */
.status-alert {
    background: rgba(255, 170, 0, 0.15);
    color: #ffb347;
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.metric-card{
cursor:pointer;
transition:transform .08s ease, box-shadow .08s ease;
}

.metric-card:hover{
transform:translateY(-2px);
box-shadow:0 4px 10px rgba(0,0,0,.35);
}

/* ================================
SQL SCRIPTS GRID
================================ */

.page-header {
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:20px;
}

.sql-toolbar {
display:flex;
gap:12px;
align-items:center;
margin-bottom:20px;
}

.sql-toolbar input {
max-width:420px;
flex:1;
}

.sql-grid {
display:grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap:16px;
}

.sql-card {
padding:16px;
display:flex;
flex-direction:column;
min-height:110px;
}

.sql-card-title {
font-size:15px;
font-weight:600;
margin-bottom:6px;
}

.sql-card-desc {
font-size:13px;
color:var(--ops-muted);
flex:1;
}

.sql-card-footer {
margin-top:12px;
display:flex;
gap:6px;
}

/* =====================================
   SQL SCRIPT VIEWER
===================================== */

.sql-script-viewer {
    width: 100%;
    max-width: 100%;
}

/* force highlight.js blocks to wrap */

.sql-script-viewer pre,
.sql-script-viewer pre code,
.sql-script-viewer .hljs {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

/* remove width expansion */

.sql-script-viewer pre code {
    min-width: 0 !important;
}


/* =========================================================
   HTTP TOOL LAYOUT
========================================================= */

.http-tool-layout{
display:grid;
grid-template-columns:260px minmax(0,1fr);
gap:20px;
margin-top:20px;
align-items:start;
}

/* collections column */

.http-collections{
min-height:520px;
display:flex;
flex-direction:column;
padding:14px;
}

.http-collections-list{
flex:1;
overflow:auto;
margin-top:6px;
padding-right:4px;
}

/* collection rows */

.http-collection{
margin-top:10px;
}

.http-collection-header{
display:flex;
align-items:center;
gap:6px;
}

.http-folder{
margin-left:12px;
margin-top:4px;
color:var(--ops-muted);
font-size:13px;
padding:2px 4px;
border-radius:4px;
}

.http-request{
padding:4px 6px;
font-size:13px;
cursor:pointer;
border-radius:4px;
}

.http-request:hover{
background:var(--ops-hover);
}

/* request editor column */

.http-request-editor{
display:flex;
flex-direction:column;
gap:10px;
}

/* response panel */

.http-response{
padding:16px;
}

/* tabs */

.http-tabs{
display:flex;
gap:6px;
margin-bottom:8px;
}

.http-tab{
background:var(--ops-surface);
padding:6px 10px;
border-radius:6px;
cursor:pointer;
}

.http-tab:hover{
background:var(--ops-hover);
}

/* collection pagination */

.http-pagination{
display:flex;
justify-content:space-between;
margin-top:8px;
}

/* fix input width inside tool */

.http-tool-layout .ops-input{
width:auto;
flex:1;
}

/* fix textarea height */

.http-tool-layout .ops-textarea{
height:160px;
}

/* responsive fallback */

@media (max-width:1200px){

.http-tool-layout{
grid-template-columns:260px 1fr;
}

.http-response{
grid-column:1 / span 2;
}

}

@media (max-width:900px){

.http-tool-layout{
grid-template-columns:1fr;
}

}

.http-collections-search-input{
width:100%;
height:34px;
padding:6px 10px;
font-size:13px;

background:var(--ops-surface);
border:1px solid var(--ops-border);
color:var(--ops-text);
border-radius:6px;

box-sizing:border-box;
}

.http-collections-search-input::placeholder{
color:var(--ops-muted);
}

/* HTTP request rows inside collections */

.http-collections .monitor-row{
color:var(--ops-text);
}

.http-collections .monitor-row span{
color:var(--ops-text);
}

/* =========================================
UTILITIES PAGE
========================================= */

.utilities-page{
display:flex;
flex-direction:column;
gap:24px;
}

.utilities-header{
display:flex;
justify-content:space-between;
align-items:center;
}

.utilities-card{
padding:22px;
}

.utilities-section{
display:flex;
flex-direction:column;
gap:10px;
}

.utilities-divider{
height:1px;
background:var(--ops-border);
margin:18px 0;
}

.utilities-textarea{
height:180px;
}

.utilities-btn{
margin-top:6px;
align-self:flex-start;
}

.utilities-input{
width:100%;
}

.utilities-btn-row{
display:flex;
gap:10px;
margin-top:10px;
}

.utilities-download{
margin-top:16px;
display:flex;
flex-direction:column;
gap:6px;
}

.utilities-filetype{
font-size:12px;
color:var(--ops-muted);
}

.utilities-preview{
margin-top:20px;
}

.utilities-image-preview{
max-width:500px;
border:1px solid var(--ops-border);
border-radius:4px;
}

.utilities-pdf-preview{
width:100%;
height:520px;
border:1px solid var(--ops-border);
border-radius:4px;
}

.utilities-jwt{
margin-top:12px;
display:grid;
grid-template-columns:1fr 1fr;
gap:20px;
}

/* ensure white text inside cards */

.utilities-card,
.utilities-card h4,
.utilities-card h5,
.utilities-card b{
color:var(--ops-text);
}

.task-overdue {
    background-color: rgba(239,68,68,0.15);
}

.task-soon {
    background-color: rgba(245,158,11,0.15);
}

/* =========================================================
   GLOBAL TABLE FIX (ADMIN / SIMPLE TABLES)
========================================================= */

.card table{
    width:100%;
    border-collapse:collapse;
}

.card table th{
    text-align:left;
    color:var(--ops-muted);
    padding:10px;
}

.card table td{
    padding:10px;
    border-top:1px solid var(--ops-border);
    color:var(--ops-text);
}

.kb-input {
width: 100%;
padding: 10px;
margin-bottom: 12px;
background: #1f2933;
color: white;
border: 1px solid #374151;
border-radius: 6px;
}

.kb-quill {
height: 700px;
background: #ffffff;
border-radius: 8px;
overflow: hidden;
}

.ql-toolbar {
background: #f3f4f6;
}

.ql-editor {
padding: 20px;
line-height: 1.7;
}

/* READ MODE */

.kb-read {
display: flex;
gap: 30px;
padding: 20px;
}

.kb-toc {
width: 250px;
position: sticky;
top: 20px;
}

.kb-toc-link {
display: block;
color: #9ca3af;
margin-bottom: 6px;
text-decoration: none;
}

.kb-content {
max-width: 900px;
}

.kb-summary {
color: #9ca3af;
margin-bottom: 15px;
}

.kb-content img {
max-width: 100%;
border-radius: 6px;
}



/* =========================================================
QUILL EDITOR (CLEAN + SINGLE SOURCE)
========================================================= */

.kb-quill {
    height: 700px;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
}

/* toolbar */

.ql-toolbar {
    background: #f3f4f6;
    border: none;
}

/* container */

.ql-container {
    border: none;
}

/* editor */

.ql-editor {
    color: #111;
    font-size: 14px;
    line-height: 1.7;
    padding: 20px;
}

/* images */

.ql-editor img {
    max-width: 100%;
    border-radius: 6px;
}
.ql-editor {
    background: #ffffff;
    color: #111;
}


/* =========================================================
KNOWLEDGE BASE (CLEANED)
========================================================= */

/* ---------- GLOBAL LINK RESET (KB ONLY) ---------- */

.kb-category-card,
.kb-category-card:visited,
.kb-article-card,
.kb-article-card:visited,
.search-result-item,
.search-result-item:visited {
    text-decoration: none;
    color: var(--ops-text);
}

/* ---------- GRID ---------- */

.kb-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* ---------- CATEGORY CARD ---------- */

.kb-category-card {
    display: block;
    padding: 14px;
    min-height: 90px;

    background: var(--ops-surface);
    border: 1px solid var(--ops-border);
    border-radius: 6px;

    transition: transform .08s ease, box-shadow .08s ease, background .12s ease;
}

.kb-category-card:hover {
    background: var(--ops-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,.35);
}

/* text */

.kb-category-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.kb-category-desc {
    font-size: 13px;
    color: var(--ops-muted);

   display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

/* ---------- ARTICLE CARDS ---------- */

.kb-article-card {
    display: block;
    padding: 14px;

    background: var(--ops-surface);
    border: 1px solid var(--ops-border);
    border-radius: 6px;

    transition: transform .08s ease, box-shadow .08s ease, background .12s ease;
}

.kb-article-card:hover {
    background: var(--ops-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,.35);
}

.kb-article-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.kb-article-summary {
    font-size: 12px;
    color: var(--ops-muted);

    display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

/* ---------- READ VIEW ---------- */

.kb-read {
    display: flex;
    gap: 30px;
    padding: 20px;
}

.kb-toc {
    width: 250px;
    position: sticky;
    top: 20px;
}

.kb-toc-link {
    display: block;
    color: var(--ops-muted);
    margin-bottom: 6px;
    text-decoration: none;
}

.kb-content {
    max-width: 900px;
}

.kb-summary {
    color: var(--ops-muted);
    margin-bottom: 15px;
}

.kb-content img {
    max-width: 100%;
    border-radius: 6px;
}

/* ---------- EDITOR FIX ---------- */

.kb-quill {
    height: 700px;
    background: white;
    border-radius: 6px;
    width: 100%;
}

.ql-toolbar {
    background: #f3f4f6;
    border: none;
}

.ql-container {
    border: none;
}

.ql-editor {
    color: #111;
    font-size: 14px;
    line-height: 1.7;
}

/* ---------- FORM ALIGNMENT ---------- */

.content-area .form-field .ops-input,
.content-area .form-field select,
.content-area .form-field textarea {
    width: 100%;
}

body {
    transition: opacity 0.08s ease-in-out;
}

/* =========================================
   JSON VIEWER OVERRIDE (FIX)
========================================= */

pre.json-viewer {
    background: #0f172a !important;
    border: 1px solid var(--ops-border) !important;
    padding: 14px !important;
    border-radius: 6px !important;
    overflow: auto !important;
}

pre.json-viewer code {
    white-space: pre !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

/* syntax colors (force override) */

.json-viewer .json-key {
    color: #60a5fa !important;
}

.json-viewer .json-string {
    color: #34d399 !important;
}

.json-viewer .json-number {
    color: #fbbf24 !important;
}

.json-viewer .json-bool {
    color: #f87171 !important;
}