* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: linear-gradient(180deg, #eef3ff 0%, #f8fafc 34%, #eef2f7 100%);
    color: #0f172a;
}

.page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 1.4rem;
}

.header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.2rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.actions {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-end;
}

.project-row {
    display: flex;
    gap: 0.45rem;
    align-items: end;
}

.project-row label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    min-width: 280px;
}

.project-row select {
    min-width: 280px;
}

.auth-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(300px, 1fr));
    gap: 1rem;
}

.auth-shell {
    align-items: stretch;
    grid-template-columns: minmax(360px, 1.15fr) minmax(360px, 1fr);
    min-height: calc(100vh - 7.5rem);
}

.auth-hero {
    border-radius: 18px;
    padding: 2rem;
    background:
        radial-gradient(circle at 15% 10%, rgba(20, 184, 166, 0.22), rgba(20, 184, 166, 0) 50%),
        radial-gradient(circle at 90% 85%, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0) 45%),
        linear-gradient(150deg, #0f172a 0%, #111827 45%, #1f2937 100%);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.26);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.85rem;
}

.auth-hero h1 {
    margin: 0;
    font-size: clamp(1.65rem, 2.2vw, 2.3rem);
    line-height: 1.2;
}

.auth-subtitle {
    margin: 0;
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.55;
}

.auth-list {
    margin: 0.55rem 0 0;
    padding: 0 0 0 1.1rem;
    color: #dbeafe;
    display: grid;
    gap: 0.38rem;
    line-height: 1.35;
}

.auth-footer {
    margin: 0.65rem 0 0;
    color: #94a3b8;
    font-size: 0.9rem;
}

.auth-stack {
    display: grid;
    gap: 1rem;
    align-content: center;
}

.auth-card {
    border-radius: 16px;
    border: 1px solid #dbe3ef;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
    padding: 1.2rem 1.25rem;
}

.auth-card h2 {
    margin-top: 0.15rem;
}

.auth-form {
    gap: 0.65rem;
}

.auth-form label {
    gap: 0.3rem;
}

.auth-form .primary {
    width: 100%;
    margin-top: 0.2rem;
}

.auth-stage {
    position: relative;
    min-height: calc(100vh - 6.5rem);
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 1.5rem 0;
}

.auth-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 15%, rgba(14, 165, 233, 0.12), rgba(14, 165, 233, 0) 40%),
        radial-gradient(circle at 82% 85%, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0) 38%);
    pointer-events: none;
}

.auth-float {
    position: absolute;
    width: 152px;
    min-height: 88px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid #d8e2f1;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    padding: 0.8rem 0.85rem;
    display: grid;
    gap: 0.35rem;
    z-index: 0;
}

.auth-float-1 {
    left: 5%;
    top: 5%;
}

.auth-float-2 {
    right: 7%;
    top: 16%;
}

.auth-float-3 {
    left: 9%;
    bottom: 8%;
}

.auth-float-4 {
    right: 8%;
    bottom: 7%;
}

.auth-float-icon {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid #c7d2fe;
    color: #4f46e5;
    font-size: 0.66rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-float-line {
    height: 2px;
    border-radius: 999px;
    background: #cbd5e1;
}

.auth-float-line.short {
    width: 70%;
}

.auth-float-line.tiny {
    width: 52%;
}

.auth-panel {
    position: relative;
    z-index: 1;
    width: min(440px, 92vw);
    border-radius: 20px;
    border: 1px solid #dbe5f2;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
    padding: 1.55rem;
    display: grid;
    gap: 0.86rem;
}

.auth-panel-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    color: #115e59;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d1fae5 0%, #ccfbf1 100%);
    border: 1px solid #99f6e4;
}

.auth-panel h1 {
    margin: 0;
    text-align: center;
    font-size: clamp(1.45rem, 2.2vw, 1.9rem);
}

.auth-panel-subtitle {
    margin: -0.2rem 0 0.15rem;
    text-align: center;
    color: #64748b;
    font-size: 0.92rem;
}

.auth-panel-form {
    gap: 0.66rem;
}

.auth-panel-form label {
    display: grid;
    gap: 0.32rem;
    font-size: 0.86rem;
    color: #334155;
}

.auth-panel-form input {
    background: #eef3ff;
    border: 1px solid #d7e1f3;
}

.auth-panel-form .primary {
    width: 100%;
    margin-top: 0.24rem;
}

