:root {
    --bg-color: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #8b5cf6; /* Mor tema: CV için profesyonel */
    --primary-hover: #7c3aed;
    --border: #e2e8f0;
    
    --cv-text: #333333;
    --cv-primary: #2c3e50;
    --cv-secondary: #7f8c8d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    flex: 1;
    min-height: 0;
}

/* Top navbar (shared across all tools; scoped to avoid clashing with this
   page's own .logo/.btn used inside the editor panel) */
header.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
header.navbar .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 800;
}
header.navbar .nav-links {
    display: flex;
    gap: 1.5rem;
}
header.navbar .nav-links a {
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}
header.navbar .nav-links a:hover {
    color: #2563eb;
}

.editor-panel {
    width: 400px;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    z-index: 10;
}

.preview-panel {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    justify-content: center;
    background-color: #cbd5e1;
}

/* Editor Styles */
.header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 20;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 20px;
    color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-main);
}

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

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
}

.btn-danger {
    background-color: #fee2e2;
    color: #ef4444;
}

.btn-danger:hover {
    background-color: #fecaca;
}

.form-section {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

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

.form-section h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.section-header h3 {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-main);
}

input, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

input:focus, textarea:focus {
    border-color: var(--primary);
}

.dynamic-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* CV A4 Preview Styles */
.a4-page {
    width: 210mm;
    min-height: 297mm;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.resume-header {
    background-color: var(--cv-primary);
    color: white;
    padding: 40px;
    text-align: center;
}

.resume-header h1 {
    font-size: 32px;
    margin-bottom: 5px;
    font-weight: 700;
    letter-spacing: 1px;
}

.resume-header h2 {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 20px;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 13px;
    opacity: 0.8;
}

.resume-body {
    display: flex;
    flex: 1;
}

.left-col {
    width: 35%;
    background-color: #f8fafc;
    padding: 30px;
    border-right: 1px solid #e2e8f0;
}

.right-col {
    width: 65%;
    padding: 30px;
}

.resume-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 18px;
    color: var(--cv-primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 5px;
    margin-bottom: 15px;
    font-weight: 600;
}

.left-col .section-title {
    font-size: 16px;
}

.resume-section p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--cv-text);
}

.skills-list {
    list-style: none;
}

.skills-list li {
    font-size: 13px;
    color: var(--cv-text);
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
}

.skills-list li:last-child {
    border-bottom: none;
}

.exp-item {
    margin-bottom: 20px;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.exp-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--cv-primary);
}

.exp-date {
    font-size: 12px;
    color: var(--cv-secondary);
    font-weight: 500;
}

.exp-company {
    font-size: 14px;
    color: var(--cv-secondary);
    margin-bottom: 8px;
    font-style: italic;
}

.exp-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--cv-text);
}

/* Print Styles */
@media print {
    body {
        background: white;
        height: auto;
        overflow: visible;
        display: block;
    }
    
    .no-print, .editor-panel, .navbar {
        display: none !important;
    }
    
    .preview-panel {
        padding: 0;
        background: white;
        display: block;
    }
    
    .a4-page {
        width: 100%;
        min-height: auto;
        box-shadow: none;
    }

    @page {
        margin: 0;
        size: A4;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container { flex-direction: column !important; height: auto !important; }
    .editor-panel { width: 100% !important; min-width: 100% !important; border-right: none !important; border-bottom: 1px solid #e2e8f0; height: auto !important; padding: 15px !important; box-sizing: border-box !important; }
    .preview-panel { width: 100% !important; padding: 10px !important; overflow-x: auto !important; }
    .invoice-wrapper, .document-wrapper, .cv-wrapper, .quotation-wrapper, .expense-wrapper, .payroll-wrapper, .inventory-wrapper, .shift-wrapper { min-width: 700px; transform: scale(1) !important; transform-origin: top left; }
    .header-left, .header-right { width: 100% !important; text-align: left !important; margin-bottom:10px; }
    .invoice-header, .cv-header, .quotation-header { flex-direction: column !important; gap: 1rem !important; }
    .actions { flex-direction: column !important; }
    .btn { width: 100% !important; margin-bottom: 5px; }
    .header { flex-wrap: wrap; gap: 0.75rem; }
}

/* Per-tool FAQ section */
.tool-faq-section {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 0 20px;
}
.tool-faq-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    margin-bottom: 20px;
}
.tool-faq-section .faq-item {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 10px;
    background: #ffffff;
    overflow: hidden;
}
.tool-faq-section .faq-item summary {
    cursor: pointer;
    padding: 14px 44px 14px 18px;
    font-weight: 600;
    color: var(--text-main, #0f172a);
    font-size: 0.95rem;
    list-style: none;
    position: relative;
}
.tool-faq-section .faq-item summary::-webkit-details-marker {
    display: none;
}
.tool-faq-section .faq-item summary::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--primary, #2563eb);
    transition: transform 0.2s;
}
.tool-faq-section .faq-item[open] summary::after {
    transform: rotate(45deg);
}
.tool-faq-section .faq-item summary:hover {
    background: #f8fafc;
}
.tool-faq-section .faq-item p {
    padding: 0 18px 16px;
    margin: 0;
    color: var(--text-muted, #64748b);
    font-size: 0.9rem;
    line-height: 1.65;
}
.tool-faq-section .faq-item p a {
    color: var(--primary, #2563eb);
}

/* Related Tools cross-links */
.related-tools-section {
    max-width: 900px;
    margin: 0 auto 24px;
    padding: 0 20px;
}
.related-tools-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    margin-bottom: 20px;
}
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.related-tool-card {
    display: block;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 16px 18px;
    background: #ffffff;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.related-tool-card:hover {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.1);
}
.related-tool-card strong {
    display: block;
    color: var(--primary, #2563eb);
    font-size: 0.95rem;
    margin-bottom: 6px;
}
.related-tool-card span {
    display: block;
    color: var(--text-muted, #64748b);
    font-size: 0.85rem;
    line-height: 1.5;
}
@media (max-width: 768px) {
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}
