/* ASI AI Solutions - Internal Wiki Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0a1628;
  --blue: #00a6ff;
  --blue-dark: #0080cc;
  --blue-light: #e6f6ff;
  --grey-bg: #f5f7fa;
  --grey-border: #e2e6ec;
  --grey-text: #5a6577;
  --white: #ffffff;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --sidebar-width: 280px;
  --header-height: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1e293b;
  background: var(--grey-bg);
  line-height: 1.7;
  font-size: 15px;
}

a { color: var(--blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

/* Layout */
.wiki-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--navy);
  color: #c5cdd8;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--white);
  flex-shrink: 0;
}

.sidebar-subtitle {
  font-size: 11px;
  color: #7a8599;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5a6577;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: #9aa5b8;
  font-size: 13.5px;
  font-weight: 400;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.04);
  text-decoration: none;
  border-left-color: rgba(0,166,255,0.3);
}

.nav-link.active {
  color: var(--white);
  background: rgba(0,166,255,0.1);
  border-left-color: var(--blue);
  font-weight: 500;
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: #5a6577;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Top Bar */
.top-bar {
  background: var(--white);
  border-bottom: 1px solid var(--grey-border);
  padding: 0 40px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--grey-text);
}

.breadcrumb a { color: var(--grey-text); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .separator { color: #ccc; }
.breadcrumb .current { color: #1e293b; font-weight: 500; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--grey-bg);
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  padding: 8px 16px;
  width: 320px;
}

.search-box input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: #1e293b;
  width: 100%;
  outline: none;
}

.search-box input::placeholder { color: #94a3b8; }

.search-icon { color: #94a3b8; font-size: 14px; }

/* Page Content */
.page-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px;
}

/* Page Header */
.page-header {
  margin-bottom: 36px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 8px;
}

.page-header .page-description {
  font-size: 16px;
  color: var(--grey-text);
  line-height: 1.6;
}

.page-meta {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  font-size: 12px;
  color: #94a3b8;
}

.page-meta span { display: flex; align-items: center; gap: 4px; }

/* Sections */
h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--grey-border);
}

h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
  margin: 28px 0 12px;
}

h4 {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  margin: 20px 0 8px;
}

p { margin-bottom: 14px; }

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s;
}

