/* ═══════════════════════════════════════════
   AI DEMO — SUBPAGES STYLES
   ═══════════════════════════════════════════ */

/* ─── COMMON SUBPAGE ─── */
.sub-page-head{
  margin-bottom:28px;
}
.sub-page-head h1{
  font-size:1.45rem;font-weight:800;letter-spacing:-.3px;margin-bottom:6px;
}
.sub-page-head h1 i{margin-right:10px;font-size:1.2rem}
.sub-page-head p{color:var(--muted);font-size:.85rem}

.sub-tabs{
  display:flex;gap:6px;margin-bottom:24px;flex-wrap:wrap;
}
.sub-tab{
  padding:9px 20px;border-radius:10px;border:1px solid var(--border);
  background:transparent;color:var(--muted);font-size:.82rem;font-weight:600;
  cursor:pointer;transition:all .25s var(--ease);font-family:var(--font);
}
.sub-tab:hover{border-color:var(--border2);color:var(--text2);background:var(--surface)}
.sub-tab.active{
  background:linear-gradient(135deg,rgba(59,130,246,.12),rgba(139,92,246,.08));
  border-color:rgba(59,130,246,.25);color:var(--accent);
  box-shadow:0 0 16px rgba(59,130,246,.08);
}
.sub-tab i{margin-right:6px}

.sub-grid{display:grid;gap:20px}
.sub-grid.cols-2{grid-template-columns:1fr 1fr}
.sub-grid.cols-3{grid-template-columns:1fr 1fr 1fr}
.sub-grid.cols-4{grid-template-columns:repeat(4,1fr)}
@media(max-width:1200px){
  .sub-grid.cols-2,.sub-grid.cols-3,.sub-grid.cols-4{grid-template-columns:1fr}
}

.sub-section{margin-bottom:28px}
.sub-section-title{
  font-size:.88rem;font-weight:700;margin-bottom:14px;
  display:flex;align-items:center;gap:8px;
}
.sub-section-title i{color:var(--accent);font-size:.82rem}

/* ─── GLASS PANEL ─── */
.glass-panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  overflow:hidden;
  position:relative;
}
.glass-panel::before{
  content:'';position:absolute;inset:0;border-radius:inherit;
  background:linear-gradient(135deg,rgba(59,130,246,.02),rgba(139,92,246,.015));
  pointer-events:none;
}
.glass-panel-head{
  padding:18px 22px;border-bottom:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;
  position:relative;
}
.glass-panel-head::after{
  content:'';position:absolute;bottom:-1px;left:22px;right:22px;height:1px;
  background:linear-gradient(90deg,var(--accent),var(--accent2),transparent);opacity:.2;
}
.glass-panel-head h3{font-size:.92rem;font-weight:700;display:flex;align-items:center;gap:8px}
.glass-panel-head h3 i{color:var(--accent);font-size:.85rem}
.glass-panel-body{padding:22px;position:relative}

/* ═══ DOCUMENT EXTRACTION PAGE ═══ */

.doc-layout{display:grid;grid-template-columns:1fr 1fr;gap:24px;min-height:500px}
@media(max-width:1100px){.doc-layout{grid-template-columns:1fr}}

/* Upload Zone */
.doc-upload-zone{
  border:2px dashed var(--border2);
  border-radius:var(--radius-lg);
  padding:40px 20px;
  text-align:center;
  cursor:pointer;
  transition:all .3s var(--ease);
  background:rgba(59,130,246,.02);
  position:relative;
}
.doc-upload-zone:hover{
  border-color:rgba(59,130,246,.3);
  background:rgba(59,130,246,.04);
  box-shadow:0 0 30px rgba(59,130,246,.06);
}
.doc-upload-zone.dragover{
  border-color:var(--accent);
  background:rgba(59,130,246,.08);
  transform:scale(1.01);
}
.doc-upload-icon{
  font-size:2.5rem;color:var(--dim);margin-bottom:16px;
  transition:color .3s;
}
.doc-upload-zone:hover .doc-upload-icon{color:var(--accent)}
.doc-upload-text{color:var(--muted);font-size:.85rem;margin-bottom:6px}
.doc-upload-hint{color:var(--dim);font-size:.72rem}

