/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 네비게이션 바 */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.nav-menu-item {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.nav-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-menu-item.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-username {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 0.3s, border-color 0.3s;
}

.nav-username:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: #c0392b;
}

/* 메인 컨텐츠 */
.main-content {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
}

/* 로그인 페이지 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
}

.login-title {
    text-align: center;
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.login-title-line1,
.login-title-line2 {
    display: block;
}

.login-subtitle {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 400;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
    background-color: #667eea;
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    margin-top: 0.5rem;
    position: relative;
}

.btn-login:hover:not(:disabled) {
    background-color: #5568d3;
}

.btn-login:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

.error-message {
    background-color: #fee;
    color: #c33;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #fcc;
    margin-bottom: 1rem;
    text-align: center;
}

/* 정기권 관리 페이지 */
.tickets-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tickets-container h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

/* 현장 선택 섹션 */
.site-section {
    margin-bottom: 2rem;
}

.site-search-section {
    margin-bottom: 1.5rem;
}

.site-search-section label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.site-search-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-search-input {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    max-width: 500px;
    background-color: white;
}

.site-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-lms-link {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: #00bf8f;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.btn-lms-link:hover:not(:disabled) {
    background-color: #00a87d;
}

.btn-lms-link:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* 현장 리스트 섹션 */
.site-list-section {
    margin-bottom: 1.5rem;
}

.site-list-section > label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.75rem;
}

.sites-list {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.site-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.site-item:last-child {
    margin-bottom: 0;
}

.site-item:hover {
    background-color: #f8f9fa;
}

.site-item.selected {
    background-color: #e3f2fd;
    border: 1px solid #667eea;
}

.site-item input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.site-item label {
    cursor: pointer;
    flex: 1;
    font-weight: normal;
    color: #333;
    margin: 0;
    user-select: none;
}

.loading-sites,
.no-sites,
.error-message {
    padding: 2rem;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

.error-message {
    color: #e74c3c;
}

/* 선택된 현장 정보 */
.selected-site-info {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.selected-site-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.selected-label {
    font-weight: 600;
    color: #2c3e50;
}

.selected-site-name {
    font-weight: 600;
    color: #27ae60;
    font-size: 1.1rem;
}

.selected-site-code {
    font-weight: 500;
    color: #7f8c8d;
    font-size: 0.95rem;
}

.selected-site-info .btn-lms-link {
    margin-left: auto;
    flex-shrink: 0;
}

.site-code {
    font-weight: normal;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-left: 0.25rem;
}

.form-select {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 250px;
    background-color: white;
}

/* 정기권 관리 섹션 */
.tickets-section {
    margin-top: 2rem;
}

.tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tickets-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tickets-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin: 0;
}

.ticket-count {
    font-size: 0.9rem;
    font-weight: normal;
    color: #7f8c8d;
    margin: 0;
    margin-top: 0.25rem;
}

.tickets-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.tickets-admin-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.ticket-color-guide {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    margin-bottom: 0.5rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: #fafafa;
    color: #4b5563;
    font-size: 0.85rem;
}

.ticket-color-guide-title {
    font-weight: 700;
    color: #2c3e50;
}

.ticket-color-guide-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ticket-color-guide-chip {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 3px;
}

.ticket-color-guide-chip.missing-tms {
    background-color: #fff9c4;
}

.ticket-color-guide-chip.expired {
    background-color: #ffebee;
}

.ticket-color-guide-chip.upcoming {
    background-color: #e3f2fd;
}

.ticket-color-guide-chip.normal {
    background-color: #ffffff;
}

.ticket-upcoming-guide {
    margin-bottom: 0.75rem;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    background-color: #e3f2fd;
    color: #37474f;
    font-size: 0.86rem;
    line-height: 1.5;
    overflow: hidden;
}

.ticket-upcoming-guide-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.ticket-upcoming-guide-toggle:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

.ticket-upcoming-guide-toggle-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    min-width: 0;
}

.ticket-upcoming-guide-toggle-main strong {
    color: #1a5276;
    font-size: 0.9rem;
}

.ticket-upcoming-guide-summary {
    color: #546e7a;
    font-size: 0.84rem;
}

.ticket-upcoming-guide-toggle-action {
    flex-shrink: 0;
    color: #1565c0;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.ticket-upcoming-guide-body {
    padding: 0 0.85rem 0.75rem 0.85rem;
    border-top: 1px solid #90caf9;
}

.ticket-upcoming-guide-body[hidden] {
    display: none;
}

.ticket-upcoming-guide-body p {
    margin: 0.55rem 0 0.3rem 0;
}

.ticket-upcoming-guide-body p:first-child {
    margin-top: 0.65rem;
}

.ticket-upcoming-guide-body p strong {
    display: inline;
    margin: 0;
    color: inherit;
    font-weight: 700;
}

.ticket-upcoming-guide code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.84em;
    padding: 0.05rem 0.25rem;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.7);
}