.auth-switch-text {
    margin: 0.1rem 0 0;
    text-align: center;
    color: #64748b;
    font-size: 0.88rem;
}

.auth-link-btn {
    border: none;
    background: transparent;
    color: #0f766e;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.1rem 0.2rem;
    border-radius: 6px;
}

.auth-link-btn:hover {
    border-color: transparent;
    background: rgba(15, 118, 110, 0.1);
}

.auth-powered-strip {
    margin-top: 0.2rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 0.62rem 0.75rem;
    display: grid;
    justify-items: center;
    gap: 0.24rem;
}

.auth-powered-strip p {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.powered-by-logo {
    width: 74px;
    height: auto;
    object-fit: contain;
}

.auth-invite-meta {
    margin: 0;
    padding: 0.35rem 0.75rem;
    list-style: none;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #f8fbff;
    display: grid;
    gap: 0.2rem;
    font-size: 0.82rem;
}

.invite-grid {
    grid-template-columns: 1.2fr 0.8fr 1.5fr 1fr auto;
}

#invite-project-select {
    min-height: 7.5rem;
}

.hint {
    color: #475569;
    font-size: 0.9rem;
    margin: 0.3rem 0 0;
}

.auth-eyebrow {
    margin: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0f766e;
    font-weight: 700;
}

.auth-hero .auth-eyebrow {
    color: #99f6e4;
}

.primary {
    border: none;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    padding: 0.64rem 0.98rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 7px 16px rgba(15, 118, 110, 0.24);
}

.primary:hover {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
}

#alerts {
    margin-top: 0.8rem;
}

.alert {
    padding: 0.7rem 0.85rem;
    border-radius: 6px;
    margin-bottom: 0.6rem;
}

.alert.info {
    background: #dbeafe;
    color: #1e3a8a;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.summary-grid {
    margin-top: 1rem;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
}

.summary-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.summary-card h2 {
    margin: 0 0 0.6rem;
    font-size: 1rem;
}

.summary-card ul {
    margin: 0;
    padding-left: 1rem;
}

.filters {
    margin-top: 1rem;
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: 2fr 1.3fr 1fr 1fr 2fr auto;
    gap: 0.8rem;
    align-items: end;
}

.filters label,
.filters fieldset {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    padding: 0.5rem 0.58rem;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.16);
}

textarea {
    width: 100%;
    min-height: 64px;
    resize: vertical;
}

#severity-filter {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
}

#severity-filter label {
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
}

.table-wrap {
    margin-top: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.6rem;
    overflow-x: auto;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.pagination-controls {
    margin-top: 0.8rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pagination-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-actions label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.84rem;
}

#page-indicator {
    color: #334155;
    font-size: 0.84rem;
    min-width: 95px;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid #e2e8f0;
    vertical-align: top;
    padding: 0.55rem;
    text-align: left;
    font-size: 0.86rem;
}

th {
    background: #f8fafc;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.severity-BLOCKER {
    background: #dc2626;
    color: white;
}

.severity-CRITICAL {
    background: #ea580c;
    color: white;
}

.severity-MAJOR {
    background: #d97706;
    color: white;
}

.severity-MINOR {
    background: #2563eb;
    color: white;
}

.severity-INFO {
    background: #475569;
    color: white;
}

.inline-actions {
    display: grid;
    gap: 0.35rem;
}

.btn {
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
}

.btn.save {
    background: #0f766e;
    color: white;
}

button {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

button:hover {
    border-color: #94a3b8;
}

button:active {
    transform: translateY(1px);
}

.btn.approve {
    background: #16a34a;
    color: white;
}

.btn.reject {
    background: #b91c1c;
    color: white;
}

.status-label {
    font-weight: bold;
    font-size: 0.8rem;
}

.rule-help-sections {
    min-width: 300px;
    display: grid;
    gap: 0.45rem;
}

.rule-help-section {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.4rem;
}

.rule-help-title {
    font-size: 0.74rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #0f172a;
}

.rule-help-text {
    margin: 0;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.76rem;
    line-height: 1.35;
    max-height: 180px;
    overflow: auto;
}

.hidden {
    display: none;
}

a {
    color: #0369a1;
}

@media (max-width: 1150px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        min-height: auto;
    }

    .auth-hero {
        padding: 1.3rem;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .auth-stage {
        min-height: auto;
    }

    .auth-float {
        display: none;
    }

    .auth-panel {
        width: min(440px, 95vw);
    }

    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
    }
}
