/* ==========================================================================
   関通ホールディングス株式会社
   倉庫自動化 ✕ 省力化補助金ROI診断ナビ (Logi-Robo Navi)
   Design: Clean Enterprise B2B Light Style (Apple Minimal ✕ High Trust & Legibility)
   ========================================================================== */

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sub: #f1f5f9;
    --bg-highlight: #ecfdf5;
    
    --border-color: #e2e8f0;
    --border-dark: #cbd5e1;
    --border-focus: #0284c7;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --primary-sky: #0284c7;
    --primary-sky-hover: #0369a1;
    --primary-blue: #1e40af;
    --accent-emerald: #059669;
    --accent-emerald-dark: #047857;
    --accent-amber: #d97706;
    --accent-rose: #e11d48;
    --accent-indigo: #4f46e5;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans JP', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
    flex: 1;
}

/* 🏢 HEADER */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.company-badge {
    padding: 0.35rem 0.8rem;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-sky);
    white-space: nowrap;
}

.system-title {
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.system-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

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

.mode-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-sub);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.mode-toggle-btn.admin-mode {
    background: #fef3c7;
    border-color: #fde68a;
    color: var(--accent-amber);
}

/* 📑 TABS NAVIGATION */
.tabs-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary-sky);
    background: #f0f9ff;
}

.tab-btn.active {
    color: #ffffff;
    background: var(--primary-sky);
    border-color: var(--primary-sky);
    box-shadow: var(--shadow-sm);
}

/* 📊 TAB CONTENT */
.tab-pane {
    display: none;
    animation: fadeIn 0.25s ease;
}

.tab-pane.active {
    display: block;
}

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

/* GRID LAYOUTS */
.sim-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr;
    gap: 1.5rem;
}

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

/* CARDS */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

/* FORM CONTROLS & SLIDERS */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-sky);
    font-family: 'Outfit', sans-serif;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-sky);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
    transition: all 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* CHECKBOX & SWITCH TILES */
.equip-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.equip-tile {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.equip-tile:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.equip-tile.selected {
    background: #f0fdf4;
    border-color: #86efac;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.1);
}

.equip-tile input[type="checkbox"] {
    margin-top: 0.2rem;
    accent-color: var(--accent-emerald);
    width: 16px;
    height: 16px;
}

.equip-tile-content h4 {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.equip-tile-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.equip-price-tag {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-emerald);
    margin-top: 0.35rem;
}

/* 💰 RESULTS KPI DASHBOARD */
.kpi-banner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.kpi-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    text-align: center;
    position: relative;
}

.kpi-card.highlight {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.kpi-value.green {
    color: var(--accent-emerald);
}

.kpi-value.sky {
    color: var(--primary-sky);
}

.kpi-subtext {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ⚖️ 2-AXIS COMPARISON BARS */
.comparison-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.comp-row {
    margin-bottom: 1rem;
}

.comp-row:last-child {
    margin-bottom: 0;
}

.comp-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.comp-bar-bg {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.comp-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.comp-bar-fill.normal {
    background: #94a3b8;
}

.comp-bar-fill.subsidy {
    background: linear-gradient(90deg, #10b981, #0284c7);
}

/* CALL TO ACTION BUTTON */
.cta-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-top: 1.25rem;
}

.cta-text h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-sky);
    margin-bottom: 0.2rem;
}

.cta-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* INTERNAL ADMIN MODE STYLES */
.admin-card {
    border-color: #fde68a;
    background: #fffbeb;
}

.badge-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-amber { background: #fef3c7; color: #b45309; }
