:root {
    --brand: #14532d;
    --brand-soft: #e8f5ee;
    --ink: #17212b;
    --muted: #637083;
    --line: #d8dee8;
    --surface: #f6f8fb;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    color: var(--ink);
    background: var(--surface);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.navbar-brand {
    color: var(--brand);
    font-weight: 700;
}

.mobile-main-actions {
    display: none;
}

.page-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

.page-title {
    margin-bottom: 20px;
}

.page-title h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
}

.page-title p {
    margin: 0;
    color: var(--muted);
}

.page-title-with-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.page-title-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

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

.action-card {
    display: flex;
    flex-direction: column;
    min-height: 180px;
    padding: 24px;
    color: var(--ink);
    text-decoration: none;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.action-card:hover {
    border-color: var(--brand);
    box-shadow: 0 8px 24px rgba(20, 83, 45, 0.08);
}

.action-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 22px;
}

.action-card span {
    color: var(--muted);
}

.action-card .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    margin-top: auto;
    line-height: 1;
    font-weight: 700;
    text-align: center;
}

.action-card .btn-primary {
    color: #ffffff;
    background: #0f5132;
    border-color: #0f5132;
}

.action-card .btn-outline-primary {
    color: #0f5132;
    border-color: #0f5132;
    background: #ffffff;
}

.section-title {
    margin: 28px 0 12px;
    font-size: 18px;
    font-weight: 700;
}

.required::after {
    content: " *";
    color: #b42318;
}