.ticket-upcoming-example {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px dashed #90caf9;
}

.ticket-upcoming-example-title {
    display: block;
    margin-bottom: 0.4rem;
    color: #1a5276;
    font-size: 0.88rem;
}

.ticket-upcoming-example > p {
    margin-bottom: 0.45rem;
}

.ticket-upcoming-example-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem;
}

.ticket-upcoming-example-table th,
.ticket-upcoming-example-table td {
    border: 1px solid #90caf9;
    padding: 0.4rem 0.5rem;
    text-align: left;
    vertical-align: top;
}

.ticket-upcoming-example-table th {
    background-color: #bbdefb;
    color: #1a5276;
    font-weight: 700;
    white-space: nowrap;
}

.ticket-upcoming-example-table td:nth-child(1) {
    white-space: nowrap;
    font-weight: 600;
}

.ticket-delete-guide-steps {
    margin: 0.35rem 0 0 1.1rem;
    padding: 0;
    color: #37474f;
}

.ticket-delete-guide-steps li {
    margin-bottom: 0.25rem;
}

.ticket-delete-guide-steps li:last-child {
    margin-bottom: 0;
}

#ticket-delete-guide {
    margin-top: -0.35rem;
}

.ticket-search-input {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    width: 260px;
    min-width: 230px;
}

.ticket-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ticket-status-filter {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    background-color: white;
    color: #2c3e50;
    min-width: 150px;
    cursor: pointer;
}

