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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f4;
    color: #1a1a1a;
    line-height: 1.5;
}

/* ===== Экран входа ===== */
#login-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    width: 320px;
    text-align: center;
}

.login-box h1 {
    font-size: 22px;
    margin-bottom: 4px;
}

.subtitle {
    color: #777;
    font-size: 14px;
    margin-bottom: 24px;
}

#login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
}

#login-form button {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}

#login-form button:hover {
    background: #1d4ed8;
}

.error-text {
    color: #dc2626;
    font-size: 13px;
    margin-top: 10px;
    min-height: 18px;
}

/* ===== Основной экран ===== */
.topbar {
    background: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
}

.topbar h1 {
    font-size: 18px;
}

.btn-secondary {
    background: #f0f0ef;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #e5e5e3;
}

.tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e5e5e5;
    padding: 0 24px;
}

.tab-btn {
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.tab-content {
    display: none;
}

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

.section-hint {
    color: #777;
    font-size: 13px;
    margin-bottom: 16px;
}

h2 {
    font-size: 16px;
    margin: 24px 0 12px;
}

h2:first-child {
    margin-top: 0;
}

/* ===== Карточки промптов ===== */
.prompt-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.prompt-card h3 {
    font-size: 15px;
    margin-bottom: 8px;
}

.prompt-card textarea {
    width: 100%;
    min-height: 160px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    margin-bottom: 10px;
}

.prompt-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.save-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.save-btn:hover {
    background: #1d4ed8;
}

.save-status {
    font-size: 13px;
    color: #16a34a;
}

/* ===== Переключатели ===== */
.toggle-row {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.2s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}

input:checked + .slider {
    background-color: #2563eb;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ===== RSS список ===== */
.rss-row {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.rss-row .rss-info {
    flex: 1;
    overflow: hidden;
}

.rss-row .rss-url {
    font-size: 13px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rss-row .delete-btn {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 13px;
}

.inline-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.inline-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.inline-form input[type="url"] {
    flex: 1;
}

.inline-form button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

/* ===== Журнал ===== */
.log-row {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.log-row-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.log-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.log-status.success { background: #dcfce7; color: #16a34a; }
.log-status.error { background: #fee2e2; color: #dc2626; }
.log-status.started { background: #dbeafe; color: #2563eb; }
.log-status.pending_approval { background: #fef3c7; color: #d97706; }

.log-time {
    font-size: 12px;
    color: #999;
}

.log-details {
    font-size: 13px;
    color: #555;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px 0;
    font-size: 14px;
}
