/* Source: resources/views/test/netshow_iq1/finops_sentinel.blade.php (block 1) */
:root {
    --bg: #0F1216;
    --surface: #171B21;
    --card: #21262E;
    --card-hover: #262C35;
    --border: #2A313A;
    --separator: #2F3640;
    --text: #E7ECF2;
    --text-secondary: #A9B2BF;
    --text-muted: #7D8896;
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-pressed: #1D4ED8;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #06B6D4;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow: 0 8px 24px rgba(0,0,0,.25);
    --shadow-sm: 0 4px 12px rgba(0,0,0,.15);
    --focus: 0 0 0 2px #3B82F6, 0 0 0 6px rgba(59,130,246,.24);
    --glow: 0 0 20px rgba(59,130,246,.3);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 14px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--surface);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Header */
.page-header {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-pressed) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--glow);
}

.brand-text h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.brand-text p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    letter-spacing: 0.02em;
}

/* Main Container */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    position: relative;
}

.card-section::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,.05);
    pointer-events: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--separator);
}

.section-icon {
    font-size: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    flex: 1;
}

/* Help Tooltip */
.help-trigger {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.help-trigger:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

.help-trigger {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.help-trigger:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Global help popup - lives outside cards */
#helpPopup {
    position: fixed;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.6);
    z-index: 99999;
    display: none;
}

#helpPopup.active {
    display: block;
}

#helpPopup h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 8px 0;
}

#helpPopup p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Form Elements */
.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.02em;
}

.form-label .emoji {
    font-size: 14px;
}

.required-star {
    color: var(--danger);
    font-size: 11px;
}

.form-control, .form-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px 16px;
    font-size: 14px;
    height: auto;
    min-height: 46px;
    transition: all 0.18s ease;
}

.form-control:focus, .form-select:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: var(--focus);
    color: var(--text);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23A9B2BF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    cursor: pointer;
}

.form-select option {
    background: var(--surface);
    color: var(--text);
    padding: 12px;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s ease;
}

.checkbox-item:hover {
    border-color: var(--primary);
    background: var(--card-hover);
}

.checkbox-item.checked {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.checkbox-item input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.18s ease;
}

.checkbox-item input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.checkbox-label {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

.checkbox-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Radio Cards */
.radio-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

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

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-card-content {
    padding: 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.2s ease;
}

.radio-card:hover .radio-card-content {
    border-color: var(--primary);
}

.radio-card input:checked + .radio-card-content {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: var(--glow);
}

.radio-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.radio-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.radio-card-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* Financial Inputs Grid */
.financial-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 576px) {
    .financial-grid {
        grid-template-columns: 1fr;
    }
}

.input-group-text {
    background: var(--surface);
    border: 1px solid var(--border);
    border-right: none;
    color: var(--text-muted);
    font-size: 14px;
    padding: 12px 14px;
}

.input-group .form-control {
    border-left: none;
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary);
}

/* Pill Selectors */
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill-option {
    position: relative;
}

.pill-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pill-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s ease;
}

.pill-label:hover {
    border-color: var(--primary);
    color: var(--text);
}

.pill-option input:checked + .pill-label {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

@media (max-width: 1024px) {
    .sidebar {
        position: relative;
        top: 0;
    }
}

.sidebar-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--separator);
    font-size: 13px;
    color: var(--text-muted);
}

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

.progress-item.completed {
    color: var(--success);
}

.progress-item.active {
    color: var(--primary);
}

.progress-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.progress-item.completed .progress-check {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.progress-item.active .progress-check {
    border-color: var(--primary);
    color: var(--primary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-ready {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

/* Generate Button */
.generate-section {
    background: linear-gradient(180deg, var(--card) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.btn-generate {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-pressed) 100%);
    border: none;
    color: white;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--glow);
    width: 100%;
    max-width: 300px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Output Section */
.output-section {
    display: none;
}

.output-section.visible {
    display: block;
}

.output-container {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.output-container pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.btn-copy {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-copy:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-copy.copied {
    background: var(--success);
    border-color: var(--success);
}

/* Quick Tips */
.tip-card {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
}

.tip-card h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tip-card p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.tip-card ul {
    margin: 8px 0 0 0;
    padding-left: 16px;
}

.tip-card li {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0;
}

/* Divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%);
    margin: 8px 0 20px;
}

/* Step Indicators */
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

/* Module Cards Grid */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.module-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.module-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.module-card.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.module-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.module-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.module-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.module-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

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

.card-section {
    animation: fadeIn 0.3s ease forwards;
}

.card-section:nth-child(1) { animation-delay: 0.05s; }
.card-section:nth-child(2) { animation-delay: 0.1s; }
.card-section:nth-child(3) { animation-delay: 0.15s; }
.card-section:nth-child(4) { animation-delay: 0.2s; }
.card-section:nth-child(5) { animation-delay: 0.25s; }
.card-section:nth-child(6) { animation-delay: 0.3s; }
.card-section:nth-child(7) { animation-delay: 0.35s; }

/* Mobile sticky button */
@media (max-width: 1024px) {
    .mobile-submit {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding: 16px 24px;
        z-index: 100;
    }

    .main-container {
        padding-bottom: 100px;
    }
}

@media (min-width: 1025px) {
    .mobile-submit {
        display: none;
    }
}
