@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lora:wght@600&display=swap');

:root {
    --grad-start: #5f1ec4;
    --grad-end: #1d62d7;
    --primary-color: #1d62d7;
    --secondary-color: #f4f7fc;
    --font-color: #1e293b;
    --border-color: #e2e8f0;
    --success-color: #107c10;
    --success-bg: #dff6dd;
    --warning-color: #d83b01;
    --warning-bg: #fdecea;
    --info-bg: #e1f5fe;
    --info-border: #0288d1;
    --disabled-color: #94a3b8;
    --shadow-color: rgba(100, 116, 139, 0.12);
    --log-table-header-height: 110px;
}
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--secondary-color);
    color: var(--font-color);
    line-height: 1.6;
}
#app {
    padding: 2em;
}

/* --- Containers & Layout --- */
.login-container {
    max-width: 500px;
    margin: 4em auto;
}
.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
}
.brand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 auto 1.5rem auto;
    max-width: 1600px;
    padding: 0 2em;
}
.brand-header img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.brand-name {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary-color);
}
.brand-subtitle {
    color: #475569;
    font-size: 0.95rem;
}
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5em;
    margin-top: 1.5em;
}
.enforcement-grid {
    display: grid;
    gap: 1.5em;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}
.enforcement-grid--two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 960px) {
    .enforcement-grid--two-column {
        grid-template-columns: 1fr;
    }
}
.dashboard-metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5em;
    margin-top: 1.5em;
}
.dashboard-metrics-row .card {
    margin-bottom: 0;
}
.metric-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 220px;
    text-align: center;
}
.metric-value {
    font-size: 3rem;
    font-weight: 600;
    color: var(--primary-color);
}
.metric-label {
    margin-top: 0.5em;
    color: #605e5c;
    font-size: 0.95em;
}
.metric-placeholder {
    color: #605e5c;
    font-weight: 600;
}


/* --- Header & User Info --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1em;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5em;
}
.dashboard-header h1 { margin: 0; color: var(--primary-color); }

.brand-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    color: var(--primary-color);
}
.brand-heading-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}
.brand-heading-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.brand-heading-name {
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2rem);
}
.brand-heading-subtitle {
    color: #4b5563;
    font-size: 1rem;
}

.user-info { 
    color: #605e5c; 
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5em;
}
.user-actions {
    display: flex;
    gap: 0.5em;
}
.switch-user-btn {
    background: none; border: 1px solid var(--border-color); border-radius: 4px; color: var(--primary-color);
    cursor: pointer; font-size: 0.9em; padding: 0.3em 0.8em;
}
.switch-user-btn:hover { background-color: #faf9f8; }

/* --- Cards --- */
.card {
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5em;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.card.full-width-card {
    grid-column: 1 / -1;
}
.card-header { padding: 1em 1.5em; border-bottom: 1px solid var(--border-color); }
.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-actions {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.card-actions .switch-user-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}
.card-header h1, .card-header h2, .card-header h3 { margin: 0; color: var(--primary-color); font-size: 1.2em; }
.card-body { padding: 1.5em; flex-grow: 1; }

.chart-container {
    position: relative;
    height: 400px;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 0.5em;
    margin-bottom: 1.5em;
}
.tabs button {
    padding: 0.8em 1.5em;
    font-size: 1em;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-bottom: none;
    background-color: #e1dfdd;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    color: #605e5c;
}
.tabs button.active {
    background-color: #fff;
    border-color: var(--border-color);
    color: var(--primary-color);
}
.tab-content {
    background-color: #fff;
    padding: 2em;
    border: 1px solid var(--border-color);
    border-radius: 0 8px 8px 8px;
}
.tab-content h2 { margin-top: 0; }

.muted-text {
    color: #605e5c;
    font-size: 0.9em;
}

.tile-status-message {
    padding: 1em;
    border-radius: 4px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    text-align: center;
    font-weight: 600;
    margin-bottom: 1em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75em;
}
.tile-status-message .pause-button {
    min-width: 90px;
}

.progress-bar-wrapper {
    margin: 0.5em 0 1em 0;
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}
.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #f3f2f1;
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    transition: width 0.2s ease-in-out;
}
.progress-bar-label {
    font-size: 0.9em;
    color: #605e5c;
    text-align: center;
}