.ticket-status-filter:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-add {
    background-color: #27ae60;
    color: white;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-add:hover {
    background-color: #229954;
}

.btn-sync {
    background-color: #9b59b6;
    color: white;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.btn-sync:hover {
    background-color: #e67e22;
}

.btn-sync:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.btn-export {
    background-color: #3498db;
    color: white;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-export:hover {
    background-color: #2980b9;
}

.btn-upload {
    background-color: #9b59b6;
    color: white;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    display: inline-block;
    text-align: center;
}

.btn-upload:hover {
    background-color: #8e44ad;
}

.btn-upload:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.btn-edit {
    background-color: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 0.5rem;
}

.btn-edit:hover {
    background-color: #2980b9;
}

.btn-to-manage {
    background-color: #27ae60;
    color: white;
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 0.5rem;
}

.btn-to-manage:hover {
    background-color: #229954;
}

.btn-force-period {
    background-color: #8e44ad;
    color: white;
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 0.5rem;
}

.btn-force-period:hover {
    background-color: #7d3c98;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* 테이블 스타일 */
.table-container {
    margin-top: 1rem;
}

#tickets-table-container {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.table-container h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    table-layout: auto;
}

.tickets-table thead {
    background-color: #34495e;
    color: white;
}

.tickets-table th,
.tickets-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
    word-wrap: break-word;
}

/* 현재 적용중인 기간, 차량번호, 고객이름, 연락처 컬럼은 한 줄로 표시 */
.tickets-table td:nth-child(4),
.tickets-table td:nth-child(5),
.tickets-table td:nth-child(6),
.tickets-table td:nth-child(7) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tickets-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
    /* 컨테이너 세로 스크롤 시 헤더(필드명) 고정 */
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #34495e;
    box-shadow: 0 1px 0 #2c3e50;
}

.tickets-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 시작일 미도래 행 스타일 (옅은 파란색) */
.tickets-table tbody tr.ticket-row-upcoming {
    background-color: #e3f2fd;
}

.tickets-table tbody tr.ticket-row-upcoming:hover {
    background-color: #bbdefb;
}

/* 종료일 지난 행 스타일 (옅은 빨간색) */
.tickets-table tbody tr.ticket-row-expired {
    background-color: #ffebee;
}

.tickets-table tbody tr.ticket-row-expired:hover {
    background-color: #ffcdd2;
}

/* 관리 목록에는 있지만 TMS에는 없는 행 스타일 (노란색) */
.tickets-table tbody tr.ticket-row-missing-tms {
    background-color: #fff9c4;
}

.tickets-table tbody tr.ticket-row-missing-tms:hover {
    background-color: #fff59d;
}

.tickets-table tbody tr:last-child td {
    border-bottom: none;
}

/* 시작일, 종료일, 현재 적용중인 기간, 차량번호, 고객이름, 연락처, 정기권요금 컬럼은 한 줄로 표시 */
.tickets-table td:nth-child(2),
.tickets-table td:nth-child(3),
.tickets-table td:nth-child(4),
.tickets-table td:nth-child(5),
.tickets-table td:nth-child(6),
.tickets-table td:nth-child(7),
.tickets-table td:nth-child(8) {
    white-space: nowrap;
}

.tickets-table td:last-child {
    white-space: nowrap;
}

.tickets-table td:last-child .btn-edit,
.tickets-table td:last-child .btn-to-manage,
.tickets-table td:last-child .btn-force-period,
.tickets-table td:last-child .btn-delete {
    display: inline-block;
    vertical-align: middle;
}

.no-data-message {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-top: 2rem;
}

.tms-only-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.tms-only-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background-color: #fff8e1;
    border: 1px solid #f1c40f;
    border-radius: 4px;
}

.tms-only-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.tms-only-header-actions .btn-tms-only-bulk {
    white-space: nowrap;
}

.tms-only-header h3 {
    margin: 0 0 0.35rem 0;
    color: #2c3e50;
    font-size: 1.25rem;
}

.tms-only-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.95rem;
}

.tms-only-header .tms-only-guide {
    margin-top: 0.35rem;
    color: #5d6d7e;
    line-height: 1.5;
}

.force-period-guide {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background-color: #f5eef8;
    border: 1px solid #d2b4de;
    border-radius: 4px;
    color: #5d6d7e;
    font-size: 0.92rem;
    line-height: 1.5;
}

.force-period-guide p {
    margin: 0 0 0.35rem 0;
}

.force-period-guide p:last-child {
    margin-bottom: 0;
}

.force-period-guide .force-period-example {
    color: #6c3483;
}

#force-period-modal input[readonly] {
    background-color: #f4f6f7;
    color: #566573;
}

#tms-only-table-container {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.tms-only-no-data-message {
    margin-top: 0;
}

.ticket-history-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.ticket-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background-color: #f4f7fb;
    border: 1px solid #c5d3e3;
    border-radius: 4px;
}

.ticket-history-header h3 {
    margin: 0 0 0.35rem 0;
}

.ticket-history-header p {
    margin: 0;
    color: #5f6b7a;
    font-size: 0.9rem;
}

