/* Reset and General Settings */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

:root {
    /* Color Palette */
    --bg-gradient-start: #0f172a; /* Slate 900 */
    --bg-gradient-end: #020617;   /* Slate 950 */
    
    --panel-bg: rgba(30, 41, 59, 0.45); /* Glass Slate */
    --panel-border: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #3b82f6;       /* Blue */
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.15);
    
    --success: #10b981;       /* Emerald */
    --success-hover: #059669;
    --success-glow: rgba(16, 185, 129, 0.15);
    
    --danger: #ef4444;        /* Rose/Red */
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.15);
    
    --warning: #f59e0b;       /* Amber */
    
    --excluded-bg: rgba(239, 68, 68, 0.08);
    --excluded-border: rgba(239, 68, 68, 0.2);
    --excluded-text: #fda4af;
    
    --font-heading: 'Outfit', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-primary);
    min-height: 100vh;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.sidebar.solid-sidebar {
    width: 250px;
    background-color: #1a2230; /* Dark solid blue-gray */
    border: none;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 0;
    z-index: 1000;
}

.layout-wrapper {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    max-width: 1920px;
    padding-left: 265px; /* Leave space for fixed sidebar */
}

/* --- IES Logo Placeholder --- */
.sidebar-logo-container {
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: center;
}

.ies-logo-placeholder {
    background-color: white;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.ies-logo-top {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.ies-logo-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #fbbf24 50%, #2563eb 50%);
}

.ies-logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: -1px;
    line-height: 1;
}

.ies-logo-sub {
    font-size: 0.5rem;
    color: #3b82f6;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

/* --- Dividers --- */
.sidebar-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.08);
    width: 100%;
}

/* --- Back Button --- */
.sidebar-back-btn {
    background-color: #334155;
    color: #cbd5e1;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
}

.sidebar-back-btn:hover {
    background-color: #475569;
    color: #f8fafc;
}

/* --- Navigation Items --- */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-item {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 0.8rem 1.25rem;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    margin: 0 0.5rem;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

.sidebar-item.active {
    background-color: #032b91; /* Deep blue from screenshot */
    color: #ffffff;
    box-shadow: none;
    font-weight: 600;
}

.sidebar-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

.sidebar-item.active i {
    opacity: 1;
    color: #ffffff;
}


.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0; /* allows it to shrink below content width if needed */
}

/* Glassmorphism panel base */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

/* Header & Filters Styling */
.app-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

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

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.brand h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.filters-container {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

select, input[type="text"], input[type="password"], input[type="number"], input[type="date"] {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

select:focus, input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2.25rem;
    min-width: 140px;
}

/* Button system */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 12px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background: var(--success-hover);
    box-shadow: 0 0 12px var(--success-glow);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 0 12px var(--danger-glow);
}

.btn-full {
    width: 100%;
}

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

/* Quick Data Entry */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) 150px;
    gap: 1rem;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.amount-input-wrapper input {
    width: 100%;
    padding-right: 2rem;
}

.currency-symbol {
    position: absolute;
    right: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}

