/* ==========================================================================
   TRIO MARINE DESIGN SYSTEM & CUSTOM CSS
   ========================================================================== */

/* --- CSS Variables & Themes --- */
:root {
    /* Ürün bazlı özel fiyat vurgusu — ekran, PDF ve Excel'de aynı kırmızı. */
    --special-price-color: #e11d48;

    --font-primary: 'Inter', sans-serif;
    --font-title: 'Outfit', sans-serif;

    /* Transition speeds */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-theme {
    --bg-app: #020617; /* Deeper slate */
    --bg-card: #0f172a;
    --bg-card-hover: #1e293b;
    --bg-input: #1e293b;
    --bg-header: rgba(15, 23, 42, 0.75); /* Glassmorphism prep */
    --bg-paper: #ffffff; /* Proposal paper is always white even in dark mode for PDF accuracy! */
    --text-paper: #0f172a;
    --border-paper: #cbd5e1;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #1e293b;
    --border-focus: #3b82f6;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-gradient: linear-gradient(135deg, #60a5fa, #3b82f6);
    --primary-light: rgba(59, 130, 246, 0.15);
    
    --secondary: #1e293b;
    --secondary-hover: #334155;
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: rgba(239, 68, 68, 0.15);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
    --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.15);
}

.light-theme {
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85); /* Glassmorphism prep */
    --bg-paper: #ffffff;
    --text-paper: #0f172a;
    --border-paper: #cbd5e1;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-gradient: linear-gradient(135deg, #60a5fa, #3b82f6);
    --primary-light: rgba(59, 130, 246, 0.1);
    
    --secondary: #ffffff;
    --secondary-hover: #f1f5f9;
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: rgba(239, 68, 68, 0.1);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-inset: inset 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* --- Base Reset & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}
::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}
::-webkit-scrollbar-thumb {
    background-color: rgba(100, 116, 139, 0.6);
    border-radius: 8px;
    border: 4px solid var(--bg-card);
    background-clip: padding-box;
}
.light-theme ::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.8);
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary);
    border: 3px solid var(--bg-card);
}

/* Base Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 600;
}

/* --- App Layout --- */
.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    height: 100vh;
    overflow: hidden;
}

/* --- App Header --- */



.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
    transition: all var(--transition-normal);
    position: relative;
    z-index: 10;
}

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