.ticket-history-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.btn-refresh-history,
.btn-history-more {
    padding: 0.45rem 0.9rem;
    border: 1px solid #5b7c99;
    border-radius: 4px;
    background-color: #fff;
    color: #2c3e50;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-refresh-history:hover,
.btn-history-more:hover {
    background-color: #e8eef5;
}

.ticket-history-filters {
    display: flex;
    gap: 0.75rem;
    margin: 0.85rem 0;
    flex-wrap: wrap;
}

.ticket-history-action-filter,
.ticket-history-search {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.ticket-history-action-filter {
    min-width: 170px;
    background-color: #fff;
}

.ticket-history-search {
    min-width: 240px;
    flex: 1;
}

.ticket-history-table-container,
#ticket-history-table-container {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.ticket-history-detail {
    font-size: 0.9rem;
    color: #34495e;
    word-break: break-word;
}

.ticket-history-footer {
    margin-top: 0.75rem;
    text-align: center;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-content {
        padding: 0 1rem;
    }
    
    .tickets-container {
        padding: 1rem;
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden; /* 페이지 전체 가로 흔들림 방지, 스크롤은 테이블 컨테이너만 */
    }
    
    .site-search-input {
        max-width: 100%;
    }
    
    .sites-list {
        max-height: 300px;
    }
    
    /* 모바일만: 테이블 가로 스크롤 허용 (PC의 overflow-x: hidden / 말줄임 의도는 유지) */
    #tickets-table-container,
    #tms-only-table-container,
    #ticket-history-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tickets-table {
        font-size: 0.9rem;
        min-width: 960px;
        width: max-content;
    }
    
    .tickets-table th,
    .tickets-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .tickets-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .tickets-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .ticket-search-input,
    .ticket-status-filter {
        width: 100%;
        min-width: 0;
    }

    .ticket-history-header {
        flex-direction: column;
    }

    .ticket-history-header-actions {
        align-items: stretch;
        width: 100%;
    }

    .ticket-history-action-filter,
    .ticket-history-search {
        width: 100%;
        min-width: 0;
    }
}

/* 로딩 오버레이 스타일 */
#loading-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.loading-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 300px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    color: #333;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
}

.modal-form {
    padding: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group-extend {
    justify-content: flex-start;
}

.btn-extend-next-month {
    padding: 0.75rem 1rem;
    border: 1px solid #667eea;
    border-radius: 4px;
    background: #fff;
    color: #667eea;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.btn-extend-next-month:hover:not(:disabled) {
    background: #667eea;
    color: #fff;
}

.btn-extend-next-month:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.extend-next-month-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #7f8c8d;
    line-height: 1.35;
    min-height: 1.1em;
}

.extend-next-month-hint.is-empty {
    color: #95a5a6;
}

.modal-form label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

.required {
    color: #e74c3c;
}

.modal-form input[type="text"],
.modal-form input[type="date"] {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.modal-form input[type="text"]:focus,
.modal-form input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 날짜 입력 필드 스타일 */
.modal-form input[type="date"] {
    cursor: pointer;
    position: relative;
}

/* 브라우저별 날짜 입력 필드 아이콘 스타일 */
.modal-form input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    margin-left: 0.5rem;
}

.modal-form input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.btn-submit {
    background-color: #667eea;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-submit:hover {
    background-color: #5568d3;
}

.btn-cancel {
    background-color: #95a5a6;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-cancel:hover {
    background-color: #7f8c8d;
}

/* 회원 가입 페이지 */
.register-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.register-footer a {
    color: #3498db;
    text-decoration: none;
}

.register-footer a:hover {
    text-decoration: underline;
}

.app-version {
    margin-top: 1rem;
    text-align: center;
    color: #b0b7bd;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.success-message p {
    margin: 0.5rem 0;
}

