:root {
    --office-blue: #185c37;
    --primary: #1a3c63;
    --secondary: #2b5797;
    --ribbon-bg: #f3f2f1;
    --ribbon-border: #e1dfdd;
    --bg: #e6e6e6;
    --text: #333;
    --grid-border: #d4d4d4;
    --cell-bg: #fff;
    --cell-alt: #f9f9f9;
}

body {
    font-family: 'Segoe UI', Calibri, Arial, sans-serif;
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden; 
    overflow-y: auto;
}

/* OFİS PROGRAMI (RIBBON) MENÜSÜ */
.ribbon-container {
    width: 100%;
    background-color: var(--secondary);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}
.ribbon-header {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cloud-status {
    font-size: 11px;
    background: #28a745;
    padding: 2px 6px;
    border-radius: 10px;
    color: white;
}
.ribbon-toolbar {
    background-color: var(--ribbon-bg);
    border-bottom: 1px solid var(--ribbon-border);
    padding: 4px 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    color: #333;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.toolbar-group {
    display: flex;
    gap: 4px;
    padding-right: 8px;
    border-right: 1px solid #ccc;
    flex-shrink: 0;
}
.toolbar-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 5px 8px;
    font-size: 11px;
    color: #333;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.toolbar-btn:hover, .toolbar-btn.active {
    background-color: #e1dfdd;
    border: 1px solid #c8c6c4;
}
.toolbar-icon { 
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
}
.toolbar-icon svg { width: 18px; height: 18px; }

