:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --ink: #111827;
    --muted: #667085;
    --line: #dfe5ef;
    --panel: rgba(255, 255, 255, 0.92);
    --blue: #007aff;
    --blue-dark: #005fcc;
    --green: #34c759;
    --danger: #c2410c;
    --shadow: 0 18px 60px rgba(15, 23, 42, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(0, 122, 255, 0.14), transparent 28rem),
        linear-gradient(135deg, #f8fbff 0%, #eef4f8 44%, #f7f3ec 100%);
    color: var(--ink);
}

button, input, select { font: inherit; }

a { color: inherit; text-decoration: none; }

.auth-shell, .install-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-panel, .install-card, .trust-panel, .panel, .table-panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.auth-panel, .install-card {
    width: min(100%, 430px);
    border-radius: 28px;
    padding: 32px;
    text-align: center;
}

.trust-panel {
    width: min(100%, 660px);
    border-radius: 20px;
    padding: 24px;
    margin-top: 22px;
}

.trust-panel li { margin: 10px 0; color: #344054; }

.brand-mark, .app-icon {
    display: inline-grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    color: white;
    font-weight: 800;
    background: linear-gradient(145deg, #007aff, #34c759);
    box-shadow: 0 10px 28px rgba(0, 122, 255, 0.28);
}

.app-icon.large {
    width: 94px;
    height: 94px;
    border-radius: 24px;
    font-size: 28px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.03; margin-bottom: 10px; letter-spacing: 0; }
h2 { font-size: 20px; margin-bottom: 18px; }
h3 { font-size: 18px; margin-bottom: 6px; }
p { color: var(--muted); line-height: 1.55; }
.hint { font-size: 13px; margin-bottom: 0; }

.eyebrow {
    display: inline-block;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 8px;
}

.stack { display: grid; gap: 14px; }

label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-size: 14px;
    text-align: left;
}

input, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    padding: 12px 14px;
    color: var(--ink);
}

.button, button {
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.primary { background: var(--blue); color: white; }
.primary:hover { background: var(--blue-dark); }
.secondary { background: #e8f2ff; color: #075aa8; }
.ghost { background: rgba(255,255,255,0.72); color: #344054; border: 1px solid var(--line); }
.danger-button { background: #fee2e2; color: #991b1b; }

.install-button {
    width: 100%;
    margin-top: 18px;
    font-size: 17px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    padding: 7px 13px;
    color: #047857;
    background: rgba(52, 199, 89, 0.14);
    font-weight: 700;
    font-size: 14px;
}

.alert, .danger {
    color: var(--danger);
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 10px 12px;
}

.admin-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.topbar, .section-head, .app-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar {
    justify-content: space-between;
    margin-bottom: 24px;
}

.grid-3, .grid-2 {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.panel, .table-panel {
    border-radius: 20px;
    padding: 22px;
}

.table-panel { margin-bottom: 18px; }
.section-head { justify-content: space-between; margin-bottom: 16px; }
.section-head span { color: var(--muted); }

.app-list { display: grid; gap: 12px; }

.app-row {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
}

.grow { flex: 1; min-width: 180px; }
.copy-field { margin-top: 8px; font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .app-row { align-items: stretch; flex-wrap: wrap; }
    .app-row form, .app-row .button { width: calc(50% - 8px); }
    .app-row button, .app-row .button { width: 100%; }
}

@media (max-width: 560px) {
    .auth-shell, .install-shell { padding: 14px; align-content: start; padding-top: 28px; }
    .auth-panel, .install-card, .trust-panel { border-radius: 22px; padding: 24px; }
    .topbar { align-items: flex-start; }
    .topbar h1 { font-size: 31px; }
    .app-row form, .app-row .button { width: 100%; }
}