.experience-analysis-body {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.experience-analysis-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    align-items: center;
}

.experience-analysis-stats {
    flex: 1 1 220px;
    display: grid;
    gap: 0.8em;
}

.experience-analysis-stats .stat-tile {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #faf9f8;
    padding: 0.9em 1.2em;
    text-align: left;
    font: inherit;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.experience-analysis-stats .stat-tile.is-active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.15);
}

.experience-analysis-stats .stat-tile.is-empty {
    opacity: 0.7;
}

.experience-analysis-stats .stat-tile:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.25);
}

.experience-analysis-stats .stat-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75em;
    color: #605e5c;
}

.experience-analysis-stats .stat-helper {
    display: block;
    font-size: 0.85em;
    color: #605e5c;
    margin-top: 0.2em;
}

.experience-analysis-stats .stat-value {
    font-size: 2em;
    font-weight: 600;
    color: var(--primary-color);
}

.experience-analysis-stats .stat-static {
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    padding: 0.9em 1.2em;
    background-color: #fff;
}

.experience-analysis-chart {
    flex: 1 1 260px;
    min-width: 240px;
    max-width: 420px;
}

.experience-analysis-chart canvas {
    width: 100% !important;
    height: auto !important;
}

.experience-analysis-details {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5em;
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.experience-analysis-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
}

.experience-analysis-table {
    max-height: 320px;
    overflow-y: auto;
}

.experience-analysis-table-actions {
    display: flex;
    justify-content: flex-end;
}