.btn-login-link {
    display: inline-block;
    margin-top: 1rem;
    background-color: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-login-link:hover {
    background-color: #2980b9;
}

.required {
    color: #e74c3c;
}

/* 관리자 페이지 스타일 */
.admin-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-subtitle {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.admin-actions {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.btn-refresh {
    background-color: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-refresh:hover {
    background-color: #2980b9;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table th {
    background-color: #ecf0f1;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #bdc3c7;
}

.admin-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ecf0f1;
}

.admin-table tbody tr:hover:not(.suspended-row) {
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.admin-table tbody tr {
    transition: background-color 0.2s;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.btn-approve {
    background-color: #27ae60;
    color: white;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    transition: background-color 0.3s;
}

.btn-approve:hover {
    background-color: #229954;
}

.btn-reject {
    background-color: #e74c3c;
    color: white;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s;
}

.btn-reject:hover {
    background-color: #c0392b;
}

.btn-edit {
    background-color: #3498db;
    color: white;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s;
}

.btn-edit:hover {
    background-color: #2980b9;
}

.loading-message {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* 현장 관리 페이지 */
.sites-manage-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-subtitle {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.current-sites-section {
    background-color: #e8f5e9;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #4caf50;
}

.current-sites-section h3 {
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.current-sites-section p {
    margin: 0.5rem 0;
    color: #2c3e50;
    font-weight: 500;
}

.request-status {
    background-color: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.request-status h3 {
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.request-status p {
    margin: 0.5rem 0;
}

.sites-selection-section {
    margin-top: 2rem;
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.selection-header h3 {
    color: #2c3e50;
}

.selection-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-select-all,
.btn-deselect-all {
    background-color: #95a5a6;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-select-all:hover,
.btn-deselect-all:hover {
    background-color: #7f8c8d;
}

.site-search-box {
    margin-bottom: 1rem;
}

.sites-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    padding: 1rem;
    background-color: #f8f9fa;
}

.site-checkbox-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.site-checkbox-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.site-checkbox-item input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.site-name {
    font-weight: 500;
    margin-right: 0.5rem;
}

.site-code {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.selection-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.btn-submit {
    background-color: #3498db;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-submit:hover:not(:disabled) {
    background-color: #2980b9;
}

.btn-submit:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.sites-list-edit {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    padding: 1rem;
    background-color: #f8f9fa;
    margin-bottom: 1rem;
}

.site-edit-section {
    margin-bottom: 1.5rem;
}

.site-edit-section h4 {
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.no-sites {
    color: #7f8c8d;
    text-align: center;
    padding: 1rem;
}

/* 현장 없음 안내 팝업 */
.no-site-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.no-site-popup-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.no-site-popup-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.no-site-popup-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.no-site-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.no-site-popup-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.no-site-popup-body {
    padding: 1.5rem;
    line-height: 1.8;
    color: #333;
}

.no-site-popup-body p {
    margin: 0.75rem 0;
}

.no-site-popup-body p:first-child {
    margin-top: 0;
}

.no-site-popup-body p:last-child {
    margin-bottom: 0;
}

.no-site-popup-body strong {
    color: #667eea;
    font-weight: 600;
}

.no-site-popup-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.no-site-popup-footer .btn-primary {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.no-site-popup-footer .btn-primary:hover {
    background-color: #5568d3;
}

.no-site-popup-footer .btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.no-site-popup-footer .btn-secondary:hover {
    background-color: #e8e8e8;
}

.no-sites-message {
    padding: 2rem;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    background-color: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 4px;
    margin: 1rem 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.btn-remove {
    background-color: #e74c3c;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-remove:hover {
    background-color: #c0392b;
}

.btn-cancel:hover {
    background-color: #7f8c8d;
}

/* 프로필 페이지 스타일 */
.profile-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-section {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-section h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #ecf0f1;
    font-size: 1.3rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    font-weight: 500;
    color: #2c3e50;
}

.info-value {
    padding: 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    color: #495057;
    font-size: 1rem;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-form .form-group label {
    font-weight: 500;
    color: #2c3e50;
}

.profile-form .form-control {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.profile-form .form-control:focus {
    outline: none;
    border-color: #3498db;
}

.profile-form .btn-primary {
    background-color: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    align-self: flex-start;
}

.profile-form .btn-primary:hover {
    background-color: #2980b9;
}

.message-area {
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-weight: 500;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 역할 배지 스타일 */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

.role-badge-admin {
    background-color: #e74c3c;
    color: white;
}

.role-badge-user {
    background-color: #3498db;
    color: white;
}

/* 역할 선택 드롭다운 스타일 */
.role-select {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    border: none;
    cursor: pointer;
    outline: none;
    transition: opacity 0.3s;
}

.role-select:hover {
    opacity: 0.9;
}

.role-select.role-badge-admin {
    background-color: #e74c3c;
    color: white;
}

.role-select.role-badge-user {
    background-color: #3498db;
    color: white;
}

.role-select option {
    background-color: white;
    color: #333;
    padding: 0.5rem;
}

/* 상태 배지 추가 스타일 (회원관리 페이지용) */
.status-active {
    background-color: #27ae60;
    color: white;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
}

.status-suspended {
    background-color: #e74c3c;
    color: white;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

/* 관리 컬럼 버튼 그룹 스타일 */
.action-buttons {
    padding: 0.5rem 0;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-icon {
    display: inline-block;
    margin-right: 0.25rem;
    font-size: 0.9em;
}

/* 사용 중지/해제 버튼 스타일 */
.btn-suspend {
    background-color: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.btn-suspend:hover {
    background-color: #c0392b;
    box-shadow: 0 3px 6px rgba(231, 76, 60, 0.3);
    transform: translateY(-1px);
}

.btn-suspend:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(231, 76, 60, 0.2);
}

.btn-restore {
    background-color: #27ae60;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

.btn-restore:hover {
    background-color: #229954;
    box-shadow: 0 3px 6px rgba(39, 174, 96, 0.3);
    transform: translateY(-1px);
}

.btn-restore:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(39, 174, 96, 0.2);
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-edit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(52, 152, 219, 0.3);
}

.btn-edit:disabled,
.btn-suspend:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 중지된 사용자 행 스타일 */
.suspended-row {
    background-color: #fff5f5;
    border-left: 3px solid #e74c3c;
}

.suspended-row td {
    position: relative;
}

.suspended-row:hover {
    background-color: #ffeaea;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .profile-section {
        padding: 1.5rem;
    }
}

/* 이용 가이드 페이지 */
.help-page {
    max-width: 960px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.help-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.help-page-header h2 {
    margin: 0 0 0.35rem 0;
    color: #2c3e50;
}

.help-page-subtitle {
    margin: 0;
    color: #5f6b7a;
    font-size: 1rem;
}

.help-back-link {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border: 1px solid #5b7c99;
    border-radius: 4px;
    background: #fff;
    color: #2c3e50;
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
}

.help-back-link:hover {
    background-color: #e8eef5;
}

.help-summary {
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
    background-color: #f4f7fb;
    border: 1px solid #c5d3e3;
    border-radius: 6px;
}

.help-summary p {
    margin: 0.35rem 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: #2c3e50;
}

.help-summary-compact {
    margin-bottom: 0.85rem;
}

.help-summary-warning {
    margin-top: 0.75rem !important;
    padding-top: 0.65rem;
    border-top: 1px solid #c5d3e3;
    color: #9a3412 !important;
    font-weight: 600;
}

.help-section {
    margin-bottom: 1.75rem;
}

.help-section h3 {
    margin: 0 0 0.85rem 0;
    color: #2c3e50;
    font-size: 1.25rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #e0e6ed;
}

.help-section > ul {
    margin: 0.4rem 0 0.85rem 1.2rem;
    padding: 0;
    line-height: 1.6;
    color: #34495e;
}

.help-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.help-table th,
.help-table td {
    padding: 0.75rem 0.9rem;
    border: 1px solid #e0e6ed;
    text-align: left;
    vertical-align: top;
    font-size: 1rem;
    line-height: 1.5;
}

.help-table th {
    background-color: #34495e;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.help-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.help-color-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.help-color-list li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.05rem;
    color: #2c3e50;
}

.help-note {
    margin: 0.85rem 0 0 0;
    color: #5f6b7a;
    font-size: 0.95rem;
}

.help-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.help-example {
    margin-top: 1.25rem;
    padding: 1rem 1.15rem;
    background: #f8fafc;
    border: 1px solid #dce3eb;
    border-radius: 6px;
}

.help-example h4 {
    margin: 0 0 0.65rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.help-example > p {
    margin: 0 0 0.85rem 0;
    color: #34495e;
    line-height: 1.55;
    font-size: 1.02rem;
}

.help-card {
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 6px;
}

.help-card h4 {
    margin: 0 0 0.65rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.help-card ul {
    margin: 0.25rem 0 0.5rem 1.15rem;
    padding: 0;
    color: #34495e;
    line-height: 1.55;
}

.help-card-label {
    margin: 0.65rem 0 0.35rem 0;
    font-weight: 600;
    color: #2c3e50;
}

.help-steps {
    margin: 0.25rem 0 0.75rem 1.25rem;
    padding: 0;
    color: #34495e;
    line-height: 1.65;
    font-size: 1.02rem;
}

.help-callout {
    margin: 0.75rem 0 0 0;
    padding: 0.7rem 0.85rem;
    background-color: #fff8e1;
    border: 1px solid #f1c40f;
    border-radius: 4px;
    color: #5d4e00;
    font-weight: 600;
    line-height: 1.45;
}

.help-flow {
    padding: 1rem 1.15rem;
    background: #f8fafc;
    border: 1px solid #dce3eb;
    border-radius: 6px;
}

.help-flow-title {
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    font-size: 1.05rem;
    color: #2c3e50;
}

.help-flow-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #34495e;
    line-height: 1.7;
    font-size: 1.02rem;
}

.help-flow-list ul {
    margin: 0.25rem 0 0.35rem 1rem;
    padding: 0;
}

.help-page-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e6ed;
    text-align: center;
}

@media (max-width: 768px) {
    .help-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .help-back-link {
        text-align: center;
    }

    .help-card-grid {
        grid-template-columns: 1fr;
    }

    .help-table th,
    .help-table td {
        font-size: 0.95rem;
        padding: 0.65rem 0.7rem;
    }

    .help-summary p,
    .help-color-list li,
    .help-steps {
        font-size: 1rem;
    }
}

/* MOBILE_DB 추가결제 이력 */
.mobile-db-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    color: #1a2332;
    -webkit-font-smoothing: antialiased;
}

.mobile-db-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.mobile-db-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    font-weight: 700;
    color: #12263a;
    letter-spacing: -0.02em;
}

.mobile-db-subtitle {
    margin: 0;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
}

.mobile-db-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.mobile-db-toolbar .btn-primary,
.mobile-db-toolbar .btn-extend-next-month {
    min-height: 2.65rem;
    padding: 0.65rem 1.35rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 4px;
    line-height: 1.2;
    cursor: pointer;
}

.mobile-db-toolbar .btn-primary {
    background-color: #1f4e79;
    color: #fff;
    border: 1px solid #1f4e79;
}

.mobile-db-toolbar .btn-primary:hover:not(:disabled) {
    background-color: #163a5c;
    border-color: #163a5c;
}

.mobile-db-toolbar .btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mobile-db-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.mobile-db-toolbar input,
.mobile-db-toolbar select {
    padding: 0.6rem 0.75rem;
    border: 1px solid #c5ced8;
    border-radius: 4px;
    min-width: 5rem;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.35;
}

.mobile-db-toolbar input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.mobile-db-erp-label {
    flex: 1;
    min-width: 280px;
}

.mobile-db-erp-label input {
    width: 100%;
}

.mobile-db-car-label {
    flex: 0 1 180px;
    min-width: 140px;
}

.mobile-db-car-label input {
    width: 100%;
}

.mobile-db-approval-label {
    flex: 0 1 180px;
    min-width: 140px;
}

.mobile-db-approval-label input {
    width: 100%;
}

.mobile-db-parking-label {
    flex: 1 1 320px;
    min-width: 220px;
}

.mobile-db-parking-label select {
    width: 100%;
    max-width: 420px;
}

.mobile-db-field-only-label {
    flex-direction: row !important;
    align-items: center;
    gap: 0.45rem !important;
    padding-bottom: 0.55rem;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
}

.mobile-db-field-only-label input[type="checkbox"] {
    min-width: auto;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: #1f4e79;
}

.mobile-db-toolbar-filters {
    margin-top: -0.25rem;
}

.mobile-db-toolbar input:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.mobile-db-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 16px 0 8px;
}

.mobile-db-load-more-wrap .btn-secondary {
    min-width: 140px;
}

.mobile-db-status {
    margin: 0 0 0.75rem;
    color: #374151;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.45;
}

.mobile-db-table-wrap {
    overflow: auto;
    max-height: 70vh;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}

.mobile-db-table {
    margin: 0;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    font-weight: 500;
    color: #111827;
}

.mobile-db-table th,
.mobile-db-table td {
    padding: 0.65rem 0.7rem;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    line-height: 1.35;
}

.mobile-db-table th {
    position: sticky;
    top: 0;
    background: #e8eef5;
    z-index: 1;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: -0.01em;
    border-bottom: 1px solid #c5d0de;
}

.mobile-db-table th.mobile-db-sortable {
    cursor: pointer;
    user-select: none;
    color: #153a66;
}

.mobile-db-table th.mobile-db-sortable:hover {
    background: #dce6f2;
}

.mobile-db-table th.mobile-db-sortable.is-asc,
.mobile-db-table th.mobile-db-sortable.is-desc {
    background: #d0dceb;
}

.mobile-db-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.mobile-db-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.mobile-db-row-clickable {
    cursor: pointer;
}

.mobile-db-row-clickable:hover {
    background: #e8f0fb !important;
}

.receipt-detail-modal-content {
    max-width: 560px;
    width: min(92vw, 560px);
    max-height: min(90vh, calc(100dvh - 1.5rem));
    margin: 0.75rem auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.receipt-detail-modal-content .modal-header {
    flex: 0 0 auto;
    padding: 1rem 1.25rem;
}

.receipt-detail-modal-content .modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #12263a;
}

#receipt-detail-message {
    flex: 0 0 auto;
    margin: 0.5rem 1.25rem 0;
}

.receipt-detail-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem 1.25rem;
    -webkit-overflow-scrolling: touch;
}

.receipt-detail-modal-content .modal-actions {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #ddd;
}

.receipt-detail-section {
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafbfc;
}

.receipt-detail-section:last-child {
    margin-bottom: 0;
}

.receipt-detail-row {
    display: grid;
    grid-template-columns: 7.25rem minmax(0, 1fr);
    column-gap: 0.85rem;
    align-items: baseline;
    padding: 0.4rem 0.3rem;
    font-size: 0.94rem;
    line-height: 1.4;
    border-bottom: 1px solid #eef1f4;
}

.receipt-detail-row:last-child {
    border-bottom: none;
}

.receipt-detail-row:nth-child(odd) {
    background: rgba(255, 255, 255, 0.85);
}

.receipt-detail-row .label {
    color: #4b5563;
    font-weight: 600;
    font-size: 0.88rem;
}

.receipt-detail-row .value {
    color: #0f172a;
    font-weight: 600;
    word-break: break-word;
    letter-spacing: -0.01em;
}

.receipt-detail-error {
    color: #b91c1c;
    margin: 8px 0;
    font-weight: 600;
    font-size: 0.98rem;
}

@media (max-width: 768px) {
    .mobile-db-header {
        flex-direction: column;
        align-items: stretch;
    }

    .receipt-detail-modal-content {
        margin: 0.5rem auto;
        max-height: calc(100dvh - 1rem);
    }

    .receipt-detail-row {
        grid-template-columns: 6.25rem minmax(0, 1fr);
        column-gap: 0.75rem;
        font-size: 0.9rem;
    }
}

