/* Hafif Çelik CAD, Sunum & Teklif Yazılımı Stilleri */
:root {
    --bg-dark: #0f172a;
    --bg-panel: #1e293b;
    --bg-surface: #334155;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #38bdf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --sidebar-width: 380px;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ========================================================
   SOL PANEL: PARAMETRELER VE GİRDİLER (SIDEBAR)
   ======================================================== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 20;
    box-shadow: 4px 0 16px rgba(0,0,0,0.3);
}

.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #1e293b 0%, #172033 100%);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), #0284c7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 10px rgba(37,99,235,0.4);
}

.logo-text h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.logo-text span {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* Accordion Form Grupları */
.form-group-card {
    background-color: #162032;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.form-group-card:hover {
    border-color: #475569;
}

.card-title {
    padding: 12px 14px;
    background-color: rgba(255,255,255,0.02);
    font-size: 12.5px;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 14px;
}

.input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

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

.input-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

input, select {
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #f1f5f9;
    padding: 7px 10px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
}

/* Alt Butonlar */
.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #131b2c;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #334155;
    color: #e2e8f0;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

/* ========================================================
   ANA ÇALIŞMA ALANI (MAIN WORKSPACE)
   ======================================================== */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
}

/* Üst Navigasyon ve Sekmeler */
.top-navbar {
    height: 58px;
    min-height: 58px;
    background-color: #172133;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.nav-tabs {
    display: flex;
    gap: 6px;
}

.nav-tab {
    padding: 9px 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.nav-tab:hover {
    color: #ffffff;
    background-color: rgba(255,255,255,0.05);
}

.nav-tab.active {
    color: #ffffff;
    background-color: var(--primary);
    box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}

.kpi-badges {
    display: flex;
    gap: 12px;
}

.kpi-badge {
    background-color: #0f172a;
    border: 1px solid #334155;
    padding: 6px 12px;
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.kpi-badge .kpi-label {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.kpi-badge .kpi-val {
    font-size: 13px;
    font-weight: 700;
    color: #38bdf8;
}

.kpi-badge.safe .kpi-val {
    color: #22c55e;
}

.kpi-badge.danger .kpi-val {
    color: #ef4444;
}

.tab-content {
    flex: 1;
    position: relative;
    display: none !important;
    height: calc(100vh - 58px);
    overflow: hidden;
}

.tab-content.active {
    display: flex !important;
}

/* --- TAB 1: 3D VIEWPORT --- */
#tab-3d {
    width: 100%;
    height: 100%;
    position: relative;
}

#viewport-3d {
    width: 100%;
    height: 100%;
}

.floating-controls {
    position: absolute;
    top: 20px;
    left: 24px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.floating-views {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 6px 10px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.chip-btn {
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip-btn:hover {
    background-color: #334155;
    color: white;
}

.chip-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* --- TAB 2: 2D PAFTALAR --- */
#tab-2d {
    width: 100%;
    height: 100%;
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    background-color: #0b0f19;
}

.sheet-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #162032;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.sheet-selector {
    display: flex;
    gap: 8px;
}

#sheet-container {
    flex: 1;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- TAB 3: METRAJ & BOM --- */
#tab-bom, #tab-analysis, #tab-proposal {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.data-card {
    background-color: #162032;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.data-card-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.custom-table th {
    background-color: #0f172a;
    color: #94a3b8;
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.custom-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #e2e8f0;
}

.custom-table tr:hover td {
    background-color: rgba(255,255,255,0.02);
}

.custom-table tfoot td {
    background-color: #0f172a;
    font-weight: 700;
    color: #38bdf8;
    border-top: 1px solid var(--border);
}

/* Statik Kartları */
.statik-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.check-card {
    background-color: #0f172a;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-card.passed {
    border-left: 4px solid var(--success);
}

.check-card.failed {
    border-left: 4px solid var(--danger);
}

.check-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.check-head h3 {
    font-size: 13.5px;
    font-weight: 700;
}

.badge-tag {
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
}

.badge-tag.passed {
    background-color: rgba(34,197,94,0.15);
    color: #4ade80;
}

.badge-tag.failed {
    background-color: rgba(239,68,68,0.15);
    color: #f87171;
}

.progress-bar-bg {
    height: 8px;
    background-color: #1e293b;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-fill.safe {
    background-color: var(--success);
}

.progress-fill.danger {
    background-color: var(--danger);
}

/* Scrollbar Özelleştirme */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: #0f172a;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Preset Buttons (Genişlik & Yükseklik Hızlı Seçiciler) */
.preset-pills .chip-btn {
    padding: 3px 7px;
    font-size: 10.5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-pills .chip-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: #38bdf8;
}

.preset-pills .chip-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    font-weight: 700;
}

/* 3D Viewport HUD Scale Bar (Aydınlık CAD Teması) */
.scale-bar-hud {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08) !important;
}
.scale-bar-hud #hudScaleText {
    color: #0284c7 !important;
}

/* 3D Yüzer Kontroller Aydınlık Cam Efekti */
.floating-controls, .floating-views {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
}
.floating-controls .chip-btn, .floating-views .chip-btn {
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
}
.floating-controls .chip-btn:hover, .floating-views .chip-btn:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}
.floating-controls .chip-btn.active, .floating-views .chip-btn.active {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* ========================================================
   SEKME 5: KURUMSAL BEYAZ TEKLİF DÖKÜMAN TASARIMI
   ======================================================== */
#tab-proposal {
    background-color: #f1f5f9 !important;
    padding: 30px 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
}

.proposal-doc {
    background-color: #ffffff;
    color: #1e293b;
    max-width: 960px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    padding: 36px 44px;
    border: 1px solid #e2e8f0;
    margin-bottom: 40px;
}

.proposal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.proposal-company h2 {
    font-size: 22px;
    font-weight: 800;
    color: #1e3a8a;
    letter-spacing: 0.5px;
}
.proposal-company span {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.proposal-client-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.proposal-client-box .meta-item label {
    font-size: 10.5px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
}
.proposal-client-box .meta-item div {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
}

.proposal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 12.5px;
}
.proposal-table th {
    background-color: #1e3a8a;
    color: #ffffff;
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
}
.proposal-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}
.proposal-table tr:nth-child(even) td {
    background-color: #f8fafc;
}
.proposal-table tfoot td {
    padding: 12px 14px;
    border-top: 2px solid #cbd5e1;
    font-weight: 700;
}
.proposal-grand-total,
.proposal-grand-total td {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    font-size: 15px !important;
}

/* ========================================================
   FİYAT & MALZEME AYARLARI MODALİ
   ======================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.modal-overlay.show,
.modal-overlay.active {
    display: flex;
}
.modal-container {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    width: 90%;
    max-width: 920px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 45px rgba(0,0,0,0.6);
    overflow: hidden;
}
.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #162032;
}
.modal-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close-btn:hover {
    color: #ffffff;
}
.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.modal-section {
    background: #162032;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 14px 18px;
}
.modal-section-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 12px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}
.modal-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.modal-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #162032;
}

