/* Applications screens and dialogs. Keep layout and interaction styles scoped. */
.applications-page { display:grid; gap:1rem; min-width:0; }
.applications-page [hidden], .apps-modal-backdrop [hidden] { display:none !important; }
.apps-header { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1.4rem; }
.apps-header .wp-page-title { margin:0 0 .4rem; }
.apps-header .wp-page-subtitle { margin:0; line-height:1.6; }
.apps-buttons,.apps-filters { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.apps-summary { display:grid; grid-template-columns:1fr 1fr 2fr; gap:1rem; }
.apps-summary-card { display:flex; flex-direction:column; gap:.5rem; padding:1rem 1.2rem; border:1px solid #dfe7f1; border-radius:12px; background:#fff; min-width:0; }
.apps-summary-card span { font-size:.79rem; color:#64748b; }
.apps-summary-card strong { color:#102c50; font-size:1.2rem; overflow-wrap:anywhere; }
.apps-card { min-width:0; overflow:hidden; }
.apps-card-heading { padding:1.2rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; border-bottom:1px solid #e5ecf5; }
.apps-card-heading h2,.apps-help h2,.apps-job h2 { margin:0 0 .4rem; font-size:1rem; color:#102c50; }
.apps-card-heading p,.apps-help p,.apps-job p { color:#64748b; font-size:.8rem; line-height:1.6; margin:0; overflow-wrap:anywhere; }
.apps-filters { min-width:0; }
.apps-filters input { width:240px; }
.apps-filters select { max-width:190px; }
.apps-btn { appearance:none; display:inline-flex; align-items:center; justify-content:center; gap:.4rem; padding:.55rem .8rem; background:#fff; color:#183c66; border:1px solid #d9e3f2; border-radius:8px; font:inherit; font-size:.78rem; line-height:1.4; cursor:pointer; text-decoration:none; transition:background .15s,border-color .15s,color .15s; }
.apps-btn:hover:not(:disabled) { color:#8352F1; border-color:#BCA2F8; background:#F6F2FE; }
.apps-btn--primary { background:#8352F1; color:#fff; border-color:#8352F1; }
.apps-btn--primary:hover:not(:disabled) { background:#6F3DDB; color:#fff; border-color:#6F3DDB; }
.apps-btn--danger { background:#fff7f7; color:#b42318; border-color:#fecaca; }
.apps-btn--danger:hover:not(:disabled) { color:#9f1c15; background:#fee2e2; border-color:#fca5a5; }
.apps-btn:disabled,.apps-input:disabled { opacity:.5; cursor:not-allowed; }
.apps-btn:focus-visible,.apps-input:focus-visible,.apps-link:focus-visible { outline:3px solid #D8C8FB; outline-offset:2px; }
.apps-input { box-sizing:border-box; width:100%; max-width:100%; min-width:0; font:inherit; font-size:.82rem; line-height:1.5; padding:.6rem .75rem; color:#183c66; background:#fff; border:1px solid #d9e3f2; border-radius:8px; }
.apps-path-input { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:.77rem; }
.apps-code-input { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; resize:vertical; min-height:105px; }
.apps-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,440px),1fr)); gap:1rem; padding:1.2rem; }
.apps-application { padding:1.1rem; border:1px solid #dfe7f1; border-radius:12px; background:#fff; min-width:0; }
.apps-application>header { display:flex; align-items:flex-start; justify-content:space-between; gap:.7rem; }
.apps-app-name { display:flex; align-items:center; gap:.7rem; min-width:0; }
.apps-app-name h3 { color:#102c50; font-size:.98rem; line-height:1.4; margin:0 0 .25rem; overflow-wrap:anywhere; }
.apps-kind-icon { display:grid; place-items:center; width:38px; height:38px; flex:0 0 38px; color:#8352F1; background:#F6F2FE; border-radius:10px; font-size:1.25rem; }
.apps-meta { display:block; color:#64748b; font-size:.72rem; line-height:1.6; overflow-wrap:anywhere; }
.apps-status { display:inline-flex; align-items:center; gap:.35rem; flex-shrink:0; padding:.25rem .5rem; border:1px solid #e2e8f0; border-radius:99px; background:#f8fafc; color:#64748b; font-size:.7rem; line-height:1.4; }
.apps-status>span { width:6px; height:6px; background:currentColor; border-radius:50%; }
.apps-status--running { color:#047857; border-color:#a7f3d0; background:#ecfdf5; }
.apps-status--failed { color:#b42318; border-color:#fecaca; background:#fef2f2; }
.apps-properties { display:grid; gap:.7rem; margin:1.2rem 0; }
.apps-properties>div { display:grid; grid-template-columns:115px minmax(0,1fr); gap:.8rem; font-size:.78rem; }
.apps-properties dt { color:#64748b; }
.apps-properties dd { color:#183c66; margin:0; overflow-wrap:anywhere; }
.apps-properties code,.apps-path { font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:.73rem; line-height:1.6; overflow-wrap:anywhere; }
.apps-action-grid { display:flex; gap:.45rem; flex-wrap:wrap; border-top:1px solid #edf2f7; padding-top:1rem; }
.apps-action-grid .apps-btn { font-size:.72rem; padding:.48rem .65rem; }
.apps-empty { padding:2rem 1.25rem; text-align:center; color:#64748b; line-height:1.7; }
.apps-empty>i { font-size:1.8rem; color:#a8b8cc; }
.apps-empty h3 { font-size:1rem; color:#183c66; margin:.8rem 0 .4rem; }
.apps-empty p { font-size:.83rem; margin:0 0 .8rem; }
.apps-help,.apps-job { padding:1.2rem; min-width:0; }
.apps-help ol { margin:.8rem 0; padding-left:1.2rem; color:#475569; font-size:.8rem; line-height:1.8; }
.apps-help a { color:#8352F1; text-decoration:underline; }
.apps-message { border:1px solid #a7f3d0; border-radius:9px; padding:.85rem 1rem; color:#065f46; background:#ecfdf5; font-size:.82rem; line-height:1.6; overflow-wrap:anywhere; }
.apps-message--error { color:#991b1b; background:#fef2f2; border-color:#fecaca; }
.apps-last-error { padding:.7rem; border-radius:7px; color:#991b1b; background:#fef2f2; font-size:.77rem; line-height:1.6; overflow-wrap:anywhere; }
.apps-notice { font-size:.77rem; color:#92400e; line-height:1.6; }
.apps-link { appearance:none; background:transparent; border:0; color:#8352F1; text-decoration:underline; font:inherit; cursor:pointer; }
.apps-job-heading { display:flex; gap:1rem; align-items:center; justify-content:space-between; }
.apps-job progress { display:block; width:100%; height:9px; margin:.8rem 0 .4rem; accent-color:#8352F1; }
.apps-logs { display:block; box-sizing:border-box; width:100%; min-width:0; padding:1rem; color:#d5e4f7; background:#122039; border:1px solid #25344d; border-radius:9px; font:12px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace; white-space:pre-wrap; overflow-wrap:anywhere; max-height:340px; overflow:auto; margin:.9rem 0 0; }
.apps-modal-backdrop { position:fixed; inset:0; z-index:1200; background:rgba(15,23,42,.58); display:flex; align-items:center; justify-content:center; padding:24px; box-sizing:border-box; }
.apps-modal { box-sizing:border-box; width:100%; max-width:720px; max-height:calc(100dvh - 48px); max-height:min(850px,calc(100dvh - 48px)); background:#fff; border:1px solid #dfe7f1; border-radius:14px; box-shadow:0 24px 70px #0f172a40; overflow:hidden; display:flex; flex-direction:column; min-width:0; }
.apps-modal>header { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1.1rem 1.3rem; border-bottom:1px solid #e5ecf5; flex-shrink:0; }
.apps-modal h2 { color:#102c50; font-size:1.05rem; line-height:1.5; overflow-wrap:anywhere; margin:0; }
.apps-close { min-width:34px; min-height:34px; padding:.4rem; }
.apps-modal-body { padding:1.2rem 1.3rem; overflow:auto; min-height:0; overscroll-behavior:contain; }
.apps-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.apps-field { min-width:0; display:flex; flex-direction:column; gap:.45rem; }
.apps-field>label { color:#334155; font-size:.8rem; font-weight:600; }
.apps-hint { font-size:.74rem; line-height:1.6; color:#64748b; margin:0; overflow-wrap:anywhere; }
.apps-path { color:#475569; padding:.5rem; background:#f8fafc; border-radius:6px; }
.apps-env { margin:1rem 0; }
.apps-env-removals { margin:.5rem 0 0; padding:.7rem; border:1px solid #e2e8f0; border-radius:7px; display:flex; gap:.5rem 1rem; flex-wrap:wrap; }
.apps-env-removals legend { color:#64748b; font-size:.72rem; padding:0 .35rem; }
.apps-env-removals label { display:flex; gap:.4rem; align-items:center; font-size:.75rem; color:#475569; overflow-wrap:anywhere; }
.apps-modal-footer { display:flex; gap:.6rem; justify-content:flex-end; margin-top:1.2rem; padding-top:1rem; border-top:1px solid #e5ecf5; }
.apps-settings-progress { display:grid; gap:.5rem; padding:.9rem 1rem; margin-bottom:1rem; background:#f6f2fe; border:1px solid #d8c8fb; border-radius:9px; min-width:0; }
.apps-settings-progress strong { font-size:.84rem; color:#183c66; }
.apps-settings-progress progress { display:block; width:100%; height:9px; accent-color:#8352F1; }
.apps-modal #apps-form-error { margin-bottom:1rem; }
.apps-git-connections { display:grid; gap:.7rem; margin:1rem 0; }
.apps-git-connection { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:.8rem; border:1px solid #e2e8f0; border-radius:9px; padding:.9rem; min-width:0; }
.apps-git-connection>div:first-child { min-width:0; flex:1 1 180px; }
.apps-git-connection strong { display:block; color:#183c66; font-size:.85rem; overflow-wrap:anywhere; }
.apps-git-form { padding-top:.8rem; border-top:1px solid #e5ecf5; }
.apps-git-form h3 { margin:.2rem 0 1rem; font-size:.95rem; color:#183c66; overflow-wrap:anywhere; }
.apps-git-token-field,.apps-git-branch-field { margin-top:1rem; }
.apps-git-form a { color:#8352F1; text-decoration:underline; }
.apps-modal #apps-git-error,.apps-modal #apps-git-source-error { margin:1rem 0; }
.apps-modal #apps-git-status,.apps-modal #apps-git-source-status { margin:.8rem 0; }
.apps-git-repository-search { display:flex; align-items:center; gap:.5rem; margin:1rem 0; }
.apps-git-repository-search .apps-input { flex:1; }
.apps-git-more { justify-self:start; align-self:flex-start; font-size:.72rem; }
.apps-modal #apps-source-empty>button { margin-top:1rem; }
.apps-sr-only { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media(max-width:800px) { .apps-header { align-items:flex-start; flex-direction:column; padding:1.1rem; } .apps-summary { gap:.65rem; grid-template-columns:1fr 1fr; } .apps-summary-card:last-child { grid-column:1/-1; } .apps-summary-card { padding:.9rem 1rem; } .apps-card-heading,.apps-grid { padding:1rem; } .apps-filters { width:100%; } .apps-filters input { flex:1 1 180px; } .apps-filters select { flex:1 1 140px; max-width:none; width:auto; } }
@media(max-width:520px) { .apps-header .apps-buttons { width:100%; } .apps-header .apps-buttons .apps-btn { flex:1; } .apps-modal-backdrop { padding:12px; } .apps-modal { max-height:calc(100dvh - 24px); } .apps-modal>header,.apps-modal-body { padding:1rem; } .apps-form-grid { grid-template-columns:1fr; } .apps-properties>div { grid-template-columns:95px minmax(0,1fr); gap:.6rem; } .apps-application { padding:1rem; } .apps-action-grid .apps-btn { flex:1 1 100px; } .apps-modal-footer .apps-btn { flex:1; } }
@media(prefers-reduced-motion:reduce) { .apps-btn { transition:none; } }
