/*
 * Atmosphere theme (Cisco IT Design System)
 * ------------------------------------------
 * Self-contained token layer derived from cisco-it-design/atmosphere
 * (libs/published/foundations/design-tokens, light theme). No external/CDN
 * dependency so it works offline and in CI.
 *
 * It exposes the Atmosphere design tokens as --atm-* custom properties and then
 * remaps the app pages' existing semantic variables (--bg, --card, --text, ...)
 * onto those tokens, so the current markup restyles to the Atmosphere look
 * without touching every rule. Loaded AFTER each page's inline <style> so this
 * :root wins the cascade.
 */
:root {
    /* ---- Brand ---- */
    --atm-brand-primary: #07182d;      /* midnight blue */
    --atm-brand-secondary: #0a60ff;    /* medium blue   */
    --atm-cisco-blue: #02c8ff;

    /* ---- Blue scale ---- */
    --atm-blue-5:  #e5f3ff;
    --atm-blue-30: #5ea9ff;
    --atm-blue-40: #2994ff;
    --atm-blue-50: #0a60ff;
    --atm-blue-60: #0953e5;
    --atm-blue-70: #0e3a99;

    /* ---- Grayscale ---- */
    --atm-gray-0:  #ffffff;
    --atm-gray-5:  #f0f6fa;
    --atm-gray-10: #e9eff5;
    --atm-gray-15: #dae2eb;
    --atm-gray-20: #c5cfd9;
    --atm-gray-30: #a9b5c4;
    --atm-gray-50: #616e80;
    --atm-gray-70: #2c3647;
    --atm-gray-95: #151d2e;

    /* ---- Status ---- */
    --atm-danger: #d91821;
    --atm-danger-hover: #b0121a;
    --atm-danger-bg: rgba(255, 212, 214, 0.48);
    --atm-success: #42a116;
    --atm-success-strong: #378015;
    --atm-success-bg: rgba(135, 229, 92, 0.24);
    --atm-warning: #b28000;
    --atm-warning-bg: rgba(255, 236, 178, 0.48);
    --atm-info: #0a60ff;
    --atm-info-bg: rgba(191, 223, 255, 0.48);

    /* ---- Surfaces / content / borders ---- */
    --atm-canvas: #f0f6fa;
    --atm-canvas-tinted: #e9eff5;
    --atm-surface: #ffffff;
    --atm-surface-selected: rgba(41, 148, 255, 0.24);
    --atm-content-primary: #151d2e;
    --atm-content-secondary: rgba(9, 17, 33, 0.75);
    --atm-border: rgba(14, 58, 153, 0.12);
    --atm-border-strong: rgba(14, 58, 153, 0.24);
    --atm-border-hover: #0a60ff;          /* hbr control border hover (blue.50) */
    --atm-divider: rgba(9, 17, 33, 0.16);
    --atm-focus: #0953e5;
    --atm-content-accent: #0953e5;        /* link/action text (blue.60) */
    --atm-surface-weak: rgba(9, 17, 33, 0.08);   /* neutral badge fill */
    --atm-surface-hover: rgba(94, 169, 255, 0.12); /* hbr-dom-table row hover */
    --atm-control-height: 40px;           /* hbr medium control height */
    --atm-radius-badge: 6px;              /* hbr-badge corner radius */

    /* ---- Typography ---- */
    --atm-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* ---- Corner radius ---- */
    --atm-radius-sm: 4px;
    --atm-radius-md: 8px;
    --atm-radius-lg: 16px;
    --atm-radius-pill: 9999px;

    /* ---- Elevation ---- */
    --atm-shadow-xs: 0 2px 6px rgba(9, 17, 33, 0.04);
    --atm-shadow-sm: 0 3px 8px rgba(9, 17, 33, 0.08);
    --atm-shadow-md: 0 4px 12px rgba(9, 17, 33, 0.12);
    --atm-shadow-lg: 0 4px 12px rgba(9, 17, 33, 0.16);

    /* ===== Remap the pages' shared semantic variables onto Atmosphere tokens =====
       (users / boards / reprocessing index + login pages all use these names). */
    --bg: var(--atm-canvas);
    --card: var(--atm-surface);
    --text: var(--atm-content-primary);
    --muted: var(--atm-content-secondary);
    --primary: var(--atm-blue-50);
    --primary-dark: var(--atm-blue-60);
    --border: var(--atm-border);
    --success-bg: var(--atm-success-bg);
    --success-text: var(--atm-success-strong);
    --error-bg: var(--atm-danger-bg);
    --error-text: var(--atm-danger);
    --warn-bg: var(--atm-warning-bg);
    --warn-text: var(--atm-warning);
}

/* Apply the Atmosphere type family everywhere. The page canvas itself is driven by the
   remapped --bg variable (below), so pages that intentionally use a gradient (e.g. the
   writeback launcher) keep it instead of being flattened here. */
body {
    font-family: var(--atm-font);
}

/* Accessible focus ring in the Atmosphere accent colour. */
:focus-visible {
    outline: 2px solid var(--atm-focus);
    outline-offset: 2px;
}

/* =====================================================================
   Atmosphere branded top app bar (Cisco logo + product name)
   Injected as the first child of <body> on every page. Fixed to the top
   so it works with both scrolling pages and flex-centred login screens.
   ===================================================================== */
.atm-appbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    /* Sit above normal page content but below modal overlays (which use z-index 50) so a modal's
       dark backdrop covers the fixed header instead of the header poking through. */
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: var(--atm-brand-primary);       /* midnight blue */
    box-shadow: var(--atm-shadow-md);
}
.atm-appbar__logo {
    height: 40px;
    width: auto;
    display: block;
}
/* The logo is a link back to the app's home landing page. Strip link chrome and keep the
   logo's own sizing; give it a visible focus ring for keyboard users. */