/* --- Forms & Buttons --- */
.action-area { padding: 1.5em; background: #faf9f8; border-top: 1px solid var(--border-color); text-align: center; }
.action-button {
    width: 100%; padding: 0.8em; font-size: 1.1em; font-weight: bold; border-radius: 4px;
    cursor: pointer; color: #fff; background-color: var(--primary-color); border: none;
}
.action-button:hover { background-color: #005a9e; }
.secondary-button {
    padding: 0.6em 1.2em;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
}
.secondary-button:hover { background-color: #f3f2f1; }
.search-form { display: flex; gap: 1em; }
.search-form input { flex-grow: 1; padding: 0.8em; border: 1px solid var(--border-color); border-radius: 4px; font-size: 1em;}
.search-form button { padding: 0.8em 1.5em; background-color: var(--primary-color); color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; }
.search-form button:disabled { background-color: var(--disabled-color); cursor: not-allowed; }

/* --- Tables --- */
.table-container { overflow-x: auto; }
.user-list-table-container {
    width: 100%;
    max-height: none;
    overflow-y: visible;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 0.8em 0.8em;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid #edebe9;
    /* white-space: nowrap; <-- Removed to allow wrapping */
}
.data-table th:last-child, .data-table td:last-child {
    border-right: none;
}
.data-table td {
    word-break: break-word; /* Helps long text like UPNs wrap nicely */
}
.user-chasing-table .data-table td {
    text-align: center;
}
.user-chasing-table .data-table td:first-child {
    text-align: left;
}
.recent-activity-table .col-user {
    min-width: 280px;
    width: 50%;
    white-space: normal;
}

.recent-activity-table .col-action,
.recent-activity-table .col-groupName,
.recent-activity-table .col-initiatedBy,
.recent-activity-table .col-date {
    width: 1%;
    white-space: nowrap;
    word-break: normal;
}
.data-table th { 
    background-color: #faf9f8; 
    font-weight: 600;
}
.data-table tbody tr:hover { background-color: #f3f2f1; }
.config-note {
    background-color: var(--info-bg);
    border: 1px solid var(--info-border);
    border-left: 5px solid var(--info-border);
    border-radius: 6px;
    color: #1e293b;
    padding: 0.75em 1em;
    margin-bottom: 1.5em;
}
.config-status {
    color: #475569;
    margin-bottom: 1.5em;
}
.configuration-pane {
    padding-bottom: 5.5em;
}
.config-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.08);
    padding: 0.75em 2em;
    z-index: 20;
}
.config-footer-inner {
    display: flex;
    justify-content: flex-end;
    gap: 0.75em;
    max-width: 1600px;
    margin: 0 auto;
}
.config-footer .action-button,
.config-footer .secondary-button {
    width: auto;
}
.config-save-modal {
    max-width: 900px;
}
.config-diff-section h3 {
    margin-top: 0;
}
.config-diff-section + .config-diff-section {
    margin-top: 1.5em;
}
.config-form {
    display: grid;
    gap: 1.25em;
}
.config-group {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
}
.config-group summary {
    list-style: none;
    cursor: pointer;
    padding: 0.9em 1em;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.35em 1em;
    align-items: center;
}
.config-group summary::-webkit-details-marker {
    display: none;
}
.config-group summary::after {
    content: '▾';
    color: #64748b;
    font-size: 0.9em;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
}
.config-group[open] summary::after {
    content: '▴';
}
.config-group-title {
    display: flex;
    align-items: center;
    gap: 0.75em;
    grid-column: 1;
    grid-row: 1;
}
.config-group-name {
    font-weight: 600;
    color: var(--primary-color);
}
.config-group-count {
    font-size: 0.8em;
    color: #64748b;
    background-color: #e2e8f0;
    padding: 0.1em 0.6em;
    border-radius: 999px;
}
.config-group-description {
    grid-column: 1 / -1;
    grid-row: 2;
    color: #475569;
    font-size: 0.9em;
}
.config-group-body {
    padding: 1em;
    display: grid;
    gap: 1em;
}
.config-field {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1em;
    background-color: #fff;
}
.config-field-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1em;
}
.config-field-header h3 {
    margin: 0;
    font-size: 1.05em;
    color: var(--primary-color);
}
.config-field-description {
    margin: 0.35em 0 0;
    color: #475569;
}
.config-field-control {
    margin-top: 0.85em;
}
.config-field-control input,
.config-field-control select,
.config-field-control textarea {
    width: 100%;
    padding: 0.6em 0.75em;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    box-sizing: border-box;
    background-color: #fff;
    color: inherit;
}
.config-input-row {
    display: flex;
    gap: 0.75em;
    align-items: center;
}
.config-input-row input {
    flex: 1;
}
.config-reset-btn {
    border: 1px solid var(--border-color);
    background-color: #f8fafc;
    color: var(--primary-color);
    padding: 0.5em 0.9em;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.config-reset-btn:hover {
    background-color: #e2e8f0;
}
.config-field-control textarea {
    min-height: 110px;
    resize: vertical;
}
.config-group-input {
    position: relative;
}
.config-group-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35em);
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    z-index: 30;
    max-height: 260px;
    overflow-y: auto;
}
.config-group-option {
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    padding: 0.65em 0.8em;
    cursor: pointer;
}
.config-group-option + .config-group-option {
    border-top: 1px solid #eef2f7;
}
.config-group-option:hover {
    background-color: #f1f5f9;
}
.config-group-option-title {
    font-weight: 600;
    color: #1e293b;
}
.config-group-option-meta {
    font-size: 0.85em;
    color: #64748b;
    margin-top: 0.2em;
}
.config-group-hint {
    padding: 0.6em 0.8em;
    color: #64748b;
    font-size: 0.9em;
}
.config-group-error {
    color: var(--warning-color);
}
.config-toggle-row {
    display: flex;
    gap: 1.5em;
    margin-top: 0.75em;
    flex-wrap: wrap;
}
.config-toggle-option {
    display: flex;
    align-items: center;
    gap: 0.4em;
    font-weight: 600;
    color: #1e293b;
}
.config-feature-media {
    margin-top: 0.75em;
}
.config-feature-image {
    width: min(100%, 260px);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: block;
}
.config-inline-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4em;
    color: #1e293b;
}
.config-field-helper {
    margin-top: 0.5em;
    color: #64748b;
    font-size: 0.9em;
}
@media (min-width: 1100px) {
    .config-form {
        grid-template-columns: 1fr;
    }
    .config-group-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.user-chasing-table td:first-child {
    width: 280px;
}
.table-container.user-chasing-table {
    position: relative;
}
.user-chasing-table thead th {
    position: sticky;
    top: 0;
    background-color: #faf9f8;
    z-index: 8;
    vertical-align: top;
    height: var(--log-table-header-height);
}
.user-chasing-table .header-with-filter {
    display: grid;
    grid-template-rows: 1fr auto;
    row-gap: 0.35em;
    align-items: flex-start;
    height: 100%;
}
.user-chasing-table .header-with-filter select {
    width: 100%;
    padding: 0.35em 0.45em;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
    color: inherit;
    box-sizing: border-box;
    align-self: stretch;
}
.user-chasing-table .header-with-filter input[type="text"] {
    width: 100%;
    padding: 0.35em 0.45em;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
    color: inherit;
    box-sizing: border-box;
    align-self: stretch;
}
.user-chasing-table thead th:hover,
.user-chasing-table thead th:focus-within {
    z-index: 100; /* Raise hovered header above neighbors so tooltips sit on top */
}

/* Alternating column backgrounds for Log Analytics table (Table 4) */
.table-container.user-chasing-table .data-table th:nth-child(even),
.table-container.user-chasing-table .data-table td:nth-child(even) {
    background-color: #f4f4f4;
}

.user-chasing-os-list {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}
.user-chasing-os-entry {
    padding: 0.4em 0;
    border-bottom: 1px solid var(--border-color);
}
.user-chasing-os-entry:last-child {
    border-bottom: none;
}
.user-chasing-os-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75em;
    font-weight: 600;
}
.status-yes { color: var(--success-color); font-weight: bold; }
.status-no { color: var(--warning-color); font-weight: bold; }
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.7em;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    font-size: 0.9em;
}
.status-pill--active {
    background-color: var(--success-bg);
    color: var(--success-color);
    border-color: #c6e5c6;
}
.status-pill--pending {
    background-color: var(--warning-bg);
    color: var(--warning-color);
    border-color: #f4c7b5;
}
.status-pill--info {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-color: #d0e4ff;
}
.group-tag { padding: 0.2em 0.6em; border-radius: 1em; color: #fff; font-size: 0.8em; white-space: nowrap; }
.group-tag.group-enforced { background-color: var(--success-color); }
.group-tag.group-issue { background-color: var(--warning-color); }
.group-tag.group-help { background-color: #605e5c; }
.group-tag.group-target { background-color: #f8b229; }


/* --- Misc & Helpers --- */
.error-box {
    background-color: var(--warning-bg);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
    padding: 1em;
    border-radius: 4px;
    margin-top: 1em;
}
.loader-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2em;
    color: #605e5c;
    min-height: 200px;
}
.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1em;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.text-center { text-align: center; }
.summary-stats {
    font-size: 1.1em;
    line-height: 1.8;
}
.summary-stats strong {
    color: var(--font-color);
}
.summary-stats small {
    display: block;
    margin-top: 1em;
    color: #605e5c;
    font-size: 0.9em;
}

/* --- Modal (for Tenant Switch) --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1.5rem;
    box-sizing: border-box;
    overflow: hidden;
}
.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: min(500px, 100%);
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 1.5em;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h2 {
    margin: 0;
    font-size: 1.2em;
    color: var(--primary-color);
}
.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #605e5c;
    line-height: 1;
}
.modal-body {
    padding: 1.5em;
}
.modal-body p {
    margin-top: 0;
    margin-bottom: 1.5em;
    color: #605e5c;
}
.tenant-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
.tenant-input-group input {
    border: none;
    flex-grow: 1;
    padding: 0.8em;
    font-size: 1em;
    outline: none;
    border-radius: 4px 0 0 4px;
}
.tenant-input-group span {
    padding: 0.8em;
    background-color: #faf9f8;
    color: #605e5c;
    border-left: 1px solid var(--border-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1em;
    padding: 1em 1.5em;
    background-color: #faf9f8;
    border-top: 1px solid var(--border-color);
}
.modal-footer .action-button,
.modal-footer .secondary-button {
    width: auto;
    padding: 0.6em 1.2em;
    font-size: 1em;
}
.modal-footer .secondary-button {
    background-color: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.modal-footer .secondary-button:hover {
    background-color: #f3f2f1;
}
.modal-footer .action-button:disabled {
    background-color: var(--disabled-color);
    border-color: var(--disabled-color);
    cursor: not-allowed;
}

/* Fullscreen modal variant (used for enforcement changes) */
.fullscreen-modal {
    padding: 0;
    align-items: stretch;
}

.fullscreen-modal-content {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
}

.fullscreen-modal-content .modal-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.fullscreen-modal-content .modal-header,
.fullscreen-modal-content .modal-footer {
    flex-shrink: 0;
}

/* --- Active Tenant Display --- */
.active-tenant-display {
    font-size: 0.9em;
    color: var(--primary-color);
    background-color: var(--info-bg);
    padding: 0.2em 0.8em;
    border-radius: 4px;
    border: 1px solid var(--info-border);
}

/* --- What's New Modal Summary Grid --- */
.summary-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 0.5em 1em;
    background-color: var(--secondary-color);
    padding: 1em;
    border-radius: 6px;
    margin-bottom: 1em;
    text-align: center;
}
.summary-header {
    font-weight: bold;
    color: var(--font-color);
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--border-color);
}
.summary-cell {
    padding: 0.5em;
    background-color: #fff;
    border-radius: 4px;
}
.summary-cell.group-name-cell {
    font-weight: 600;
    text-align: left;
}

