/* ============================================
   GACL Work Permit System - Dashboard Styles
   ============================================ */

/* CSS Variables */
:root {
    --primary: #1a5f7a;
    --primary-dark: #134a5f;
    --secondary: #159895;
    --accent: #57c5b6;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --white: #ffffff;

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 15px;

    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   Header
   ============================================ */
.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 20px 30px;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-placeholder {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}

.project-info h1 {
    font-size: 1.8em;
    margin-bottom: 2px;
}

.project-info p {
    opacity: 0.9;
    font-size: 0.95em;
}

.team-info {
    text-align: right;
}

.team-name {
    display: block;
    font-weight: 600;
    font-size: 1.1em;
}

.team-members {
    opacity: 0.85;
    font-size: 0.9em;
}

/* ============================================
   Tab Navigation
   ============================================ */
.tab-nav {
    background: var(--white);
    padding: 0 30px;
    display: flex;
    gap: 5px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-btn {
    padding: 15px 30px;
    border: none;
    background: transparent;
    font-size: 1em;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    position: relative;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--light);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ============================================
   Container & Sections
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.section-title {
    color: var(--primary);
    font-size: 1.5em;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.subsection {
    margin-bottom: 25px;
}

.subsection h3 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 1.1em;
}

/* ============================================
   Key Metrics Cards
   ============================================ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.metric-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border-radius: var(--radius);
    padding: 25px 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.metric-icon {
    font-size: 1.8em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.metric-value {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 0.85em;
    opacity: 0.9;
}

/* Different card colors */
.metric-card.savings { background: linear-gradient(135deg, #28a745, #20c997); }
.metric-card.payback { background: linear-gradient(135deg, #17a2b8, #6610f2); }
.metric-card.roi { background: linear-gradient(135deg, #fd7e14, #e83e8c); }
.metric-card.profit { background: linear-gradient(135deg, #20c997, #28a745); }

/* ============================================
   Summary Cards
   ============================================ */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.summary-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 25px;
    border-left: 4px solid var(--primary);
}

.summary-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.15em;
}

.summary-card ul {
    list-style: none;
}

.summary-card li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
}

.summary-card li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

.summary-card.problem { border-left-color: var(--danger); }
.summary-card.problem h3 { color: var(--danger); }
.summary-card.solution { border-left-color: var(--success); }
.summary-card.solution h3 { color: var(--success); }
.summary-card.benefits { border-left-color: var(--primary); }

/* ============================================
   Modules Grid
   ============================================ */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.module-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 20px 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: var(--transition);
}

.module-card:hover {
    border-color: var(--accent);
    background: var(--white);
}

.module-icon {
    display: block;
    font-size: 1.8em;
    margin-bottom: 10px;
}

/* ============================================
   Tags
   ============================================ */
.permit-types, .dept-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.permit-tag, .dept-tag {
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9em;
}

.permit-tag {
    color: var(--white);
}

.permit-tag.hot { background: #dc3545; }
.permit-tag.cold { background: #17a2b8; }
.permit-tag.height { background: #fd7e14; }
.permit-tag.confined { background: #6f42c1; }
.permit-tag.excavation { background: #795548; }

.dept-tag {
    background: var(--light);
    color: var(--dark);
    border: 1px solid var(--gray-light);
}

/* ============================================
   Safety Grid
   ============================================ */
.safety-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.safety-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.safety-item span {
    color: var(--success);
    font-size: 1.2em;
}

/* ============================================
   Tables
   ============================================ */
.cost-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.cost-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 20px;
}

.cost-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

.cost-table, .savings-table, .summary-table, .projection-table, .risk-table, .breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

.cost-table th, .cost-table td,
.savings-table th, .savings-table td,
.summary-table th, .summary-table td,
.projection-table th, .projection-table td,
.risk-table th, .risk-table td,
.breakdown-table th, .breakdown-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.cost-table th, .savings-table th, .summary-table th,
.projection-table th, .risk-table th, .breakdown-table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.cost-table tbody tr:hover,
.savings-table tbody tr:hover,
.summary-table tbody tr:hover,
.projection-table tbody tr:hover {
    background: rgba(87, 197, 182, 0.1);
}

.amount {
    text-align: right !important;
    font-family: 'Consolas', monospace;
}

.positive { color: var(--success); font-weight: 600; }
.negative { color: var(--danger); font-weight: 600; }

.total-row {
    background: var(--primary) !important;
    color: var(--white) !important;
}

.total-row td {
    color: var(--white);
    border-bottom: none;
}

/* ============================================
   Development Phases & Resources
   ============================================ */
.dev-phases-container {
    margin-bottom: 30px;
}

.dev-phases-container > h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.2em;
}

.phases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.phase-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--primary);
}

.phase-card.phase1 { border-top-color: #1a5f7a; }
.phase-card.phase2 { border-top-color: #159895; }
.phase-card.phase3 { border-top-color: #57c5b6; }
.phase-card.phase4 { border-top-color: #28a745; }

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

.phase-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}

.phase-info h4 {
    color: var(--primary);
    margin: 0;
    font-size: 1.1em;
}

.phase-duration {
    font-size: 0.85em;
    color: var(--gray);
}

.phase-tasks {
    list-style: none;
    margin: 0 0 15px 0;
    padding: 0;
}

.phase-tasks li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    font-size: 0.9em;
    color: var(--dark);
}

.phase-tasks li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

.phase-team {
    background: var(--light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    color: var(--gray);
    text-align: center;
}

/* Resource Table */
.resource-table-container {
    background: var(--light);
    border-radius: var(--radius);
    padding: 25px;
}

.resource-table-container h4 {
    color: var(--primary);
    margin-bottom: 15px;
}

.resource-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}

.resource-table th,
.resource-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.resource-table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.resource-table tbody tr:hover {
    background: rgba(87, 197, 182, 0.1);
}

.resource-table .center {
    text-align: center;
}

.resource-table .subtotal-row {
    background: var(--light);
    font-weight: 500;
}

.resource-table .subtotal-row td {
    border-top: 2px solid var(--gray-light);
}

.total-summary {
    background: var(--light);
    border-radius: var(--radius);
    padding: 25px;
}

.total-summary h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

/* ============================================
   ROI Calculation Box
   ============================================ */
.roi-calculation {
    margin: 30px 0;
}

.roi-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-lg);
    padding: 30px;
    color: var(--white);
}

.roi-formula {
    display: grid;
    gap: 15px;
}

.formula-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
}

.formula-item.highlight {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

.formula-item.result {
    background: rgba(40, 167, 69, 0.3);
    border: 2px solid rgba(40, 167, 69, 0.5);
}

.formula-label {
    opacity: 0.9;
}

.formula-value {
    font-weight: 600;
}

/* ============================================
   Bar Chart
   ============================================ */
.chart-container {
    margin: 30px 0;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 250px;
    padding: 20px;
    background: var(--light);
    border-radius: var(--radius);
    border-bottom: 3px solid var(--gray-light);
    border-left: 3px solid var(--gray-light);
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 100px;
}

.bar {
    width: 50px;
    background: linear-gradient(to top, var(--primary), var(--accent));
    border-radius: 5px 5px 0 0;
    position: relative;
    transition: height 0.5s ease;
}

.bar::before {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75em;
    font-weight: bold;
    color: var(--primary);
    white-space: nowrap;
}

.bar-label {
    margin-top: 10px;
    font-size: 0.85em;
    color: var(--gray);
}

.chart-legend {
    text-align: center;
    margin-top: 15px;
    color: var(--gray);
    font-size: 0.9em;
}

/* ============================================
   Benefits Grid
   ============================================ */
.qualitative-benefits {
    margin-top: 30px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--light);
    border-radius: var(--radius);
    border-left: 3px solid var(--success);
}

.benefit-item span {
    color: var(--success);
    font-size: 1.2em;
}

/* ============================================
   Gantt Chart
   ============================================ */
.gantt-chart {
    background: var(--light);
    border-radius: var(--radius);
    padding: 25px;
    overflow-x: auto;
}

.gantt-header, .gantt-row {
    display: grid;
    grid-template-columns: 180px repeat(7, 1fr);
    gap: 5px;
    align-items: center;
}

.gantt-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.gantt-weeks {
    display: contents;
}

.gantt-weeks span {
    text-align: center;
    font-size: 0.85em;
    color: var(--gray);
    font-weight: 600;
}

.gantt-row {
    margin-bottom: 10px;
}

.gantt-label {
    font-weight: 500;
    font-size: 0.9em;
}

.gantt-bar {
    padding: 10px;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 0.8em;
    text-align: center;
    font-weight: 500;
}

.gantt-bar.phase1 { background: #1a5f7a; }
.gantt-bar.phase2 { background: #159895; }
.gantt-bar.phase3 { background: #57c5b6; }
.gantt-bar.phase4 { background: #17a2b8; }
.gantt-bar.phase5 { background: #fd7e14; }
.gantt-bar.phase6 { background: #28a745; }

/* Milestones */
.milestones {
    margin-top: 30px;
}

.milestone-list {
    display: grid;
    gap: 12px;
}

.milestone {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: var(--light);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.milestone-week {
    background: var(--primary);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================
   Risk Table
   ============================================ */
.risk-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--white);
}

.risk-badge.high { background: var(--danger); }
.risk-badge.medium { background: var(--warning); color: var(--dark); }
.risk-badge.low { background: var(--success); }

/* ============================================
   Verdict Box
   ============================================ */
.verdict-box {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
    border: 3px solid var(--success);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
}

.verdict-icon {
    font-size: 4em;
    color: var(--success);
    margin-bottom: 15px;
}

.verdict-box h3 {
    color: var(--success);
    font-size: 1.8em;
    margin-bottom: 25px;
}

.verdict-reasons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.reason {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.reason span {
    color: var(--warning);
    font-size: 1.3em;
}

/* Next Steps */
.next-steps {
    margin-top: 30px;
    padding: 25px;
    background: var(--light);
    border-radius: var(--radius);
}

.next-steps h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.next-steps ol {
    margin-left: 20px;
}

.next-steps li {
    padding: 8px 0;
}

/* CTA */
.calculator-cta {
    margin-top: 30px;
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    color: var(--white);
}

.cta-btn {
    margin-top: 15px;
    padding: 15px 40px;
    background: var(--white);
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.cta-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

/* ============================================
   Calculator Tab
   ============================================ */
.calculator-header {
    text-align: center;
    margin-bottom: 30px;
}

.calculator-header h2 {
    color: var(--primary);
    font-size: 1.8em;
    margin-bottom: 10px;
}

.calculator-header p {
    color: var(--gray);
}

/* Sticky Results */
.sticky-results {
    position: sticky;
    top: 60px;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.result-item {
    text-align: center;
    color: var(--white);
}

.result-label {
    font-size: 0.85em;
    opacity: 0.9;
    display: block;
    margin-bottom: 5px;
}

.result-value {
    font-size: 1.4em;
    font-weight: 700;
}

/* Calc Sections */
.calc-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.calc-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: var(--light);
    cursor: pointer;
    transition: var(--transition);
}

.section-header:hover {
    background: var(--gray-light);
}

.section-icon {
    font-size: 1.5em;
}

.section-header h3 {
    flex: 1;
    font-size: 1em;
    color: var(--primary);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.calc-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.calc-section.collapsed .section-content {
    display: none;
}

.section-content {
    padding: 20px;
}

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9em;
    color: var(--dark);
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 1em;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--secondary);
}

/* Detailed Results */
.detailed-results {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

.detailed-results h3 {
    color: var(--primary);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent);
}

.detailed-results h4 {
    color: var(--primary-dark);
    margin: 25px 0 15px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.result-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.result-card.highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
}

.result-card.highlight .rc-label {
    color: var(--white);
    opacity: 1;
    font-weight: 600;
}

.result-card.highlight .rc-value {
    color: #7fff7f;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    font-size: 1.6em;
}

.result-card.highlight .rc-value.positive {
    color: #7fff7f;
}

.result-card.highlight .rc-value.negative {
    color: #ff6b6b;
}

.rc-label {
    font-size: 0.85em;
    color: var(--gray);
    margin-bottom: 8px;
}

.rc-value {
    font-size: 1.5em;
    font-weight: 700;
}

/* Breakdown Sections */
.breakdown-section {
    margin-bottom: 25px;
}

/* Calc Chart */
.calc-chart {
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 20px;
    background: var(--light);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

/* Calc Verdict */
.calc-verdict {
    text-align: center;
    padding: 30px;
    border-radius: var(--radius);
    margin-top: 25px;
}

.calc-verdict.excellent {
    background: rgba(40, 167, 69, 0.15);
    border: 2px solid var(--success);
}

.calc-verdict.good {
    background: rgba(255, 193, 7, 0.15);
    border: 2px solid var(--warning);
}

.calc-verdict.risky {
    background: rgba(220, 53, 69, 0.15);
    border: 2px solid var(--danger);
}

.calc-verdict h4 {
    margin: 0 0 10px;
    font-size: 1.3em;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: var(--radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--dark);
}

/* ============================================
   Footer
   ============================================ */
.main-footer {
    text-align: center;
    padding: 30px;
    background: var(--white);
    color: var(--gray);
    margin-top: 30px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.main-footer p {
    margin: 5px 0;
}

/* ============================================
   PDF Export Bar
   ============================================ */
.export-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 15px 25px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    color: var(--white);
}

.export-info {
    display: flex;
    flex-direction: column;
}

.doc-title {
    font-weight: 600;
    font-size: 1.1em;
}

.doc-date {
    font-size: 0.85em;
    opacity: 0.9;
}

.pdf-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    color: var(--primary);
    border: none;
    padding: 12px 25px;
    border-radius: var(--radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.pdf-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.pdf-icon {
    font-size: 1.2em;
}

/* PDF Cover Page (Print Only) */
.print-only {
    display: none;
}

.pdf-cover {
    page-break-after: always;
}

.cover-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 40px;
}

.cover-logo {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 40px;
}

.pdf-cover h1 {
    color: var(--primary);
    font-size: 3em;
    margin-bottom: 10px;
}

.pdf-cover h2 {
    color: var(--secondary);
    font-size: 1.5em;
    font-weight: 400;
    margin-bottom: 20px;
}

.cover-subtitle {
    font-size: 1.2em;
    color: var(--gray);
    margin-bottom: 50px;
}

.cover-meta {
    margin-bottom: 50px;
}

.cover-meta p {
    margin: 10px 0;
    font-size: 1.1em;
}

.cover-highlights {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.highlight-box {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 25px 35px;
    border-radius: var(--radius);
    text-align: center;
}

.hl-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 5px;
}

.hl-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    body {
        background: white !important;
        font-size: 10pt;
        line-height: 1.4;
    }

    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .tab-nav, .sticky-results, .action-buttons, .calculator-cta, .export-bar, #calculator {
        display: none !important;
    }

    /* Container adjustments */
    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    /* Header styling for print */
    .main-header {
        background: linear-gradient(135deg, #1a5f7a, #159895) !important;
        -webkit-print-color-adjust: exact;
        padding: 15px 20px;
        page-break-after: avoid;
    }

    .header-content {
        max-width: 100%;
    }

    .project-info h1 {
        font-size: 1.5em;
    }

    /* Section styling */
    .section {
        box-shadow: none;
        border: 1px solid #e0e0e0;
        margin-bottom: 15px;
        padding: 20px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .section-title {
        font-size: 1.3em;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    /* Metrics cards */
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .metric-card {
        padding: 15px 10px;
        background: linear-gradient(135deg, #1a5f7a, #159895) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .metric-card.savings {
        background: linear-gradient(135deg, #28a745, #20c997) !important;
    }

    .metric-card.payback {
        background: linear-gradient(135deg, #17a2b8, #6610f2) !important;
    }

    .metric-card.roi {
        background: linear-gradient(135deg, #fd7e14, #e83e8c) !important;
    }

    .metric-card.profit {
        background: linear-gradient(135deg, #20c997, #28a745) !important;
    }

    .metric-value {
        font-size: 1.5em;
    }

    .metric-label {
        font-size: 0.75em;
    }

    /* Summary cards */
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .summary-card {
        padding: 15px;
        font-size: 0.9em;
    }

    .summary-card li {
        padding: 5px 0;
    }

    /* Module cards */
    .modules-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .module-card {
        padding: 10px;
        font-size: 0.8em;
    }

    .module-icon {
        font-size: 1.4em;
        margin-bottom: 5px;
    }

    /* Tags */
    .permit-types, .dept-grid {
        gap: 6px;
    }

    .permit-tag, .dept-tag {
        padding: 6px 12px;
        font-size: 0.8em;
    }

    .permit-tag.hot { background: #dc3545 !important; }
    .permit-tag.cold { background: #17a2b8 !important; }
    .permit-tag.height { background: #fd7e14 !important; }
    .permit-tag.confined { background: #6f42c1 !important; }
    .permit-tag.excavation { background: #795548 !important; }

    /* Safety grid */
    .safety-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .safety-item {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    /* Development Phases */
    .phases-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .phase-card {
        padding: 12px;
        font-size: 0.85em;
    }

    .phase-tasks li {
        padding: 4px 0;
        font-size: 0.85em;
    }

    /* Resource table */
    .resource-table-container {
        padding: 15px;
    }

    .resource-table th,
    .resource-table td {
        padding: 8px 10px;
        font-size: 0.85em;
    }

    /* Cost tables */
    .cost-tables-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .cost-card {
        padding: 15px;
    }

    .cost-table th, .cost-table td {
        padding: 8px 10px;
        font-size: 0.85em;
    }

    /* ROI Box */
    .roi-box {
        background: linear-gradient(135deg, #1a5f7a, #159895) !important;
        padding: 20px;
    }

    .formula-item {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    /* Charts */
    .bar-chart, .calc-chart {
        height: 180px;
        page-break-inside: avoid;
    }

    .bar {
        background: linear-gradient(to top, #1a5f7a, #57c5b6) !important;
        -webkit-print-color-adjust: exact;
    }

    /* Projection table */
    .projection-table th,
    .projection-table td {
        padding: 8px 10px;
        font-size: 0.85em;
    }

    /* Gantt chart */
    .gantt-chart {
        padding: 15px;
        font-size: 0.85em;
        page-break-inside: avoid;
    }

    .gantt-bar {
        padding: 6px;
        font-size: 0.75em;
    }

    .gantt-bar.phase1 { background: #1a5f7a !important; }
    .gantt-bar.phase2 { background: #159895 !important; }
    .gantt-bar.phase3 { background: #57c5b6 !important; }
    .gantt-bar.phase4 { background: #17a2b8 !important; }
    .gantt-bar.phase5 { background: #fd7e14 !important; }
    .gantt-bar.phase6 { background: #28a745 !important; }

    /* Milestones */
    .milestone-list {
        gap: 8px;
    }

    .milestone {
        padding: 8px 15px;
        font-size: 0.85em;
    }

    .milestone-week {
        padding: 4px 10px;
        font-size: 0.75em;
    }

    /* Risk table */
    .risk-table th,
    .risk-table td {
        padding: 8px 10px;
        font-size: 0.85em;
    }

    .risk-badge {
        padding: 3px 8px;
        font-size: 0.7em;
    }

    .risk-badge.high { background: #dc3545 !important; }
    .risk-badge.medium { background: #ffc107 !important; color: #212529 !important; }
    .risk-badge.low { background: #28a745 !important; }

    /* Verdict */
    .verdict-box {
        padding: 25px;
        border: 3px solid #28a745 !important;
        background: rgba(40, 167, 69, 0.1) !important;
        page-break-inside: avoid;
    }

    .verdict-icon {
        font-size: 3em;
        color: #28a745 !important;
    }

    .verdict-box h3 {
        font-size: 1.4em;
        color: #28a745 !important;
    }

    .verdict-reasons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .reason {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .reason span {
        color: #ffc107 !important;
    }

    /* Next steps */
    .next-steps {
        padding: 15px;
    }

    .next-steps li {
        padding: 5px 0;
        font-size: 0.9em;
    }

    /* Benefits grid */
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .benefit-item {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .benefit-item span {
        color: #28a745 !important;
    }

    /* Footer */
    .main-footer {
        margin-top: 20px;
        padding: 15px;
        font-size: 0.85em;
        border-top: 2px solid #1a5f7a;
        page-break-before: avoid;
    }

    /* PDF Cover Page */
    .pdf-cover {
        page-break-after: always;
        background: white;
    }

    .cover-content {
        min-height: 100vh;
        padding: 60px 40px;
    }

    .cover-logo {
        width: 100px;
        height: 100px;
        background: linear-gradient(135deg, #1a5f7a, #159895) !important;
        font-size: 1.8em;
        margin-bottom: 40px;
    }

    .pdf-cover h1 {
        font-size: 2.5em;
        color: #1a5f7a !important;
    }

    .pdf-cover h2 {
        font-size: 1.3em;
        color: #159895 !important;
    }

    .cover-subtitle {
        font-size: 1.1em;
    }

    .cover-meta {
        margin: 40px 0;
    }

    .cover-meta p {
        font-size: 1em;
        margin: 8px 0;
    }

    .cover-highlights {
        gap: 20px;
    }

    .highlight-box {
        background: linear-gradient(135deg, #1a5f7a, #159895) !important;
        padding: 20px 30px;
    }

    .hl-value {
        font-size: 1.8em;
    }

    .hl-label {
        font-size: 0.85em;
    }

    /* Page break controls */
    .section#summary {
        page-break-before: always;
    }

    .section#costs {
        page-break-before: always;
    }

    .section#savings {
        page-break-before: always;
    }

    .section#timeline {
        page-break-before: always;
    }

    .section#risks {
        page-break-before: always;
    }

    /* Ensure tables don't break awkwardly */
    table {
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }

    /* Ensure color text prints correctly */
    .positive {
        color: #28a745 !important;
    }

    .negative {
        color: #dc3545 !important;
    }

    .total-row {
        background: #1a5f7a !important;
    }

    .total-row td {
        color: white !important;
    }

    /* Avoid orphans and widows */
    p, li {
        orphans: 3;
        widows: 3;
    }

    h2, h3, h4 {
        page-break-after: avoid;
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .container {
        padding: 20px;
    }

    .section {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .team-info {
        text-align: center;
    }

    .project-info h1 {
        font-size: 1.4em;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-value {
        font-size: 1.5em;
    }

    .sticky-results {
        grid-template-columns: repeat(2, 1fr);
        position: relative;
        top: 0;
    }

    .gantt-chart {
        font-size: 0.85em;
    }

    .tab-btn {
        padding: 12px 15px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .section {
        padding: 15px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid, .cost-tables-grid {
        grid-template-columns: 1fr;
    }

    .verdict-reasons {
        grid-template-columns: 1fr;
    }
}
