body {
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, #0661aa 0%, #e3e9f7 100%);
    min-height: 100vh;
    margin: 0;
    transition: background 0.4s;
}

.dark-mode body {
    background: linear-gradient(135deg, #181c23 0%, #232a36 100%);
}

.dark-mode .header {
    background: linear-gradient(90deg, #232a36 60%, #0661aa 100%);
    color: #fff;
}

.dark-mode .main-card {
    background: #232a36;
    color: #e3e9f7;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.dark-mode h2,
.dark-mode .kg-box label {
    color: #90caf9;
}

.dark-mode th {
    background: linear-gradient(90deg, #0661aa 60%, #232a36 100%);
    color: #fff;
}

.dark-mode td {
    background: #232a36;
    color: #e3e9f7;
}

.dark-mode .total-row {
    background: linear-gradient(90deg, #0661aa 0%, #232a36 100%);
}

.dark-mode .footer {
    background: #232a36;
    color: #fff;
}

.dark-mode input,
.dark-mode select {
    background: #181c23;
    color: #e3e9f7;
    border-color: #444;
}

.dark-mode button[type="submit"] {
    background: linear-gradient(90deg, #232a36 60%, #0661aa 100%);
    color: #fff;
}

.dark-mode button[type="button"].increase,
.dark-mode button[type="button"].decrease {
    background: #232a36;
    color: #90caf9;
}

.dark-mode .icon-cell {
    color: #90caf9;
}

.dark-mode #success-message {
    background: #388e3c;
    color: #fff;
}

.dark-mode a {
    color: #90caf9;
}

.dark-mode table {
    background: #232a36;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
}

.dark-mode tr:hover {
    background: #181c23;
}

.dark-mode input[type="number"],
.dark-mode input[type="text"] {
    background: #181c23;
    color: #e3e9f7;
    border-color: #444;
}

.dark-mode .main-card {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.dark-mode .header img {
    filter: brightness(0.85) contrast(1.1);
}

.darkmode-toggle {
    position: fixed;
    top: 18px;
    right: 24px;
    z-index: 10000;
    background: #fff;
    color: #0661aa;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5em;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.13);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.dark-mode .darkmode-toggle {
    background: #232a36;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.header {
    background: linear-gradient(90deg, #0661aa 60%, #2196f3 100%);
    color: #fff;
    padding: 24px 0 16px 0;
    text-align: center;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.10);
    margin-bottom: 20px;
}

.header img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.13);
}

.header h1 {
    margin: 0;
    font-size: 2.2em;
    font-weight: 700;
    letter-spacing: 1px;
}

.header p {
    margin: 0;
    font-size: 1.1em;
    font-weight: 400;
    opacity: 0.85;
}

.main-card {
    background: #fff;
    max-width: 950px;
    margin: 40px auto 0 auto;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.13);
    padding: 32px 24px 24px 24px;
    animation: fadeIn 1s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    color: #0661aa;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.kg-box label {
    color: #0661aa;
    font-weight: 500;
}

table {
    width: 100%;
    margin: 20px auto;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.07);
    border-radius: 12px;
    overflow: hidden;
    animation: fadeIn 1.2s;
}

th,
td {
    padding: 12px;
    border: 1px solid #e3e6ed;
    text-align: center;
    transition: background 0.3s;
}

th {
    background: linear-gradient(90deg, #0661aa 60%, #2196f3 100%);
    color: #fff;
    font-size: 1.05em;
}

tr {
    transition: background 0.3s;
}

tr:hover {
    background: #f0f4fa;
}

input[type="number"],
input[type="text"] {
    width: 70px;
    padding: 7px;
    text-align: center;
    border-radius: 7px;
    border: 1.5px solid #bdbdbd;
    font-size: 16px;
    margin: 0 2px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #f7f9fc;
    box-shadow: 0 1px 4px rgba(44, 62, 80, 0.07);
}

input[type="number"]:focus,
input[type="text"]:focus {
    border-color: #3949ab;
    box-shadow: 0 0 0 2px #e3e9f7;
    outline: none;
}

button[type="button"].increase,
button[type="button"].decrease {
    background: #e3e6ed;
    color: #0661aa;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    font-weight: bold;
    margin: 0 3px;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07);
    cursor: pointer;
    position: relative;
    z-index: 1;
}

button[type="button"].increase:active,
button[type="button"].decrease:active {
    background: #b3e0ff;
    transform: scale(1.15);
}

button[type="submit"] {
    padding: 12px 28px;
    margin-top: 18px;
    cursor: pointer;
    background: linear-gradient(90deg, #0661aa 60%, #2196f3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.10);
    transition: background 0.2s, transform 0.1s;
}

button[type="submit"]:hover {
    background: linear-gradient(90deg, #2196f3 60%, #0661aa 100%);
    transform: translateY(-2px) scale(1.03);
}

@media (max-width: 700px) {
    .main-card {
        padding: 10px 2px;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 7px;
    }

    .kg-box {
        font-size: 15px;
    }
}

.bayi-input {
    width: 250px;
    min-width: 150px;
    max-width: 100%;
}

.total-row {
    background: linear-gradient(90deg, #0661aa 0%, #2196f3 100%);
    font-weight: bold;
    font-size: 1.08em;
}

.icon-cell {
    font-size: 1.2em;
}

.footer {
    margin-top: 40px;
    background: #0661aa;
    color: #fff;
    text-align: center;
    padding: 18px 0 10px 0;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    font-size: 1.05em;
    letter-spacing: 0.5px;
    box-shadow: 0 -2px 8px rgba(44, 62, 80, 0.07);
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    border: 7px solid #e3e9f7;
    border-top: 7px solid #0661aa;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 18px;
    color: #0661aa;
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: 0 2px 8px #fff;
}

.dark-mode .loading-overlay {
    background: rgba(24, 28, 35, 0.7);
}

.dark-mode .spinner {
    border: 7px solid #232a36;
    border-top: 7px solid #90caf9;
}

.dark-mode .loading-text {
    color: #90caf9;
    text-shadow: 0 2px 8px #232a36;
}