/* --- Method Icons --- */
.method-icons-cell span {
    font-size: 1.5em;
    margin-right: 0.5em;
}
.method-audit-notes {
    margin-top: 0.35em;
    font-size: 0.85em;
    color: #605e5c;
}
.method-audit-notes span {
    display: block;
}
.method-audit-notes span + span {
    margin-left: 0;
    margin-top: 0.35em;
}

/* --- Configuration Card List --- */
.config-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.config-list li {
    display: flex;
    align-items: center;
    margin-bottom: 1em;
    font-size: 1.1em;
}
.config-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.8em;
    flex-shrink: 0;
}
.config-list a {
    color: var(--primary-color);
    text-decoration: none;
}
.config-list a:hover {
    text-decoration: underline;
}

/* --- Card Footer & Link Button (for 'Show All') --- */
.card-footer {
    padding: 0.75em 1.5em;
    border-top: 1px solid var(--border-color);
    background-color: #faf9f8;
    text-align: center;
}

.link-button {
    background: none;
    border: none;
    padding: 0.25em 0.5em;
    font-family: inherit;
    font-size: 1em;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    border-radius: 4px;
}

.link-button:hover, .link-button:focus {
    text-decoration: underline;
    background-color: var(--secondary-color);
    outline: none;
}

/* --- Licensing Snapshot --- */
.licensing-card .card-body {
    min-height: 200px;
}

