* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

.container {
    max-width: 980px;
    margin: 24px auto;
    padding: 0 16px;
}

h1 {
    margin: 0 0 16px;
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 10px;
}

select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
}

button {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
}

button[type="button"] {
    background: #0ea5e9;
}

button.remove-btn {
    background: #ef4444;
}

.point-toggle-btn.toggle-to-passive {
    background: #dc2626;
}

.point-toggle-btn.toggle-to-active {
    background: #16a34a;
}

button.route-delete-btn {
    background: #dc2626;
    margin-left: 6px;
}

.point-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.point-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-weight: 600;
}

.address-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.status {
    margin-top: 8px;
    font-size: 13px;
    color: #334155;
}

.actions {
    margin-top: 12px;
}

.list-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

#routesTableWrap {
    display: none;
}

.routes-accordion {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.route-dropdown {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.route-dropdown summary {
    cursor: pointer;
    padding: 10px;
    font-weight: 700;
    color: #0f172a;
}

.route-dropdown-content {
    padding: 10px;
    border-top: 1px dashed #e5e7eb;
    display: grid;
    gap: 6px;
}

.route-point-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    background: #f8fafc;
    margin-top: 6px;
}

.route-point-head {
    font-weight: 700;
    margin-bottom: 4px;
}

.message {
    margin-top: 12px;
    font-weight: 600;
}

.message.error {
    color: #dc2626;
}

.message.success {
    color: #059669;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.responsive-table {
    min-width: 980px;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 6px;
}

.route-detail {
    margin-top: 16px;
}

.route-detail h3 {
    margin: 0 0 8px;
}

.route-detail-mobile {
    display: none;
}

.point-dropdown {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
}

.point-dropdown summary {
    cursor: pointer;
    padding: 10px;
    font-weight: 600;
    list-style: none;
}

.point-dropdown-content {
    border-top: 1px dashed #e5e7eb;
    padding: 10px;
    display: grid;
    gap: 6px;
    font-size: 14px;
}

.dropdown-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.mobile-empty {
    font-size: 14px;
    color: #475569;
    margin: 8px 0;
}

.point-edit {
    margin-top: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}

.point-edit h4 {
    margin: 0 0 8px;
}

#cancelPointEditBtn {
    background: #64748b;
    margin-left: 6px;
}

.go-link {
    display: inline-block;
    background: #16a34a;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .container {
        margin: 12px auto;
        padding: 0 10px;
    }

    .card {
        padding: 12px;
    }

    .row-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .address-grid,
    .list-toolbar {
        grid-template-columns: 1fr;
    }

    .table-wrap {
        overflow: visible;
    }

    .responsive-table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table th,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table {
        min-width: 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 8px;
        background: #fff;
    }

    .responsive-table td {
        border: 0;
        border-bottom: 1px dashed #e5e7eb;
        padding: 8px 4px;
    }

    .responsive-table td:last-child {
        border-bottom: 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        color: #64748b;
        margin-bottom: 2px;
        font-weight: 600;
    }

    #routeDetailSection .table-wrap {
        display: none;
    }

    .route-detail-mobile {
        display: block;
    }

    .dropdown-actions {
        flex-wrap: wrap;
    }

    #cancelPointEditBtn {
        margin-left: 0;
        margin-top: 8px;
    }
}