/* Sample thumbnails */
.doc-samples{
  display:flex;gap:12px;margin-top:20px;flex-wrap:wrap;justify-content:center;
}
.doc-sample{
  width:100px;height:72px;border-radius:10px;
  border:1px solid var(--border);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  cursor:pointer;transition:all .25s var(--ease);
  font-size:.68rem;color:var(--muted);font-weight:600;gap:6px;
  background:var(--surface2);
}
.doc-sample i{font-size:1.2rem}
.doc-sample:hover{
  border-color:var(--accent);color:var(--accent);
  background:var(--accent-soft);transform:translateY(-2px);
  box-shadow:0 4px 16px rgba(59,130,246,.1);
}
.doc-sample.active{
  border-color:var(--accent);color:var(--accent);
  background:rgba(59,130,246,.1);
  box-shadow:0 0 20px rgba(59,130,246,.12);
}

/* Processing animation */
.doc-processing{
  display:none;flex-direction:column;align-items:center;gap:16px;
  padding:30px 0;
}
.doc-processing.show{display:flex}
.doc-processing-icon{
  width:60px;height:60px;border-radius:50%;
  background:linear-gradient(135deg,rgba(59,130,246,.15),rgba(139,92,246,.1));
  display:flex;align-items:center;justify-content:center;
  font-size:1.5rem;color:var(--accent);
  animation:pulse 1.5s ease infinite;
}
.doc-progress-bar{
  width:100%;max-width:300px;height:6px;border-radius:3px;
  background:var(--surface2);overflow:hidden;
}
.doc-progress-fill{
  height:100%;border-radius:3px;width:0%;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  transition:width .3s var(--ease);
  box-shadow:0 0 8px var(--accent-glow);
}
.doc-processing-text{color:var(--muted);font-size:.82rem}

/* Result panel */
.doc-result{display:none}
.doc-result.show{display:block;animation:fadeIn .5s var(--ease) both}
.doc-result-header{
  display:flex;align-items:center;gap:10px;margin-bottom:16px;
  padding-bottom:12px;border-bottom:1px solid var(--border);
}
.doc-result-badge{
  padding:4px 12px;border-radius:20px;font-size:.68rem;font-weight:700;
  background:rgba(34,197,94,.1);color:#4ade80;
  border:1px solid rgba(34,197,94,.1);
}

.doc-field{
  display:flex;align-items:center;gap:12px;
  padding:14px 16px;border-radius:10px;
  background:var(--surface2);border:1px solid var(--border);
  margin-bottom:8px;
  animation:fadeIn .4s var(--ease) both;
  transition:border-color .2s;
}
.doc-field:hover{border-color:var(--border2)}
.doc-field-icon{
  width:32px;height:32px;border-radius:8px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  font-size:.75rem;
}
.doc-field-info{flex:1;min-width:0}
.doc-field-name{font-size:.7rem;color:var(--muted);font-weight:600;margin-bottom:2px;text-transform:uppercase;letter-spacing:.5px}
.doc-field-value{font-size:.88rem;font-weight:600;color:var(--text)}
.doc-field-conf{
  display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex-shrink:0;
}
.doc-field-conf-num{font-size:.72rem;font-weight:700;font-family:var(--en)}
.doc-field-conf-bar{
  width:60px;height:4px;border-radius:2px;background:var(--surface3);overflow:hidden;
}
.doc-field-conf-fill{
  height:100%;border-radius:2px;
  transition:width .6s var(--ease);
}
.conf-high{background:var(--green)}
.conf-mid{background:var(--amber)}
.conf-low{background:var(--red)}

