@charset "UTF-8";
/* 네비게이션 바 전체 컨테이너 */
.theone-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    font-family: 'Pretendard', sans-serif;
}

/* 메뉴 그룹별 배치 */
.nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 카테고리 구분 라벨 */
.nav-category-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    margin-right: 4px;
    text-transform: uppercase;
}

/* 개별 메뉴 버튼 스타일 (연한 파란색 포인트 적용) */
.theone-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* 마우스 올렸을 때 부드러운 연한 하늘색 배경 */
.theone-nav a:hover {
    background-color: var(--primary-soft);
    color: var(--primary-color);
}

/* 현재 선택된 메뉴 (Active) */
.theone-nav a.active {
    background-color: var(--primary-soft);
    color: var(--primary-color);
    font-weight: 600;
}

/* 관리자/계정 그룹 영역 구분감 부여 (배경색 살짝 다르게) */
.admin-user-group {
    background-color: var(--bg-light);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* 관리자 관제센터 특수 강조 뱃지 (부드러운 블루톤) */
.admin-menu-badge {
    background-color: #dbeafe !important;
    color: #1d4ed8 !important;
    font-weight: 600 !important;
}

/* 관리자 서브 탭 스타일 */
.admin-sub-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #1e293b;
    border-radius: 8px;
    color: #ffffff;
}
.admin-sub-header--hidden {
    display: none;
}
.admin-pane {
    display: none;
}
.admin-sub-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
}
.admin-sub-header-title {
    margin: 0;
    color: #ffffff;
    font-size: 1.25rem;
}
.admin-sub-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-sub-header-user {
    color: #cbd5e1;
    font-size: 0.9rem;
}
.admin-logout-btn {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
}
.admin-sub-tabs {
    display: flex;
    gap: 8px;
}
.sub-tab-btn {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.sub-tab-btn:hover {
    background-color: var(--primary-soft);
}
.sub-tab-btn.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    font-weight: 600;
}

#adminPasswordInput {
    text-align: center;
    margin-bottom: 15px;
    padding: 12px;
    width: 100%;
}

/* 관리자 인박스 대시보드 카드 레이아웃 */
.admin-dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#admin-tab-rental .sub-title {
    margin-top: 30px;
}

/* 렌탈관제: 검색/리스트 박스를 살짝 띄워 가독성을 높인다 */
#admin-tab-rental .rental-search {
    margin: 10px 0 14px;
}

#admin-tab-rental .table-wrap {
    margin-bottom: 24px;
}

.admin-active-user-panel {
    margin-bottom: 12px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
}

.admin-active-user-panel__title {
    font-weight: bold;
    margin-bottom: 6px;
}

/* 관리자 신규 부품 등록 폼 */
.radio-inline,
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    font-weight: normal;
    gap: 6px;
}

.checkbox-inline input {
    width: 16px;
    height: 16px;
    accent-color: #ea580c;
}

.btn-submit--orange {
    margin-top: 15px;
    background: #ea580c;
}

/* 관리자 ERP 대시보드 검색 박스 */
.admin-search-box {
    background: #eff6ff;
    border-color: #bfdbfe;
}

#admin-tab-erp .table-wrap {
    overflow-x: auto;
}

#admin-tab-erp .erp-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

#admin-tab-erp .input-side {
    flex: 1 1 360px;
    min-width: 320px;
    max-width: 430px;
}

#admin-tab-erp .display-side {
    flex: 2 1 640px;
    min-width: 0;
    width: 100%;
}

#admin-tab-erp {
    width: 100%;
}

#admin-tab-erp .form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

#admin-tab-erp .form-field {
    display: flex;
    flex-direction: column;
    flex: 1 1 230px;
    min-width: 0;
}

#admin-tab-erp .form-field > label {
    margin-bottom: 6px;
    min-height: 18px;
    line-height: 1.35;
}

#admin-tab-erp .form-col {
    width: 100%;
    min-width: 0;
}

#admin-tab-erp table#mainGrid {
    min-width: 1900px;
    width: max-content;
    table-layout: auto;
}

#admin-tab-erp table#mainGrid th,
#admin-tab-erp table#mainGrid td {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