/* Summary Dashboard Card system */
.summary-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.summary-card.income::before {
    background: var(--success);
}
.summary-card.expense::before {
    background: var(--danger);
}
.summary-card.net-profit::before {
    background: var(--primary);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.income .card-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.expense .card-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.net-profit .card-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.card-info h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.amount-display {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.net-profit-positive {
    color: var(--success);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.net-profit-negative {
    color: var(--danger);
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

/* Tables Section */
.transactions-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.table-section {
    padding: 0;
    overflow: hidden;
}

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

.table-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.income-header h2 {
    color: #93c5fd; /* Soft Blue/Cyan */
}

.expense-header h2 {
    color: #fca5a5; /* Soft Red */
}

.subtitle {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.table-wrapper {
    overflow-x: auto;
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.financial-table th {
    background: rgba(15, 23, 42, 0.3);
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
 
.financial-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.financial-table tbody tr {
    transition: background-color 0.2s ease;
}

.financial-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* Custom Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-logo {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-manual {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Inclusion checkbox container styling */
.checkbox-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkbox-btn {
    cursor: pointer;
    font-size: 1.25rem;
    transition: transform 0.15s ease, color 0.15s ease;
    border: none;
    background: none;
    outline: none;
}

.checkbox-btn:hover {
    transform: scale(1.15);
}

.checkbox-btn.included {
    color: var(--success);
}

.checkbox-btn.excluded {
    color: var(--danger);
}

/* Excluded Row Styling */
tr.excluded-row {
    background-color: var(--excluded-bg) !important;
    border-left: 3px solid var(--danger);
}

tr.excluded-row td {
    color: var(--text-muted);
    text-decoration: line-through;
}

tr.excluded-row td.actions-cell, tr.excluded-row td.checkbox-cell {
    text-decoration: none;
}

tr.excluded-row td.amount-cell {
    opacity: 0.6;
}

/* Action button icons styling */
.action-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    padding: 0.35rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.15rem;
}

.action-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.action-icon-btn.edit-btn:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.15);
}

.action-icon-btn.delete-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 17, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-primary);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.25rem;
}

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

.modal-body {
    /* Existing content for modal-body could go here */
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal-btn:hover {
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.disabled-input {
    background: rgba(15, 23, 42, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;            /* çok buton sığmazsa taşmak yerine alt satıra geç */
    gap: 0.75rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}
.modal-footer .btn { white-space: nowrap; }  /* "SQL Test Et" tek satır, kare kırılma olmasın */

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

.financial-table tbody tr {
    animation: fadeIn 0.3s ease forwards;
}

/* Inline Add Company Styles */
.select-with-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-inline-btn {
    padding: 0.6rem 0.8rem;
    height: 38px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.add-inline-btn:hover {
    background: var(--success-glow);
    color: #ffffff;
    border-color: var(--success);
    transform: scale(1.05);
}

/* Navigation Tabs Styles */
.view-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #ffffff;
    background: var(--primary-glow);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* View Containers and reports layout */
.view-container {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease forwards;
}

.view-container.active {
    display: flex;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 1.5rem;
}

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

/* Eşleştirme (Matching) Stilleri */

/* Satış tablosunda aktif seçili satış faturası satırı */
tr.active-sale-row {
    background: rgba(59, 130, 246, 0.15) !important;
    border-left: 4px solid var(--primary) !important;
    box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.1);
}

/* Alış tablosunda eşleştirilmiş alış satırları */
/* Alış/Satış Tablosunda Tam Eşleşen Manuel Satırlar (Yeşil) */
tr.matched-purchase-row, tr.matched-sale-row {
    background: rgba(16, 185, 129, 0.15) !important;
    border-left: 4px solid var(--success) !important;
}

tr.matched-purchase-row td, tr.matched-sale-row td {
    color: #e2e8f0;
}

/* Alış/Satış Tablosunda Kısmi Eşleşen Manuel Satırlar (Turuncu) */
tr.partially-matched-purchase-row, tr.partially-matched-sale-row {
    background: rgba(245, 158, 11, 0.12) !important;
    border-left: 4px solid var(--warning) !important;
}

tr.partially-matched-purchase-row td, tr.partially-matched-sale-row td {
    color: #e2e8f0;
}

/* Sihirbaz Eşleştirme (Wizard Match) Stilleri */

/* Alış/Satış Tablosunda Sihirbazla Tam Eşleşen Satırlar (Mor) */
tr.wizard-matched-purchase-row, tr.wizard-matched-sale-row {
    background: rgba(139, 92, 246, 0.15) !important;
    border-left: 4px solid #8b5cf6 !important;
}
tr.wizard-matched-purchase-row td, tr.wizard-matched-sale-row td {
    color: #e2e8f0;
}

/* Alış/Satış Tablosunda Sihirbazla Kısmi Eşleşen Satırlar (Açık Mor/Kesikli) */
tr.wizard-partially-matched-purchase-row, tr.wizard-partially-matched-sale-row {
    background: rgba(139, 92, 246, 0.08) !important;
    border-left: 4px dashed #a78bfa !important;
}
tr.wizard-partially-matched-purchase-row td, tr.wizard-partially-matched-sale-row td {
    color: #e2e8f0;
}

/* Dimmed Row for UI visual filtering */
tr.dimmed-row {
    display: none !important;
}
tr.dimmed-row td {
    color: var(--text-muted) !important;
}

/* Eşleştirme butonu */

.match-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    padding: 0.35rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.15rem;
}

.match-action-btn:hover {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.15);
}

/* Sağdan Kayarak Açılan Eşleştirme Paneli */
.match-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 17, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: flex-end;
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-overlay.active {
    display: flex;
    opacity: 1;
}

.match-panel {
    width: 850px;
    max-width: 95vw;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem;
}

.match-overlay.active .match-panel {
    transform: translateX(0);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.match-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-match-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-match-btn:hover {
    color: #fff;
}

.selected-sale-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.selected-sale-card h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.selected-sale-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.selected-sale-item span {
    color: var(--text-secondary);
    display: block;
    font-size: 0.75rem;
    margin-bottom: 0.15rem;
}

.selected-sale-item strong {
    color: #fff;
}

.purchase-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.purchase-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.purchase-list-header h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-primary);
}

.purchase-search {
    width: 100%;
    margin-bottom: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
}

.purchase-list-wrapper {
    flex: 1;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.4);
}

.purchase-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.purchase-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.purchase-item.selected {
    background: rgba(16, 185, 129, 0.08);
}

.purchase-checkbox {
    flex-shrink: 0;
    margin-right: 1rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.purchase-details {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.2fr;
    gap: 0.75rem;
    font-size: 0.8rem;
    align-items: center;
    margin-right: 1rem;
}

.purchase-details > div {
    min-width: 0;
}

.purchase-title {
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.purchase-desc {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.purchase-amount {
    text-align: right;
    font-weight: 600;
    color: var(--danger);
}

.purchase-isyeri {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.purchase-qty-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.purchase-qty-info strong {
    color: var(--warning);
}

.purchase-qty-match-container {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    width: 85px;
}

.purchase-qty-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.purchase-qty-input:focus {
    border-color: var(--success);
}

.purchase-qty-input:disabled {
    background: rgba(15, 23, 42, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
}

.match-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-summary-info {
    font-size: 0.85rem;
}

.match-summary-info div {
    margin-bottom: 0.25rem;
}

.match-actions {
    display: flex;
    gap: 0.5rem;
}

/* Legend Interactive Filters */
.legend-item {
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.legend-item.active {
    color: #fff;
}

.legend-item[data-filter="full-manual"].active {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.legend-item[data-filter="partial-manual"].active {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.legend-item[data-filter="full-wizard"].active {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.legend-item[data-filter="partial-wizard"].active {
    background: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.2);
}

/* Toast Notifications */
.toast-notification {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--primary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 250px;
    font-size: 0.95rem;
}
.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}
.toast-notification.success { border-left-color: var(--success); }
.toast-notification.error { border-left-color: var(--danger); }
.toast-notification.warning { border-left-color: var(--warning); }
.toast-icon { font-size: 1.2rem; }
.toast-success-icon { color: var(--success); }
.toast-error-icon { color: var(--danger); }
.toast-warning-icon { color: var(--warning); }

/* ==========================================================================
   EXECUTIVE SUMMARY DASHBOARD (YÖNETİCİ ÖZETİ)
   ========================================================================== */
.executive-summary {
    margin-top: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.executive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.exec-card {
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.exec-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.exec-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

/* Gauge Chart Styles */
.gauge-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 80%;
    max-height: 180px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 3.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out, stroke 0.5s ease;
}

.percentage {
    fill: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.5em;
    font-weight: bold;
    text-anchor: middle;
}

.gauge-desc {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Top 5 Lists Styles */
.top-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: background 0.2s ease;
}

.top-list li:hover {
    background: rgba(15, 23, 42, 0.8);
}

.top-list li.empty-list {
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.client-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 65%;
}

.client-amount {
    font-weight: 700;
    font-size: 0.95rem;
    font-family: var(--font-mono);
}

#topCustomersList li { border-left-color: var(--success); }
#topCustomersList .client-amount { color: var(--success); }

#topSuppliersList li { border-left-color: var(--danger); }
#topSuppliersList .client-amount { color: var(--danger); }


/* ============================================================
   MOBİL UYUMLULUK (Responsive) — paylaşılan kurallar
   ============================================================ */

/* Hamburger butonu (mobilde görünür) ve sidebar overlay */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 13000;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    color: #fff;
    font-size: 1.35rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 11999;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

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

@media (max-width: 768px) {
    /* Ekran dışı paneller (sidebar/detay paneli) yatay taşma yaratmasın */
    html, body { overflow-x: hidden; max-width: 100%; }

    body { padding: 0.6rem; }

    /* Hamburger görünür olsun */
    .mobile-menu-btn { display: flex; }

    /* Sabit sidebar -> kayan çekmece (drawer) */
    .sidebar.solid-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 260px;
        z-index: 12000;
    }
    .sidebar.solid-sidebar.open {
        transform: translateX(0);
        box-shadow: 6px 0 32px rgba(0,0,0,0.55);
    }

    /* İçeriği sidebar boşluğundan kurtar */
    .layout-wrapper {
        padding-left: 0 !important;
        flex-direction: column;
        gap: 1rem;
        padding-top: 3.5rem; /* hamburger barı için yer */
    }

    /* Filtreler ve grid'ler tek sütun */
    .filters-container { grid-template-columns: 1fr !important; }
    .kpi-grid,
    .stats-grid,
    .dashboard-grid,
    .reports-grid { grid-template-columns: 1fr !important; }

    /* App header dikey */
    .app-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
        text-align: center;
    }

    /* Geniş tablolar yatay kaydırılabilir olsun (sıkışmasın) */
    .financial-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .table-container { overflow-x: auto; }

    /* Modallar tam genişlik */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 90vh;
        overflow-y: auto;
    }
    /* Modal içi iki sütunlu form grid'leri tek sütun */
    .modal-body > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Butonları ve form satırlarını sar */
    .toolbar, .table-header, .form-row { flex-wrap: wrap !important; }
}

@media (max-width: 480px) {
    h1, .app-title { font-size: 1.25rem !important; }
    .modal-content { width: 100% !important; max-width: 100% !important; border-radius: 12px 12px 0 0; }
    .btn { font-size: 0.8rem; }
}

/* ============================================================
   AÇIK TEMA — TanaHub shell teması "light" olduğunda aktif.
   tanahub.js, shell'in postMessage'ından <html data-theme="light">
   set eder. Standalone (data-theme yok) koyu tema aynen kalır.
   ============================================================ */
html[data-theme="light"] {
    --bg-gradient-start: #f1f5f9;
    --bg-gradient-end:   #e2e8f0;
    --panel-bg:    #ffffff;
    --panel-border: rgba(15, 23, 42, 0.10);
    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;
    --primary-glow:   rgba(59, 130, 246, 0.10);
    --success-glow:   rgba(16, 185, 129, 0.10);
    --danger-glow:    rgba(239, 68, 68, 0.10);
}
html[data-theme="light"] body {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #0f172a;
}
/* Paneller / kartlar / header */
html[data-theme="light"] .glass-panel,
html[data-theme="light"] .app-header,
html[data-theme="light"] .summary-card,
html[data-theme="light"] .modal-content {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
    backdrop-filter: none !important;
}
/* Sidebar (embedded'da üst bar) */
html[data-theme="light"] .sidebar.solid-sidebar {
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .sidebar-item { color: #475569 !important; }
html[data-theme="light"] .sidebar-item:hover { background: rgba(15,23,42,0.05) !important; color:#0f172a !important; }
html[data-theme="light"] .sidebar-item.active { background: var(--primary-glow) !important; color: var(--primary) !important; }
/* Form elemanları */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    background: #f8fafc !important;
    border: 1px solid rgba(15, 23, 42, 0.15) !important;
    color: #0f172a !important;
}
/* Tablolar */
html[data-theme="light"] table th { color: #64748b !important; }
html[data-theme="light"] table td,
html[data-theme="light"] table th { border-color: rgba(15, 23, 42, 0.08) !important; }
/* Derin mavi vurgu (#032b91) -> daha yumuşak */
html[data-theme="light"] [style*="#032b91"],
html[data-theme="light"] .deep-blue { background-color: #1d4ed8 !important; }
/* Genel metin yumuşatma */
html[data-theme="light"] .muted,
html[data-theme="light"] .text-muted { color: #94a3b8 !important; }
/* Brand başlığı (gradient-text) açık temada düz koyu renk */
html[data-theme="light"] .brand h1 {
    background: none !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    color: var(--text-primary) !important;
}

/* ── Açık tema: modal başlık/gövde + kokpit slide-out detay paneli + sürükle panelleri ── */
html[data-theme="light"] .modal-header { background: #f8fafc !important; border-bottom: 1px solid rgba(15,23,42,0.08) !important; }
html[data-theme="light"] .modal-header h3 { color: #0f172a !important; }
html[data-theme="light"] .modal-body { background: #ffffff !important; }
html[data-theme="light"] .modal-footer { background: #f8fafc !important; border-top: 1px solid rgba(15,23,42,0.08) !important; }
/* Kokpit kayan E-Fatura detay paneli */
html[data-theme="light"] #invoiceDetailPanel { background: #ffffff !important; border-left: 1px solid rgba(15,23,42,0.10) !important; }
html[data-theme="light"] .detail-panel-header { background: linear-gradient(135deg,#eef2f7,#e2e8f0) !important; color: #0f172a !important; }
html[data-theme="light"] .detail-panel-header * { color: #0f172a !important; }
html[data-theme="light"] .detail-row { border-bottom-color: rgba(15,23,42,0.08) !important; }
html[data-theme="light"] .detail-section-title { border-bottom-color: rgba(15,23,42,0.12) !important; }
/* Genel: koyu temaya özel beyaz kenarlıkları açık temada koyuya çevir */
html[data-theme="light"] [style*="rgba(255, 255, 255"], 
html[data-theme="light"] [style*="rgba(255,255,255"] { border-color: rgba(15,23,42,0.10) !important; }

/* ── Açık tema: Logo eşleme modalı (#logoMappingModal kendi inline stilleri) ── */
html[data-theme="light"] #logoMappingModal .modal-content { background: #ffffff !important; border: 1px solid rgba(15,23,42,0.10) !important; }
html[data-theme="light"] #logoMappingModal .lmap-card,
html[data-theme="light"] #logoMappingModal .lmap-line { background: #f8fafc !important; border: 1px solid rgba(15,23,42,0.08) !important; }
html[data-theme="light"] #logoMappingModal .lmap-in { background: #ffffff !important; border: 1px solid rgba(15,23,42,0.15) !important; color: #0f172a !important; }
html[data-theme="light"] #logoMappingModal .lmap-label { color: #64748b !important; }
html[data-theme="light"] #logoMappingModal .lmap-sec { color: #7c3aed !important; }

/* Tıklanabilir KPI kartları (dashboard) */
.stat-clickable { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.stat-clickable:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.18); }
.stat-clickable:active { transform: translateY(-1px); }
html[data-theme="light"] .stat-clickable:hover { box-shadow: 0 10px 28px rgba(15,23,42,0.12); }

/* Açık tema: aktif sekme — beyaz yazı yerine mavi yazı + belirgin zemin (okunur) */
html[data-theme="light"] .tab-btn.active {
    color: #1d4ed8 !important;
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
    box-shadow: none !important;
}
html[data-theme="light"] .tab-btn { color: #475569; }
html[data-theme="light"] .tab-btn:hover { background: rgba(15,23,42,0.04); color: #0f172a; }

/* ============================================================
   TASARIM SİSTEMİ — Modern & Sade (ferah, yumuşak, temiz)
   Açık tema = embedded shell'in temel teması. Hepsi tutarlı.
   ============================================================ */

/* Ferah, sakin arka plan */
html[data-theme="light"] body { background: #f6f8fb !important; }

/* Kartlar: temiz beyaz, yumuşak çift gölge, ince kenar, yumuşak köşe */
html[data-theme="light"] .glass-panel,
html[data-theme="light"] .summary-card {
  background: #ffffff !important;
  border: 1px solid #edf0f4 !important;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 10px rgba(16,24,40,.04) !important;
  border-radius: 14px !important;
  backdrop-filter: none !important;
}
html[data-theme="light"] .glass-panel:hover {
  box-shadow: 0 6px 18px rgba(16,24,40,.08) !important;
  border-color: #e3e8ef !important;
}

/* Butonlar: modern, tutarlı (iki tema) */
.btn { border-radius: 10px; font-weight: 600; transition: all .15s ease; }
.btn:active { transform: translateY(1px); }
html[data-theme="light"] .btn-secondary {
  background: #f1f5f9 !important; border: 1px solid #e3e8ef !important; color: #334155 !important;
}
html[data-theme="light"] .btn-secondary:hover { background: #e8edf3 !important; }

/* Form alanları: temiz, ferah */
html[data-theme="light"] select,
html[data-theme="light"] input[type=text],
html[data-theme="light"] input[type=password],
html[data-theme="light"] input[type=number],
html[data-theme="light"] input[type=date],
html[data-theme="light"] textarea {
  background: #f9fafb !important;
  border: 1px solid #e3e8ef !important;
  color: #0f172a !important;
  border-radius: 10px !important;
}
html[data-theme="light"] select:focus,
html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12) !important;
  background: #ffffff !important;
}
html[data-theme="light"] select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important; background-position: right 0.75rem center !important; background-size: 1em !important;
}

/* Tipografi: net hiyerarşi */
html[data-theme="light"] h1 { color: #0f172a; }
html[data-theme="light"] h2 { color: #0f172a; }
html[data-theme="light"] h3 { color: #1e293b; }
html[data-theme="light"] label { color: #475569; }

/* Tablolar: sakin, okunur */
html[data-theme="light"] table th {
  color: #64748b !important; font-weight: 600 !important; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: .03em;
}
html[data-theme="light"] table td { color: #334155 !important; }
html[data-theme="light"] table tbody tr:hover td { background: #f8fafc !important; }
html[data-theme="light"] table th, html[data-theme="light"] table td { border-color: #eef1f5 !important; }

/* Modal: ferah, yumuşak */
html[data-theme="light"] .modal-content {
  border-radius: 16px !important;
  box-shadow: 0 20px 50px rgba(16,24,40,.16) !important;
  border: 1px solid #edf0f4 !important;
}
