:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #17202a;
    --muted: #667085;
    --border: #e4e7ec;
    --primary: #166534;
    --primary-dark: #14532d;
    --danger: #b42318;
    --warning: #b54708;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.topbar {
    min-height: 68px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    position: sticky;
    top: 0;
    z-index: 20;
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
    padding: 8px 18px;
    overflow-x: auto;
}

.nav a {
    color: var(--text);
    text-decoration: none;
    padding: 9px 13px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 14px;
}

.nav a:hover {
    background: #eef7f0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 50px;
}

h1 {
    margin: 0 0 5px;
    font-size: 26px;
}

h2 {
    margin-top: 0;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 20px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 17px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.stat-value {
    font-size: 27px;
    font-weight: 800;
    margin-top: 8px;
}

.actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.action {
    text-decoration: none;
    color: white;
    background: var(--primary);
    padding: 17px;
    border-radius: 12px;
    text-align: center;
    font-weight: 700;
}

.action.danger {
    background: var(--danger);
}

.action.secondary {
    background: #344054;
}

.form-card {
    max-width: 720px;
    margin: 0 auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.field {
    margin-bottom: 15px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    padding: 12px;
    font-size: 16px;
    background: white;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.btn {
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: white;
    padding: 13px 18px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.logout-btn {
    border: 0;
    background: #f2f4f7;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.alert {
    padding: 13px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.alert.success {
    background: #ecfdf3;
    color: #027a48;
}

.alert.error {
    background: #fef3f2;
    color: #b42318;
}

.table-wrap {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 13px;
}

th {
    background: #f9fafb;
}

.total-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.login-card {
    max-width: 420px;
    margin: 60px auto;
}

@media (max-width: 800px) {
    .cards {
        grid-template-columns: 1fr 1fr;
    }

    .actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px 10px 40px;
    }

    .cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .card {
        padding: 13px;
    }

    .stat-value {
        font-size: 21px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .field.full {
        grid-column: auto;
    }

    h1 {
        font-size: 22px;
    }
}

.production-section {
    margin-top: 22px;
}

.production-heading {
    background: #166534;
    color: white;
    border-radius: 11px 11px 0 0;
    padding: 12px 14px;
}

.production-heading strong {
    display: block;
    font-size: 18px;
}

.production-heading small {
    display: block;
    opacity: .85;
    margin-top: 3px;
}

.production-row {
    background: white;
    border: 1px solid #e4e7ec;
    border-top: 0;
    padding: 13px;
}

.production-item {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    margin-bottom: 9px;
}

.production-item strong {
    font-size: 15px;
}

.planned {
    color: #667085;
    font-size: 13px;
    white-space: nowrap;
}

.actual-box {
    display: grid;
    grid-template-columns: 1fr 110px 90px;
    gap: 8px;
}

.actual-box input,
.actual-box select {
    margin: 0;
}

.row-notes {
    margin-top: 8px;
    font-size: 13px;
}

@media (max-width: 600px) {
    .production-item {
        display: block;
    }

    .planned {
        display: block;
        margin-top: 4px;
    }

    .actual-box {
        grid-template-columns: 1fr 85px 75px;
    }

    .actual-box .btn {
        padding: 10px 8px;
        font-size: 14px;
    }
}
