* {
    box-sizing: border-box;
}

body {
    font-family: Roboto, "Segoe UI", Tahoma, sans-serif;
    background-image: radial-gradient(circle at 100% 0%, rgba(55, 162, 219, 0.18), transparent 35%), radial-gradient(circle at 0% 100%, rgba(244, 157, 25, 0.15), transparent 30%);
}

body.satapp-app-page {
    background: #ffffff !important;
    background-image: none !important;
    /* When a sub-app sizes its iframe to its content (content-sized apps),
       the parent body's Tailwind min-h-screen leaves a tall band of empty
       whitespace below the iframe whenever the content is shorter than the
       viewport. Drop the floor so the body matches the actual content. */
    min-height: 0 !important;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    color: #334155;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-pill:hover {
    border-color: var(--sat-primary, #37A2DB);
    color: var(--sat-primary, #37A2DB);
    background: rgba(148, 163, 184, 0.12);
}

.nav-pill-danger {
    border-color: #fecaca;
    color: #b91c1c;
}

.nav-pill-danger:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.form-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.7rem;
    padding: 0.62rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.2;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #fff;
}

.form-input:focus {
    border-color: var(--sat-primary, #37A2DB);
    box-shadow: 0 0 0 3px rgba(55, 162, 219, 0.22);
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    padding: 0.6rem 0.95rem;
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--sat-accent, #F49D19);
    border-color: var(--sat-accent, #F49D19);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(0.92);
}

.btn-secondary {
    background: var(--sat-primary, #37A2DB);
    border-color: var(--sat-primary, #37A2DB);
    color: #fff;
}

.btn-secondary:hover {
    filter: brightness(0.92);
}

.btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-disabled {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    padding: 0.3rem 0.45rem;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
    line-height: 1;
    min-width: 0;
}

.btn-icon:hover {
    filter: brightness(0.9);
}

.btn-icon.bg-blue {
    background: var(--sat-primary, #37A2DB);
    border-color: var(--sat-primary, #37A2DB);
    color: #fff;
}

.btn-icon.bg-amber {
    background: var(--sat-accent, #F49D19);
    border-color: var(--sat-accent, #F49D19);
    color: #fff;
}

.btn-icon.bg-green {
    background: var(--sat-success, #69B32F);
    border-color: var(--sat-success, #69B32F);
    color: #fff;
}

.btn-icon.bg-red {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.btn-icon.bg-red:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-icon.bg-slate {
    background: #94a3b8;
    border-color: #94a3b8;
    color: #fff;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-box {
    width: min(780px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 55px rgba(15, 23, 42, 0.25);
    padding: 1rem;
}

.modal-box-wide {
    width: min(1080px, 100%);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.modal-close {
    border: 1px solid #cbd5e1;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: #334155;
    background: #fff;
}

.modal-close:hover {
    background: #f1f5f9;
}

.admin-tab-btn {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 0.6rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.84rem;
    font-weight: 600;
}

.admin-tab-btn.active {
    background: var(--sat-primary, #37A2DB);
    border-color: var(--sat-primary, #37A2DB);
    color: #fff;
}

.admin-panel.hidden,
.modal-pane.hidden {
    display: none;
}

.modal-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.section-card {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 1rem;
}

.section-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.choice-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: flex-start;
    border: 1px solid #cbd5e1;
    border-radius: 0.95rem;
    padding: 0.9rem 1rem;
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    cursor: pointer;
}

.choice-card:hover {
    border-color: var(--sat-primary, #37A2DB);
    box-shadow: 0 10px 24px rgba(148, 163, 184, 0.18);
}

.choice-card.active {
    border-color: var(--sat-primary, #37A2DB);
    background: rgba(55, 162, 219, 0.06);
    box-shadow: 0 0 0 3px rgba(55, 162, 219, 0.12);
}

.choice-card.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.choice-card input {
    margin-top: 0.2rem;
}

.choice-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.choice-text {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #64748b;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
}

.app-dashboard-card {
    position: relative;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.app-dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
    border-color: #bfdbfe;
}

.app-dashboard-media {
    position: relative;
    height: 110px;
    overflow: hidden;
    background: #e2e8f0;
}

.app-dashboard-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-dashboard-card-disabled .app-dashboard-image {
    filter: grayscale(1) saturate(0.15) brightness(0.88);
}

.app-dashboard-card-disabled .app-dashboard-overlay {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.16) 0%, rgba(15, 23, 42, 0.42) 100%);
}

.app-dashboard-card-disabled {
    border-color: #d7dde5;
}

.app-dashboard-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.02) 0%, rgba(15, 23, 42, 0.18) 100%);
}

.app-dashboard-title {
    font-size: 1.18rem;
    line-height: 1.25;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
}

.app-dashboard-description {
    margin-top: 0.55rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 900px) {
    .modal-summary-grid,
    .choice-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .app-dashboard-media {
        height: 104px;
    }
}