.card:hover { box-shadow: 0 4px 16px rgba(10,22,40,0.06); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.card-icon.blue { background: #e6f6ff; color: var(--blue); }
.card-icon.green { background: #dcfce7; color: var(--green); }
.card-icon.orange { background: #fef3c7; color: var(--orange); }
.card-icon.red { background: #fee2e2; color: var(--red); }
.card-icon.purple { background: #ede9fe; color: var(--purple); }
.card-icon.navy { background: #e2e6ec; color: var(--navy); }

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.card-text {
  font-size: 14px;
  color: var(--grey-text);
  line-height: 1.6;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--grey-border);
  border-radius: 10px;
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

th:first-child { border-radius: 9px 0 0 0; }
th:last-child { border-radius: 0 9px 0 0; }

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--grey-border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background: #fafbfc; }

/* Badges/Tags */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-blue { background: #e6f6ff; color: #0077b6; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-orange { background: #fef3c7; color: #d97706; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-grey { background: #f1f5f9; color: #64748b; }

/* Callout Boxes */
.callout {
  border-radius: 10px;
  padding: 20px 24px;
  margin: 20px 0;
  display: flex;
  gap: 14px;
  font-size: 14px;
  line-height: 1.6;
}

.callout-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.callout-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.callout-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.callout-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.callout-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Checklists */
.checklist {
  list-style: none;
  margin: 16px 0;
}

.checklist li {
  padding: 8px 0 8px 32px;
  position: relative;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.checklist li:last-child { border-bottom: none; }

.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--grey-border);
  border-radius: 4px;
  background: var(--white);
}

/* Flowchart */
.flowchart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 30px 0;
  padding: 30px 20px;
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: 12px;
}

.flow-step {
  width: 320px;
  padding: 16px 20px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  position: relative;
  border: 2px solid;
}

.flow-step.start {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
  border-radius: 50px;
}

.flow-step.process {
  background: #e6f6ff;
  border-color: #7dd3fc;
  color: #0c4a6e;
}

.flow-step.decision {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
  transform: rotate(0deg);
  clip-path: none;
  border-radius: 4px;
}

.flow-step.end {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
  border-radius: 50px;
}

.flow-step .step-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.flow-arrow {
  width: 2px;
  height: 28px;
  background: #cbd5e1;
  position: relative;
}

.flow-arrow::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #cbd5e1;
}

/* Horizontal flow */
.flowchart-horizontal {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 30px 0;
  padding: 30px 20px;
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: 12px;
  overflow-x: auto;
}

.flow-arrow-h {
  height: 2px;
  width: 30px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
}

.flow-arrow-h::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #cbd5e1;
}

/* Steps/Timeline */
.process-steps {
  position: relative;
  margin: 24px 0;
}

.step {
  display: flex;
  gap: 20px;
  margin-bottom: 0;
  position: relative;
  padding-bottom: 32px;
}

.step:last-child { padding-bottom: 0; }

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  z-index: 1;
}

.step-line {
  width: 2px;
  flex: 1;
  background: var(--grey-border);
  margin-top: 8px;
}

.step:last-child .step-line { display: none; }

.step-content {
  flex: 1;
  padding-top: 4px;
}

.step-content h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.step-content p {
  font-size: 14px;
  color: var(--grey-text);
}

/* Lists */
ul, ol {
  margin: 12px 0;
  padding-left: 24px;
}

li { margin-bottom: 6px; font-size: 14px; }

/* RACI */
.raci-r { background: #dbeafe; color: #1e40af; font-weight: 600; text-align: center; }
.raci-a { background: #fce7f3; color: #9d174d; font-weight: 600; text-align: center; }
.raci-c { background: #fef3c7; color: #92400e; font-weight: 600; text-align: center; }
.raci-i { background: #f0fdf4; color: #166534; font-weight: 600; text-align: center; }

/* Status Indicators */
.status { display: flex; align-items: center; gap: 6px; }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green { background: var(--green); }
.status-dot.orange { background: var(--orange); }
.status-dot.red { background: var(--red); }

/* Metric Cards */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.metric-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
}

.metric-label {
  font-size: 12px;
  color: var(--grey-text);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Template Box */
.template-box {
  background: #f8fafc;
  border: 2px dashed var(--grey-border);
  border-radius: 10px;
  padding: 24px;
  margin: 20px 0;
}

.template-box h4 {
  margin-top: 0;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-box .field {
  margin: 10px 0;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  font-size: 13px;
}

.template-box .field-label {
  font-weight: 600;
  color: var(--navy);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.template-box .field-value {
  color: #94a3b8;
  font-style: italic;
}

/* Tabs (for page sections) */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--grey-border);
  margin: 24px 0 20px;
  overflow-x: auto;
}

.tab-link {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-text);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  cursor: pointer;
}

.tab-link:hover { color: var(--navy); text-decoration: none; }
.tab-link.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* KPI bar */
.kpi-bar {
  display: flex;
  gap: 2px;
  background: var(--grey-border);
  border-radius: 8px;
  overflow: hidden;
  height: 8px;
  margin: 8px 0;
}

.kpi-fill {
  background: var(--blue);
  border-radius: 8px 0 0 8px;
}

/* Print */
@media print {
  .sidebar, .top-bar { display: none; }
  .main-content { margin-left: 0; }
  .page-content { max-width: 100%; }
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .page-content { padding: 24px; }
}

/* Welcome/Home specific */
.hero-section {
  background: linear-gradient(135deg, var(--navy) 0%, #162544 100%);
  border-radius: 16px;
  padding: 48px 40px;
  margin-bottom: 32px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0,166,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-section h1 {
  color: var(--white);
  font-size: 36px;
  margin-bottom: 12px;
}

.hero-section p {
  color: #94a3b8;
  font-size: 16px;
  max-width: 600px;
}

.hero-search {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  max-width: 500px;
}

.hero-search input {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  color: var(--white);
  outline: none;
}

.hero-search input::placeholder { color: #7a8599; }

.hero-search button {
  padding: 14px 28px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search button:hover { background: var(--blue-dark); }

/* Recent updates */
.update-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--grey-border);
}

.update-item:last-child { border-bottom: none; }

.update-date {
  flex-shrink: 0;
  width: 56px;
  text-align: center;
}

.update-date .day {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.update-date .month {
  font-size: 11px;
  color: var(--grey-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.update-info h4 { margin: 0 0 4px; font-size: 14px; }
.update-info p { margin: 0; font-size: 13px; color: var(--grey-text); }

/* Escalation matrix arrows */
.escalation-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 24px 0;
  flex-wrap: wrap;
}

.escalation-level {
  padding: 14px 24px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  min-width: 140px;
}

.escalation-arrow {
  font-size: 20px;
  color: #cbd5e1;
  padding: 0 4px;
}

/* Section anchors */
h2[id], h3[id] {
  scroll-margin-top: calc(var(--header-height) + 20px);
}

/* Code/pre */
code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #e11d48;
}

pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Approval thresholds visual */
.threshold-bar {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0;
  height: 48px;
  font-size: 12px;
  font-weight: 600;
}

.threshold-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  white-space: nowrap;
}

/* Playbook summary */
.playbook {
  border-left: 4px solid var(--blue);
  padding: 20px 24px;
  margin: 20px 0;
  background: var(--white);
  border-radius: 0 10px 10px 0;
  border-top: 1px solid var(--grey-border);
  border-right: 1px solid var(--grey-border);
  border-bottom: 1px solid var(--grey-border);
}

.playbook h4 {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Accordion-style sections */
details {
  margin: 12px 0;
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  overflow: hidden;
}

details[open] { background: var(--white); }

summary {
  padding: 14px 20px;
  background: var(--white);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

summary::-webkit-details-marker { display: none; }

summary::before {
  content: '\25B6';
  font-size: 10px;
  color: var(--grey-text);
  transition: transform 0.2s;
}

details[open] summary::before { transform: rotate(90deg); }

details .details-content { padding: 0 20px 20px; }

/* Two column layout helper */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}
