/* App Layout */
.page { display: flex; flex-direction: column; min-height: 100vh; }
.header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--border-color); background: var(--bg-secondary); }
.header-logo { display: flex; align-items: center; gap: 0.5rem; }
.header-logo svg { width: 28px; height: 28px; }
.header-logo span { font-size: 1rem; font-weight: 600; }
.header-nav { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.header-nav a { font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500; }
.header-nav a:hover { color: var(--cf-orange); opacity: 1; }
.header-user { font-size: 0.75rem; color: var(--text-muted); padding: 0.25rem 0.5rem; background: var(--bg-tertiary); border-radius: var(--radius-sm); border: 1px solid var(--border-light); }
.main { flex: 1; padding: 2rem 1.5rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.footer { padding: 0.75rem 1.5rem; border-top: 1px solid var(--border-color); text-align: center; font-size: 0.75rem; color: var(--text-muted); }

/* Landing */
.landing-hero { text-align: center; margin-bottom: 2.5rem; }
.landing-hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.landing-hero h1 span { color: var(--cf-orange); }
.landing-hero p { color: var(--text-secondary); max-width: 560px; margin: 0 auto; font-size: 0.9375rem; }

/* UC Cards */
.uc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.uc-card { display: flex; flex-direction: column; padding: 1.5rem; border-radius: var(--radius-lg); border: 1.5px solid var(--border-color); background: var(--bg-card); transition: all var(--transition-base); }
.uc-card:hover { border-color: var(--cf-orange); box-shadow: var(--shadow-glow-orange); transform: translateY(-2px); }
.uc-badge { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--cf-orange); background: rgba(243,128,32,0.1); border: 1px solid rgba(243,128,32,0.2); padding: 0.15rem 0.5rem; border-radius: 3px; width: fit-content; margin-bottom: 0.75rem; }
.uc-card h3 { font-size: 1.25rem; margin-bottom: 0.375rem; }
.uc-card p { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.6; flex: 1; margin-bottom: 1rem; }
.uc-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1rem; }
.uc-tag { font-size: 0.625rem; padding: 0.15rem 0.4rem; border-radius: 3px; background: var(--bg-tertiary); color: var(--text-muted); border: 1px solid var(--border-light); }
.uc-resources { font-size: 0.6875rem; color: var(--text-muted); margin-bottom: 1rem; }
.uc-resources strong { color: var(--text-secondary); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; padding: 0.625rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.8125rem; font-weight: 600; transition: all var(--transition-fast); }
.btn-primary { background: var(--cf-orange); color: #fff; }
.btn-primary:hover { background: var(--cf-orange-dark); }
.btn-danger { background: var(--color-red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-secondary:hover { color: var(--text-primary); border-color: var(--text-muted); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Form */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; }
.form-group input, .form-group textarea { width: 100%; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 0.625rem 0.75rem; color: var(--text-primary); font-size: 0.875rem; font-family: inherit; outline: none; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--cf-orange); }
.form-group textarea { resize: vertical; min-height: 80px; }

/* Dashboard */
.env-list { display: flex; flex-direction: column; gap: 1rem; }
.env-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-card); }
.env-item:hover { border-color: var(--border-color); }
.env-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.env-status.provisioning { background: var(--color-yellow); animation: pulse 1.5s infinite; }
.env-status.active { background: var(--color-green); }
.env-status.destroying { background: var(--color-red); animation: pulse 1.5s infinite; }
.env-status.destroyed { background: var(--text-muted); }
.env-status.failed { background: var(--color-red); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.env-info { flex: 1; min-width: 0; }
.env-info h4 { font-size: 0.875rem; margin-bottom: 0.125rem; }
.env-info .env-meta { font-size: 0.6875rem; color: var(--text-muted); display: flex; gap: 0.75rem; flex-wrap: wrap; }
.env-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }
.env-ttl { font-size: 0.6875rem; color: var(--color-yellow); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 1.5rem; width: 90%; max-width: 480px; }
.modal h2 { font-size: 1.125rem; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* Empty state */
.empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty p { font-size: 0.875rem; margin-bottom: 1rem; }

/* Section headers */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.section-header h2 { font-size: 1.25rem; }

/* Env detail */
.env-detail-header { margin-bottom: 1.5rem; }
.env-detail-header h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.env-detail-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }
.detail-card { padding: 1.25rem; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-card); margin-bottom: 1rem; }
.detail-card h3 { font-size: 0.875rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.resource-list { list-style: none; }
.resource-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0; font-size: 0.8125rem; border-bottom: 1px solid var(--border-light); }
.resource-list li:last-child { border-bottom: none; }
.resource-type { font-size: 0.625rem; font-weight: 600; color: var(--cf-orange); background: rgba(243,128,32,0.1); padding: 0.1rem 0.35rem; border-radius: 3px; text-transform: uppercase; }
.live-url { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.75rem 1rem; border-radius: var(--radius-md); border: 1px solid rgba(16,185,129,0.3); background: rgba(16,185,129,0.06); color: var(--color-green); font-size: 0.875rem; font-weight: 500; margin-bottom: 1rem; }

@media (max-width: 640px) {
  .uc-grid { grid-template-columns: 1fr; }
  .env-item { flex-direction: column; align-items: flex-start; }
  .env-actions { width: 100%; justify-content: flex-end; }
}
