* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
    background-color: #f0f2f5;
}

body {
    background-color: #f0f2f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1140px;
    margin: 0 auto;
    width: 100%;
}

/* Hide spin buttons for numbers */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    /* Firefox */
}

header {
    background: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.logo {
    font-weight: bold;
    font-size: 1.2rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

#user-email {
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    background: #f1f3f5;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e9ecef;
}

.btn-outline {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
}

.btn-primary {
    background: #228be6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #1c7ed6;
    box-shadow: 0 4px 8px rgba(34, 139, 230, 0.2);
}

.main-container {
    display: flex;
    flex: 1;
}

/* Сайдбар */
.sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    padding: 15px;
}



/* Removed duplicate queue-item styles */

/* Сайдбар - Управление */
.sidebar-header {
    margin-bottom: 10px;
}

.mode-switch {
    display: flex;
    gap: 8px;
    /* Чуть больше отступ */
    margin-bottom: 12px;
}

.mode-btn {
    flex: 1;
    padding: 10px 8px;
    /* Чуть больше padding */
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    /* Inter semibold */
    font-size: 0.85rem;
    color: #495057;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: #e9ecef;
}

.mode-btn.active {
    background: #228be6;
    /* Более современный синий */
    color: white;
    border-color: #228be6;
    box-shadow: 0 2px 4px rgba(34, 139, 230, 0.3);
}

.subfilters {
    display: flex;
    gap: 6px;
}

.subfilter-btn {
    flex: 1;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 20px;
    /* Pill shape */
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #495057;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
}

.subfilter-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.subfilter-btn.active {
    background: #495057;
    color: white;
    border-color: #495057;
}

/* Блок статистики по модели */
.model-stats {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.model-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
    max-width: 65%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-progress-large {
    font-size: 1.1rem;
    font-weight: 800;
    color: #007bff;
}

.stats-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f8f9fa;
}

.stat-item.done {
    color: #28a745;
    background: #e6fffa;
}

.stat-item.skipped {
    color: #ffc107;
    background: #fff3cd;
}

.stat-item.deleted {
    color: #dc3545;
    background: #ffebee;
}

.stat-item svg {
    width: 14px;
    height: 14px;
}

/* Списки */
.queue-list {
    flex: 1;
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fff;
    /* Ensure white background */
}

.queue-item {
    padding: 8px 10px;
    /* Default padding */
    border-left: 4px solid transparent;
    /* Reserve space for border to prevent layout shift */
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    transition: background-color 0.2s;
}

.queue-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

.queue-item-meta {
    font-weight: bold;
    font-size: 0.8rem;
    margin-left: 8px;
    white-space: nowrap;
}

.queue-item:hover {
    background: #f8f9fa;
}

/* Increased specificity to force highlight */
.sidebar .queue-list .queue-item.active {
    background-color: #e7f1ff !important;
    border-left: 4px solid #007bff !important;
    font-weight: 600;
}

.queue-item.done {
    text-decoration: line-through;
    opacity: 0.6;
    background-color: #f0f0f0;
}

/* Список следующих моделей */
.next-models {
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 5px;
    background: #fafafa;
}

.next-title {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 5px;
    padding-left: 5px;
}