/* ANA İÇERİK ALANI */
.main-workspace {
    width: 100%;
    flex: 1;
    overflow: auto;
    padding: 15px 10px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.page-container {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
}
.page-container.active {
    display: flex;
}

/* FİŞ STİLLERİ */
.invoice-container {
    width: 210mm;
    min-height: 297mm;
    background: white;
    padding: 15mm;
    box-sizing: border-box;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border: 1px solid #ccc;
    transform-origin: top center;
}

.header { display: flex; justify-content: space-between; align-items: center; }
.fatura-logo { max-width: 250px; max-height: 80px; object-fit: contain; }
.fatura-title { font-size: 50px; color: #447294; font-weight: bold; text-align: right; line-height: 1.1; }
.divider-thick { border-top: 3px solid #447294; margin: 15px 0; }
.divider-thin { border-top: 1px solid #447294; margin: 15px 0; }
.info-section { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 20px; }
.company-name { font-weight: bold; color: #444; font-size: 15px; }
.company-sub { color: #888; margin-top: 3px; padding-left: 20px; }
.meta-table { border-collapse: collapse; }
.meta-table td { padding: 2px 5px; }
.meta-table .lbl { text-align: right; color: #555; }
.meta-table input { color: #777; font-weight: bold; }
.address-section { display: flex; justify-content: center; gap: 50px; margin: 30px 0; font-size: 12px; }
.address-table { border-collapse: collapse; }
.address-table td { padding: 2px 5px; }
.address-table .lbl { text-align: right; color: #333; width: 90px; }

input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.invoice-container input, .invoice-container select {
    border: 1px solid transparent; background: transparent; font-family: inherit; font-size: inherit; outline: none; width: 100%;
}
.invoice-container input:focus { border: 1px solid #2b5797; background: #f0f8ff; }
.invoice-container select { border-bottom: 1px dashed #ccc; cursor: pointer; font-weight: bold; color: var(--primary); }

table.data-table { width: 100%; border-collapse: collapse; margin-top: 15px; border: 1px solid var(--grid-border); }
table.data-table th { background-color: #447294; color: white; padding: 6px; text-align: center; font-weight: normal; font-size: 13px; border: 1px solid #fff; }
table.data-table td { height: 24px; padding: 0; border: 1px solid var(--grid-border); }
table.data-table tr:nth-child(even) td { background-color: var(--cell-alt); }
table.data-table tr:nth-child(odd) td { background-color: var(--cell-bg); }
table.data-table td input { text-align: center; height: 100%; width: 100%; padding: 4px; box-sizing: border-box; color: #333; }
table.data-table td.label-cell { background-color: #e1dfdd; color: #333; text-align: right; padding-right: 15px; font-weight: bold; font-size: 13px; }

.footer { text-align: center; margin-top: 40px; font-size: 12px; color: #444; }

/* MÜŞTERİ SAYFASI (MOBİL UYUMLU DÜZENLEME) */
.customer-dashboard {
    width: 100%;
    max-width: 1400px;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: auto !important;
    min-height: calc(100vh - 120px);
}
.customer-form-side {
    width: 100%;
    background: #f9f9f9;
    border-bottom: 1px solid var(--grid-border);
    padding: 15px;
    box-sizing: border-box;
}
.customer-form-side h3 { margin-top: 0; color: var(--secondary); font-size: 16px; border-bottom: 2px solid var(--secondary); padding-bottom: 5px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; color: #555; margin-bottom: 3px; font-weight: 600; }
.form-group input { 
    width: 100%; padding: 6px; border: 1px solid #ccc; border-radius: 2px; box-sizing: border-box; 
    font-family: inherit; font-size: 13px;
}
.customer-list-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    width: 100%;
    overflow-x: auto;
}
.list-header {
    padding: 10px 20px;
    background: #e1dfdd;
    border-bottom: 1px solid var(--grid-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.list-header h2 { margin: 0; font-size: 16px; color: #333; }
.table-wrapper { 
    width: 100%;
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
}
.customer-table { 
    width: 100%; 
    border-collapse: collapse; 
    min-width: 650px;
}
.customer-table th, .customer-table td { border: 1px solid var(--grid-border); padding: 8px 10px; text-align: left; font-size: 13px; }
.customer-table th { background-color: var(--secondary); color: white; position: sticky; top: 0; font-weight: normal; z-index: 10; }
.customer-table tr:nth-child(even) { background-color: #f9f9f9; }
.customer-table tr:hover { background-color: #e5f1fb; } 

.action-btn {
    padding: 4px 8px; border: 1px solid #ccc; border-radius: 2px; cursor: pointer; background: white; color: #555; margin-right: 2px;
    display: inline-flex; align-items: center; justify-content: center;
}
.action-btn:hover { background: #e1dfdd; color: #000; }
.bakiye-pozitif { color: #d9534f; font-weight: bold; }
.bakiye-sifir { color: var(--accent); font-weight: bold; }
.btn-solid { background-color: var(--secondary); color: white; border: none; padding: 8px 15px; border-radius: 2px; cursor: pointer; font-weight: bold; font-size: 13px; }
.btn-solid:hover { background-color: #1a3c63; }

.modal-overlay { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.5); z-index: 2000; justify-content: center; align-items: center; }
.modal-content { background: white; padding: 0; border: 1px solid #ccc; width: 90%; max-width: 800px; max-height: 85vh; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.3); display: flex; flex-direction: column;}
.modal-header { display: flex; justify-content: space-between; align-items: center; background: var(--secondary); color: white; padding: 10px 15px; }
.modal-header h2 { margin: 0; font-size: 16px; font-weight: normal;}
.close-btn { background: transparent; color: white; border: none; cursor: pointer; font-size: 20px; font-weight: bold; display: flex; align-items: center; justify-content: center;}
.modal-body { padding: 15px; overflow-y: auto; flex: 1; background: #f9f9f9;}

.settings-card { background: white; border: 1px solid #ccc; box-shadow: 0 4px 10px rgba(0,0,0,0.1); width: 100%; max-width: 600px; padding: 30px; border-radius: 8px; margin-top: 20px; box-sizing: border-box; }
.settings-card h2 { color: var(--primary); border-bottom: 2px solid var(--secondary); padding-bottom: 10px; margin-top: 0; }
.logo-preview { width: 100%; max-width: 250px; height: 100px; border: 2px dashed #ccc; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; object-fit: contain; }

/* TABLET VE BİLGİSAYAR GÖRÜNÜMÜ */
@media (min-width: 768px) {
    .customer-dashboard { 
        flex-direction: row; 
        height: calc(100vh - 150px) !important; 
    }
    .customer-form-side { 
        width: 320px; 
        border-right: 1px solid var(--grid-border); 
        border-bottom: none; 
    }
    .customer-table {
        min-width: 100%;
    }
}

/* TELEFONLAR İÇİN ÖLÇEKLENDİRME */
@media (max-width: 767px) {
    .main-workspace { padding: 5px !important; align-items: center !important; }
    .invoice-container {
        width: 210mm !important;
        transform: scale(0.48);
        transform-origin: top center;
        margin-top: 0 !important;
        margin-bottom: -90px !important;
        box-shadow: none !important;
    }
    .customer-dashboard { height: auto; }
}

@media print {
    @page { size: A4 portrait; margin: 0; }
    body, html { margin: 0; padding: 0; background: white; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; display: block; width: 100%; height: 100%; overflow: visible;}
    .ribbon-container, .modal-overlay { display: none !important; }
    .main-workspace { padding: 0; overflow: visible; display: block;}
    #sayfa-fatura { display: block !important; margin: 0; padding: 0; width: 100%; }
    #sayfa-musteriler, #sayfa-ayarlar { display: none !important; }
    .invoice-container { transform: none !important; box-shadow: none !important; border: none !important; margin: 0 auto !important; padding: 15mm !important; width: 210mm !important; height: 297mm !important; box-sizing: border-box !important; page-break-after: avoid; }
    table.data-table td input { border: none !important; background: transparent !important; }
}