/* ============================================
   BIZPLAN - Business Plan Builder
   ============================================ */

:root {
    --bg-main: #f8f9fa;
    --bg-white: #ffffff;
    --bg-sidebar: #1e2330;
    --bg-sidebar-hover: #282d3e;
    
    --burgundy: #6B1C2A;
    --burgundy-light: #8B2C3A;
    --gold: #C9A962;
    --gold-light: #D4BC7D;
    
    --text-dark: #1a1d26;
    --text-medium: #4a5568;
    --text-light: #718096;
    --text-sidebar: #a0aec0;
    
    --border: #e2e8f0;
    --border-dark: #cbd5e0;
    
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    
    --font-sans: 'DM Sans', -apple-system, sans-serif;
    --font-display: 'DM Serif Display', Georgia, serif;
    
    --sidebar-width: 280px;
    --header-height: 70px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-main);
}

/* App Layout */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.logo svg {
    width: 28px;
    height: 28px;
    color: var(--gold);
}

.logo span {
    font-family: var(--font-display);
    font-size: 1.5rem;
}

.plan-selector {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.plan-selector select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-sidebar-hover);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: white;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 0.75rem;
}

.nav-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    padding: 0.75rem 0.75rem 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--text-sidebar);
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.9375rem;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: white;
}

.nav-item.active {
    background: rgba(201, 169, 98, 0.15);
    color: var(--gold);
}

.nav-number {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.nav-item.active .nav-number {
    background: var(--gold);
    color: var(--bg-sidebar);
}

.nav-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    margin-left: auto;
}

.nav-status.complete {
    background: var(--success);
}

.nav-status.partial {
    background: var(--warning);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.progress-ring {
    position: relative;
    width: 60px;
    height: 60px;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 3;
}

.progress-fill {
    fill: none;
    stroke: var(--gold);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-sidebar);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.main-header {
    height: var(--header-height);
    padding: 0 2rem;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.plan-title-input {
    font-family: var(--font-display);
    font-size: 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-dark);
    padding: 0.5rem 0;
    width: 300px;
}

.plan-title-input:focus {
    outline: none;
    border-bottom: 2px solid var(--gold);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.btn-primary {
    background: var(--burgundy);
    color: white;
}

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

.btn-secondary {
    background: var(--bg-main);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

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

.btn-ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-ai:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-add {
    background: transparent;
    color: var(--burgundy);
    border: 1px dashed var(--border-dark);
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
}

.btn-add:hover {
    background: rgba(107, 28, 42, 0.05);
    border-color: var(--burgundy);
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.btn-remove:hover {
    color: var(--danger);
}

/* Sections */
.section {
    display: none;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.section-info h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.section-info p {
    color: var(--text-medium);
}

/* Form Cards */
.form-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.9375rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.input-with-prefix {
    display: flex;
    align-items: stretch;
}

.input-with-prefix .prefix {
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 6px 0 0 6px;
    color: var(--text-medium);
    font-weight: 500;
}

.input-with-prefix input {
    border-radius: 0 6px 6px 0;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-item input {
    width: auto;
    accent-color: var(--burgundy);
}

.checkbox-item span {
    font-size: 0.875rem;
}

/* Highlights List */
.highlights-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.highlight-item {
    display: flex;
    gap: 0.5rem;
}

.highlight-item input {
    flex: 1;
}

/* Pain Points List */
.pain-points-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pain-point-item {
    display: flex;
    gap: 0.5rem;
}

.pain-point-item input {
    flex: 1;
}

/* Tags Input */
.tags-input {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 50px;
}

.tags-input input {
    flex: 1;
    min-width: 150px;
    border: none;
    padding: 0.375rem 0.5rem;
}

.tags-input input:focus {
    outline: none;
    box-shadow: none;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: rgba(107, 28, 42, 0.1);
    color: var(--burgundy);
    border-radius: 999px;
    font-size: 0.8125rem;
}

.tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Competitors Table */
.competitors-table {
    overflow-x: auto;
}

.competitors-table table {
    width: 100%;
    border-collapse: collapse;
}

.competitors-table th,
.competitors-table td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.competitors-table th {
    background: var(--bg-main);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-medium);
}

.competitors-table input {
    width: 100%;
    padding: 0.5rem;
    border: none;
    background: transparent;
}

.competitors-table input:focus {
    outline: none;
    background: rgba(201, 169, 98, 0.05);
}

/* Products List */
.product-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    border: none;
    background: transparent;
    padding: 0;
}

.product-name:focus {
    outline: none;
    border-bottom: 2px solid var(--gold);
}

/* Team Members */
.team-member {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

/* Financial Table */
.financial-table {
    overflow-x: auto;
}

.financial-table table {
    width: 100%;
    border-collapse: collapse;
}

.financial-table th,
.financial-table td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: right;
}

.financial-table th {
    background: var(--bg-main);
    font-size: 0.8125rem;
    font-weight: 600;
}

.financial-table th:first-child,
.financial-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.financial-table input {
    width: 100%;
    padding: 0.5rem;
    border: none;
    background: transparent;
    text-align: right;
    font-family: 'IBM Plex Mono', monospace;
}

.financial-table input:focus {
    outline: none;
    background: rgba(201, 169, 98, 0.05);
}

.financial-table .section-row td:first-child {
    font-weight: 600;
}

.financial-table .subtotal-row {
    background: var(--bg-main);
}

.financial-table .total-row {
    background: rgba(107, 28, 42, 0.05);
    font-weight: 600;
}

.financial-table .calculated {
    color: var(--text-medium);
    font-family: 'IBM Plex Mono', monospace;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.metric-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 0.375rem;
}

.metric-item input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'IBM Plex Mono', monospace;
}

/* File Upload */
.file-upload {
    position: relative;
}

.file-upload input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.file-upload label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    border: 2px dashed var(--border-dark);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-medium);
}

.file-upload label:hover {
    border-color: var(--burgundy);
    background: rgba(107, 28, 42, 0.02);
}

.file-upload svg {
    width: 32px;
    height: 32px;
    stroke: var(--text-light);
}

/* Section Navigation */
.section-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-actions {
        flex-wrap: wrap;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
}
