/* =========================================================
   SR 요청 접수 시스템 - 커스텀 스타일
   디자인 컨셉: 다크 네이비 사이드바 + 화이트 본문 + 레드 액센트
   ========================================================= */

:root {
    --color-primary: #c8102e;        /* 소방청 레드 */
    --color-primary-hover: #a30c24;
    --color-navy: #0f172a;           /* 다크 네이비 */
    --color-navy-soft: #1e293b;
    --color-navy-hover: #334155;
    --color-bg: #f1f5f9;
    --color-card: #ffffff;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --color-info: #0ea5e9;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.16);
    --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
                 system-ui, "맑은 고딕", "Malgun Gothic", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
}

/* =========================================
   로그인 화면
   ========================================= */
.view-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at top, rgba(200, 16, 46, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(14, 165, 233, 0.10) 0%, transparent 50%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 24px;
}

.login-wrap {
    width: 100%;
    max-width: 420px;
    color: #fff;
    text-align: center;
}

.login-brand {
    margin-bottom: 32px;
    animation: fadeUp 0.6s ease-out;
}

.login-brand-icon {
    width: 80px; height: 80px;
    margin: 0 auto 16px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--color-primary), #ff4d6d);
    display: flex; align-items: center; justify-content: center;
    font-size: 40px;
    color: #fff;
    box-shadow: 0 8px 32px rgba(200, 16, 46, 0.4);
}

.login-brand-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

.login-brand-sub {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    margin: 0;
    letter-spacing: 0.5px;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    color: var(--color-text);
    border-radius: 16px;
    padding: 32px 28px;
    text-align: left;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    animation: fadeUp 0.7s ease-out 0.1s both;
}

.login-card .form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text);
}

.login-card .input-group-text {
    background: var(--color-bg);
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

.login-card .form-control {
    border-color: var(--color-border);
    padding: 10px 12px;
}

.login-card .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.15);
}

.login-hint {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
}