/* ═══ ANOMALY DETECTION PAGE ═══ */

.anomaly-stats{
  display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:28px;
}
@media(max-width:900px){.anomaly-stats{grid-template-columns:1fr}}

.anomaly-stat{
  padding:22px 24px;border-radius:var(--radius-lg);
  background:var(--surface);border:1px solid var(--border);
  position:relative;overflow:hidden;
  transition:all .3s var(--ease);
}
.anomaly-stat:hover{border-color:var(--border2);box-shadow:var(--shadow)}
.anomaly-stat::before{
  content:'';position:absolute;top:0;left:0;right:0;height:3px;
}
.anomaly-stat.stat-green::before{background:linear-gradient(90deg,var(--green),#16a34a)}
.anomaly-stat.stat-red::before{background:linear-gradient(90deg,var(--red),#dc2626)}
.anomaly-stat.stat-amber::before{background:linear-gradient(90deg,var(--amber),#d97706)}
.anomaly-stat-label{font-size:.78rem;color:var(--muted);margin-bottom:8px;display:flex;align-items:center;gap:8px}
.anomaly-stat-label i{font-size:.75rem}
.anomaly-stat-value{font-size:2rem;font-weight:800;font-family:var(--en);letter-spacing:-.5px}
.anomaly-stat-sub{font-size:.72rem;color:var(--dim);margin-top:4px}
.stat-green .anomaly-stat-value{color:var(--green)}
.stat-red .anomaly-stat-value{color:var(--red)}
.stat-amber .anomaly-stat-value{color:var(--amber)}

/* Anomaly Timeline */
.anomaly-timeline{display:flex;flex-direction:column;gap:12px}

.anomaly-card{
  padding:20px 22px;border-radius:var(--radius-lg);
  background:var(--surface);border:1px solid var(--border);
  display:flex;gap:16px;align-items:flex-start;
  transition:all .3s var(--ease);
  animation:fadeIn .4s var(--ease) both;
  position:relative;overflow:hidden;
}
.anomaly-card:hover{border-color:var(--border2);box-shadow:var(--shadow);transform:translateY(-1px)}
.anomaly-card::before{
  content:'';position:absolute;left:0;top:0;bottom:0;width:3px;
}
.anomaly-card.sev-critical::before{background:var(--red)}
.anomaly-card.sev-warning::before{background:var(--amber)}
.anomaly-card.sev-info::before{background:var(--accent)}

.anomaly-sev{
  width:42px;height:42px;border-radius:12px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;font-size:1.1rem;
}
.anomaly-sev.critical{background:rgba(239,68,68,.1);color:#f87171}
.anomaly-sev.warning{background:rgba(245,158,11,.1);color:#fbbf24}
.anomaly-sev.info{background:rgba(59,130,246,.1);color:#60a5fa}

.anomaly-content{flex:1;min-width:0}
.anomaly-title{font-size:.88rem;font-weight:700;margin-bottom:4px}
.anomaly-desc{font-size:.8rem;color:var(--text2);margin-bottom:10px;line-height:1.5}
.anomaly-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.anomaly-time{font-size:.7rem;color:var(--dim);font-family:var(--en);display:flex;align-items:center;gap:4px}
.anomaly-time i{font-size:.6rem}
.anomaly-system{
  padding:3px 10px;border-radius:6px;font-size:.65rem;font-weight:700;
  letter-spacing:.5px;
}

.anomaly-action{
  margin-top:12px;padding:12px 14px;border-radius:10px;
  background:var(--surface2);border:1px solid var(--border);
  font-size:.78rem;color:var(--text2);
  display:flex;align-items:flex-start;gap:8px;
}
.anomaly-action i{color:var(--accent);margin-top:2px;flex-shrink:0;font-size:.75rem}

/* Live Pulse Dot */
.live-dot{
  width:8px;height:8px;border-radius:50%;
  display:inline-block;margin-right:6px;
  animation:pulse 2s ease infinite;
}
.live-dot.green{background:var(--green)}
.live-dot.red{background:var(--red)}
.live-dot.amber{background:var(--amber)}

/* ═══ REPORT PAGE ═══ */

.report-type-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:28px;
}
@media(max-width:1100px){.report-type-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.report-type-grid{grid-template-columns:1fr}}

.report-type-card{
  padding:20px;border-radius:var(--radius-lg);
  background:var(--surface);border:1px solid var(--border);
  cursor:pointer;transition:all .3s var(--ease);
  text-align:center;position:relative;
}
.report-type-card:hover{border-color:var(--border2);transform:translateY(-2px);box-shadow:var(--shadow)}
.report-type-card.active{
  border-color:rgba(59,130,246,.3);
  background:rgba(59,130,246,.04);
  box-shadow:0 0 24px rgba(59,130,246,.08);
}
.report-type-card.active::after{
  content:'';position:absolute;top:0;left:0;right:0;height:2px;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
}
.report-type-icon{
  width:48px;height:48px;border-radius:14px;margin:0 auto 12px;
  display:flex;align-items:center;justify-content:center;font-size:1.2rem;
}
.report-type-name{font-size:.84rem;font-weight:700;margin-bottom:4px}
.report-type-desc{font-size:.7rem;color:var(--dim)}

/* Generation Steps */
.report-gen{
  display:none;margin-bottom:28px;
}
.report-gen.show{display:block;animation:fadeIn .4s var(--ease) both}
.report-steps{
  display:flex;align-items:center;gap:0;justify-content:center;
  padding:30px 0;
}
.report-step{
  display:flex;flex-direction:column;align-items:center;gap:10px;
  position:relative;min-width:120px;
}
.report-step-icon{
  width:52px;height:52px;border-radius:50%;
  background:var(--surface2);border:2px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  font-size:1.1rem;color:var(--dim);
  transition:all .5s var(--ease);position:relative;z-index:1;
}
.report-step.active .report-step-icon{
  background:rgba(59,130,246,.1);border-color:var(--accent);color:var(--accent);
  box-shadow:0 0 20px rgba(59,130,246,.2);
  animation:pulse 1.2s ease infinite;
}
.report-step.done .report-step-icon{
  background:rgba(34,197,94,.1);border-color:var(--green);color:var(--green);
  animation:none;
}
.report-step-label{font-size:.75rem;color:var(--dim);font-weight:600;transition:color .3s}
.report-step.active .report-step-label{color:var(--accent)}
.report-step.done .report-step-label{color:var(--green)}

.report-step-line{
  width:60px;height:2px;background:var(--border);
  margin-bottom:24px;transition:background .5s;
}
.report-step-line.done{background:var(--green)}

/* Report Preview */
.report-preview{
  display:none;
}
.report-preview.show{display:block;animation:fadeInUp .5s var(--ease) both}

.report-paper{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-xl);padding:36px 40px;
  position:relative;overflow:hidden;
  max-width:900px;margin:0 auto;
}
.report-paper::before{
  content:'';position:absolute;top:0;left:0;right:0;height:4px;
  background:linear-gradient(90deg,var(--accent),var(--accent2),var(--purple));
}
.report-title{
  font-size:1.3rem;font-weight:800;margin-bottom:6px;
  text-align:center;
}
.report-subtitle{
  font-size:.78rem;color:var(--muted);text-align:center;
  margin-bottom:28px;padding-bottom:20px;
  border-bottom:1px solid var(--border);
}
.report-section{margin-bottom:24px}
.report-section h4{
  font-size:.88rem;font-weight:700;margin-bottom:12px;
  display:flex;align-items:center;gap:8px;
  color:var(--text);
}
.report-section h4 i{color:var(--accent);font-size:.8rem}

.report-summary{
  padding:18px 20px;border-radius:var(--radius);
  background:var(--surface2);border:1px solid var(--border);
  font-size:.84rem;color:var(--text2);line-height:1.7;
}

.report-metrics{
  display:grid;grid-template-columns:repeat(4,1fr);gap:12px;
}
@media(max-width:800px){.report-metrics{grid-template-columns:repeat(2,1fr)}}
.report-metric{
  padding:16px;border-radius:var(--radius);
  background:var(--surface2);border:1px solid var(--border);
  text-align:center;
}
.report-metric-label{font-size:.7rem;color:var(--muted);margin-bottom:6px}
.report-metric-value{font-size:1.3rem;font-weight:800;font-family:var(--en)}
.report-metric-change{
  font-size:.68rem;font-weight:600;margin-top:4px;
  display:flex;align-items:center;justify-content:center;gap:3px;
}
.report-metric-change.up{color:var(--green)}
.report-metric-change.down{color:var(--red)}

.report-table{width:100%;border-collapse:collapse;margin-top:8px}
.report-table th{
  padding:10px 14px;text-align:left;font-size:.7rem;font-weight:700;
  color:var(--muted);letter-spacing:.5px;text-transform:uppercase;
  border-bottom:1px solid var(--border);background:var(--surface2);
}
.report-table td{
  padding:10px 14px;font-size:.8rem;border-bottom:1px solid rgba(255,255,255,.03);
}
.report-table tbody tr:hover{background:rgba(59,130,246,.02)}

.report-insights{
  padding:18px 20px;border-radius:var(--radius);
  background:linear-gradient(135deg,rgba(168,85,247,.05),rgba(59,130,246,.05));
  border:1px solid rgba(139,92,246,.1);
}
.report-insight-item{
  display:flex;align-items:flex-start;gap:10px;
  padding:8px 0;font-size:.82rem;color:var(--text2);
  line-height:1.5;
}
.report-insight-item i{color:var(--purple);margin-top:3px;flex-shrink:0;font-size:.75rem}
.report-insight-item + .report-insight-item{border-top:1px solid rgba(255,255,255,.04)}

.report-footer{
  margin-top:28px;padding-top:16px;border-top:1px solid var(--border);
  display:flex;justify-content:space-between;align-items:center;
}
.report-footer-text{font-size:.7rem;color:var(--dim)}

/* ═══ WORKFLOW PAGE ═══ */

.wf-canvas{
  padding:30px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  position:relative;overflow:hidden;
  min-height:400px;
}
.wf-canvas::before{
  content:'';position:absolute;inset:0;
  background-image:
    radial-gradient(circle,rgba(255,255,255,.03) 1px,transparent 1px);
  background-size:24px 24px;
  pointer-events:none;
}

.wf-pipeline{
  display:flex;align-items:center;gap:0;
  justify-content:center;flex-wrap:wrap;
  padding:20px 0;position:relative;z-index:1;
}

.wf-node{
  width:200px;padding:20px;border-radius:var(--radius-lg);
  background:var(--surface2);border:1px solid var(--border);
  text-align:center;position:relative;
  transition:all .4s var(--ease);
  flex-shrink:0;
}
.wf-node:hover{border-color:var(--border2);box-shadow:var(--shadow)}
.wf-node.glow{
  border-color:var(--accent);
  box-shadow:0 0 30px rgba(59,130,246,.2),0 0 60px rgba(59,130,246,.05);
}
.wf-node.glow .wf-node-icon{
  background:rgba(59,130,246,.15);color:var(--accent);
  box-shadow:0 0 16px rgba(59,130,246,.3);
}
.wf-node.done{border-color:var(--green)}
.wf-node.done .wf-node-icon{
  background:rgba(34,197,94,.12);color:var(--green);
}

.wf-node-icon{
  width:48px;height:48px;border-radius:14px;
  margin:0 auto 12px;
  background:rgba(255,255,255,.04);
  display:flex;align-items:center;justify-content:center;
  font-size:1.15rem;color:var(--muted);
  transition:all .4s var(--ease);
}
.wf-node-title{font-size:.82rem;font-weight:700;margin-bottom:4px}
.wf-node-desc{font-size:.7rem;color:var(--dim);line-height:1.4;margin-bottom:10px}
.wf-node-badge{
  display:inline-block;padding:3px 10px;border-radius:20px;
  font-size:.62rem;font-weight:700;letter-spacing:.3px;
}

.wf-connector{
  width:50px;height:2px;flex-shrink:0;
  position:relative;margin:0 -1px;
  display:flex;align-items:center;
}
.wf-connector-line{
  width:100%;height:2px;
  background:var(--border);
  border-radius:1px;
  position:relative;
}
.wf-connector-line::after{
  content:'';position:absolute;right:-4px;top:-4px;
  width:0;height:0;
  border-top:5px solid transparent;
  border-bottom:5px solid transparent;
  border-left:6px solid var(--border);
  transition:border-color .4s;
}
.wf-connector.done .wf-connector-line{
  background:var(--green);
}
.wf-connector.done .wf-connector-line::after{
  border-left-color:var(--green);
}
.wf-connector.active .wf-connector-line{
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  animation:pulse 1s ease infinite;
}
.wf-connector.active .wf-connector-line::after{
  border-left-color:var(--accent);
}

/* Flow animation particle */
@keyframes flowParticle{
  0%{left:0;opacity:0}
  10%{opacity:1}
  90%{opacity:1}
  100%{left:calc(100% - 6px);opacity:0}
}
.wf-connector.active .wf-connector-line::before{
  content:'';position:absolute;top:-2px;width:6px;height:6px;
  border-radius:50%;background:var(--accent);
  box-shadow:0 0 8px var(--accent);
  animation:flowParticle 1s ease-in-out infinite;
}

/* Workflow Info Bar */
.wf-info{
  display:flex;gap:16px;margin-top:24px;justify-content:center;flex-wrap:wrap;
}
.wf-info-item{
  padding:10px 18px;border-radius:10px;
  background:var(--surface2);border:1px solid var(--border);
  font-size:.78rem;color:var(--text2);
  display:flex;align-items:center;gap:8px;
}
.wf-info-item i{color:var(--accent);font-size:.75rem}

/* Simulation Button */
.wf-sim-btn{
  display:block;margin:24px auto 0;
  padding:12px 32px;border-radius:12px;
  background:linear-gradient(135deg,var(--accent),#2563eb);
  border:none;color:#fff;font-size:.88rem;font-weight:700;
  cursor:pointer;transition:all .3s var(--ease);
  font-family:var(--font);
  box-shadow:0 4px 16px rgba(59,130,246,.2);
}
.wf-sim-btn:hover{
  box-shadow:0 6px 28px rgba(59,130,246,.35);
  transform:translateY(-2px);
}
.wf-sim-btn:active{transform:translateY(0);box-shadow:0 2px 8px rgba(59,130,246,.2)}
.wf-sim-btn:disabled{opacity:.5;cursor:not-allowed;transform:none}
.wf-sim-btn i{margin-right:6px}

/* ─── SHARED RESPONSIVE ─── */
@media(max-width:768px){
  .doc-layout{grid-template-columns:1fr}
  .anomaly-stats{grid-template-columns:1fr}
  .report-type-grid{grid-template-columns:1fr 1fr}
  .report-metrics{grid-template-columns:1fr 1fr}
  .report-paper{padding:24px 20px}
  .wf-pipeline{flex-direction:column}
  .wf-connector{width:2px;height:40px;flex-direction:column}
  .wf-connector-line{width:2px;height:100%}
  .wf-connector-line::after{
    right:auto;top:auto;bottom:-4px;left:-4px;
    border:5px solid transparent;
    border-top:6px solid var(--border);border-left:none;
  }
}
