* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #121212;
    color: #e8e8e8;
    font-size: 14px;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
}

header {
    background: #000000;
    border-bottom: 1px solid #2c2c2c;
    padding: 10px 20px;
}

header a {
    color: #4da3ff;
    text-decoration: none;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* gap: 20px; */
    padding: 0 20px 0 0;
}

main {
    padding: 16px 0;
}

h1 {
    font-size: 20px;
    margin: 0 0 16px;
    color: #ffffff;
    font-weight: 600;
}

h2 {
    font-size: 16px;
    margin: 0 0 12px;
    color: #ffffff;
    font-weight: 600;
}

form input,
form textarea,
form button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    background: #1e1e1e;
    color: #e8e8e8;
    border: 1px solid #333333;
    border-radius: 4px;
    margin-bottom: 10px;
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: #4da3ff;
}

form button {
    background: #2b6cb0;
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

form button:hover {
    background: #2c5282;
}

.farm-layout {
    display: flex;
    gap: 20px;
    align-items: start;
}

.dialog-panel {
    flex: 2;
    min-width: 0;
}

.snapshot-panel {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

@media (max-width: 900px) {
    .farm-layout {
        flex-direction: column;
    }
    .snapshot-panel {
        max-width: none;
    }
}

@media (max-width: 900px) {
    .farm-layout {
        grid-template-columns: 1fr;
    }
}

.dialog-panel,
.snapshot-panel {
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    border-radius: 6px;
    padding: 16px;
}

.dialog-box {
    height: 500px;
    overflow-y: auto;
    background: #121212;
    border: 1px solid #2c2c2c;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
}

.message {
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 4px;
}

.message.user {
    background: #1e3a5f;
    text-align: right;
}

.message.ai {
    background: #1e1e1e;
    border: 1px solid #2c2c2c;
    text-align: left;
}

.message-text {
    white-space: normal;
}

.snapshot-panel {
    min-height: 500px;
}

#dialog-input {
    min-height: 44px;
}

/* Tasks */

.filters {
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-form select,
.filter-form button {
    padding: 8px 12px;
    background: #1e1e1e;
    color: #e8e8e8;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.filter-form button {
    background: #2b6cb0;
    color: #fff;
    border: none;
}

.filter-form button:hover {
    background: #2c5282;
}

.task-table {
    width: 100%;
    border-collapse: collapse;
}

.task-table th,
.task-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #2c2c2c;
    text-align: left;
}

.task-table th {
    background: #1a1a1a;
    color: #aaa;
    font-weight: 500;
}

.task-row {
    cursor: pointer;
    transition: background 0.2s;
}

.task-row:hover {
    background: #1a1a1a;
}

.task-info {
    background: #1a1a1a;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.task-info p {
    margin: 4px 0;
}

.task-description {
    margin-bottom: 20px;
}

.task-reports {
    margin-top: 20px;
}

.report-item {
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.report-header {
    margin-bottom: 8px;
    color: #aaa;
}

.report-text {
    margin-bottom: 8px;
}

.report-facts {
    background: #121212;
    padding: 8px;
    border-radius: 4px;
}

.report-facts pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 4px 0 0;
    font-family: inherit;
    font-size: 13px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
}

.logo-img {
    height: 120px;
    width: auto;
    display: block;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.header-nav {
    display: flex;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

.header-nav a {
    color: #4da3ff;
    text-decoration: none;
    font-size: 14px;
}

.header-nav a:hover {
    text-decoration: underline;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.username {
    color: #aaa;
    font-size: 14px;
}

.logout-link {
    color: #4da3ff;
    text-decoration: none;
    font-size: 14px;
}

.logout-link:hover {
    text-decoration: underline;
}

.user-balance {
    display: block;
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

.missing-panel {
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    border-radius: 6px;
    padding: 16px;
}

.missing-box {
    height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    background: #121212;
    border: 1px solid #2c2c2c;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 8px;
}

.missing-hint {
    font-size: 12px;
    color: #aaa;
    margin: 0;
}

.data-section,
.debug-section {
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    border-radius: 6px;
    padding: 16px;
    margin-top: 20px;
    width: 100%;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.dashboard-actions .btn-primary,
.dashboard-actions .btn-outline {
    text-decoration: none;
}

.btn-primary {
    display: inline-block;
    padding: 10px 16px;
    background: #2b6cb0;
    color: #fff;
    border-radius: 6px;
    border: none;
}

.btn-outline {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid #2b6cb0;
    color: #2b6cb0;
    border-radius: 6px;
    background: transparent;
}

.report-list {
    list-style: none;
    padding: 0;
}

.report-list li {
    padding: 8px 0;
    border-bottom: 1px solid #2c2c2c;
}