/* file: public/css/components.css */

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow, .section-label { margin: 0 0 7px; color: var(--brand); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.page-title { margin: 0; color: var(--text-strong); font-size: clamp(28px, 3vw, 42px); line-height: 1.16; letter-spacing: -.035em; }
.page-subtitle { max-width: 900px; margin: 9px 0 0; color: var(--muted); }
.panel { padding: 22px; background: linear-gradient(180deg, rgba(255,255,255,.93), rgba(255,255,255,.99)); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.panel-head h2, .panel-head h3 { margin: 0; color: var(--text-strong); line-height: 1.25; letter-spacing: -.02em; }
.panel-head h2 { font-size: 22px; }
.panel-head h3 { font-size: 18px; }
.panel-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.card-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 16px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
.metric-card { padding: 18px; background: linear-gradient(180deg, #fff, #f9fcff); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.metric-label { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.metric-value { display: block; margin-top: 8px; color: var(--text-strong); font-size: clamp(24px, 2.6vw, 34px); font-weight: 900; letter-spacing: -.04em; line-height: 1.1; }
.metric-note { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.soft-card { padding: 17px; background: linear-gradient(180deg, rgba(232,242,250,.74), rgba(255,255,255,.95)); border: 1px solid #d7e7f4; border-radius: 16px; }
.soft-card h3, .soft-card h4 { margin: 0 0 7px; }
.soft-card p { margin: 0; color: var(--muted); font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text); font-weight: 850; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(18,42,66,.08); text-decoration: none; }
.btn.primary { color: #fff; border-color: transparent; background: linear-gradient(180deg, #1687d4, var(--brand)); box-shadow: 0 10px 22px rgba(0,104,183,.18); }
.btn.secondary { color: var(--brand-dark); border-color: rgba(0,104,183,.18); background: var(--brand-soft); }
.btn.danger { color: #fff; border-color: transparent; background: linear-gradient(180deg, #dc2626, #b91c1c); }
.btn.ghost { background: rgba(255,255,255,.76); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 14px; }
.field { grid-column: span 4; min-width: 0; }
.field.span-6 { grid-column: span 6; } .field.span-8 { grid-column: span 8; } .field.span-12 { grid-column: span 12; }
label { display: block; margin-bottom: 7px; color: #31445b; font-size: 12px; font-weight: 900; }
input, select, textarea { width: 100%; min-height: 42px; padding: 10px 12px; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; outline: none; transition: border-color var(--transition), box-shadow var(--transition); }
textarea { min-height: 180px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: rgba(0,104,183,.55); box-shadow: 0 0 0 4px rgba(0,104,183,.10); }
.field-hint { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; font-size: 11px; font-weight: 900; white-space: nowrap; }
.pill.info { color: #075985; background: #e0f2fe; border-color: #bae6fd; }
.pill.success { color: #065f46; background: #d1fae5; border-color: #a7f3d0; }
.pill.warning { color: #9a3412; background: #ffedd5; border-color: #fed7aa; }
.pill.danger { color: #991b1b; background: #fee2e2; border-color: #fecaca; }
.pill.neutral { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.data-table { width: 100%; min-width: 840px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 12px; }
.data-table th { position: sticky; top: 0; z-index: 1; color: #31445b; background: #f3f8fc; font-weight: 900; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(0,104,183,.035); }
.table-check { width: 18px; height: 18px; min-height: auto; }
.empty-state { padding: 34px 20px; color: var(--muted); text-align: center; }
.code-block { position: relative; margin: 0; padding: 16px; overflow: auto; color: #dbeafe; background: #0b1f33; border: 1px solid #1d3a56; border-radius: 14px; font-size: 12px; line-height: 1.65; white-space: pre; }
.json-viewer { min-height: 220px; max-height: 520px; }
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid; font-size: 13px; }
.alert.info { color: #075985; background: #f0f9ff; border-color: #bae6fd; }
.alert.warning { color: #9a3412; background: #fff7ed; border-color: #fed7aa; }
.alert.danger { color: #991b1b; background: #fff1f2; border-color: #fecdd3; }
.alert.success { color: #065f46; background: #ecfdf5; border-color: #a7f3d0; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: var(--shadow-lg); font-size: 13px; animation: toast-in .2s ease; }
.toast.success { border-color: #a7f3d0; } .toast.error { border-color: #fecaca; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.loading { position: relative; pointer-events: none; opacity: .68; }
.loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border: 3px solid rgba(0,104,183,.16); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: #eef4f8; border: 1px solid var(--line); border-radius: 999px; }
.segmented button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 850; cursor: pointer; }
.segmented button.is-active { color: var(--brand-dark); background: #fff; box-shadow: 0 4px 12px rgba(18,42,66,.08); }
.progress { height: 8px; overflow: hidden; background: #eaf0f5; border-radius: 999px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #38bdf8); border-radius: inherit; }
.stat-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: 0; }
.details-list details { border-bottom: 1px solid var(--line); }
.details-list details:last-child { border-bottom: 0; }
.details-list summary { padding: 13px 0; cursor: pointer; font-weight: 850; }
.details-list .details-content { padding: 0 0 15px; color: var(--muted); font-size: 13px; }
