/*
 * THREESIXOH_ALERT_READABILITY_V1
 *
 * Operational Alerts readability improvements.
 * Scoped to the Alerts module so Work Center notification cards
 * and other CRM components remain unchanged.
 */


/* ------------------------------------------------------------------
   Alert list
   ------------------------------------------------------------------ */

body.module-alerts .notification-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}


/* ------------------------------------------------------------------
   Individual alert card
   ------------------------------------------------------------------ */

body.module-alerts .notification-row {
    --tso-alert-accent: #64748b;
    --tso-alert-soft: rgba(100, 116, 139, 0.045);

    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;

    position: relative;

    margin: 0;
    padding: 16px 18px 14px;

    border: 1px solid #dbe4ee;
    border-left: 4px solid var(--tso-alert-accent);
    border-radius: 12px;

    background: linear-gradient(
        90deg,
        var(--tso-alert-soft) 0,
        rgba(255,255,255,0) 42%
    ),
    #ffffff;

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.035),
        0 5px 18px rgba(15, 23, 42, 0.025);

    overflow: hidden;
}


/* Severity coloring */

body.module-alerts .notification-row.notification-critical {
    --tso-alert-accent: #dc2626;
    --tso-alert-soft: rgba(220, 38, 38, 0.055);
}

body.module-alerts .notification-row.notification-warning {
    --tso-alert-accent: #d97706;
    --tso-alert-soft: rgba(217, 119, 6, 0.055);
}

body.module-alerts .notification-row.notification-info {
    --tso-alert-accent: #0284c7;
    --tso-alert-soft: rgba(2, 132, 199, 0.05);
}


/* Unread gets slightly stronger visual weight without being loud */

body.module-alerts .notification-row.notification-unread {
    border-color: #cbd8e5;
    border-left-color: var(--tso-alert-accent);

    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.045),
        0 7px 20px rgba(15, 23, 42, 0.04);
}


/* ------------------------------------------------------------------
   Alert content
   ------------------------------------------------------------------ */

body.module-alerts .notification-copy {
    min-width: 0;
}

body.module-alerts .notification-card-head {
    margin: 0 0 7px;
}


/* Icon, severity, category and date on one clean line */

body.module-alerts .tso-alert-severity-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;

    min-width: 0;
}


/* Remove old floating/standalone icon behavior */

body.module-alerts .notification-icon.tso-alert-inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    position: static;
    inset: auto;

    flex: 0 0 auto;

    width: 21px;
    height: 21px;

    margin: 0;
    padding: 0;

    border-radius: 999px;

    background: var(--tso-alert-accent);
    color: #ffffff;

    font-size: 0.72rem;
    line-height: 1;
    font-weight: 900;
}


body.module-alerts .notification-severity {
    display: inline-flex;
    align-items: center;

    color: var(--tso-alert-accent);

    font-size: 0.78rem;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}


body.module-alerts .tso-alert-meta {
    color: #64748b;

    font-size: 0.76rem;
    line-height: 1.35;
    font-weight: 500;
}


/* Main alert title */

body.module-alerts .tso-alert-title {
    display: inline-block;

    margin-top: 1px;

    color: #0f3d63;
    text-decoration: none;
}

body.module-alerts .tso-alert-title strong {
    font-size: 0.96rem;
    line-height: 1.4;
    font-weight: 800;
}

body.module-alerts .tso-alert-title:hover {
    text-decoration: underline;
}


/* Description */

body.module-alerts .tso-alert-body {
    max-width: 92ch;

    margin: 7px 0 0;

    color: #334155;

    font-size: 0.88rem;
    line-height: 1.5;
}


/* Due / resolved metadata */

body.module-alerts .tso-alert-detail-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;

    margin-top: 8px;

    color: #64748b;
}


/* ------------------------------------------------------------------
   Actions
   ------------------------------------------------------------------ */

body.module-alerts .notification-actions.tso-alert-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;

    gap: 8px;

    margin: 0;
    padding: 0;

    width: auto;
}

body.module-alerts .tso-alert-actions form {
    display: inline-flex;

    width: auto;

    margin: 0;
    padding: 0;
}


/* Keep action buttons visually related */

body.module-alerts .tso-alert-actions button,
body.module-alerts .tso-alert-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 78px;
    min-height: 34px;

    margin: 0;
}


/* Open is primary action */

body.module-alerts .tso-alert-open {
    font-weight: 750;
}


/* Dismiss becomes a proper quiet secondary control */

body.module-alerts .tso-alert-dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 78px;
    min-height: 34px;

    padding: 7px 13px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: #ffffff;
    color: #475569;

    font-size: 0.82rem;
    line-height: 1;
    font-weight: 700;

    text-decoration: none;
    cursor: pointer;
}

body.module-alerts .tso-alert-dismiss:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #1e293b;
}


/* ------------------------------------------------------------------
   Dark mode
   ------------------------------------------------------------------ */

html[data-theme="dark"] body.module-alerts .notification-row {
    background:
        linear-gradient(
            90deg,
            var(--tso-alert-soft) 0,
            rgba(15, 23, 42, 0) 44%
        ),
        #172033;

    border-color: #334155;
    border-left-color: var(--tso-alert-accent);

    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.18),
        0 7px 20px rgba(0, 0, 0, 0.10);
}

html[data-theme="dark"] body.module-alerts
.notification-row.notification-critical {
    --tso-alert-soft: rgba(248, 113, 113, 0.075);
}

html[data-theme="dark"] body.module-alerts
.notification-row.notification-warning {
    --tso-alert-soft: rgba(251, 191, 36, 0.07);
}

html[data-theme="dark"] body.module-alerts
.notification-row.notification-info {
    --tso-alert-soft: rgba(56, 189, 248, 0.07);
}

html[data-theme="dark"] body.module-alerts .tso-alert-title {
    color: #7dd3fc;
}

html[data-theme="dark"] body.module-alerts .tso-alert-body {
    color: #cbd5e1;
}

html[data-theme="dark"] body.module-alerts .tso-alert-meta,
html[data-theme="dark"] body.module-alerts .tso-alert-detail-line {
    color: #94a3b8;
}

html[data-theme="dark"] body.module-alerts .tso-alert-dismiss {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

html[data-theme="dark"] body.module-alerts .tso-alert-dismiss:hover {
    background: #263449;
    border-color: #64748b;
    color: #f8fafc;
}


/* ------------------------------------------------------------------
   Mobile
   ------------------------------------------------------------------ */

@media (max-width: 700px) {

    body.module-alerts .notification-row {
        padding: 14px;
        border-radius: 10px;
    }

    body.module-alerts .tso-alert-meta {
        flex-basis: 100%;
        margin-left: 27px;
    }

    body.module-alerts .notification-actions.tso-alert-actions {
        width: 100%;
    }

    body.module-alerts .tso-alert-actions form {
        flex: 1 1 0;
    }

    body.module-alerts .tso-alert-actions button,
    body.module-alerts .tso-alert-actions .button {
        width: 100%;
    }
}

/* STYLE_POLISH_20261001: consistent spacing between header actions. */
body.module-alerts .page-head > div:last-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
body.module-alerts .page-head > div:last-child form { margin: 0; }
body.module-alerts .page-head > div:last-child .button { margin-left: 0; }