.licensing-metric {
    text-align: center;
    padding: 1.5em 0;
}

.licensing-metric .licensing-value {
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary-color);
}

.licensing-metric .metric-subtext {
    margin-top: 0.5em;
    color: #605e5c;
    font-size: 0.9rem;
}

.info-tooltip {
    position: relative;
    display: inline;
    cursor: help;
    color: #000000;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    z-index: 1;
}

.info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(100, 100, 100, 0.85);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 400;
    white-space: pre-line;
    max-width: 280px;
    width: max-content;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    margin-bottom: 4px;
    text-align: left;
    /* Ensure tooltip never extends beyond viewport bounds */
    box-sizing: border-box;
}

/* Position tooltip to the left for right-aligned headers */
.data-table th:last-child .info-tooltip::after {
    left: auto;
    right: 0;
    transform: none;
}

/* Fallback: center with right alignment constraint for better containment */
@supports (max(1px)) {
    .info-tooltip::after {
        left: max(6px, min(50%, calc(100vw - 256px - 12px)));
    }
    
    .data-table th:last-child .info-tooltip::after {
        right: max(6px, auto);
    }
}

.info-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Raise parent element when tooltip is hovered so it appears above siblings */
.info-tooltip:hover {
    z-index: 1000;
    position: relative;
}