.atm-appbar__home {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    border-radius: var(--atm-radius-sm);
    cursor: pointer;
}
.atm-appbar__home:focus-visible {
    outline: 2px solid var(--atm-cisco-blue);
    outline-offset: 3px;
}
/* "Cisco" wordmark in camel case, rendered as text (Inter) beside the bridge icon. */
.atm-appbar__brand {
    font-family: var(--atm-font);
    font-weight: 600;
    font-size: 19px;
    line-height: 1;
    letter-spacing: 0.01em;
    color: #ffffff;
    margin-left: -6px;
}
.atm-appbar__title {
    font-family: var(--atm-font);
    font-weight: 500;
    font-size: 15px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.85);
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.24);
    /* Keep the product name on a single line even when the flex row is tight. */
    white-space: nowrap;
    flex: 0 0 auto;
}
.atm-appbar__spacer { flex: 1 1 auto; }
.atm-appbar__env {
    font-family: var(--atm-font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--atm-cisco-blue);
    border: 1px solid rgba(2, 200, 255, 0.4);
    border-radius: var(--atm-radius-pill);
    padding: 4px 10px;
}

/* Make room for the fixed bar. Longhand after any page's shorthand padding wins for the top. */
body { padding-top: 56px; }

/* =====================================================================
   Atmosphere component layer (authentic Harbor patterns)
   Values below are lifted from the Harbor component sources in
   cisco-it-design/atmosphere:
     - hbr-button   -> pill radius, 600 weight, medium 40px control height
     - hbr-input    -> 8px radius, strong border, hover->blue, focus ring +
                       extra-small elevation, 40px control height
     - hbr-dom-table-> bold primary headers (no uppercase), divider borders,
                       surface-hover row highlight
     - hbr-badge    -> 6px radius, body-small bold, 0.2px letter-spacing
   Selectors stay specific enough to win over each page's base rules.
   ===================================================================== */

/* ---- Data tables (hbr-dom-table) ---- */
/* Harbor headers are bold + primary colour in normal case (not uppercased). */
table thead th,
table th {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 700;
    color: var(--atm-content-primary);
    background: transparent;
    border-bottom: 1px solid var(--atm-divider);
}
table td {
    border-bottom: 1px solid var(--atm-divider);
}
table tbody tr {
    transition: background 0.12s ease;
}
table tbody tr:hover {
    background: var(--atm-surface-hover);
}

/* ---- Buttons (hbr-button) ---- */
/* Signature Atmosphere trait: buttons are fully pill-shaped, 600 weight. */
button,
.btn {
    border-radius: var(--atm-radius-pill);
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    transition: background 0.12s ease, box-shadow 0.12s ease,
        border-color 0.12s ease, transform 0.02s ease;
}
/* Standard text buttons take Harbor's medium control height + horizontal padding.
   Small round/icon affordances (.icon-btn, .info-btn, .btn-sm, .link-btn) opt out so they keep
   their own compact sizing. */
button:not(.icon-btn):not(.link-btn):not(.btn-sm):not(.info-btn),
.btn:not(.icon-btn):not(.link-btn):not(.btn-sm):not(.info-btn) {
    min-height: var(--atm-control-height);
    padding-inline: 16px;
}
button:not(.link-btn):not(.icon-btn):not(:disabled):hover {
    box-shadow: var(--atm-shadow-sm);
}
button:not(.link-btn):not(.icon-btn):not(:disabled):active {
    transform: translateY(0.5px);
}

/* ---- Form controls (hbr-input) ---- */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    border-radius: var(--atm-radius-md);            /* 8px */
    border: 1px solid var(--atm-border-strong);
    background: var(--atm-surface);
    box-shadow: var(--atm-shadow-xs);               /* subtle elevation */
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:not([type="checkbox"]):not([type="radio"]),
select {
    min-height: var(--atm-control-height);          /* 40px */
}
input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover {
    border-color: var(--atm-border-hover);          /* border shifts to blue */
}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--atm-border-strong);
    /* focus ring + retained elevation, mirroring hbr-input's box-shadow stack */
    box-shadow: 0 0 0 3px rgba(9, 83, 229, 0.16), var(--atm-shadow-xs);
}

/* ---- Status tags / pills (hbr-badge shape) ---- */
.pill,
.badge,
.tag {
    border-radius: var(--atm-radius-badge);   /* 6px, per hbr-badge */
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.2;
}
/* Map the apps' hardcoded success/neutral/danger pills onto Atmosphere status tokens. */
.pill.true {
    background: var(--atm-success-bg);
    color: var(--atm-success-strong);
    border-color: rgba(66, 161, 22, 0.32);
}
.pill.false {
    background: var(--atm-danger-bg);
    color: var(--atm-danger);
    border-color: rgba(217, 24, 33, 0.32);
}
.pill.ignored {
    background: var(--atm-surface-weak);
    color: var(--atm-content-secondary);
    border-color: var(--atm-divider);
}

/* ---- Text links (hbr-link) ---- */
/* Content links use the accent colour + 500 weight. Scoped to plain anchors so
   the writeback launcher cards (which set their own colour) are untouched. */
a:not([class]) {
    color: var(--atm-content-accent);
    font-weight: 500;
}

/* NOTE: The scrollable-table (.atm-table-scroll) and pagination (.atm-pagination /
   .atm-page-btn / .atm-page-size) styles used by the other Gong admin UIs are intentionally
   omitted here. Writeback is a launcher (app-link cards only) with no data table or
   atm-paginate.js, so those rules would be dead code in this app. */

