/* =============================================================================
   Agilent S/4HANA Business Case — Professional Styling
   McKinsey/Deloitte aesthetic with print-friendly layout
   ============================================================================= */

:root {
    --primary: #1B2A4A;
    --primary-light: #2C4066;
    --accent: #0077B6;
    --accent-light: #48CAE4;
    --success: #1E8449;
    --warning: #B7950B;
    --danger: #C0392B;
    --text: #2C3E50;
    --text-muted: #6C757D;
    --bg: #F8F9FA;
    --card-bg: #FFFFFF;
    --border: #DEE2E6;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary);
    color: #fff;
    overflow-y: auto;
    z-index: 1000;
    padding-top: 0;
}

.sidebar-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.15);
}

.sidebar-header h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-header .subtitle {
    font-size: 11px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--accent-light);
}

.sidebar-nav a .nav-icon {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    font-size: 14px;
}

.sidebar-nav .nav-section {
    padding: 15px 20px 5px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.5;
    font-weight: 600;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.15);
}

.draft-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 3px;
}

.confidential-text {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 5px;
    letter-spacing: 0.5px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px 40px;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary);
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 5px;
}

.page-header .page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
}

.kpi-card.positive::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.negative::before { background: var(--danger); }

.kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.kpi-detail {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    margin-bottom: 25px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.card-body {
    padding: 20px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: var(--primary);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table th.right,
.data-table td.right {
    text-align: right;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: rgba(0,119,182,0.03);
}

.data-table .total-row {
    font-weight: 700;
    background: #F0F4F8;
    border-top: 2px solid var(--primary);
}

.data-table .total-row td {
    padding: 10px 12px;
}

.data-table .category-row {
    background: #F8F9FA;
    font-weight: 600;
}

.data-table .category-row td {
    padding: 10px 12px;
    color: var(--primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Classification badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-source { background: #D5F5E3; color: #1E8449; }
.badge-derived { background: #D4E6F1; color: #1B4F72; }
.badge-assumption { background: #FEF9E7; color: #7D6608; }
.badge-expert { background: #F5EEF8; color: #6C3483; }
.badge-recommendation { background: #FADBD8; color: #922B21; }

/* Risk severity */
.risk-high { color: var(--danger); font-weight: 700; }
.risk-medium { color: var(--warning); font-weight: 700; }
.risk-low { color: var(--success); font-weight: 700; }

/* Progress bars (readiness) */
.readiness-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.readiness-track {
    flex: 1;
    height: 8px;
    background: #E8E8E8;
    border-radius: 4px;
    overflow: hidden;
}

.readiness-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.readiness-label {
    font-size: 12px;
    font-weight: 600;
    min-width: 35px;
}

/* Chart containers */
.chart-container {
    position: relative;
    width: 100%;
    max-height: 400px;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 25px;
}

/* Migration path cards */
.path-card {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    transition: all 0.2s;
}

.path-card.recommended {
    border-color: var(--success);
    background: linear-gradient(135deg, #F0FFF0, #FFFFFF);
    box-shadow: 0 4px 12px rgba(30,132,73,0.15);
}

.path-card h4 {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--primary);
}

.path-score {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 15px;
}

.path-card.recommended .path-score {
    background: var(--success);
    color: #fff;
}

.pros-cons {
    margin: 15px 0;
}

.pros-cons h5 {
    margin: 10px 0 5px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pros-cons ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
}

.pros-cons li {
    margin-bottom: 3px;
}

/* Sensitivity controls */
.sensitivity-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.control-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

/* Timeline */
.timeline-container {
    position: relative;
    padding: 20px 0;
}

.timeline-phase {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    position: relative;
}

.timeline-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    margin-right: 20px;
    position: relative;
    z-index: 1;
}

.timeline-phase:not(:last-child) .timeline-marker::after {
    content: '';
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(100% + 20px);
    background: #DEE2E6;
    z-index: 0;
}

.timeline-content {
    flex: 1;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.timeline-content h4 {
    margin: 0 0 5px;
    font-size: 16px;
    color: var(--primary);
}

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-activities {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

.timeline-activities li {
    padding: 3px 0 3px 15px;
    position: relative;
    font-size: 13px;
}

.timeline-activities li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* Watermark */
.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    font-size: 100px;
    font-weight: 900;
    color: rgba(192, 57, 43, 0.04);
    pointer-events: none;
    z-index: 0;
    letter-spacing: 10px;
    white-space: nowrap;
}

/* Section dividers */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin: 30px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}

/* Utility */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

/* Print styles */
@media print {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 20px; }
    .watermark { display: block; }
    .card { break-inside: avoid; }
    body { font-size: 11px; }
}

/* Responsive */
@media (max-width: 1200px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; }
    .main-content { margin-left: 0; padding: 20px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .sensitivity-controls { grid-template-columns: 1fr; }
}

/* Negative values */
.negative-value { color: var(--danger); }
.positive-value { color: var(--success); }