.brand-logo {
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.brand-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.brand-divider {
    width: 1px;
    height: 22px;
    background-color: var(--border-color);
    margin: 0 4px;
}

.brand-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- User Profile UI --- */
.user-profile {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    padding: 6px 6px 6px 12px;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    margin-left: auto;
    gap: 10px;
    transition: var(--transition-base);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    padding-right: 12px;
    margin-right: 2px;
    border-right: 1px solid var(--border-color);
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.btn-logout {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-logout:hover {
    background: #fee2e2;
    color: #ef4444;
}
/* ----------------------- */

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    background: var(--primary-gradient);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 15px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
}

/* Fix for buttons inside the white proposal paper in dark mode */
.proposal-paper .btn-secondary {
    color: var(--text-paper);
    border-color: var(--border-paper);
    background-color: rgba(15, 23, 42, 0.03); /* Very subtle gray to make it visible */
}

.proposal-paper .btn-secondary:hover {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
    color: #ffffff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 15px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background-color: var(--warning);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    background-color: #d97706; /* darker orange */
    color: #ffffff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 15px rgba(245, 158, 11, 0.3);
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background-color: #059669; /* darker green */
    color: #ffffff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 15px rgba(16, 185, 129, 0.3);
}

.btn-cancel {
    background-color: var(--border-color);
    color: var(--text-primary);
    border: none;
}

.btn-cancel:hover {
    background-color: var(--text-muted);
    color: #ffffff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-icon:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 16px 28px;
    font-size: 15px;
    border-radius: 12px;
}

/* Sun/Moon Toggle */
#btn-theme-toggle .icon-sun {
    display: none;
}
.light-theme #btn-theme-toggle .icon-moon {
    display: none;
}
.light-theme #btn-theme-toggle .icon-sun {
    display: block;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-focus);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.stat-icon.orange { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.stat-info h3 {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-info p {
    font-family: var(--font-title);
    font-size: 24px;
    font-weight: 700;
}

.stat-info .text-profit {
    font-size: 15px;
    font-family: var(--font-primary);
    color: var(--success);
    font-weight: 600;
}

/* --- Filter Section --- */
.filter-section {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background-color: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin: 0;
    transition: all var(--transition-normal);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 14px;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-inset);
}

.search-box input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group select {
    padding: 10px 16px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.filter-group select:focus {
    border-color: var(--border-focus);
}

.filter-actions-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-proposal-badge {
    background-color: var(--primary-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dashboard-proposal-badge strong {
    color: var(--primary);
    font-size: 15px;
}

/* Year Section Grouping styling */
.year-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

.year-header {
    font-family: var(--font-title);
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 16px;
    padding: 6px 16px;
    background: var(--bg-header); /* Glassmorphism background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    flex-shrink: 0;
    align-self: flex-start;
    position: relative;
    z-index: 10;
    margin-top: 8px;
}

/* --- Proposals Dashboard Table --- */
.proposals-list-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.list-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.dashboard-table th {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-table td {
    padding: 18px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.dashboard-table tr {
    transition: all var(--transition-normal);
}

.dashboard-table tbody tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.dashboard-table tr:last-child td {
    border-bottom: none;
}

.dashboard-table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 5;
}

.dashboard-table tbody tr:hover td {
    background-color: var(--bg-card-hover);
    border-color: transparent; /* Alt çizgi karışıklığını engeller */
}




.proposal-project-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proposal-client {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proposal-no-badge {
    font-family: monospace;
    background-color: var(--secondary);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-draft { background-color: rgba(100, 116, 139, 0.15); color: #94a3b8; }
.status-badge.status-sent { background-color: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-badge.status-completed { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }

select.status-badge {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    padding: 6px 30px 6px 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' 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 10px center;
    box-shadow: var(--shadow-sm);
}
select.status-badge:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
select.status-badge:hover {
    filter: brightness(0.9);
}
.dark-theme select.status-badge:hover {
    filter: brightness(1.2);
}
select.status-badge option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.actions-cell {
    text-align: right;
    white-space: nowrap;
}
.actions-cell .btn {
    margin-left: 6px;
}

.no-data-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    gap: 16px;
    color: var(--text-muted);
}

.no-data-view svg {
    width: 64px;
    height: 64px;
}

.no-data-view p {
    font-size: 15px;
    text-align: center;
}

/* ==========================================================================
   PROPOSAL EDITOR FULLSCREEN MODAL
   ========================================================================== */
.editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-app);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.editor-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Editor Top Navbar */
.editor-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.editor-title-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.editor-title-container h2 {
    font-size: 18px;
}

.editor-actions-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-profit-badge {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

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

.editor-profit-badge .badge-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
}

.status-dropdown-wrapper select {
    padding: 10px 14px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    outline: none;
}

/* Workspace Scroll Area */
.editor-workspace {
    flex: 1;
    overflow-y: auto;
    padding: 40px 24px 60px 24px;
    display: block;
    background-color: rgba(0, 0, 0, 0.2);
}

/* --- The Proposal Document (Paper) --- */
.proposal-paper {
    background-color: var(--bg-paper);
    color: var(--text-paper);
    width: 95%;
    max-width: 1550px;
    min-height: 1400px;
    margin: 0 auto;
    padding: 48px 50px 250px 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    border: 1px solid var(--border-paper);
}

/* Paper Header Layout */
.paper-header {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 24px;
}

.header-left-brand {
    flex: 1.4;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trio-logo-wrapper {
    display: flex;
    align-items: center;
}

.trio-logo-img {
    max-width: 220px;
    max-height: 70px;
    object-fit: contain;
    margin-bottom: 4px;
}

.trio-logo-title {
    font-family: var(--font-title);
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 2px;
}

.trio-address-block {
    font-size: 10.5px;
    color: #475569;
    line-height: 1.55;
}

.trio-company-name {
    font-weight: 700;
    font-size: 11.5px;
    color: #0f172a;
    margin-bottom: 3px;
}

.trio-address-item {
    margin-bottom: 1px;
}

.trio-web-item {
    margin-top: 2px;
    font-style: italic;
    font-size: 10px;
    color: #64748b;
}

.header-right-meta-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.meta-date-proposal-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 250px;
}

.meta-inline-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-label {
    font-weight: 700;
    font-size: 11px;
    color: #475569;
    width: 80px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-inline-input {
    flex: 1;
    border: none;
    border-bottom: 1px dashed transparent;
    background: transparent;
    padding: 4px 6px;
    font-family: var(--font-primary);
    font-size: 12px;
    color: #1e293b;
    transition: all var(--transition-fast);
    width: 100%;
}

.meta-inline-input:hover {
    border-bottom-color: #cbd5e1;
}

.meta-inline-input:focus {
    border-bottom-color: var(--primary);
    background-color: #f8fafc;
    outline: none;
}

.meta-inline-input[readonly] {
    color: #64748b;
    cursor: not-allowed;
    border-bottom: none;
}

/* Client Info Section */
.client-meta-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: -8px;
    padding: 10px 14px;
    max-width: 800px;
    width: 100%;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.client-meta-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.client-meta-label {
    font-weight: 700;
    font-size: 11px;
    color: #334155;
    width: 75px;
    display: inline-block;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.client-meta-input {
    flex: 1;
    border: none;
    border-bottom: 1px dashed transparent;
    background: transparent;
    padding: 2px 4px;
    font-family: var(--font-primary);
    font-size: 12px;
    color: #1e293b;
    transition: all var(--transition-fast);
    font-weight: 600;
    width: 100%;
}

.client-meta-input:hover {
    border-bottom-color: #cbd5e1;
}

.client-meta-input:focus {
    border-bottom-color: var(--primary);
    background-color: #f8fafc;
    outline: none;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    background-color: var(--secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
    margin-right: 8px;
}

.btn-lang {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 11px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

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

.btn-lang:hover:not(.active) {
    color: var(--text-primary);
}

/* ==========================================================================
   DYNAMIC PROPOSAL PARTS & ZONES
   ========================================================================== */
.parts-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.part-section {
    border: 1px solid #dce3ed;
    border-radius: 12px;
    background-color: #ffffff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.part-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

.part-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.part-letter {
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 700;
    background-color: #3b82f6;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.part-title-input {
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 8px;
    width: 60%;
    outline: none;
    transition: all var(--transition-fast);
}

.part-title-input:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.part-title-input:focus {
    background-color: #ffffff;
    border-color: var(--primary);
}

.part-actions {
    display: flex;
    gap: 8px;
}

/* Zone container */
.zones-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.zone-section {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    padding: 20px;
}

.zone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.zone-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.zone-number-badge {
    font-family: var(--font-title);
    font-size: 13px;
    font-weight: 700;
    background-color: #6366f1;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zone-title-input {
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    border: 2px dashed #cbd5e1;
    border-radius: 6px;
    padding: 6px 12px;
    width: 50%;
    outline: none;
    background-color: #fefce8;
    transition: all var(--transition-fast);
}


.zone-title-input::placeholder {
    color: #d97706;
    font-weight: 500;
    font-style: italic;
}

.zone-title-input:hover {
    border-color: #a78bfa;
    background-color: #fef9c3;
}

.zone-title-input:focus {
    background: white;
    border-color: #6366f1;
    border-style: solid;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.zone-actions {
    display: flex;
    gap: 8px;
}

/* Delivery Term Selector */
.delivery-term-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 16px;
    padding: 3px 10px;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
}

.delivery-term-label {
    font-size: 10px;
    font-weight: 700;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.delivery-term-select {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #1e40af;
    background-color: #ffffff;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    font-family: var(--font-primary);
}

.delivery-term-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
/* --- Table Scroll Wrapper (Previene el colapso y encabalgamiento de columnas) --- */
.table-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    padding-bottom: 8px;
}

/* Beautiful and Highly Visible Horizontal Scrollbar for Table */
.table-scroll-wrapper::-webkit-scrollbar {
    height: 16px;
}

.table-scroll-wrapper::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid #e2e8f0;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 3px solid #f8fafc;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.table-scroll-wrapper::-webkit-scrollbar-button:horizontal:start:decrement {
    display: block;
    width: 24px;
    background-color: #f1f5f9;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2364748b"><path d="M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 0 0 0 8px;
    border-top: 1px solid #e2e8f0;
    cursor: pointer;
}
.table-scroll-wrapper::-webkit-scrollbar-button:horizontal:start:decrement:hover {
    background-color: #e2e8f0;
}

.table-scroll-wrapper::-webkit-scrollbar-button:horizontal:end:increment {
    display: block;
    width: 24px;
    background-color: #f1f5f9;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2364748b"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 0 0 8px 0;
    border-top: 1px solid #e2e8f0;
    cursor: pointer;
}
.table-scroll-wrapper::-webkit-scrollbar-button:horizontal:end:increment:hover {
    background-color: #e2e8f0;
}

/* --- THE MAIN PROPOSAL DATA TABLE --- */
.proposal-edit-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    table-layout: auto;
}

.proposal-edit-table th {
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 900;
    color: #0f172a;
    background-color: #e2e8f0;
    border: 1px solid #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.proposal-edit-table td {
    padding: 4px 4px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    vertical-align: middle;
    position: relative;
    overflow: visible; /* Importante para que el autocomplete no se corte */
}

/* Explicit minimum widths for columns to prevent squeezing on landscape screen */
.proposal-edit-table td:nth-child(1) { width: 50px; min-width: 50px; } /* S/N */
.proposal-edit-table td:nth-child(2) { width: 130px; min-width: 130px; } /* Marka */
.proposal-edit-table td:nth-child(3) { width: 130px; min-width: 130px; } /* Model */
.proposal-edit-table td:nth-child(4) { min-width: 280px; } /* Malzeme Tanımı */
.proposal-edit-table td:nth-child(5) { width: 100px; min-width: 100px; } /* Resim */
.proposal-edit-table td:nth-child(6) { width: 65px; min-width: 65px; } /* Miktar */
.proposal-edit-table td:nth-child(7) { width: 85px; min-width: 85px; } /* Birim */
.proposal-edit-table td:nth-child(8) { width: 100px; min-width: 100px; } /* Birim Fiyat */
.proposal-edit-table td:nth-child(9) { width: 100px; min-width: 100px; } /* Toplam Fiyat */

/* Hidden calculation columns min-widths */
.col-hidden-calc.num-cost-eur,
.col-hidden-calc.num-cost-usd,
.col-hidden-calc.num-cost-gbp,
.col-hidden-calc input {
    width: 80px;
    min-width: 80px;
}
.col-hidden-calc.num-discount-rate,
.col-hidden-calc.num-profit-rate,
.col-hidden-calc input[placeholder="0"] {
    width: 60px;
    min-width: 60px;
}

/* Row-specific elements */
.sn-cell {
    font-weight: bold;
    text-align: center;
    font-size: 12px;
    color: #475569;
}

/* Input Cell Redesign */
.input-cell {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 6px;
    font-family: var(--font-primary);
    font-size: 12px;
    color: #0f172a;
    background-color: #f8fafc;
    outline: none;
    transition: all var(--transition-fast);
}

.input-cell:hover {
    border-color: #9ca3af;
}

.input-cell:focus {
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea.input-cell {
    resize: vertical;
    min-height: 40px;
    font-size: 11px;
    line-height: 1.3;
}

.select-cell {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #f8fafc;
    font-family: var(--font-primary);
    font-size: 12px;
    color: #0f172a;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.select-cell:hover {
    border-color: #9ca3af;
}

.select-cell:focus {
    border-color: var(--primary);
    background-color: #ffffff;
}

.price-display-cell {
    text-align: right;
    font-weight: 700;
    font-size: 13px;
    color: #0f172a;
}

/* Image Cell Drag & Drop & Adjustable Slider */
.table-img-container {
    width: 90px;
    height: 70px;
    border: 1px dashed #94a3b8;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: #f8fafc;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.table-img-container:hover {
    border-color: var(--primary);
    background-color: #eff6ff;
}

.table-img-text {
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
}

.table-img-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Image scale slider */
.img-scale-slider-popover {
    display: none;
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 100;
    width: 110px;
    align-items: center;
    gap: 4px;
}

.table-img-container:hover .img-scale-slider-popover {
    display: flex;
}

.img-scale-slider-popover input[type="range"] {
    width: 100%;
    height: 4px;
    cursor: pointer;
}

.btn-remove-row-image {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 15;
}

.table-img-container:hover .btn-remove-row-image {
    display: flex;
}

/* --- Autocomplete (Akıllı Bellek) --- */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 500;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.autocomplete-item {
    padding: 8px 12px;
    font-size: 12px;
    color: #1e293b;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

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

.autocomplete-item:hover, .autocomplete-item.active {
    background-color: #eff6ff;
    color: var(--primary);
    font-weight: 500;
}

/* Hidden Cost & profit Columns (Highlighted in Yellow/Grey on Screen) */
.col-hidden-calc {
    background-color: #fffbeb !important; /* Pastel yellow background for easy identification */
    border-color: #fde68a !important;
    color: #92400e !important;
}

.header-calc-title {
    background-color: #d97706 !important;
    color: #ffffff !important;
    font-weight: bold;
}

.col-hidden-calc input {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
    font-weight: 500;
}

.col-hidden-calc input:focus {
    background-color: #ffffff;
    border-color: #d97706;
}

/* Cost Input Wrapper with Currency Symbol */
.cost-input-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
    width: 100%;
}

.cost-currency-symbol {
    font-size: 13px;
    font-weight: 800;
    color: #b45309;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

/* Active/Inactive Cost Column States */
.col-hidden-calc.cost-active {
    background-color: #dcfce7 !important;
    border-color: #86efac !important;
}

.col-hidden-calc.cost-active input {
    background-color: #dcfce7;
    border-color: #86efac;
    color: #166534;
    font-weight: 700;
}

.col-hidden-calc.cost-active .cost-currency-symbol {
    color: #166534;
    font-size: 14px;
}

.col-hidden-calc.cost-inactive {
    opacity: 0.35;
}

.col-hidden-calc.cost-inactive input {
    background-color: #f1f5f9;
    color: #94a3b8;
}

/* --- Zone Totals --- */
.zone-totals-row {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.zone-total-badge {
    background-color: #eef2ff;
    color: #1e3a5f;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12.5px;
    border: 1px solid #c7d2fe;
}

/* Control buttons inside tables */
.btn-delete-row {
    color: var(--danger);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-row:hover {
    background-color: var(--danger-light);
}

.table-controls {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

/* ==========================================================================
   GENERAL TOTALS AND STAMP/SIGNATURE
   ========================================================================== */
.general-totals-section {
    border: 2px solid #0f172a;
    border-radius: 8px;
    padding: 24px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.totals-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.totals-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.totals-summary-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
}

.totals-summary-table tr:last-child td {
    border-bottom: none;
}

.global-discount-container {
    padding: 16px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-row label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

.discount-inputs {
    display: flex;
    gap: 20px;
}

.input-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-inline label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.input-inline input {
    width: 80px;
    padding: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 12px;
    color: #1e293b;
}

/* Grand totals layout */
.grand-totals-wrapper {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #cbd5e1;
    padding-top: 8px;
    margin-top: 4px;
}

.grand-totals-table {
    width: 100%;
    border-collapse: collapse;
}

.grand-totals-table td {
    padding: 10px 12px;
    font-size: 13px;
}

.grand-totals-table .grand-label {
    font-weight: 700;
    color: #334155;
    text-align: right;
    padding-right: 20px;
    white-space: nowrap !important;
}

.grand-totals-table .grand-value {
    text-align: right;
    font-weight: 800;
    font-size: 15px;
    color: #0f172a;
    width: 150px;
    white-space: nowrap !important;
}

.grand-totals-table tr.discounted-row td {
    color: #e11d48;
}

.grand-totals-table tr.discounted-row .grand-value {
    color: #e11d48;
}

.grand-totals-table tr.net-total-row td {
    background-color: #f8fafc;
    border-top: 2px solid #0f172a;
    border-bottom: 3px double #0f172a;
    padding: 14px 16px;
}

.grand-totals-table tr.net-total-row td.grand-label {
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
}

.grand-totals-table tr.net-total-row td.grand-value {
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
}

/* Delivery Subtotal Rows */
.delivery-subtotal-row td {
    padding: 6px 12px;
}

.delivery-subtotal-row.delivery-turkiye .grand-label {
    color: #0369a1;
    font-weight: 600;
}

.delivery-subtotal-row.delivery-turkiye .grand-value {
    color: #0369a1;
    font-weight: 700;
    font-size: 14px;
}

.delivery-subtotal-row.delivery-gumruk .grand-label {
    color: #7c3aed;
    font-weight: 600;
}

.delivery-subtotal-row.delivery-gumruk .grand-value {
    color: #7c3aed;
    font-weight: 700;
    font-size: 14px;
}

.delivery-separator td {
    padding: 2px 0 !important;
}

/* --- Paper Footer (Trio Terms & Stamp) --- */
.paper-footer {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-top: 20px;
    page-break-inside: avoid;
}

.terms-column {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.terms-column h4 {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 4px;
}

.terms-list {
    list-style-type: none;
    font-size: 10px;
    line-height: 1.6;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.signature-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    background-color: #f8fafc;
    min-height: 160px;
    justify-content: space-between;
}

.signature-title {
    font-size: 10px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.5px;
    text-align: center;
}

.signature-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.signature-line {
    width: 80%;
    border-bottom: 1px dashed #94a3b8;
    height: 40px;
}

.signature-date {
    font-size: 9px;
    color: #64748b;
}

/* File System Access Overlay */
.fs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-app);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.fs-modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: fadeInUp 0.4s ease forwards;
}

.fs-icon {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: 8px;
}

.fs-modal h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.fs-modal p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.fs-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    background: var(--danger-light);
    padding: 10px;
    border-radius: 8px;
    width: 100%;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.3s ease forwards;
}

.modal-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-header h3 {
    font-size: 16px;
    color: var(--text-primary);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
}

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

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.modal-search-box input {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.modal-search-box input:focus {
    border-color: var(--border-focus);
}

.modal-zone-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-zone-selector label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.modal-zone-selector select {
    padding: 8px 12px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.modal-results-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 350px;
    background-color: var(--bg-input);
}

.modal-results-table {
    width: 100%;
    border-collapse: collapse;
}

.modal-results-table th {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 12px;
    font-size: 12px;
    text-align: left;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.modal-results-table td {
    padding: 12px;
    font-size: 12px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.modal-results-table tr:hover td {
    background-color: var(--bg-card-hover);
}

.modal-results-table .btn-add-from-modal {
    padding: 6px 12px;
    font-size: 11px;
}

/* ==========================================================================
   PRINT LAYOUT STYLING
   ========================================================================== */
.print-only {
    display: none;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    .no-print {
        display: none !important;
    }

    table.print-master-table {
        counter-reset: page;
        width: 100% !important;
    }
    thead.print-header {
        display: table-header-group;
    }
    
    .print-fixed-footer {
        position: fixed;
        bottom: 12mm;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 8px;
        color: #64748b;
    }

    body.print-mode {
        background-color: #ffffff !important;
        overflow: visible !important;
        height: auto !important;
        min-height: auto !important;
        margin: 0 !important;
        padding: 0 12mm !important;
    }

    .print-fixed-footer::after {
        counter-increment: page;
        content: "Sayfa " counter(page);
    }

    body {
        background-color: #ffffff !important;
        color: #0f172a !important;
        font-size: 10px !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .print-only {
        display: block !important;
    }

    .table-scroll-wrapper {
        overflow: visible !important;
        padding-bottom: 0 !important;
        margin-bottom: 0px !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .proposal-paper {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        background-color: #ffffff !important;
        color: #000000 !important;
        gap: 16px !important;
    }

    .col-hidden-calc, 
    .header-calc-title {
        display: none !important;
    }

    input, textarea, select {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        color: #000000 !important;
        font-size: 9px !important;
        outline: none !important;
        box-shadow: none !important;
        resize: none !important;
        pointer-events: none !important;
    }

    textarea {
        height: auto !important;
        overflow: visible !important;
    }

    .btn-delete-row,
    .btn-delete-zone,
    .btn-delete-part,
    .btn-add-row,
    .btn-add-zone,
    .img-scale-slider-popover,
    .btn-remove-row-image,
    .btn-remove-logo,
    .delivery-term-wrapper {
        display: none !important;
    }

    .table-img-container {
        border: none !important;
        background: transparent !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    .table-img-preview {
        max-width: 40px !important;
        max-height: 20px !important;
        width: auto !important;
        display: block !important;
    }
    .table-img-text {
        display: none !important;
    }

    .proposal-edit-table {
        table-layout: fixed !important;
        font-size: 8px !important;
        border-collapse: collapse !important;
        border-spacing: 0 !important;
    }

    .proposal-edit-table th {
        background-color: #e2e8f0 !important;
        color: #000000 !important;
        border: none !important;
        border-bottom: 2px solid #000000 !important;
        padding: 4px 2px !important;
        font-size: 8.5px !important;
        font-weight: 900 !important;
        letter-spacing: 0 !important;
        word-break: normal !important;
    }

    .proposal-edit-table td {
        border: none !important;
        background-color: #ffffff !important;
        padding: 3px 2px !important;
        font-size: 7.5px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        color: #000000 !important;
    }

    .proposal-edit-table th:nth-child(1), .proposal-edit-table td:nth-child(1) { width: 18px !important; min-width: 18px !important; text-align: center !important;}
    .proposal-edit-table th:nth-child(2), .proposal-edit-table td:nth-child(2) { width: 70px !important; min-width: 70px !important; }
    .proposal-edit-table th:nth-child(3), .proposal-edit-table td:nth-child(3) { width: 85px !important; min-width: 85px !important; }
    .proposal-edit-table th:nth-child(4), .proposal-edit-table td:nth-child(4) { width: auto !important; word-break: break-word !important; }
    .proposal-edit-table th:nth-child(5), .proposal-edit-table td:nth-child(5) { width: 65px !important; min-width: 65px !important; text-align: center !important;}
    .proposal-edit-table th:nth-child(6), .proposal-edit-table td:nth-child(6) { width: 45px !important; min-width: 45px !important; text-align: center !important;}
    .proposal-edit-table th:nth-child(7), .proposal-edit-table td:nth-child(7) { width: 35px !important; min-width: 35px !important; text-align: center !important;}
    .proposal-edit-table th:nth-child(8), .proposal-edit-table td:nth-child(8) { width: 65px !important; min-width: 65px !important; text-align: right !important;}
    .proposal-edit-table th:nth-child(9), .proposal-edit-table td:nth-child(9) { width: 65px !important; min-width: 65px !important; text-align: right !important;}

    .price-display-cell {
        font-size: 7px !important;
    }

    .sn-cell {
        font-size: 7px !important;
    }

    .print-static-textarea {
        font-size: 7.5px !important;
        line-height: 1.2 !important;
        white-space: pre-wrap !important;
        word-break: break-word !important;
    }

    .proposal-edit-table .print-static-value {
        word-break: break-word !important;
        white-space: pre-wrap !important;
        display: inline-block !important;
        max-width: 100% !important;
    }

    .zone-number-badge {
        display: none !important;
    }

    .paper-header {
        gap: 40px !important;
        padding-bottom: 12px !important;
        margin-bottom: 10px !important;
    }

    .trio-logo-img {
        max-width: 120px !important;
        max-height: 40px !important;
    }

    .trio-address-block {
        font-size: 7px !important;
        line-height: 1.1 !important;
    }

    .trio-company-name {
        font-size: 8px !important;
        margin-bottom: 1px !important;
    }

    .header-right-meta-top {
        display: block !important;
        text-align: right !important;
    }

    .meta-date-proposal-box {
        display: inline-flex !important;
        flex-direction: column !important;
        gap: 2px !important;
        width: 180px !important;
    }

    .meta-inline-row {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        border: none !important;
        justify-content: flex-end !important;
        gap: 4px !important;
    }

    .meta-label {
        font-weight: bold !important;
        color: #000000 !important;
        width: 60px !important;
        text-align: left !important;
        font-size: 8px !important;
        display: inline-block !important;
    }

    .meta-inline-input, .meta-inline-row span.print-static-value, .meta-revision-value {
        border: none !important;
        padding: 0 !important;
        font-size: 8.5px !important;
        color: #000000 !important;
        background: transparent !important;
        text-align: left !important;
        flex: 1 !important;
        align-self: center !important;
    }

    .meta-section-wrapper {
        display: block !important;
        position: relative !important;
        margin-bottom: 4px !important;
        border-bottom: 1px solid #000 !important;
        padding-bottom: 4px !important;
        min-height: 45px !important;
    }

    .header-right-meta-top {
        position: absolute !important;
        right: 0 !important;
        top: 0 !important;
        text-align: right !important;
    }

    .client-meta-section {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 2px !important;
        padding: 0 !important;
        border: none !important;
    }

    .client-meta-row {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }

    .client-meta-label {
        font-weight: bold !important;
        color: #000000 !important;
        width: 50px !important;
        font-size: 8px !important;
        display: inline-block !important;
    }

    .client-meta-input, .client-meta-row span.print-static-value {
        border: none !important;
        padding: 0 !important;
        font-size: 9px !important;
        color: #000000 !important;
        background: transparent !important;
        text-align: left !important;
        flex: 1 !important;
        align-self: center !important;
        font-weight: 600 !important;
    }

    .part-header {
        display: flex !important;
        background-color: #f1f5f9 !important;
        border-bottom: 1.5px solid #0f172a !important;
        padding: 1px 4px !important;
        margin-top: 2px !important;
        margin-bottom: 0px !important;
        page-break-after: avoid;
    }

    .part-title-wrapper {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .part-title-wrapper span.print-static-value {
        font-size: 11px !important;
        font-weight: 900 !important;
        color: #0f172a !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    .zone-title-wrapper span.print-static-value {
        font-size: 9.5px !important;
        font-weight: 800 !important;
        color: #334155 !important;
        text-transform: uppercase !important;
        font-style: italic !important;
        display: block !important;
        margin-bottom: 2px !important;
        border-bottom: 1px dotted #cbd5e1 !important;
        padding-bottom: 1px !important;
        width: 100% !important;
    }

    .part-letter {
        background-color: #1e293b !important;
        color: #ffffff !important;
        border-radius: 4px !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: bold !important;
    }

    .parts-container {
        gap: 0 !important;
    }

    .part-section {
        padding: 0 !important;
        gap: 0 !important;
        border: none !important;
        background-color: transparent !important;
        box-shadow: none !important;
        margin-bottom: 1px !important;
    }

    .zone-section {
        background-color: #ffffff !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 0 0 10px !important;
        box-shadow: none !important;
        margin-bottom: 0px !important;
    }

    .zone-header {
        margin-bottom: 1px !important;
        margin-top: 1px !important;
    }

    .part-letter {
        background-color: #0f172a !important;
        color: #ffffff !important;
        border-radius: 2px !important;
    }

    .general-totals-section, .paper-footer {
        page-break-inside: avoid;
    }

    .proposal-edit-table tr {
        page-break-inside: avoid;
    }

    .zones-list {
        gap: 0 !important;
    }

    .zones-list .zone-section:not(:first-child) .proposal-edit-table thead {
        display: none !important;
    }

    .general-totals-section {
        border: 1px solid #94a3b8 !important;
        padding: 4px 6px !important;
        border-radius: 2px !important;
        gap: 4px !important;
    }

    .totals-title {
        font-size: 9px !important;
        padding-bottom: 4px !important;
    }

    .totals-summary-table td {
        font-size: 7.5px !important;
        padding: 3px 6px !important;
        border-bottom: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
    }

    .grand-totals-table {
        width: 260px !important;
    }

    .grand-totals-table td {
        font-size: 8px !important;
        padding: 3px 6px !important;
    }

    .grand-totals-table .grand-value {
        font-size: 10px !important;
    }

    .paper-footer {
        page-break-inside: avoid !important;
        border-top: 1px solid #94a3b8;
        padding-top: 4px;
        gap: 8px !important;
        margin-top: 4px !important;
    }

    .terms-list {
        font-size: 6.5px !important;
        line-height: 1.1 !important;
        gap: 1px !important;
    }

    .terms-column h4 {
        font-size: 7.5px !important;
        margin-bottom: 2px !important;
    }

    .signature-column {
        min-height: 60px !important;
        padding: 4px !important;
    }

    .signature-title {
        font-size: 6.5px !important;
    }

    .signature-date {
        font-size: 5.5px !important;
    }

    .signature-line {
        height: 15px !important;
    }

    .delivery-subtotal-row .grand-label,
    .delivery-subtotal-row .grand-value,
    .grand-totals-table .grand-label,
    .grand-totals-table .grand-value {
        color: #000000 !important;
        white-space: nowrap !important;
    }

    .grand-totals-table tr.discounted-row td,
    .grand-totals-table tr.discounted-row .grand-label,
    .grand-totals-table tr.discounted-row .grand-value {
        color: #e11d48 !important;
    }
}
/* --- Totals Area Styling (HTML Editor view vs Print view) --- */
.zone-totals-stacked {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-weight: 700;
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.part-totals-inner {
    display: flex;
    flex-direction: column;
    padding: 8px 16px;
    margin-top: 12px;
    margin-bottom: 8px;
    border-top: 2px solid #0f172a;
    border-bottom: 2px solid #0f172a;
    background-color: #f8fafc;
    page-break-inside: avoid;
}

.part-totals-header {
    font-size: 14px;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 4px;
    text-transform: uppercase;
    text-align: right;
}

.part-totals-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 800;
    color: #334155;
}

.part-totals-label {
    margin-right: 12px;
}

.part-totals-value {
    min-width: 80px;
    text-align: right;
    color: #0f172a;
    font-size: 14px;
}

/* Profit & Loss colors */
.profit-positive {
    color: #16a34a !important;
}

.profit-negative {
    color: #dc2626 !important;
}

.profit-positive .part-totals-value, .profit-negative .part-totals-value {
    color: inherit;
}

/* --- Print overrides for totals --- */
@media print {
    .zone-totals-stacked {
        font-size: 7px !important;
        margin-top: 1px !important;
        margin-bottom: 1px !important;
    }
    
    .zone-totals-row {
        margin-top: 1px !important;
    }
    
    .part-totals-inner {
        padding: 4px 10px !important;
        margin-top: 6px !important;
        margin-bottom: 4px !important;
        border-top-width: 1.5px !important;
        border-bottom-width: 1.5px !important;
    }
    
    .part-totals-header {
        font-size: 8.5px !important;
        margin-bottom: 2px !important;
    }
    
    .part-totals-row {
        font-size: 8px !important;
        margin-bottom: 1px !important;
    }
    
    .part-totals-value {
        font-size: 8.5px !important;
        min-width: 65px !important;
    }
}
.zone-totals-container { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; }
.zone-totals-label { font-weight: 700; font-size: 11px; color: #334155; }
.zone-totals-val { font-weight: 800; font-size: 13px; color: #0f172a; }
@media print {
    .zone-totals-container { gap: 4px !important; }
    .zone-totals-label { font-size: 7.5px !important; font-weight: 700 !important; }
    .zone-totals-val { font-size: 8px !important; font-weight: 800 !important; }
}

/* --- Image Library Modal --- */
.image-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-app);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.library-img-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.library-img-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.library-img-card img {
    width: 100px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
}

.library-img-card span {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- DELIVERY REPORT MODAL --- */
.delivery-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.delivery-report-table th, .delivery-report-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 13px;
    color: var(--text-primary);
}

.delivery-report-table th {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-app);
}

.delivery-report-table input[type="number"], .delivery-report-table input[type="text"] {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.delivery-report-table input[type="text"] {
    width: 100%;
    min-width: 150px;
}

/* --- SIGNATURE FOOTER (PRINT) --- */
.signature-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 20px;
    page-break-inside: avoid;
    width: 100%;
}

.signature-box {
    width: 45%;
    text-align: center;
}

.signature-title {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 5px;
    margin-bottom: 40px;
}

/* --- DASHBOARD RESPONSIVE LAYOUT FIXES --- */
.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    height: auto;
    overflow: visible;
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    flex: none;
    overflow: visible;
}

.proposals-list-section {
    display: flex;
    flex-direction: column;
    flex: none;
    overflow: visible;
}

.filter-section {
    flex-shrink: 0;
}

.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    background-color: var(--bg-card);
}

/* Tablo başlığının scroll yaparken yukarıda sabit (sticky) kalması için donanım hızlandırması (3D Layer) kilitlemesi */
.table-responsive-wrapper thead {
    /* Satırlardaki animasyonların (z-index 5) üstünde kalmasını garantile */
    transform: translateZ(1px); /* Safari/Chrome Stacking Context bug fix: Thead'i 3D katmana taşı */
}

.table-responsive-wrapper thead th {
    background-color: var(--bg-app); /* Arka planı tamamen opak ve hafif koyu yaparak alttan geçenleri tam kapattık */
    box-shadow: 0 1px 0 var(--border-color); /* Alt çizgi efekti */
    background-clip: padding-box;
}

.table-responsive-wrapper thead th::after {
    /* İkinci bir alt zemin katmanı atarak transparans bug'ını engelliyoruz */
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0; top: 0;
    background-color: var(--bg-app);
    z-index: -1;
}

/* Ensure tables inside wrapper don't break layout */
.table-responsive-wrapper .dashboard-table {
    min-width: 800px; /* Force minimum width to enable horizontal scroll on small screens */
}

/* MEDIA QUERIES FOR DASHBOARD */
@media screen and (max-width: 1024px) {
    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        max-width: 100%;
        width: 100%;
    }
    .filter-actions-group {
        justify-content: space-between;
        width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .filter-actions-group {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    .dashboard-proposal-badge {
        justify-content: center;
        margin-top: 10px;
    }
}

/* --- Dinamik Logo ve Ayarlar Modalı CSS --- */
.logo-selection-container {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.logo-option {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.logo-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.logo-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.logo-option img {
    height: 40px;
    object-fit: contain;
    max-width: 100%;
}

.logo-option span {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

/* Otomatik Boyutlandırma Kuralları */
.header-logo .brand-logo {
    max-height: 40px;
    max-width: 140px;
    object-fit: contain;
}

.proposal-header-left img.trio-logo-img,
.trio-logo-img {
    max-height: 70px;
    max-width: 200px;
    object-fit: contain;
}

/* --- Modern Proposal List Grid --- */
.proposal-list-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.proposal-list-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.06);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.prop-col-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prop-client {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.prop-project {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.prop-no-mini {
    font-size: 11px;
    background-color: var(--primary-light);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.prop-col-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prop-date {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.prop-creator {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.prop-col-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

.prop-col-status {
    display: flex;
    justify-content: center;
}

.prop-col-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-icon:hover {
    background-color: var(--bg-app);
    color: var(--primary);
}

.btn-icon.edit:hover {
    color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.1);
}

.btn-icon.print:hover {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.1);
}

.btn-icon.delete:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

/* Status select pill style */
select.status-badge {
    appearance: none;
    -webkit-appearance: none;
    padding: 6px 24px 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' 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 8px center;
}

@media (max-width: 900px) {
    .proposal-list-item {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: 
            "info info"
            "date amount"
            "status actions";
    }
    .prop-col-info { grid-area: info; }
    .prop-col-date { grid-area: date; }
    .prop-col-amount { grid-area: amount; text-align: left; }
    .prop-col-status { grid-area: status; justify-content: flex-start; }
    .prop-col-actions { grid-area: actions; }
}

/* Yeni ürün zorunlu-alan kuralı: eksik alanı olan teklif satırını vurgular */
tr.row-missing-fields > td {
    box-shadow: inset 0 0 0 2px #ef4444;
    background-color: rgba(239, 68, 68, 0.06);
}

/* --- Ürün Bazlı Özel Fiyat (item special price) --- */
/* Ayrı ÖZEL FİYAT sütunu. Yalnız 'item' modunda görünür; diğer modlarda
   tablodan tamamen kaldırılır (body.price-mode-item bayrağı ile). */
.col-special-price {
    display: none;
}

body.price-mode-item .col-special-price {
    display: table-cell;
}

.fx-panel { margin-bottom: 14px; padding: 12px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-secondary, #f8fafc); }
.fx-panel-title { font-size: 12px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.fx-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.fx-controls select { min-width: 210px; }
.fx-status { margin-top: 8px; color: var(--text-secondary, #64748b); font-size: 11px; line-height: 1.45; }

.txt-special-price {
    cursor: text;
    outline: none;
    border-bottom: 1px dashed var(--special-price-color);
    min-width: 70px;
    display: inline-block;
    text-align: right;
    font-weight: 700;
    color: var(--special-price-color);
}

.txt-special-price:focus {
    background-color: #fef2f2;
    border-bottom-style: solid;
}

/* Özel fiyat girilmemiş satırda soluk tire */
.txt-special-price:empty::before {
    content: "—";
    color: #cbd5e1;
    font-weight: 400;
}

/* Mali özette ürün bazlı özel fiyat satırı — ekranda ve çıktıda kırmızı. */
.special-price-row .grand-label,
.special-price-row .grand-value {
    color: var(--special-price-color) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Satır içi indirim oranı rozeti */
.special-price-pct {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #e11d48;
    margin-top: 2px;
    white-space: nowrap;
}

@media print {
    /* Yazdırma/PDF: düzenleme ipucu gitsin, tutar kalsın. */
    .txt-special-price {
        border-bottom: none !important;
        background: transparent !important;
        /* Özel fiyat çıktıda da KIRMIZI kalır — müşteri ayrıcalığı görsün.
           Eskiden #0f172a ile siyaha zorlanıyordu. */
        color: var(--special-price-color) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 7px !important;
    }
    .special-price-pct {
        font-size: 6px !important;
    }
}

/* Screen notifications must never appear in customer PDFs, even during saving. */
@media print {
    #sync-toast-msg, #product-rule-toast, #autosave-toast {
        display: none !important;
        visibility: hidden !important;
    }
}

.special-price-source { display:block; font-size:10px; color:#64748b; margin-top:3px; }
.btn-special-auto { font-size:10px; border:1px solid #cbd5e1; border-radius:4px; background:#f8fafc; cursor:pointer; padding:3px 6px; }
.special-comparison-row { break-inside:avoid; }