/* Green text for registered devices seen in sign-in logs */
.device-seen-in-logs {
    color: var(--success-color);
}

/* Grey text for registered devices not yet seen */
.device-registered-inactive {
    color: var(--disabled-color);
}

/* Bold for device with most sign-ins */
.device-most-signins {
    font-weight: 700;
}

/* Highlight box for device with most sign-ins */
.user-chasing-table td > div > div:has(.device-most-signins) {
    box-shadow: 0 0 0 2px var(--primary-color), 0 6px 14px rgba(29, 98, 215, 0.16);
    background-color: #f7fbff;
}

/* Blue text for detected-only devices (not registered) */
.device-detected-only {
    color: var(--primary-color) !important;
}

/* Detected label in column header */
.detected-device-label {
    font-weight: normal;
    font-size: 0.9em;
    color: var(--success-color);
}
.detected-device-label.detected-only {
    color: var(--primary-color);
}

/* Raise device entry container when hovering over tooltip inside it */
.user-chasing-table td > div > div:has(.info-tooltip:hover) {
    z-index: 1000;
    position: relative;
}

/* Big Table container - allow sticky positioning */
.big-table-card {
    overflow: visible;
}

/* Log Analytics sticky table header - pins to viewport when scrolling */
.log-analytics-sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    padding: 0.5em 1.5em 0.75em 1.5em;
    border-bottom: 1px solid var(--border-color);
    margin: 0 -1.5em;
}
.big-table-scope {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-top: 0.6em;
    flex-wrap: wrap;
}
.big-table-scope-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #605e5c;
}
.big-table-scope-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    padding: 0.15em;
    border-radius: 999px;
    background: #f4f4f4;
    border: 1px solid var(--border-color);
}
.big-table-scope-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.big-table-scope-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.big-table-scope-option span {
    display: inline-flex;
    align-items: center;
    padding: 0.35em 0.9em;
    border-radius: 999px;
    font-weight: 600;
    color: #605e5c;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.big-table-scope-option input:checked + span {
    background-color: #fff;
    color: #1e293b;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.16);
}
.big-table-scope-option input:focus-visible + span {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Big Table container - no inner scroll, uses window scroll */
.big-table-scroll-container {
    /* No max-height or overflow - let the window scroll */
}

.big-table-scroll-container .user-chasing-table {
    overflow-x: auto;
}

/* Table headers sticky below the info bar */
.big-table-scroll-container .user-chasing-table thead th {
    position: sticky;
    /* Height of sticky header: ~52px without progress bar */
    top: 52px;
    background-color: #faf9f8;
    z-index: 90;
}

/* Raise hovered header above siblings so tooltips aren't clipped */
.big-table-scroll-container .user-chasing-table thead th:hover,
.big-table-scroll-container .user-chasing-table thead th:focus-within {
    z-index: 200;
}

/* When progress bar is visible, header is taller (~100px) */
.big-table-scroll-container:has(.progress-bar-wrapper) .user-chasing-table thead th {
    top: 100px;
}

.log-analytics-table thead {
    position: sticky;
    top: 3.5em;
    z-index: 12;
    background: #f3f2f1;
}

.log-analytics-table thead th {
    position: sticky;
    top: 3.5em;
    background: #f3f2f1;
    z-index: 13;
}

.log-analytics-table thead input,
.log-analytics-table thead select {
    width: 100%;
    box-sizing: border-box;
}
