* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f5f7;
    color: #1f2937;
}

a {
    color: #0f766e;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    min-height: 56px;
    background: #111827;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 20px;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.nav a {
    color: #d1d5db;
    font-size: 14px;
}

.nav a:hover {
    color: #fff;
}

.container {
    max-width: 1180px;
    margin: 24px auto;
    padding: 0 18px;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
}

.card h1,
.card h2,
.card h3 {
    margin-top: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
}

.stat strong {
    display: block;
    font-size: 28px;
    margin-bottom: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.form-row {
    margin-bottom: 14px;
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 14px;
    background: #fff;
}

textarea {
    min-height: 80px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin: 16px 0;
}

.btn,
button {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 9px 14px;
    background: #0f766e;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.btn.secondary {
    background: #374151;
}

.btn.danger,
button.danger {
    background: #b91c1c;
}

.btn.light {
    background: #e5e7eb;
    color: #111827;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th {
    background: #f9fafb;
    font-size: 13px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge.ok {
    background: #dcfce7;
    color: #166534;
}

.badge.off {
    background: #fee2e2;
    color: #991b1b;
}

.notice {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.error {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.small {
    color: #6b7280;
    font-size: 12px;
}

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

.operation-row {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(130px, 1fr) minmax(130px, 1fr) 100px 120px 140px;
    gap: 10px;
    margin-bottom: 14px;
    align-items: end;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.operation-row > div {
    min-width: 0;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-height: 38px;
    font-weight: 700;
}

.inline-check input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.operation-row button.danger {
    width: 100%;
    white-space: nowrap;
}

@media (max-width: 860px) {
    .grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
    }

    .operation-row {
        grid-template-columns: 1fr;
    }

    .operation-row button.danger {
        width: auto;
    }
}

@media print {
    .no-print {
        display: none !important;
    }
}