.login-hint code {
    background: var(--color-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11.5px;
}

.login-portal-link {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}
.login-portal-link a {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}
.login-portal-link a:hover { text-decoration: underline; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   레이아웃 (사이드바 + 메인)
   ========================================= */
.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* 사이드바 */
.sidebar {
    background: var(--color-navy);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    padding: 22px 24px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand i {
    color: var(--color-primary);
    font-size: 22px;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-item i {
    font-size: 18px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(200, 16, 46, 0.2), rgba(200, 16, 46, 0.05));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.sidebar-foot {
    padding: 16px 24px;
    color: #475569 !important;
    font-size: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.sidebar-foot .text-muted { color: #475569 !important; }

/* 메인 영역 */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    background: #fff;
    padding: 16px 28px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.topbar-title h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.topbar-title small {
    font-size: 12px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
    color: var(--color-text);
    text-decoration: none;
    transition: opacity 0.15s;
}
.user-info:hover { opacity: 0.7; color: var(--color-text); }

.user-info strong { font-size: 14px; }
.user-info small  { font-size: 11px; }

.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #ff4d6d);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: transform 0.15s;
}
.user-avatar:hover { color: #fff; transform: scale(1.05); }

/* 컨텐츠 */
.content {
    padding: 24px 28px;
    flex: 1;
}

/* =========================================
   제조사 워드마크 (footer brand)
   ========================================= */
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1;
}
.brand-mark small {
    color: var(--color-text-muted);
    font-size: 10.5px;
    letter-spacing: 0.2px;
}
.brand-mark img {
    height: 22px; width: auto;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.15s;
}
.brand-mark:hover img { opacity: 1; }
.brand-mark-light small { color: #94a3b8; }

/* 로그인 페이지 풋터 마크 */
.login-foot-brand {
    margin-top: 28px;
    display: flex; align-items: center; justify-content: center;
    gap: 8px;
    opacity: 0.75;
    transition: opacity 0.2s;
}
.login-foot-brand:hover { opacity: 1; }
.login-foot-brand small { color: rgba(255,255,255,0.6); font-size: 10.5px; letter-spacing: 0.2px; }
.login-foot-brand img {
    height: 22px; width: auto;
}

/* =========================================
   대시보드 기간 라벨
   ========================================= */
.dash-period {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12.5px;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}
.dash-period i { color: var(--color-primary); }

/* =========================================
   통계 카드
   ========================================= */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-text);
}

.stat-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 38px;
    opacity: 0.15;
}

.stat-new      { border-left: 4px solid var(--color-info); }
.stat-new      .stat-icon { color: var(--color-info); }
.stat-progress { border-left: 4px solid var(--color-warning); }
.stat-progress .stat-icon { color: var(--color-warning); }
.stat-done     { border-left: 4px solid var(--color-success); }
.stat-done     .stat-icon { color: var(--color-success); }
.stat-rejected { border-left: 4px solid var(--color-primary); }
.stat-rejected .stat-icon { color: var(--color-primary); }
.stat-total    { border-left: 4px solid #64748b; }
.stat-total    .stat-icon { color: #64748b; }

/* =========================================
   카드 (검색, 테이블 컨테이너)
   ========================================= */
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-footer {
    background: #fff;
    border-top: 1px solid var(--color-border);
}

/* 버튼 컬러 오버라이드 */
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

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

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

/* =========================================
   SR 테이블
   ========================================= */
.sr-table {
    font-size: 14px;
    margin-bottom: 0;
}

.sr-table thead th {
    background: #f8fafc;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
    padding: 12px 16px;
}

.sr-table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border);
}

.sr-table tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

.sr-table tbody tr:hover { background: #fff5f5; }
.sr-table td.empty {
    text-align: center;
    padding: 60px 0 !important;
    color: var(--color-text-muted);
    cursor: default;
}

.sr-table .title-col {
    font-weight: 500;
    color: var(--color-text);
}

/* 상태 뱃지 */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
}
.badge-status::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.badge-new        { background: #e0f2fe; color: #0369a1; }
.badge-pending    { background: #e0f2fe; color: #0369a1; }   /* 접수전 */
.badge-accepted   { background: #ede9fe; color: #6d28d9; }   /* 접수중 */
.badge-inprogress { background: #fef3c7; color: #b45309; }   /* 진행중 */
.badge-done       { background: #dcfce7; color: #166534; }   /* 완료 */
.badge-closed     { background: #e2e8f0; color: #334155; }   /* 닫기 */
.badge-canceled   { background: #fee2e2; color: #b91c1c; }   /* 취소 */

/* 우선순위 */
.badge-priority {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
}
.prio-LOW    { background: #f1f5f9; color: #64748b; }
.prio-NORMAL { background: #e0e7ff; color: #4338ca; }
.prio-HIGH   { background: #ffe4e6; color: #be123c; }
.prio-URGENT { background: #fee2e2; color: #991b1b; animation: pulse 2s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.7; }
}

/* 분야 칩 */
.chip-category {
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 500;
}

/* 페이지네이션 */
.pagination .page-link {
    color: var(--color-text);
    border-color: var(--color-border);
}

.pagination .page-item.active .page-link {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* =========================================
   모달 폼
   ========================================= */
.modal-content {
    border: none;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-weight: 700;
    font-size: 16px;
}

.modal-body {
    padding: 22px 24px;
}

.modal-footer {
    border-top: 1px solid var(--color-border);
    padding: 14px 24px;
}

.form-label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.form-control, .form-select {
    border-color: var(--color-border);
    border-radius: 8px;
    padding: 9px 12px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

/* meta-row (상세 모드) */
.meta-item {
    background: var(--color-bg);
    border-radius: 8px;
    padding: 10px 14px;
}

.meta-item small {
    color: var(--color-text-muted);
    font-size: 11px;
    display: block;
    margin-bottom: 2px;
}

.meta-item > div {
    font-weight: 600;
    font-size: 14px;
}

/* 첨부파일 */
.attach-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px;
}

.attach-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-bg);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.attach-list li a {
    color: var(--color-primary);
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attach-list li a:hover { text-decoration: underline; }

.attach-list .file-size {
    color: var(--color-text-muted);
    font-size: 11.5px;
}

.attach-list .x-btn {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.1s;
}

.attach-list .x-btn:hover {
    background: #fee2e2;
    color: var(--color-primary);
}

/* =========================================
   확인 다이얼로그
   ========================================= */
.confirm-icon {
    font-size: 48px;
    color: var(--color-primary);
    margin-bottom: 14px;
}

.confirm-msg {
    font-size: 15px;
    line-height: 1.6;
}

#confirmModal .modal-footer .btn {
    min-width: 90px;
}

/* =========================================
   기타
   ========================================= */
.empty {
    text-align: center;
    color: var(--color-text-muted);
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   알림 벨 (topbar)
   ========================================= */
.topbar-notify { position: relative; }
.topbar-bell {
    position: relative;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--color-text);
    font-size: 17px;
    transition: background 0.15s;
}
.topbar-bell:hover { background: var(--color-bg); }
.topbar-bell-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; padding: 0 5px;
    background: var(--color-primary);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 10.5px; font-weight: 700;
    line-height: 14px;
    text-align: center;
}
.notif-menu {
    width: 320px;
    padding: 0;
    box-shadow: var(--shadow-md);
    border-color: var(--color-border);
}
.notif-head {
    padding: 12px 14px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--color-border);
    background: #f8fafc;
    border-radius: var(--radius) var(--radius) 0 0;
}
.notif-list { max-height: 360px; overflow-y: auto; padding: 6px 0; }
.notif-empty { padding: 22px 14px; text-align: center; color: var(--color-text-muted); font-size: 13px; }
.notif-item {
    display: block;
    padding: 9px 14px;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }
.notif-row1 { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.notif-row1 .notif-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-row2 { font-size: 11.5px; color: var(--color-text-muted); margin-top: 2px; }
.notif-foot {
    display: block; padding: 10px 14px; text-align: center;
    background: #f8fafc;
    border-top: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius) var(--radius);
    color: var(--color-primary); font-weight: 600; font-size: 13px;
    text-decoration: none;
}
.notif-foot:hover { background: #f1f5f9; color: var(--color-primary-hover); }
.notif-kind-mine { color: var(--color-success); font-size: 11px; }
.notif-kind-unassigned { color: var(--color-warning); font-size: 11px; }

/* =========================================
   반응형
   ========================================= */
/* 햄버거: 기본 숨김, 모바일에서만 노출 */
.topbar-hamburger {
    display: none;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    color: var(--color-text);
    cursor: pointer;
    font-size: 18px;
}
.topbar-hamburger:hover { background: var(--color-bg); }

/* 사이드바 백드롭 (모바일) */
.sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* 태블릿(641-960): 아이콘만 보이는 좁은 사이드바 */
@media (max-width: 960px) {
    .layout { grid-template-columns: 64px 1fr; }
    .sidebar-brand span,
    .nav-item span,
    .sidebar-foot { display: none; }
    .sidebar-brand { justify-content: center; padding: 22px 0; }
    .nav-item { justify-content: center; padding: 12px; }
}

@media (max-width: 640px) {
    .topbar { padding: 12px 14px; gap: 8px; }
    .content { padding: 14px; }
    .topbar-title h1 { font-size: 17px; }
    .topbar-title small { display: none; }
    .user-info { display: none; }
}

/* 모바일(< 768px): 사이드바 오프캔버스 (햄버거로 토글) */
@media (max-width: 767.98px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; top: 0; left: 0;
        height: 100vh; width: 240px;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.35);
    }
    /* 열렸을 때는 텍스트도 다시 보이게 (960px 규칙 무력화) */
    .sidebar.open .sidebar-brand span,
    .sidebar.open .nav-item span,
    .sidebar.open .sidebar-foot { display: inline; }
    .sidebar.open .sidebar-brand { justify-content: flex-start; padding: 22px 24px; }
    .sidebar.open .nav-item { justify-content: flex-start; padding: 11px 14px; }
    .sidebar.open .sidebar-foot { display: block; padding: 16px 24px; }

    .topbar-hamburger { display: inline-flex; }
    .topbar { padding: 10px 12px; }
    .topbar-title h1 { font-size: 16px; }
    .user-avatar { width: 32px; height: 32px; font-size: 12px; }
    .topbar-bell { width: 34px; height: 34px; font-size: 15px; }
    .notif-menu { width: 280px; }

    .content { padding: 12px; }

    /* 테이블 부수 컬럼 숨김 */
    .sr-table th.col-hide-sm,
    .sr-table td.col-hide-sm { display: none; }
    .sr-table thead th { padding: 10px 12px; font-size: 11px; }
    .sr-table tbody td { padding: 10px 12px; }

    /* 카드 헤더가 좁아 wrap 되도록 */
    .card-header { flex-wrap: wrap; gap: 6px; }

    /* 모달 마진 축소 */
    .modal-dialog { margin: 0.5rem; }

    /* 통계 카드 폰트 축소 */
    .stat-value { font-size: 22px; }
    .stat-icon  { font-size: 30px; }
}

/* =========================================
   사이드바 섹션 라벨 (관리자 메뉴 구분)
   ========================================= */
.nav-section {
    padding: 16px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
}

.nav-item.disabled-soft {
    opacity: 0.6;
}

@media (max-width: 960px) {
    .nav-section { text-align: center; padding: 12px 0 4px; font-size: 9px; }
}

/* =========================================
   SR 상세 본문
   ========================================= */
.sr-content {
    background: var(--color-bg);
    border-radius: 8px;
    padding: 16px 18px;
    line-height: 1.7;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 120px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 14px 18px;
}

dl.row dt { font-weight: 600; }

/* =========================================
   에러 페이지
   ========================================= */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 24px;
}

.error-box {
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 440px;
}

.error-code {
    font-size: 64px;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}

.error-text {
    font-size: 20px;
    font-weight: 700;
    margin-top: 8px;
}

.error-msg {
    color: var(--color-text-muted);
    margin-top: 12px;
    font-size: 14px;
}

/* =========================================
   첨부 위젯 (드롭존 + 붙여넣기 + 미리보기)
   ========================================= */
.dropzone {
    border: 2px dashed var(--color-border);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s;
    background: #fafbfc;
}
.dropzone:hover { border-color: var(--color-primary); background: #fff5f5; }
.dropzone.dragover {
    border-color: var(--color-primary);
    background: #fff0f1;
    color: var(--color-primary);
}
.dropzone .dz-icon { font-size: 30px; opacity: 0.6; }
.dropzone .dz-title { font-weight: 600; margin-top: 6px; }
.dropzone .dz-hint { font-size: 12px; margin-top: 2px; }
.dropzone kbd {
    background: #e2e8f0; color: #334155; border-radius: 4px;
    padding: 1px 5px; font-size: 11px;
}

.attach-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.attach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    position: relative;
}
.attach-thumb {
    width: 44px; height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--color-bg);
}
.attach-thumb-file {
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--color-text-muted);
}
.attach-meta { flex: 1; min-width: 0; }
.attach-name {
    font-size: 13px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-size { font-size: 11.5px; color: var(--color-text-muted); }
.attach-remove {
    border: none; background: transparent; color: var(--color-text-muted);
    cursor: pointer; padding: 4px 6px; border-radius: 4px; flex-shrink: 0;
}
.attach-remove:hover { background: #fee2e2; color: var(--color-primary); }

/* =========================================
   공개 포털 (JIRA풍)
   ========================================= */
.portal-body {
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.portal-header {
    background: var(--color-navy);
    color: #fff;
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.portal-brand {
    display: flex; align-items: center; gap: 10px;
    color: #fff; text-decoration: none;
    font-size: 18px; font-weight: 700;
}
.portal-brand i { color: var(--color-primary); font-size: 22px; }
.portal-nav { display: flex; gap: 6px; }
.portal-nav-link {
    color: #cbd5e1; text-decoration: none;
    padding: 8px 14px; border-radius: 8px; font-size: 14px;
    transition: all 0.15s;
}
.portal-nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.portal-nav-login { color: #fff; border: 1px solid rgba(255,255,255,0.25); }

.portal-main { flex: 1; padding: 36px 20px; }
.portal-container { max-width: 1000px; margin: 0 auto; }
.portal-narrow { max-width: 760px; }
.portal-footer {
    text-align: center; padding: 20px; color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
}

.portal-hero { text-align: center; margin-bottom: 36px; }
.portal-hero h1 { font-size: 30px; font-weight: 700; }
.portal-hero p { color: var(--color-text-muted); font-size: 15px; }

.portal-cards .portal-card {
    display: block;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 28px;
    text-decoration: none;
    color: var(--color-text);
    height: 100%;
    transition: all 0.18s;
}
.portal-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}
.portal-card-icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin-bottom: 16px;
}
.bg-primary-soft { background: #fee2e2; color: var(--color-primary); }
.bg-info-soft { background: #e0f2fe; color: #0369a1; }
.bg-lock-soft { background: #f1f5f9; color: #475569; }
.portal-card h5 { font-weight: 700; }
.portal-card p { color: var(--color-text-muted); font-size: 14px; margin-bottom: 14px; }
.portal-card-go { color: var(--color-primary); font-weight: 600; font-size: 14px; }

.portal-page-title { font-size: 22px; font-weight: 700; margin-bottom: 18px; }

/* =========================================
   포털 모바일 카드 리스트 (게시판 행을 카드로)
   ========================================= */
.portal-card-list { display: none; flex-direction: column; gap: 10px; }
.portal-row-card {
    display: block;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.1s, background 0.15s;
}
.portal-row-card:active { transform: scale(0.985); background: #f8fafc; }
.portal-row-card .pr-title {
    display: flex; align-items: flex-start; gap: 6px;
    font-weight: 600; font-size: 15px; line-height: 1.4;
    color: var(--color-text); word-break: break-word;
}
.portal-row-card .pr-title i { font-size: 13px; padding-top: 3px; }
.portal-row-card .pr-meta {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-top: 10px;
}
.portal-row-card .pr-foot {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 8px; font-size: 12px; color: var(--color-text-muted);
}
.portal-row-card .pr-no { font-weight: 700; color: var(--color-primary); letter-spacing: 0.3px; }

/* 접수 완료 */
.portal-done { text-align: center; background: #fff; border-radius: 14px; padding: 48px 32px; box-shadow: var(--shadow-sm); }
.portal-done-icon { font-size: 64px; color: var(--color-success); }
.portal-done h2 { font-weight: 700; margin-top: 12px; }
.portal-ticket {
    display: inline-flex; flex-direction: column; gap: 4px;
    background: var(--color-bg); border-radius: 12px; padding: 16px 32px; margin-top: 20px;
}
.portal-ticket-label { font-size: 12px; color: var(--color-text-muted); }
.portal-ticket-no { font-size: 26px; font-weight: 800; color: var(--color-primary); letter-spacing: 0.5px; }

/* =========================================
   포털 모바일 반응형 (≤ 767.98px)
   ========================================= */
@media (max-width: 767.98px) {
    /* 헤더: 높이 조정, nav 텍스트 유지하되 폰트 축소 */
    .portal-header { padding: 0 14px; height: auto; min-height: 54px; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
    .portal-brand { font-size: 16px; }
    .portal-brand i { font-size: 19px; }
    .portal-nav { gap: 2px; flex-wrap: wrap; }
    .portal-nav-link { padding: 6px 10px; font-size: 13px; }

    /* 본문 패딩 축소 */
    .portal-main { padding: 16px 12px; }
    .portal-container, .portal-narrow { max-width: 100%; }
    .portal-page-title { font-size: 18px; margin-bottom: 12px; }

    /* 게시판: 테이블 숨기고 카드 리스트 노출 */
    .portal-table-wrap { display: none; }
    .portal-card-list { display: flex; }

    /* 상세 메타 영역 */
    .portal-meta dl.row > dt { font-size: 12px; margin-bottom: 2px; }
    .portal-meta dl.row > dd { margin-bottom: 10px; }

    /* 접수 완료 */
    .portal-done { padding: 28px 18px; }
    .portal-done h2 { font-size: 19px; }
    .portal-done-icon { font-size: 52px; }
    .portal-ticket { padding: 14px 22px; }
    .portal-ticket-no { font-size: 22px; }

    /* 댓글 영역 */
    .comment-avatar { width: 30px; height: 30px; font-size: 12px; }
    .comment-bubble { padding: 8px 12px; }

    /* 자물쇠 인라인 폼 - 모바일에서 max-width 해제 */
    #verify-form { max-width: 100% !important; }
}

/* =========================================
   댓글 타임라인
   ========================================= */
.comment-thread { display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 10px; align-items: flex-start; }
.comment-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; flex-shrink: 0; font-size: 14px;
    background: #64748b;
}
.comment-bubble {
    background: var(--color-bg);
    border-radius: 10px;
    padding: 10px 14px;
    flex: 1;
}
.comment-head { font-size: 13px; margin-bottom: 4px; }
.comment-time { color: var(--color-text-muted); font-size: 11.5px; margin-left: 6px; }
.comment-body { font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* 담당자 댓글: 우측 정렬 + 레드 계열 */
.comment-handler { flex-direction: row-reverse; }
.comment-handler .comment-avatar { background: var(--color-primary); }
.comment-handler .comment-bubble { background: #fff0f1; }
.comment-handler .comment-head { text-align: right; }

/* 시스템 이력(상태 변경): 가운데 안내 줄 */
.comment-system {
    justify-content: center;
}
.comment-system .comment-avatar { display: none; }
.comment-system .comment-bubble {
    background: transparent;
    color: var(--color-text-muted);
    font-size: 12.5px;
    text-align: center;
    flex: none;
    border: 1px dashed var(--color-border);
    border-radius: 999px;
    padding: 4px 14px;
}
.comment-system .comment-head { display: none; }

/* =========================================
   처리 칸반 보드
   ========================================= */
.kanban-board {
    display: flex;            /* grid 가 안 잡히는 환경 대비 flex 베이스 */
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    overflow-y: visible;
    min-height: 60vh;
    padding-bottom: 8px;
}
.kanban-board > .kanban-col {
    flex: 0 0 260px;          /* 컬럼 폭 고정 - 가로 스크롤 보장 */
    min-width: 260px;
    max-width: 260px;
}
.kanban-col {
    background: #f1f5f9;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}
.kanban-col-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 10px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 10px;
}
.kanban-count {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--color-text-muted);
    background: #fff;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
}
.kanban-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px;
}
.kanban-list.drop-hover {
    outline: 2px dashed var(--color-primary);
    outline-offset: -4px;
    background: rgba(200, 16, 46, 0.04);
    border-radius: 8px;
}
.kanban-card {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    border: 1px solid var(--color-border);
    transition: transform 0.1s, box-shadow 0.1s;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kanban-card.dragging { opacity: 0.45; cursor: grabbing; }

/* 종결 카드 - 시각적으로 흐릿하게 */
.kanban-card-terminal {
    opacity: 0.78;
    cursor: default;
}
.kanban-card-terminal:hover { transform: none; }

/* 반려 컬럼 - 빨간 톤 배경 */
.kanban-col-rejected {
    background: #fef2f2;
}
.kanban-col-rejected .kanban-col-head { border-bottom-color: #fecaca; }

/* drop 비활성 리스트 - 호버 안 함 */
.kanban-list-readonly.drop-hover {
    outline: none;
    background: transparent;
}
.kc-head {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}
.kc-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-text);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.kc-meta { color: var(--color-text-muted); font-size: 12px; margin-bottom: 6px; }
.kc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    border-top: 1px dashed var(--color-border);
    padding-top: 6px;
}
.kc-assignee.mine { color: var(--color-primary); font-weight: 600; }
.kc-assignee.unassigned { color: var(--color-text-muted); }
.kc-assignee .btn-take { font-size: 11.5px; padding: 2px 8px; }
.kc-foot a { padding: 0 4px; color: var(--color-text-muted); }
.kc-foot a:hover { color: var(--color-primary); }

/* 처리 결과 박스 */
.reject-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #7f1d1d;
    white-space: pre-wrap;
    line-height: 1.6;
}
.resolution-box {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #064e3b;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 14px;
}

/* 공개/비공개 라디오 카드 */
.visibility-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.vis-option { cursor: pointer; }
.vis-option input { display: none; }
.vis-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    background: #fff;
    transition: all 0.12s;
}
.vis-card i { font-size: 22px; }
.vis-card strong { font-size: 14px; }
.vis-card small { font-size: 12px; line-height: 1.4; }
.vis-option:hover .vis-card { border-color: var(--color-primary); background: #fff5f5; }
.vis-option input:checked + .vis-card {
    border-color: var(--color-primary);
    background: #fff0f1;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

/* 잠금 안내 박스 */
.locked-content {
    text-align: center;
    padding: 40px 24px;
    background: #f8fafc;
    border: 1px dashed var(--color-border);
    border-radius: 10px;
    color: var(--color-text-muted);
}
.locked-content > i { font-size: 38px; color: var(--color-text-muted); }
.locked-content h6 { color: var(--color-text); font-weight: 700; }