.next-model-item {
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.next-model-item:hover {
    background: #e9ecef;
}

.progress-block {
    margin-bottom: 15px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.progress-bar {
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    margin: 5px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #28a745;
    transition: width 0.3s;
}

.progress-stats {
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    color: #666;
}

/* Контент */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px 20px;
    /* Убираем gap, так как отступы делаем марджинами */
    width: 100%;
}

/* Обновленный Workspace */
.workspace {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e0e4e8;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ws-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1d21;
}

.copy-icon-btn {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.copy-icon-btn:hover {
    color: #228be6;
}

/* Сетка параметров */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.spec-item {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #868e96;
    font-weight: 600;
}

.spec-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #343a40;
}

/* Карточки ввода */
.inputs-section {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.input-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.primary-input {
    border-top: 4px solid #228be6;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1d21;
    margin-bottom: 20px;
}

/* Унифицированный стиль для всех инпутов */
.modern-input-group {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) inset;
}

.primary-input .modern-input-group:focus-within {
    border-color: #228be6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34, 139, 230, 0.1), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.hybrid-card .modern-input-group:focus-within {
    border-color: #20c997;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(32, 201, 151, 0.1), 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* HP Input Styling */
.hp-input-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
}

.hp-input-group input {
    font-size: 2.2rem;
    font-weight: 800;
    width: 100px;
    border: none;
    background: transparent;
    outline: none;
    color: #1a1d21;
    padding: 0;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.hp-input-group input::placeholder {
    color: #ced4da;
}

.unit {
    font-size: 1.1rem;
    font-weight: 600;
    color: #868e96;
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px dashed #e9ecef;
}

.kw-indicator {
    background: #e7f5ff;
    color: #1c7ed6;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    border: 1px solid #d0ebff;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Common Actions */
.btn-icon {
    background: #fff;
    border: 1px solid #dee2e6;
    color: #495057;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.btn-icon:hover {
    background: #f8f9fa;
    color: #228be6;
    border-color: #228be6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(34, 139, 230, 0.15);
}

/* Гибридная карточка */
.hybrid-card {
    border-top: 4px solid transparent;
    opacity: 0.6;
    transition: all 0.3s ease;
    filter: grayscale(100%);
}

.hybrid-card:focus-within,
.hybrid-card.active {
    border-top-color: #20c997;
    opacity: 1;
    filter: grayscale(0%);
    box-shadow: 0 6px 16px rgba(32, 201, 151, 0.08);
}

.dual-inputs {
    display: flex;
    gap: 16px;
}

.dual-inputs .sub-input {
    flex: 1;
}

.sub-input label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #868e96;
    margin-bottom: 8px;
    font-weight: 700;
}

.label-with-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.label-with-toggle label {
    margin-bottom: 0;
    /* Override previous margin */
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-wrapper input {
    font-size: 1.4rem;
    font-weight: 700;
    width: 100%;
    min-width: 60px;
    border: none;
    background: transparent;
    outline: none;
    color: #1a1d21;
    padding: 0;
    font-variant-numeric: tabular-nums;
}

.input-wrapper input::placeholder {
    color: #dee2e6;
}

/* Футер */
.ws-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid #f1f3f5;
}

.secondary-actions {
    display: flex;
    gap: 8px;
}

.btn-flat {
    background: none;
    border: 1px solid transparent;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    color: #868e96;
    transition: all 0.2s;
}

.btn-flat:hover {
    background: #f1f3f5;
    color: #495057;
}

.btn-flat.danger:hover {
    background: #fff5f5;
    color: #fa5252;
}

.btn-main {
    background: #228be6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 139, 230, 0.25);
    transition: all 0.2s;
}

.btn-main:hover {
    background: #1c7ed6;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 139, 230, 0.35);
}

.page-header {
    margin-bottom: 24px;
}

.btn-drom {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    margin-left: auto;
}

.btn-drom:hover {
    background: #fff;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Examples (grid adjustment) */
.example-links {
    display: flex;
    gap: 8px;
}

.examples-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.examples-table th,
.examples-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
    font-size: 0.85rem;
    color: #495057;
}

.examples-table th {
    font-weight: 700;
    color: #868e96;
    background: #f8f9fa;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.examples-table tr:last-child td {
    border-bottom: none;
}

.examples-table tr:hover td {
    background: #fdfdfe;
}

/* Status Alert */
.status-alert {
    margin-top: 10px;
    background: #fff9db;
    border: 1px solid #ffec99;
    padding: 10px;
    border-radius: 6px;
    color: #e67700;
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 440px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1d21;
}

.modal-content textarea {
    width: 100%;
    height: 120px;
    padding: 14px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    resize: none;
    margin-bottom: 24px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #495057;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-content textarea:focus {
    outline: none;
    border-color: #228be6;
    box-shadow: 0 0 0 3px rgba(34, 139, 230, 0.1);
}

.modal-content textarea::placeholder {
    color: #adb5bd;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.examples-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.examples-table th,
.examples-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 0.85rem;
}

.examples-table th {
    font-weight: 600;
    color: #888;
    background: #f8f9fa;
}

.examples-table tr:hover {
    background: #f8f9fa;
}

/* Toggle Switch */
.label-with-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.label-with-toggle label[id="label-30min"] {
    margin-bottom: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: #20c997;
}

input:focus+.slider {
    box-shadow: 0 0 1px #20c997;
}

input:checked+.slider:before {
    transform: translateX(16px);
}

input:disabled+.slider {
    cursor: not-allowed;
    background-color: #e9ecef;
}

input:disabled+.slider:before {
    background-color: #f8f9fa;
}

/* Rounded sliders */
.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}