@media screen and (max-width: 860px) {
    .admin-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-sub-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 8px;
    }
    .sub-tab-btn {
        flex: 0 0 auto;
        min-width: 140px;
        width: auto;
        white-space: nowrap;
    }
    .admin-sub-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .admin-sub-header-user {
        overflow-wrap: anywhere;
    }

    #admin-tab-erp .input-side,
    #admin-tab-erp .display-side {
        flex: 1 1 100%;
        max-width: 100%;
    }

    #admin-tab-erp .erp-layout {
        gap: 14px;
    }

    #admin-tab-erp .input-side {
        min-width: 0;
    }

    #admin-tab-erp .display-side {
        min-width: 0;
    }

    #sec-admin .search-box,
    #sec-admin .rental-search,
    #sec-admin .dashboard-cards,
    #sec-admin .form-row,
    #sec-admin .admin-sub-header-meta {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        min-width: 0;
    }

    #sec-admin .search-box > *,
    #sec-admin .rental-search > *,
    #sec-admin .dashboard-cards > *,
    #sec-admin .form-row > *,
    #sec-admin .admin-sub-header-meta > * {
        flex: 0 0 auto;
    }

    #sec-admin .search-box input,
    #sec-admin .search-box select,
    #sec-admin .rental-search input,
    #sec-admin .rental-search select {
        min-width: 150px;
        flex: 0 0 150px;
    }

    #admin-tab-rental .rental-search {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
    }

    #admin-tab-rental .rental-search input,
    #admin-tab-rental .rental-search select {
        flex: 0 0 140px;
        min-width: 140px;
        height: 38px;
        font-size: 13px;
    }

    #sec-admin .table-wrap table {
        width: max-content;
        min-width: 100%;
    }

    #sec-admin .table-wrap th,
    #sec-admin .table-wrap td,
    #sec-admin .search-box input,
    #sec-admin .search-box select,
    #sec-admin .rental-search input,
    #sec-admin .rental-search select,
    #sec-admin .form-field > label,
    #sec-admin .sub-tab-btn,
    #sec-admin .btn-register,
    #sec-admin .btn-save,
    #sec-admin .admin-logout-btn {
        white-space: nowrap;
    }

    #sec-admin .dashboard-cards .card {
        min-width: 220px;
    }

    #admin-tab-inbox .dashboard-cards .card {
        min-width: 150px;
        padding: 10px;
        font-size: 12px;
    }

    #admin-tab-inbox .dashboard-cards .card span {
        font-size: 16px;
        margin-top: 4px;
    }

    /* ERP: 화면 맞춤 우선 (선택 기사 카드가 과도하게 커지지 않도록 제한) */
    #admin-tab-erp .display-side .dashboard-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    #admin-tab-erp .display-side .dashboard-cards .card {
        min-width: 0;
        font-size: 12px;
        padding: 10px;
    }

    #admin-tab-erp .display-side .dashboard-cards .card span {
        font-size: 16px;
    }

}

@media screen and (max-width: 640px) {
    .admin-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .admin-sub-tabs {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .sub-tab-btn {
        width: auto;
        min-width: 132px;
        white-space: nowrap;
    }

    #admin-tab-erp .input-side {
        overflow-x: visible;
    }

    #admin-tab-erp .input-side form {
        min-width: 0;
    }

    #admin-tab-erp .form-row {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 8px;
        overflow: visible;
    }

    #admin-tab-erp .form-field {
        flex: 1 1 100%;
        min-width: 0;
    }

    #admin-tab-erp .form-col {
        width: 100%;
    }

    #admin-tab-rental .rental-search input,
    #admin-tab-rental .rental-search select {
        flex: 0 0 132px;
        min-width: 132px;
        height: 36px;
        font-size: 12px;
    }

    #admin-tab-erp .form-field > label {
        white-space: nowrap;
    }

    #admin-tab-erp .display-side .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

.form-row--spaced {
    margin-bottom: 10px;
}

.admin-dashboard-card--purple {
    background: #5b21b6;
}

.admin-dashboard-card--teal {
    background: #065f46;
}

/* 모바일에서 마지막 로드 CSS 충돌로 슬라이드가 깨지는 것을 방지하는 관리자 전용 보정 */
@media screen and (max-width: 860px) {
    #sec-admin .table-wrap {
        overflow-x: auto !important;
        overflow-y: hidden;
    }

    #sec-admin .table-wrap > table:not(.admin-product-table),
    #sec-admin table.min-table,
    #sec-admin table#mainGrid {
        width: max-content !important;
        min-width: 100% !important;
    }

    #sec-admin #admin-tab-rental .rental-search,
    #sec-admin #admin-tab-drivers .search-box {
        display: flex;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden;
    }

    #sec-admin #admin-tab-rental .rental-search > *,
    #sec-admin #admin-tab-drivers .search-box > * {
        flex: 0 0 auto;
    }
}

/* =======================================================
   최종 안정화: 공지/게시 모달 + 부품관리 레이아웃 고정
   ======================================================= */

/* 1) 공지/게시 모달이 본문 전체를 꽉 채우지 않도록 크기 제한 */
#noticeModal,
#boardWriteModal,
#boardViewModal {
    padding: 16px !important;
    box-sizing: border-box;
    justify-content: center !important;
    align-items: center !important;
}

