:root {
    --primary-color: #c1272d;
    --primary-dark: #9a1f24;
    --primary-light: #e85a5f;
    --secondary-color: #4a4a4a;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --techway-gray: #4a4a4a;
    --sidebar-width: 250px;
    --header-height: 60px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box .logo {
    display: block;
    max-width: 200px;
    height: auto;
    margin: 0 auto 20px;
}

.login-box h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 24px;
    text-align: center;
}

.login-box .subtitle {
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 14px;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark-color);
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-box button:hover {
    background: var(--primary-dark);
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-color);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 18px;
    margin-bottom: 5px;
}

.sidebar-header .version {
    font-size: 12px;
    opacity: 0.7;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.sidebar-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-menu .menu-header {
    padding: 10px 20px;
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.5;
    margin-top: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
}

.header {
    background: white;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 20px;
    color: var(--dark-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info .avatar {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.content {
    padding: 30px;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    color: var(--dark-color);
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card .icon.primary { background: rgba(193, 39, 45, 0.1); color: var(--primary-color); }
.stat-card .icon.success { background: rgba(40, 167, 69, 0.1); color: var(--success-color); }
.stat-card .icon.warning { background: rgba(255, 193, 7, 0.1); color: var(--warning-color); }
.stat-card .icon.danger { background: rgba(220, 53, 69, 0.1); color: var(--danger-color); }

.stat-card .info h4 {
    font-size: 24px;
    color: var(--dark-color);
}

.stat-card .info p {
    font-size: 14px;
    color: var(--secondary-color);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--dark-color);
}

table tr:hover {
    background: #f8f9fa;
}

table .badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: rgba(40, 167, 69, 0.1); color: var(--success-color); }
.badge-warning { background: rgba(255, 193, 7, 0.1); color: #856404; }
.badge-danger { background: rgba(220, 53, 69, 0.1); color: var(--danger-color); }
.badge-info { background: rgba(23, 162, 184, 0.1); color: var(--info-color); }
.badge-primary { background: rgba(193, 39, 45, 0.1); color: var(--primary-color); }

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-success { background: var(--success-color); color: white; }
.btn-success:hover { background: #218838; }

.btn-danger { background: var(--danger-color); color: white; }
.btn-danger:hover { background: #c82333; }

.btn-secondary { background: var(--secondary-color); color: white; }
.btn-secondary:hover { background: #5a6268; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

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

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success { background: rgba(40, 167, 69, 0.1); color: var(--success-color); border-left: 4px solid var(--success-color); }
.alert-danger { background: rgba(220, 53, 69, 0.1); color: var(--danger-color); border-left: 4px solid var(--danger-color); }
.alert-warning { background: rgba(255, 193, 7, 0.1); color: #856404; border-left: 4px solid var(--warning-color); }
.alert-info { background: rgba(23, 162, 184, 0.1); color: var(--info-color); border-left: 4px solid var(--info-color); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: var(--dark-color);
}

.pagination a:hover {
    background: var(--light-color);
}

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

/* Filters */
.filters {
    background: var(--light-color);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.filters .form-row {
    margin-bottom: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

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

.modal {
    background: white;
    border-radius: 10px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
}

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

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--secondary-color);
    transition: all 0.3s;
}

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

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 200;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================================================
   Lead Magnet Creator - additional components
   ========================================================================= */

/* Result viewer: one card per PDF, one block per page */
.pdf-result {
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.pdf-result-header {
    background: var(--dark-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pdf-result-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.pdf-page {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.pdf-page:last-child {
    border-bottom: none;
}

.pdf-page-no {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 8px;
}

.pdf-field {
    margin-bottom: 8px;
}

.pdf-field .pdf-field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pdf-field .pdf-field-value {
    white-space: pre-wrap;
}

/* Raw result / prompt text areas */
.result-raw {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
    white-space: pre-wrap;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    max-height: 500px;
    overflow-y: auto;
}

/* Agent conversation (job steps) */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step-item {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.step-item summary {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--light-color);
    list-style: none;
}

.step-item summary::-webkit-details-marker { display: none; }

.step-item .step-body {
    padding: 15px;
    white-space: pre-wrap;
    font-size: 13px;
    max-height: 400px;
    overflow-y: auto;
}

.step-agent {
    font-weight: 600;
}

.step-agent.autor { color: var(--primary-color); }
.step-agent.kritiker { color: var(--info-color); }

.step-meta {
    margin-left: auto;
    font-size: 12px;
    color: var(--secondary-color);
}

/* Status polling spinner */
.job-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(193, 39, 45, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Textareas */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

textarea.form-control.code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    min-height: 220px;
}

/* Settings sections */
.settings-section {
    margin-bottom: 30px;
}

.settings-section h4 {
    margin-bottom: 12px;
    color: var(--dark-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.form-hint {
    font-size: 12px;
    color: var(--secondary-color);
    margin-top: 4px;
}

/* Copy button feedback */
.btn-copied {
    background: var(--success-color) !important;
    color: white !important;
}

/* Inline action buttons in tables */
.table-actions {
    display: flex;
    gap: 6px;
}
