/* PSAP Insight - Global UI Stylesheet */

:root {
    --psap-bg-dark: #0b1c2c;
    --psap-nav: #0f2438;
    --psap-surface: #f5f7fa;
    --psap-surface-alt: #ffffff;
    --psap-border: #dde3ec;
    --psap-text-main: #1f2933;
    --psap-text-muted: #6b7380;
    --psap-accent-blue: #2678c2;
    --psap-accent-green: #2ecc71;
    --psap-accent-red: #e74c3c;
    --psap-accent-gold: #f1c40f;

    --psap-radius: 8px;
    --psap-shadow-soft: 0 4px 12px rgba(15, 36, 56, 0.14);
    --psap-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--psap-font);
    font-size: 15px;
    background: radial-gradient(circle at top, #1d3557 0, #0b1c2c 45%, #020812 100%);
    color: var(--psap-text-main);
}

/* Shell and main content container */

.psap-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.psap-main {
    max-width: 1240px;
    margin: 24px auto 32px auto;
    padding: 20px 22px 28px;
    background: var(--psap-surface);
    border-radius: 16px;
    box-shadow: var(--psap-shadow-soft);
}

/* Headings, text, misc */

h1,
h2,
h3 {
    color: var(--psap-text-main);
}

h2 {
    font-size: 20px;
    margin-top: 4px;
    margin-bottom: 6px;
}

h3 {
    font-size: 16px;
}

hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 0;
}

form {
    margin-top: 10px;
    margin-bottom: 10px;
}

.subtext {
    font-size: 12px;
    color: var(--psap-text-muted);
}

/* Inputs and controls */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
    font-family: var(--psap-font);
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--psap-border);
    background: var(--psap-surface-alt);
    color: var(--psap-text-main);
    min-width: 180px;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--psap-accent-blue);
    box-shadow: 0 0 0 2px rgba(38, 120, 194, 0.2);
}

button,
.psap-btn {
    font-family: var(--psap-font);
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--psap-accent-blue);
    background: var(--psap-accent-blue);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.07s ease, box-shadow 0.15s ease;
}

button:hover,
.psap-btn:hover {
    background: #21649f;
    box-shadow: 0 2px 6px rgba(15, 36, 56, 0.35);
}

button:active,
.psap-btn:active {
    transform: scale(0.97);
    box-shadow: none;
}

.psap-btn-secondary {
    background: #ffffff;
    color: var(--psap-accent-blue);
    border-color: var(--psap-accent-blue);
}

.psap-btn-secondary:hover {
    background: #e6edf7;
}

/* Range picker row */

.range-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    margin-bottom: 10px;
}

.range-form label {
    font-size: 13px;
    color: var(--psap-text-muted);
}

/* Cards and summary blocks */

.summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 16px 0;
}

.card {
    border-radius: var(--psap-radius);
    border: 1px solid var(--psap-border);
    padding: 10px 14px;
    min-width: 180px;
    background: var(--psap-surface-alt);
    box-shadow: 0 1px 3px rgba(15, 36, 56, 0.12);
}

.card h3 {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--psap-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card strong {
    font-size: 18px;
    color: var(--psap-text-main);
}

/* Tables */

.mini-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
}

.mini-table th,
.mini-table td {
    border: 1px solid var(--psap-border);
    padding: 3px 6px;
    font-size: 12px;
}

.mini-table th {
    background: #edf2fb;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: var(--psap-surface-alt);
    border-radius: 10px;
    overflow: hidden;
}

th,
td {
    border: 1px solid var(--psap-border);
    padding: 6px 8px;
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

th {
    background: #e4ebf5;
    white-space: nowrap;
    font-weight: 600;
}

tr:nth-child(even) {
    background: #f9fbff;
}

tbody tr:hover {
    background: #edf4ff;
}

.details-row {
    background: #f4f7fc;
}

/* Badges */

.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    background: #eef2ff;
    color: #273469;
}

.badge-sub {
    background: #e6ffe9;
    color: #145c2e;
}

.badge-priority-High {
    background: #ffe5e5;
    color: #8a0010;
}

.badge-priority-Medium {
    background: #fff3cd;
    color: #7a5b00;
}

.badge-priority-Low {
    background: #e6ffed;
    color: #145c2e;
}

/* Details toggle text */

.details-toggle {
    cursor: pointer;
    font-size: 11px;
    color: var(--psap-accent-blue);
    text-decoration: underline;
}

/* Monospace blocks */

.ali-block,
.payload-block {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

/* Login layout */

.psap-login {
    max-width: 420px;
    margin: 60px auto;
    padding: 22px 24px 26px;
    background: var(--psap-surface);
    border-radius: 16px;
    box-shadow: var(--psap-shadow-soft);
}

.psap-login h1 {
    margin-top: 0;
}

.psap-login h2 {
    margin-top: 4px;
    margin-bottom: 16px;
}

.psap-login button {
    width: 100%;
}

/* Header and nav */

.psap-header {
    width: 100%;
    background: var(--psap-nav);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.psap-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.psap-logo {
    height: 46px;
    width: auto;
}

.psap-title-group h1 {
    margin: 0;
    padding: 0;
    font-size: 22px;
    color: #fff;
}

.psap-tenant {
    margin: 0;
    padding: 0;
    font-size: 12px;
    color: #a0b4c8;
}

/* Main nav */

.psap-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.psap-nav-link {
    padding: 6px 12px;
    font-size: 14px;
    text-decoration: none;
    color: #dce6f5;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.psap-nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
}

.psap-nav-active {
    background: rgba(255, 255, 255, 0.18) !important;
}

/* Dropdown nav */

.psap-nav-dropdown {
    position: relative;
}

.psap-nav-dropdown button {
    border: none;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.psap-nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 36px;
    left: 0;
    background: #0f2438;
    padding: 6px;
    border-radius: 8px;
    min-width: 220px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.psap-nav-dropdown:hover .psap-nav-dropdown-menu {
    display: block;
}

.psap-nav-dropdown-menu a {
    display: block;
    padding: 8px 10px;
    color: #dce6f5;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
}

.psap-nav-dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Responsive tweaks */

@media (max-width: 768px) {
    .psap-main {
        margin: 16px 8px 24px;
        padding: 16px 14px 22px;
    }

    .psap-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .psap-nav {
        flex-wrap: wrap;
    }

    table,
    th,
    td {
        font-size: 12px;
    }
}
