:root {
    color-scheme: light dark;
    font-family: system-ui, sans-serif;
    line-height: 1.5;
    --background: #f4f4f9;
    --surface: #ffffff;
    --surface-muted: #eef2f7;
    --text: #1f2933;
    --text-muted: #52606d;
    --accent: #2563eb;
    --border: #d1d5db;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.auth-container {
    width: 100%;
    max-width: 360px;
    padding: 2rem;
}

.app-header {
    background: #1f2933;
    color: #fff;
    padding: 1rem 2.5rem;
}

.app-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 2rem;
}

.app-nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.app-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.app-nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.app-nav-dropdown-menu {
    position: absolute;
    top: 120%;
    left: 0;
    min-width: 180px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
    padding: 0.4rem 0;
    display: none;
    flex-direction: column;
    z-index: 20;
}

.app-nav-dropdown.is-open .app-nav-dropdown-menu,
.app-nav-dropdown:hover .app-nav-dropdown-menu {
    display: flex;
}

.app-nav-dropdown.is-active > .app-nav-link {
    background: #fff;
    color: #1f2933;
    font-weight: 600;
}

.app-nav-dropdown-trigger {
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.app-nav-dropdown-link {
    padding: 0.55rem 0.9rem;
    color: #1f2933;
    text-decoration: none;
    font-weight: 500;
}

.app-nav-dropdown-link:hover {
    background: #e5e7eb;
}

.app-nav-link {
    color: #f8fafc;
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.app-nav-link.is-active {
    background: #fff;
    color: #1f2933;
    font-weight: 600;
}

.logout-form {
    display: flex;
    margin-left: 0;
}

.logout-form button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 500;
    cursor: pointer;
}

.logout-form button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.settings-button {
    width: 46px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-button:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
}

.settings-button svg {
    display: block;
}

.settings-button-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.app-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.app-content-wide {
    max-width: 1600px;
}

.panel-projects {
    padding: 2rem;
}

.app-footer {
    text-align: center;
    padding: 1rem;
    background: #e5e7eb;
    color: #4b5563;
    margin-top: auto;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.analytics-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: -0.25rem 0 0.5rem;
}

.analytics-quick-link,
.analytics-manage-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.analytics-quick-link:hover,
.analytics-manage-button:hover {
    background: #dbe4f3;
    border-color: #c8d5f2;
    color: var(--text);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

.analytics-manage-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.analytics-links-table {
    margin-top: 1rem;
}

.analytics-links-table td:nth-child(2) .panel-link {
    word-break: break-all;
}

.analytics-actions-column {
    width: 110px;
}

.analytics-remove-button {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.analytics-remove-button:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.analytics-form-toggle {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.metric-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.12),
        0 4px 12px rgba(15, 23, 42, 0.08);
}

.metric-card h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.metric-value {
    font-size: 2rem;
    font-weight: 600;
    margin: 0.5rem 0 0;
}

.panel {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.10);
    margin-bottom: 2rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.panel-header-tight {
    margin-bottom: 0.0rem;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.panel-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.panel-link:hover {
    text-decoration: underline;
}

.button-primary,
.button-secondary,
.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.button-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.button-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.button-secondary {
    background: var(--surface-muted);
    color: var(--text);
    border-color: var(--border);
}

.button-compact {
    padding: 0.45rem 0.85rem;
    font-size: 0.95rem;
}

.button-secondary:hover {
    background: #dbe4f3;
}

.copy-button {
    font-size: 0.85rem;
    padding: 0.4rem 0.85rem;
    align-self: flex-start;
    margin-bottom: 0.5rem;
}

.copy-button.is-copied {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.6);
    color: #166534;
}

.button-danger {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.button-danger:hover {
    background: #fecaca;
    border-color: #f87171;
}

.wizard-steps {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.wizard-step {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    background: #ffffff;
}

.wizard-step.is-active {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.20);
}

.wizard-step.is-complete {
    background: #ffffff;
    border-color: #16a34a;
}

.wizard-step-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.wizard-step-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: block;
}

.wizard-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid.two-columns {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.form-group-wide {
    min-width: 240px;
    flex: 1 1 100%;
}

.form-group label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.35rem;
}

.form-group.required label::after {
    content: ' *';
    color: #dc2626;
    font-weight: 700;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    background: var(--surface-muted);
    color: var(--text);
    box-sizing: border-box;
}

.form-group input[type="text"]::placeholder,
.form-group input[type="url"]::placeholder,
.form-group input[type="number"]::placeholder,
.form-group input[type="email"]::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    margin: 0.35rem 0 0;
    color: #b91c1c;
    font-size: 0.85rem;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.35rem;
}

.status-tag.is-ready {
    background: rgba(34, 197, 94, 0.18);
    color: #166534;
}

.status-tag.is-fallback {
    background: rgba(37, 99, 235, 0.16);
    color: #1d4ed8;
}

.status-tag.is-missing {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
}

.wizard-help {
    margin: 0;
    color: var(--text-muted);
}

.wizard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.wizard-step-content {
    border: none;
    border-radius: 12px;
    background: #ffffff;
    padding: 1.5rem;
}

.wizard-highlight {
    border: 1px dashed var(--accent);
    background: rgba(37, 99, 235, 0.08);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 0 0 1.5rem;
}

.wizard-highlight-title {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

.wizard-docs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.doc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    padding: 1.25rem 1.5rem;
}

.doc-card-header {
    margin-bottom: 1rem;
}

.doc-card-header h3 {
    margin: 0.35rem 0 0.25rem;
}

.doc-card-header p {
    margin: 0;
    color: var(--text-muted);
}

.doc-step {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent);
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.doc-card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doc-label {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.doc-card-body .wizard-list {
    margin: 0;
}

.doc-card pre {
    margin: 0;
}

.wizard-step-content > h3 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.wizard-step-content > h3:first-of-type {
    margin-top: 0;
}

.wizard-step-content p {
    color: var(--text-muted);
}

.wizard-list {
    color: var(--text-muted);
    padding-left: 1.25rem;
}

.login-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.login-panel h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-panel p {
    text-align: center;
}

.login-subtitle {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    text-align: center;
}

.login-panel form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-panel input[type="text"],
.login-panel input[type="password"] {
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    color: #111827;
    display: block;
}

.login-panel input[type="text"]::placeholder,
.login-panel input[type="password"]::placeholder,
.login-panel input[type="text"]::-webkit-input-placeholder,
.login-panel input[type="password"]::-webkit-input-placeholder,
.login-panel input[type="text"]::-moz-placeholder,
.login-panel input[type="password"]::-moz-placeholder,
.login-panel input[type="text"]:-ms-input-placeholder,
.login-panel input[type="password"]:-ms-input-placeholder,
.login-panel input[type="text"]::-ms-input-placeholder,
.login-panel input[type="password"]::-ms-input-placeholder {
    color: #6b7280;
}

.login-panel button {
    padding: 0.7rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.login-panel button:hover {
    background: #1d4ed8;
}

.alert {
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.alert-success {
    background: rgba(34, 197, 94, 0.18);
    color: #166534;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.18);
    color: #92400e;
}

.alert-list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.alert-list li {
    margin: 0.2rem 0;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-form label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.filter-form select {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.table-wrapper {
    overflow-x: auto;
}

.table-wrapper table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.9rem;
}

/* Project avatars */
.project-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.project-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.project-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-avatar-fallback {
    font-weight: 700;
    color: #1f2933;
    font-size: 0.9rem;
}

.project-avatar-lg {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1rem;
}

.project-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-name-link {
    display: inline-flex;
    align-items: center;
}

thead {
    background: var(--surface-muted);
}

th,
td {
    padding: 0.75rem 1rem;
    text-align: left;
}

.table-wrapper thead th {
    border-bottom: 1px solid var(--border);
}

.table-wrapper tbody tr {
    border-bottom: 1px solid var(--border);
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.table-wrapper table tbody tr:hover {
    background: rgba(37, 99, 235, 0.08);
}

.user-id-link,
.user-id-value {
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.user-id-link:hover {
    text-decoration: underline;
}

.user-id-value {
    cursor: default;
}

code {
    background: rgba(15, 23, 42, 0.08);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.copyable {
    cursor: pointer;
}

.copyable.copied {
    background: rgba(34, 197, 94, 0.25);
    color: #166534;
}

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-code {
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
}

.status-active,
.status-code-success {
    background: rgba(34, 197, 94, 0.18);
    color: #166534;
}

.status-cron-success {
    background: rgba(34, 197, 94, 0.18);
    color: #166534;
}

.status-pending_deletion,
.status-code-warning {
    background: rgba(249, 115, 22, 0.2);
    color: #9a3412;
}

.status-deleted,
.status-code-error {
    background: rgba(239, 68, 68, 0.22);
    color: #991b1b;
}

.status-code-info {
    background: rgba(14, 165, 233, 0.18);
    color: #075985;
}

.status-cron-failed {
    background: rgba(239, 68, 68, 0.22);
    color: #991b1b;
}

.status-email-sent {
    background: rgba(34, 197, 94, 0.2);
    color: #166534;
}

.status-email-failed {
    background: rgba(251, 191, 36, 0.25);
    color: #92400e;
}

.status-email-error {
    background: rgba(239, 68, 68, 0.25);
    color: #b91c1c;
}

.status-note {
    margin: 0.35rem 0 0;
    color: #b91c1c;
    font-size: 0.8rem;
}

.table-link {
    color: var(--accent);
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.panel-hint {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.85rem;
}

.code-block {
    display: block;
    background: #0b1120;
    color: #e2e8f0;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 1rem 1.1rem;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.55;
    white-space: pre;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    font-family: ui-monospace, SFMono-Regular, SFMono, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
    padding: 1.25rem;
}

.summary-card-user-id {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 140px;
}

.summary-card-user-id h3 {
    margin: 0 0 0.80rem;
}

.summary-card-user-id p {
    margin: 0;
}

.summary-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

.summary-list {
    margin: 0;
    padding: 0;
}

.summary-list div {
    margin-bottom: 0.65rem;
}

.summary-list div:last-child {
    margin-bottom: 0;
}

.summary-list dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.summary-list dd {
    margin: 0;
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted);
}

.subpanel {
    margin-top: 2rem;
}

.subpanel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.subpanel-hint {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.subpanel-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.retention-test-panel .retention-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.retention-test-card {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: flex-start;
}

.retention-test-card h4 {
    margin: 0;
    font-size: 1rem;
}

.retention-test-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.retention-test-card button {
    margin-top: auto;
}

.retention-test-alert {
    margin-bottom: 1rem;
}

.log-details summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
    list-style: none;
    outline: none;
}

.log-details summary::-webkit-details-marker {
    display: none;
}

.log-details[open] summary {
    color: var(--text);
}

.log-details-body {
    margin-top: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
}

.log-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem 1.25rem;
    margin: 0;
}

.log-details-grid dt {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.log-details-grid dd {
    margin: 0.15rem 0 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.log-details-payload {
    margin-top: 1rem;
}

.log-details-label {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.log-details-payload pre {
    margin: 0;
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
    background: #0f172a;
    color: #e2e8f0;
    overflow-x: auto;
    font-size: 0.85rem;
}

body.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.is-open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.modal-dialog {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
    padding: 1.5rem;
    width: min(640px, calc(100% - 2rem));
    max-height: calc(100% - 4rem);
    overflow-y: auto;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-modal-body {
    gap: 1.25rem;
}

.settings-section {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    overflow: hidden;
}

.settings-section + .settings-section {
    margin-top: 0.5rem;
}

.settings-section summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
}

.settings-section summary::-webkit-details-marker {
    display: none;
}

.settings-section h4 {
    margin: 0 0 0.25rem;
}

.settings-section p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.settings-section-content {
    padding: 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-section-icon {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.settings-section[open] .settings-section-icon {
    transform: rotate(90deg);
    color: var(--text);
}

.settings-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-form .form-group + .form-group {
    margin-top: 1rem;
}

.payload-snippet-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.payload-snippet-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payload-snippet-row input {
    flex: 1;
    min-width: 0;
}

.payload-snippet-row .button-secondary {
    white-space: nowrap;
}

.settings-form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.settings-status {
    min-height: 1.25rem;
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.settings-status[data-state="success"] {
    color: #15803d;
}

.settings-status[data-state="error"] {
    color: #b91c1c;
}

.settings-hint {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.settings-toggle-copy {
    flex: 1 1 240px;
}

.settings-toggle-label {
    margin: 0;
    font-weight: 600;
    color: var(--text);
}

.settings-toggle-description {
    margin: 0.25rem 0 0;
}

.switch {
    position: relative;
    width: 48px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.switch input {
    appearance: none;
    width: 100%;
    height: 100%;
    position: absolute;
    margin: 0;
    cursor: pointer;
}

.switch-track {
    width: 48px;
    height: 26px;
    border-radius: 999px;
    background: var(--border);
    position: relative;
    transition: background 0.2s ease;
}

.switch-track::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease;
}

.switch input:checked + .switch-track {
    background: var(--accent);
}

.switch input:checked + .switch-track::after {
    transform: translateX(22px);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.reactivation-body {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.reactivation-container {
    width: min(560px, calc(100% - 2rem));
}

.reactivation-panel {
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.35);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.reactivation-panel h1,
.reactivation-panel h2 {
    margin: 0;
    color: #0f172a;
}

.reactivation-panel p {
    color: #475569;
    line-height: 1.6;
    margin: 0;
    max-width: 360px;
}

.empty-state {
    padding: 1rem;
    background: var(--surface-muted);
    border-radius: 10px;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.panel-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-summary {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    background: #fff;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pagination-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-link.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    cursor: default;
}

.pagination-link.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.pagination-nav {
    padding: 0.4rem 0.85rem;
}

.pagination-ellipsis {
    color: var(--text-muted);
    padding: 0 0.15rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .app-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .app-nav-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .app-content {
        padding: 1rem;
    }

    .panel-projects {
        padding: 1.2rem;
    }

    th,
    td {
        padding: 0.6rem;
    }
}