.form-control,
.form-select,
.btn {
    min-height: 44px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.placeholder-select:invalid {
    color: #8b96a8;
}

.placeholder-select option {
    color: var(--ink);
}

.placeholder-select option[value=""] {
    color: #8b96a8;
}

.btn-primary {
    border-color: var(--brand);
    background: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: #0f3f22;
    background: #0f3f22;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--brand);
    background: var(--brand-soft);
    font-weight: 700;
}

.status-badge--submitted {
    color: #92400e;
    background: #fef3c7;
}

.status-badge--approved {
    color: #166534;
    background: #dcfce7;
}

.status-badge--rejected {
    color: #991b1b;
    background: #fee2e2;
}

.status-badge--edit-requested {
    color: #1d4ed8;
    background: #dbeafe;
}

.status-badge--cancel-requested {
    color: #9a3412;
    background: #ffedd5;
}

.status-badge--cancel-approved {
    color: #374151;
    background: #e5e7eb;
}

.status-badge--completed {
    color: #0f766e;
    background: #ccfbf1;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
}

.detail-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.detail-label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.sort-save-button:disabled {
    color: #8b96a8;
    background: #ffffff;
    border-color: #cfd6e2;
    opacity: 1;
}

.sort-save-button.is-dirty:not(:disabled) {
    color: #b42318;
    background: #ffffff;
    border-color: #b42318;
    font-weight: 700;
}

.sort-save-button.is-dirty:not(:disabled):hover,
.sort-save-button.is-dirty:not(:disabled):focus {
    color: #921b13;
    background: #fff5f5;
    border-color: #921b13;
}

.sort-handle-cell {
    width: 76px;
}

.drag-handle {
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-height: 42px;
    padding: 0;
    color: #637083;
    cursor: grab;
    background: #ffffff;
    border: 1px solid #cfd6e2;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(23, 33, 43, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.drag-handle:hover,
.drag-handle:focus {
    color: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(20, 83, 45, 0.10);
    outline: 0;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle::before,
.drag-handle::after {
    position: absolute;
    left: 50%;
    width: 10px;
    height: 10px;
    border-color: currentColor;
    border-style: solid;
    content: "";
}

.drag-handle::before {
    top: 10px;
    border-width: 2px 0 0 2px;
    transform: translateX(-50%) rotate(45deg);
}

.drag-handle::after {
    bottom: 10px;
    border-width: 0 2px 2px 0;
    transform: translateX(-50%) rotate(45deg);
}

.drag-handle span {
    display: none;
}

.sortable-table tr.dragging {
    opacity: 0.55;
}

.sortable-table tr.drag-over {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

.region-company-separator td {
    padding: 10px 12px;
    color: var(--ink);
    background: #eef2f7;
    border-top: 3px solid #8b96a8;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
}

.region-child-name {
    padding-left: 22px;
    background-image: linear-gradient(90deg, #d0d7e2 0, #d0d7e2 10px, transparent 10px);
    background-position: 8px 50%;
    background-repeat: no-repeat;
    background-size: 10px 1px;
}

.time-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.region-select-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.sub-region-required-missing {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.vehicle-entry {
    display: grid;
    grid-template-columns: max-content minmax(180px, 1fr);
    gap: 12px;
    align-items: end;
}

.vehicle-check-wrap {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-bottom: 2px;
}

.vehicle-check-label {
    color: #0d6efd;
    font-weight: 700;
}

.host-candidate-panel {
    padding: 16px;
    border: 1px solid #f1b5b5;
    border-radius: 8px;
    background: #fff8f8;
}

.host-candidate-title {
    margin-bottom: 10px;
    color: #b42318;
    font-weight: 700;
}

.host-candidate-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.host-candidate-option {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 58px;
    padding: 12px;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.host-candidate-option:hover,
.host-candidate-option:focus-within {
    border-color: #b42318;
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

.host-candidate-option input {
    margin-top: 4px;
}

.host-candidate-option strong,
.host-candidate-option small {
    display: block;
    overflow-wrap: anywhere;
}

.host-candidate-option small {
    margin-top: 4px;
    color: var(--muted);
}

.password-toggle-button {
    width: 48px;
}

.password-eye-icon {
    display: block;
}

.validation-summary-errors,
.field-validation-error {
    color: #b42318;
}

.validation-summary-errors ul {
    margin-bottom: 0;
}

.mobile-card-table td,
.mobile-card-table th {
    vertical-align: middle;
}

@media (max-width: 768px) {
    .page-shell {
        padding: 24px 14px 40px;
    }

    .site-header .page-shell {
        display: flex;
        gap: 12px;
    }

    .navbar-brand {
        display: none;
    }

    .mobile-main-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 44px;
        font-weight: 700;
    }

    .mobile-main-actions a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        color: var(--brand);
        text-decoration: none;
    }

    .mobile-main-actions span {
        color: #a0a9b8;
    }

    .navbar-toggler,
    .navbar-collapse {
        display: none !important;
    }

    .page-title h1 {
        font-size: 24px;
    }

    .page-title-with-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-title-actions {
        justify-content: flex-start;
    }

    .panel {
        padding: 18px;
    }

    .action-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .mobile-card-table thead {
        display: none;
    }

    .mobile-card-table,
    .mobile-card-table tbody,
    .mobile-card-table tr,
    .mobile-card-table td {
        display: block;
        width: 100%;
    }

    .mobile-card-table tr {
        margin-bottom: 12px;
        padding: 14px;
        background: #ffffff;
        border: 1px solid var(--line);
        border-radius: 8px;
    }

    .mobile-card-table tr.region-company-separator {
        padding: 0;
        border: 0;
        border-radius: 0;
    }

    .mobile-card-table td {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding: 8px 0;
        border: 0;
    }

    .mobile-card-table .region-company-separator td {
        display: block;
        margin: 18px 0 8px;
        padding: 10px 12px;
    }

    .mobile-card-table .region-company-separator td::before {
        display: none;
    }

    .sort-handle-cell {
        width: 100%;
    }

    .vehicle-entry {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .region-select-pair {
        grid-template-columns: minmax(0, 1fr);
    }

    .vehicle-check-wrap {
        min-height: 32px;
        padding-bottom: 0;
    }

    .host-candidate-list {
        grid-template-columns: 1fr;
    }

    .mobile-card-table td::before {
        content: attr(data-label);
        flex: 0 0 96px;
        color: var(--muted);
        font-weight: 700;
    }

    .mobile-card-table td.table-actions-cell {
        display: block;
    }

    .mobile-card-table td.table-actions-cell::before {
        display: none;
    }
}