#noticeModal .modal-content {
    width: min(92vw, 560px) !important;
    max-width: 560px !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    margin: 0 auto !important;
    box-sizing: border-box;
}

#boardWriteModal .board-modal-content,
#boardViewModal .board-view-modal-content {
    width: min(92vw, 680px) !important;
    max-width: 680px !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    margin: 0 auto !important;
    box-sizing: border-box;
}

/* 2) 부품관리: 모바일은 세로, 큰 화면은 좌우 배치 강제 */
#sec-admin #admin-tab-parts .erp-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
}

/* 상위 content-section 폭/overflow 제한으로 부품관리 영역이 잘리는 현상 방지 */
#sec-admin {
    max-width: 1500px !important;
    overflow-x: visible !important;
}

#sec-admin #admin-tab-parts .input-side,
#sec-admin #admin-parts-display {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

#sec-admin #admin-parts-display {
    align-self: stretch !important;
}

@media screen and (min-width: 861px) {
    #sec-admin #admin-tab-parts .erp-layout {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
        gap: 20px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    #sec-admin #admin-tab-parts .input-side {
        flex: 0 0 420px !important;
        width: 420px !important;
        max-width: 420px !important;
        min-width: 320px !important;
    }

    #sec-admin #admin-parts-display {
        flex: 1 1 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
}

/* 3) 현재 등록된 부품 판매 리스트 관리 영역이 자식(table)보다 작아지지 않도록 고정 */
#sec-admin #admin-parts-display .sub-title,
#sec-admin #admin-parts-display .table-wrap {
    display: block !important;
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box;
}

#sec-admin #admin-parts-display .table-wrap {
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

#sec-admin #admin-parts-display .table-wrap > table.admin-product-table {
    width: max-content !important;
    min-width: max(640px, 100%) !important;
}

/* ============================================
   �¶��� ��� �ǽð� ���� �г�
   ============================================ */

/* ���� ���� ��� ��ư */
.online-panel-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1100;
    display: none; /* ������ �α��� �� JS�� ǥ�� */
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: 10px 8px;
    cursor: pointer;
    box-shadow: -2px 0 10px rgba(0,0,0,0.25);
    font-size: 11px;
    line-height: 1.3;
    transition: background 0.2s;
}
.online-panel-toggle:hover { background: #334155; }
.online-panel-toggle-icon { font-size: 20px; }
.online-panel-toggle-label { font-weight: 700; letter-spacing: 0.5px; }

/* �¶��� ī��Ʈ ���� */
.online-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    background: #22c55e;
    color: #fff;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* �����̵� �г� */
.online-member-panel {
    position: fixed;
    right: -280px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1100;
    width: 260px;
    max-height: 70vh;
    background: #0f172a;
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 0 24px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.online-member-panel.is-open { right: 0; }

.online-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}
.online-panel-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s;
}
.online-panel-close:hover { color: #f1f5f9; }

.online-member-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}
.online-panel-placeholder {
    color: #64748b;
    font-size: 12px;
    padding: 16px;
    text-align: center;
}

/* ��� ���� �׸� */
.online-driver-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid #1e293b;
    cursor: pointer;
    transition: background 0.15s;
}
.online-driver-item:last-child { border-bottom: none; }
.online-driver-item:hover { background: #1e293b; }

.online-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
    transition: background 0.2s;
}
.online-indicator--on  { background: #22c55e; color: #22c55e; }
.online-indicator--auto { background: #38bdf8; color: #38bdf8; box-shadow: 0 0 8px rgba(56,189,248,0.9); }
.online-indicator--off { background: #475569; color: #475569; box-shadow: none; }

.online-driver-info { flex: 1; min-width: 0; }
.online-driver-name {
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.online-driver-type {
    color: #64748b;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.online-driver-status-label {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 9px;
    flex-shrink: 0;
}
.online-driver-status-label--on  { background: #166534; color: #86efac; }
.online-driver-status-label--auto { background: #0c4a6e; color: #7dd3fc; }
.online-driver-status-label--off { background: #1e293b; color: #64748b; }

/* ============================================
   ���� ���� ���� ����
   ============================================ */
.dispatch-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    transition: opacity 0.15s, transform 0.1s;
    line-height: 1.4;
}
.dispatch-badge:hover { opacity: 0.82; transform: scale(0.97); }
.dispatch-badge--waiting  { background: #fef3c7; color: #92400e; }
.dispatch-badge--assigned { background: #dbeafe; color: #1e40af; }
.dispatch-badge--driving  { background: #dcfce7; color: #166534; }
.dispatch-badge--done     { background: #f1f5f9; color: #475569; }
