/* Stats */
.stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-box { background: white; padding: 20px; border-radius: 12px; border-left: 5px solid #1B9BD7; }
.stat-box.waiting { border-left-color: #c62828; }
.stat-box.assigned { border-left-color: #e65100; }
.stat-box.complete { border-left-color: #2e7d32; }
.stat-label { font-size: 13px; color: #666; margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 900; color: #0D5C8A; }
.stat-box.waiting .stat-value { color: #c62828; }
.stat-box.assigned .stat-value { color: #e65100; }
.stat-box.complete .stat-value { color: #2e7d32; }

/* Filter & Search */
.filter-bar { display: flex; gap: 8px; background: white; padding: 12px; border-radius: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 15px; }
.filter-label { font-weight: 700; font-size: 13px; color: #666; }
.search-bar { background: white; padding: 12px; border-radius: 12px; margin-bottom: 15px; display: flex; gap: 8px; align-items: center; }
.search-input { flex: 1; padding: 10px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; }

/* Table */
.table-wrap { background: white; border-radius: 15px; overflow-x: auto; margin-bottom: 20px; position: relative; }
table { width: 100%; min-width: 800px; border-collapse: collapse; }
th { background: #f8f9fa; padding: 15px 12px; font-weight: 900; font-size: 12px; color: #0D5C8A; border-bottom: 2px solid #e0e0e0; text-align: left; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
tr:hover { background: #fafafa; cursor: pointer; }

/* ── 관리 컬럼(마지막 컬럼) 오른쪽 고정 ── */
.table-wrap table th:last-child,
.table-wrap table td:last-child {
    position: sticky;
    right: 0;
    background: white;
    z-index: 2;
    box-shadow: -4px 0 8px rgba(0,0,0,0.06);
    min-width: 100px;
    text-align: center;
}
.table-wrap table th:last-child {
    background: #f8f9fa;
}
.table-wrap table tr:hover td:last-child {
    background: #fafafa;
}

/* Cards */
.card-list { display: flex; flex-direction: column; gap: 15px; }
.data-card { background: white; padding: 20px; border-radius: 15px; border-left: 5px solid #1B9BD7; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-title { font-size: 18px; font-weight: 900; color: #0D5C8A; }
.card-subtitle { font-size: 13px; color: #666; margin: 6px 0; }
.card-info { font-size: 14px; margin: 8px 0; line-height: 1.6; }
.card-actions { display: flex; gap: 8px; margin-top: 15px; padding-top: 15px; border-top: 1px solid #f0f0f0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.card { background: white; padding: 18px; border-radius: 12px; border-left: 4px solid #1B9BD7; cursor: pointer; }

/* Buttons */
.btn { padding: 10px 18px; border-radius: 8px; font-weight: 700; cursor: pointer; border: none; transition: 0.2s; white-space: nowrap; font-size: 14px; }
.btn-primary { background: #1B9BD7; color: white; }
.btn-success { background: #00C48C; color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-edit { background: #e3f2fd; color: #1B9BD7; }
.btn-delete { background: #ffebee; color: #f44336; }
.btn-search { background: #0D5C8A; color: white; min-width: 70px; }
.btn-warning { background: #ff9800; color: white; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000; align-items: center; justify-content: center; padding: 15px; }
.modal-box { background: white; width: 100%; max-width: 900px; max-height: 90vh; border-radius: 20px; overflow: hidden; }
.modal-box.large { max-width: 1000px; }
.modal-header { padding: 20px; background: #f8f9fa; border-bottom: 1px solid #e0e0e0; display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 20px; font-weight: 900; color: #0D5C8A; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: #e0e0e0; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; }
.modal-close:hover { background: #f44336; color: white; }
.modal-body { padding: 15px; overflow-y: auto; max-height: calc(90vh - 150px); }
.modal-footer { padding: 15px 20px; background: #f8f9fa; border-top: 1px solid #e0e0e0; display: flex; gap: 10px; justify-content: flex-end; }

/* Form */
.form-row { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 700; color: #0D5C8A; font-size: 14px; }
.form-input { width: 100%; padding: 12px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 15px; }
.form-input:focus { border-color: #1B9BD7; outline: none; }
.form-input[readonly] { background: #f5f5f5; }
.input-group { display: flex; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Autocomplete */
.autocomplete { position: relative; }
.autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 2px solid #1B9BD7; border-radius: 8px; max-height: 200px; overflow-y: auto; z-index: 1000; display: none; margin-top: 5px; }
.autocomplete-item { padding: 12px; cursor: pointer; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.autocomplete-item:hover { background: #e3f2fd; }

/* Badge */
.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-block; white-space: nowrap; }
.badge.waiting { background: #ffebee; color: #c62828; }
.badge.pickup_wait { background: #fff3e0; color: #e65100; }
.badge.delivering { background: #f3e5f5; color: #7b1fa2; }
.badge.complete { background: #e8f5e9; color: #2e7d32; }
.badge.prepay { background: #e0f2f1; color: #00695c; }
.badge.charge { background: #fff9c4; color: #f57f17; }
.badge.settle-wait { background: #fff3e0; color: #e65100; }
.badge.settle-done { background: #e8f5e9; color: #2e7d32; }

/* Info Section */
.info-section { background: #f8f9fa; padding: 15px; border-radius: 10px; margin-bottom: 15px; }
.info-row { display: flex; margin-bottom: 10px; }
.info-label { font-weight: 700; color: #0D5C8A; min-width: 100px; flex-shrink: 0; }
.info-value { color: #333; word-break: keep-all; line-height: 1.5; }

/* Week Nav */
.week-nav { display: flex; align-items: center; gap: 12px; background: white; padding: 12px 16px; border-radius: 12px; margin-bottom: 15px; }
.week-nav-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #1B9BD7; background: white; color: #1B9BD7; font-size: 18px; font-weight: 900; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.week-nav-btn:hover { background: #1B9BD7; color: white; }
.week-nav-text { flex: 1; text-align: center; font-weight: 700; color: #0D5C8A; font-size: 15px; }

/* Settle Summary */
.settle-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.settle-summary-box { background: white; padding: 20px; border-radius: 12px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.settle-summary-box .s-label { font-size: 13px; color: #666; margin-bottom: 8px; }
.settle-summary-box .s-value { font-size: 22px; font-weight: 900; color: #0D5C8A; }

/* Rider Settle Table */
.rider-settle-table { width: 100%; border-collapse: collapse; }
.rider-settle-table th { background: #f0f7ff; padding: 12px 8px; font-size: 12px; color: #0D5C8A; border-bottom: 2px solid #1B9BD7; }
.rider-settle-table td { padding: 10px 8px; font-size: 13px; text-align: center; border-bottom: 1px solid #eee; }
.rider-settle-table tr:hover { background: #f8f9fa; }

/* Status Filter */
.status-filter-box { display: flex; gap: 8px; background: white; padding: 12px; border-radius: 12px; margin-bottom: 15px; flex-wrap: wrap; }
.status-filter-chip { padding: 8px 15px; border-radius: 20px; border: 2px solid #e0e0e0; background: white; cursor: pointer; font-weight: 700; font-size: 12px; color: #666; transition: 0.2s; }
.status-filter-chip.active { border-color: #1B9BD7; background: #1B9BD7; color: white; }
.status-filter-chip:hover { border-color: #1B9BD7; }

/* Pagination */
.page-btn { padding: 8px 12px; border: 1px solid #ddd; background: white; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 700; color: #333; transition: 0.2s; }
.page-btn:hover { border-color: #5C6BC0; color: #5C6BC0; }
.page-btn.active { background: #5C6BC0; color: white; border-color: #5C6BC0; }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ══════════════════════════════════════════
   15인치 노트북(1200~1500px) 중간 해상도 대응
   ══════════════════════════════════════════ */
@media (max-width: 1500px) and (min-width: 769px) {
    table { min-width: 750px; }
    th { padding: 12px 8px; font-size: 11px; }
    td { padding: 10px 8px; font-size: 12px; }
    td[style*="max-width"] { max-width: 150px !important; }
    .btn-sm { padding: 4px 8px; font-size: 11px; }
    .stat-value { font-size: 28px; }
    .stat-box { padding: 15px; }
}
