/* ===== Portera Content Platform — Shared Styles ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=DM+Serif+Display&display=swap');

:root {
  --portera-dark: #131e29;
  --portera-accent: #009eff;
  --portera-accent-hover: #0080cc;
  --portera-red: #fa0050;
  --portera-green: #1d8649;
  --portera-orange: #f59e0b;
  --portera-light: #f7f9fc;
  --portera-border: #e2e7ed;
  --portera-bg: #ffffff;
  --portera-text: #1e293b;
  --portera-muted: #64748b;
  --portera-accent-soft: #eef6ff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', Roboto, Helvetica, Arial, sans-serif; background: var(--portera-light); color: var(--portera-text); }

/* ===== Cards ===== */
.wire-card { background: var(--portera-bg); border: 1px solid var(--portera-border); border-radius: 12px; padding: 28px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.wire-card.centered { text-align: center; max-width: 460px; margin-left: auto; margin-right: auto; }

/* ===== Form elements ===== */
.wire-input { width: 100%; padding: 5px 14px; border: 1px solid var(--portera-border); border-radius: 8px; font-size: 13px; font-family: inherit; background: var(--portera-light); margin-bottom: 12px; color: var(--portera-text); transition: border-color 0.2s; }
.wire-input:focus { outline: none; border-color: var(--portera-accent); }
.wire-input::placeholder { color: #94a3b8; }
.wire-label { display: block; font-size: 12px; font-weight: 600; color: var(--portera-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
.wire-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--portera-border); border-radius: 8px; font-size: 13px; font-family: inherit; background: var(--portera-light); margin-bottom: 12px; min-height: 80px; resize: vertical; color: var(--portera-text); }

/* ===== Buttons ===== */
.wire-btn { padding: 8px 20px; border: none; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.wire-btn-primary { background: var(--portera-accent); color: #fff; }
.wire-btn-primary:hover { background: var(--portera-accent-hover); }
.wire-btn-secondary { background: var(--portera-light); color: var(--portera-muted); border: 1px solid var(--portera-border); }
.wire-btn-secondary:hover { background: #f1f5f9; border-color: #cbd5e1; }
.wire-btn-danger { background: var(--portera-red); color: #fff; }
.wire-btn-danger:hover { background: #d9004a; }
.wire-btn-success { background: var(--portera-green); color: #fff; }
.wire-btn-success:hover { background: #166f3c; }
.wire-btn-sm { padding: 5px 12px; font-size: 12px; }
.wire-btn + .wire-btn { margin-left: 8px; }

/* ===== Typography ===== */
h1.wire { font-size: 18px; font-weight: 600; color: var(--portera-text); margin-bottom: 4px; }
h2.wire { font-size: 18px; font-weight: 600; color: var(--portera-text); margin-bottom: 6px; }
h3.wire { font-size: 15px; font-weight: 600; color: var(--portera-text); margin-bottom: 8px; }
p.wire { font-size: 14px; color: var(--portera-muted); line-height: 1.6; margin-bottom: 16px; }
.wire-subtitle { font-size: 14px; color: var(--portera-muted); margin-bottom: 20px; }
.wire-hint { font-size: 12px; color: #94a3b8; margin-top: 4px; }

/* ===== Divider ===== */
.wire-divider { border: none; border-top: 1px solid var(--portera-border); margin: 20px 0; }

/* ===== Status badges ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-active { background: #f0fdf4; color: var(--portera-green); }
.badge-expired { background: #fef2f2; color: var(--portera-red); }
.badge-draft { background: #fff7ed; color: #ea580c; }
.badge-disabled { background: #f1f5f9; color: var(--portera-muted); }
.badge-inprogress { background: var(--portera-accent-soft); color: var(--portera-accent); }
.badge-high { background: #f0fdf4; color: var(--portera-green); }
.badge-medium { background: #fffbeb; color: #d97706; }
.badge-low { background: #fef2f2; color: var(--portera-red); }
.badge-role { background: var(--portera-accent-soft); color: var(--portera-accent); }
.badge-voting { background: #fef3c7; color: #92400e; }
.badge-completed { background: #dbeafe; color: #1e40af; }
.badge-closed { background: #f1f5f9; color: var(--portera-muted); }
.badge-consolidating { background: #ede9fe; color: #6d28d9; }
.badge-discover { background: #f0fdf4; color: #065f46; }
.badge-individual { background: #dbeafe; color: #1e40af; }
.badge-pod_consolidation { background: #fef3c7; color: #92400e; }
.badge-iv_matrix { background: #ede9fe; color: #6d28d9; }
.badge-deep_dive { background: #fce7f3; color: #9d174d; }
.badge-final_vote { background: #d1fae5; color: #065f46; }
.badge-ready { background: #d1fae5; color: #065f46; }

/* ===== Table ===== */
.wire-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.wire-table th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; color: #fff; text-transform: uppercase; letter-spacing: 0.6px; background: var(--portera-dark); }
.wire-table th:first-child { border-radius: 6px 0 0 0; }
.wire-table th:last-child { border-radius: 0 6px 0 0; }
.wire-table td { padding: 14px 14px; font-size: 14px; border-bottom: 1px solid var(--portera-border); color: var(--portera-text); }
.wire-table tr:hover { background: var(--portera-accent-soft); }
.wire-table .clickable { cursor: pointer; color: var(--portera-accent); font-weight: 600; }
.wire-table .clickable:hover { text-decoration: underline; }

/* ===== Toggle switch ===== */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.toggle { width: 44px; height: 24px; background: #cbd5e1; border-radius: 12px; position: relative; cursor: pointer; transition: 0.2s; flex-shrink: 0; }
.toggle.on { background: var(--portera-accent); }
.toggle::after { content: ''; position: absolute; width: 20px; height: 20px; background: #fff; border-radius: 50%; top: 2px; left: 2px; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.toggle.on::after { left: 22px; }

/* ===== Stat cards ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--portera-bg); border: 1px solid var(--portera-border); border-radius: 12px; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 3px rgba(0,0,0,0.04); border-top: 3px solid var(--portera-accent); }
.stat-card:nth-child(2) { border-top-color: var(--portera-green); }
.stat-card:nth-child(3) { border-top-color: var(--portera-orange); }
.stat-card:nth-child(4) { border-top-color: var(--portera-red); }
.stat-card .stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--portera-muted); margin-bottom: 6px; }
.stat-card .num { font-size: 18px; font-weight: 700; color: var(--portera-dark); }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stat-icon-blue { background: rgba(0,158,255,0.08); color: var(--portera-accent); }
.stat-icon-red { background: rgba(250,0,80,0.06); color: var(--portera-red); }
.stat-icon-orange { background: rgba(245,158,11,0.06); color: var(--portera-orange); }
.stat-icon-green { background: rgba(29,134,73,0.06); color: var(--portera-green); }

/* ===== Tabs ===== */
.wire-tabs { display: flex; border-bottom: 1px solid var(--portera-border); margin-bottom: 24px; gap: 4px; }
.wire-tab { padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--portera-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: 0.2s; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.wire-tab:hover { color: var(--portera-text); }
.wire-tab.active { color: var(--portera-accent); border-bottom-color: var(--portera-accent); font-weight: 600; }

/* ===== Tag chips ===== */
.tag { display: inline-block; background: var(--portera-accent-soft); color: var(--portera-accent-hover); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; margin-right: 4px; border: 1px solid rgba(0,158,255,0.15); }

/* ===== Chart placeholder ===== */
.chart-placeholder { background: var(--portera-light); border: 1px dashed #cbd5e1; border-radius: 10px; height: 200px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 14px; margin-bottom: 16px; }

/* ===== Upload zone ===== */
.upload-zone { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 36px; text-align: center; color: #94a3b8; margin-bottom: 16px; cursor: pointer; transition: 0.2s; }
.upload-zone:hover { border-color: var(--portera-accent); color: var(--portera-accent); }
.upload-zone.dragover { border-color: var(--portera-accent); background: var(--portera-accent-soft); color: var(--portera-accent); }
.upload-zone .icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone-sm { border: 2px dashed #cbd5e1; border-radius: 8px; padding: 14px; text-align: center; color: #94a3b8; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.upload-zone-sm:hover { border-color: var(--portera-accent); color: var(--portera-accent); }
.upload-zone-sm.dragover { border-color: var(--portera-accent); background: var(--portera-accent-soft); }

/* ===== Portera branding ===== */
.portera-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 24px; }
.portera-brand .logo-text { font-size: 22px; font-weight: 700; color: var(--portera-text); letter-spacing: -0.3px; }
.portera-brand .logo-sub { font-size: 12px; color: #94a3b8; font-weight: 400; }
.portera-brand.large { flex-direction: column; gap: 16px; margin-bottom: 32px; }
.portera-brand.large .logo-text { font-size: 32px; }

/* ===== Microsoft sign-in button ===== */
.ms-signin-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 14px 24px; background: #2f2f2f; color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 500; font-family: inherit; cursor: pointer; transition: background 0.2s; text-decoration: none; }
.ms-signin-btn:hover { background: #1a1a1a; }

/* ===== Breadcrumb ===== */
.breadcrumb { font-size: 13px; color: #94a3b8; margin-bottom: 16px; }
.breadcrumb a { color: var(--portera-accent); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== Section badge ===== */
.section-badge { display: inline-block; background: var(--portera-accent-soft); color: var(--portera-accent); padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; margin-right: 8px; }

/* ===== Avatar circle ===== */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--portera-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* ===== Grid helpers ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }

/* ===== Alert / Flash messages ===== */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #fef2f2; color: var(--portera-red); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--portera-green); border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

/* ===== Confirm Dialog ===== */
.confirm-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 9000; align-items: center; justify-content: center; }
.confirm-overlay.active { display: flex; animation: confirmFadeIn 0.15s ease; }
@keyframes confirmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.confirm-dialog { background: var(--portera-bg, #fff); border-radius: 12px; padding: 28px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.18); animation: confirmSlideIn 0.15s ease; }
@keyframes confirmSlideIn { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.confirm-dialog-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; }
.confirm-dialog-icon-danger { background: rgba(250,0,80,0.08); color: var(--portera-red, #fa0050); }
.confirm-dialog-icon-warning { background: rgba(245,158,11,0.08); color: var(--portera-orange, #f59e0b); }
.confirm-dialog-title { font-size: 16px; font-weight: 600; color: var(--portera-text, #1e293b); margin-bottom: 6px; }
.confirm-dialog-message { font-size: 14px; color: var(--portera-muted, #64748b); line-height: 1.5; margin-bottom: 24px; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-dialog-actions button { padding: 8px 20px; border: none; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.confirm-dialog-cancel { background: var(--portera-light, #f7f9fc); color: var(--portera-muted, #64748b); border: 1px solid var(--portera-border, #e2e7ed) !important; }
.confirm-dialog-cancel:hover { background: #f1f5f9; }
.confirm-dialog-ok { background: var(--portera-red, #fa0050); color: #fff; }
.confirm-dialog-ok:hover { background: #d9004a; }
.confirm-dialog-ok-primary { background: var(--portera-accent, #009eff); color: #fff; }
.confirm-dialog-ok-primary:hover { background: var(--portera-accent-hover, #0080cc); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
