        :root {
            --primary: #0f766e;
            --primary-hover: #0f5e57;
            --bg-dark: #efeae0;
            --bg-wash: #e7e1d6;
            --card-bg: #f9f6f0;
            --surface-strong: #f3efe6;
            --surface-soft: #f7f3eb;
            --text-main: #1f2937;
            --text-dim: #6b7280;
            --border: #d7d2c6;
            --accent: #1d4ed8;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-dark);
            background-image:
                radial-gradient(900px 300px at 8% -10%, rgba(15, 118, 110, 0.12), transparent 60%),
                radial-gradient(700px 260px at 92% 0%, rgba(29, 78, 216, 0.1), transparent 60%),
                linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-wash) 100%);
            color: var(--text-main);
            line-height: 1.6;
            padding: 2rem;
            min-height: 100vh;
        }

        .container {
            max-width: 98%;
            margin: 0 auto;
        }

        .sticky-shell {
            position: sticky;
            top: 0;
            z-index: 50;
            padding: 1rem 0 0;
            background: linear-gradient(180deg,
                    rgba(239, 234, 224, 0.98) 0%,
                    rgba(239, 234, 224, 0.9) 65%,
                    rgba(239, 234, 224, 0.7) 100%);
            backdrop-filter: blur(8px);
            border-bottom: 1px solid var(--border);
        }

        /* 3단계 분류 필터 콤보박스 */
        .filter-selects {
            display: flex;
            align-items: flex-end;
            gap: 0;
            padding: 0.6rem 0;
            flex-wrap: wrap;
            row-gap: 0.5rem;
        }

        .filter-select-group {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .filter-select-label {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-dim);
            padding-left: 2px;
        }

        .filter-select {
            padding: 7px 32px 7px 12px;
            border-radius: 10px;
            border: 1.5px solid var(--border);
            background: var(--card-bg);
            color: var(--text-main);
            font-size: 0.92rem;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
            transition: border-color 0.15s, box-shadow 0.15s;
            min-width: 140px;
        }
        .filter-select:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
        }

        .filter-select-arrow {
            font-size: 1.3rem;
            color: var(--text-dim);
            padding: 0 6px;
            padding-bottom: 6px;
            line-height: 1;
            align-self: flex-end;
        }

        .filter-select-stats {
            align-self: flex-end;
            padding: 7px 12px;
            font-size: 0.85rem;
            color: var(--text-dim);
            font-weight: 600;
        }

        header {
            margin-bottom: 0.75rem;
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            flex-wrap: wrap;
            gap: 1rem;
        }

        h1 {
            font-family: 'Outfit', sans-serif;
            font-size: 2.5rem;
            font-weight: 800;
            background: linear-gradient(135deg, #0f172a 0%, #64748b 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 0.5rem;
        }

        .stats {
            color: var(--text-dim);
            font-size: 0.9rem;
        }

        .controls {
            margin-bottom: 0;
            display: flex;
            gap: 1rem;
            align-items: center;
        }

        .search-box {
            flex: 1;
            position: relative;
        }

        input[type="text"],
        input[type="password"],
        select {
            width: 100%;
            padding: 12px 20px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            color: var(--text-main);
            outline: none;
            transition: all 0.2s;
            font-size: 1rem;
        }

        input[type="text"]:focus,
        input[type="password"]:focus,
        select:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
        }

        input:disabled,
        textarea:disabled,
        select:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .table-container {
            background: var(--card-bg);
            border-radius: 16px;
            border: 1px solid var(--border);
            overflow-x: auto;
            max-height: calc(100vh - 250px);
            overflow-y: auto;
            box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.14);
        }

        table {
            width: 100%;
            min-width: 2040px;
            /* Adjusted to match sum of columns better */
            border-collapse: collapse;
            font-size: 0.9rem;
            table-layout: fixed;
        }

        thead {
            position: sticky;
            top: 0;
            z-index: 10;
        }

        th {
            background: var(--surface-strong);
            text-align: left;
            padding: 1rem;
            color: var(--text-dim);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-size: 0.75rem;
            border-bottom: 1px solid var(--border);
            position: relative;
            user-select: none;
            cursor: pointer;
            transition: all 0.2s;
        }

        th:hover {
            background: var(--surface-soft);
            color: var(--text-main);
        }

        .sort-icon {
            margin-left: 6px;
            font-size: 10px;
            opacity: 0.3;
        }

        th.active-sort {
            color: var(--accent);
        }

        th.active-sort .sort-icon {
            opacity: 1;
        }

        th.no-sort {
            cursor: default;
        }

        /* Column Visibility */
        .hidden-col {
            display: none !important;
        }

        .toggle-container {
            margin-bottom: 1rem;
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .filter-bar {
            margin-top: 0.75rem;
            margin-bottom: 0.5rem;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.5rem;
        }

        .filter-label {
            font-size: 0.8rem;
            color: var(--text-dim);
            margin-right: 0.25rem;
        }

        .filter-btn {
            background: var(--card-bg);
            border: 1px solid var(--border);
            color: var(--text-dim);
            padding: 6px 14px;
            border-radius: 999px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .filter-btn.active {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 0.85rem;
            color: var(--text-dim);
        }

        .user-badge {
            padding: 6px 10px;
            border-radius: 999px;
            background: var(--surface-soft);
            border: 1px solid var(--border);
            color: var(--text-main);
            font-weight: 600;
        }

        .logout-btn {
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-dim);
            padding: 6px 12px;
            border-radius: 999px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .logout-btn:hover {
            color: var(--text-main);
            border-color: var(--text-main);
        }

        .status-toggle {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }

        .status-chip {
            padding: 6px 12px;
            border-radius: 999px;
            border: 1px solid var(--border);
            background: var(--card-bg);
            color: var(--text-dim);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .status-chip.active {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
        }

        .login-screen {
            position: fixed;
            inset: 0;
            background: linear-gradient(180deg, rgba(239, 234, 224, 0.96), rgba(231, 225, 214, 0.98));
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2000;
        }

        .login-card {
            width: min(420px, 92vw);
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 24px;
            padding: 2rem;
            box-shadow: 0 30px 60px -40px rgba(15, 23, 42, 0.3);
        }

        .login-title {
            font-family: 'Outfit', sans-serif;
            font-size: 2rem;
            margin-bottom: 0.25rem;
            color: var(--text-main);
        }

        .login-subtitle {
            font-size: 0.95rem;
            color: var(--text-dim);
            margin-bottom: 1.5rem;
        }

        .login-error {
            color: #ef4444;
            font-size: 0.85rem;
            margin-top: 0.75rem;
            min-height: 1.2rem;
        }

        .hidden {
            display: none !important;
        }
        .toggle-btn {
            background: var(--card-bg);
            border: 1px solid var(--border);
            color: var(--text-dim);
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .toggle-btn.active {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
        }

        /* History Items */
        .history-list {
            max-height: 250px;
            overflow-y: auto;
            margin-top: 1rem;
            padding: 10px;
            background: rgba(15, 23, 42, 0.04);
            border-radius: 12px;
        }

        .history-item {
            padding: 10px;
            border-bottom: 1px solid var(--border);
            font-size: 0.85rem;
        }

        .history-item:last-child {
            border-bottom: none;
        }

        .history-date {
            color: var(--accent);
            font-weight: 600;
            margin-right: 8px;
        }

        .history-inspector {
            color: #10b981;
            font-weight: 600;
        }

        .history-participants {
            color: var(--text-dim);
            font-size: 0.8rem;
            margin-top: 4px;
        }

        .participants-header {
            font-size: 0.85rem;
            color: var(--text-dim);
            margin-bottom: 6px;
        }

        .participants-list {
            max-height: 140px;
            overflow-y: auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 6px;
            padding: 8px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: var(--surface-soft);
        }

        .participant-option {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.85rem;
            color: var(--text-main);
        }

        .participants-empty {
            color: var(--text-dim);
            font-size: 0.8rem;
        }

        /* Device Management Styles */
        .device-list {
            max-height: 250px;
            overflow-y: auto;
            margin-top: 1rem;
            padding: 10px;
            background: rgba(15, 23, 42, 0.04);
            border-radius: 12px;
        }

        .device-item {
            padding: 12px;
            border-bottom: 1px solid var(--border);
            font-size: 0.85rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--card-bg);
            margin-bottom: 8px;
            border-radius: 8px;
        }

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

        .device-item-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .device-item-content > div {
            color: var(--text-main);
        }

        .device-item-content .device-label {
            color: var(--text-dim);
            font-size: 0.75rem;
            margin-right: 4px;
        }

        .device-actions {
            display: flex;
            gap: 6px;
        }

        .device-actions button {
            padding: 4px 10px;
            font-size: 0.75rem;
            border: 1px solid var(--border);
            background: var(--surface-soft);
            color: var(--text-main);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .device-actions button:hover {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .device-count {
            display: inline-block;
            background: var(--primary);
            color: white;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 0.85rem;
            font-weight: 600;
        }

        /* Section & Sensor Styles */
        .section-list {
            max-height: 400px;
            overflow-y: auto;
            margin-top: 1rem;
        }

        .section-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 15px;
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border);
        }

        .section-title {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--text-main);
        }

        .sensor-list {
            margin-top: 10px;
        }

        .sensor-item {
            background: rgba(15, 23, 42, 0.04);
            padding: 10px 12px;
            margin-bottom: 8px;
            border-radius: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .sensor-types {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }

        .sensor-type-badge {
            display: inline-block;
            background: var(--primary);
            color: white;
            padding: 3px 10px;
            border-radius: 8px;
            font-size: 0.75rem;
        }

        .sensor-form {
            background: rgba(15, 23, 42, 0.02);
            padding: 12px;
            border-radius: 8px;
            margin-top: 12px;
        }

        .sensor-checkboxes {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 8px;
            margin-bottom: 10px;
        }

        .sensor-checkbox-item {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .sensor-checkbox-item input[type="checkbox"] {
            width: 16px;
            height: 16px;
            cursor: pointer;
        }

        .sensor-checkbox-item label {
            font-size: 0.85rem;
            color: var(--text-main);
            cursor: pointer;
            user-select: none;
        }

        /* Mode Toggle Buttons */
        .mode-toggle-btn {
            padding: 6px 14px;
            font-size: 0.85rem;
            border: 1px solid var(--border);
            background: var(--card-bg);
            color: var(--text-main);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .mode-toggle-btn:hover {
            background: var(--surface-soft);
        }

        .mode-toggle-btn.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        /* Bulk Section Styles */
        .bulk-section-item {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 15px;
        }

        .bulk-section-header {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border);
        }

        .sensor-row {
            display: flex;
            gap: 8px;
            align-items: center;
            margin-bottom: 8px;
        }

        .sensor-row select {
            flex: 1;
            padding: 8px 12px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-main);
            font-size: 0.85rem;
        }

        .sensor-row button {
            padding: 6px 12px;
            font-size: 0.8rem;
            border: 1px solid var(--border);
            background: var(--surface-soft);
            color: var(--text-main);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .sensor-row button:hover {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }

        .add-sensor-row-btn {
            padding: 6px 12px;
            font-size: 0.8rem;
            border: 1px dashed var(--border);
            background: rgba(15, 23, 42, 0.02);
            color: var(--text-dim);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 8px;
        }

        .add-sensor-row-btn:hover {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
            border-style: solid;
        }

        .sensor-checkboxes-inline {
            display: flex;
            gap: 15px;
            flex: 1;
            align-items: center;
            flex-wrap: wrap;
        }

        .sensor-checkboxes-inline label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.85rem;
            color: var(--text-main);
            cursor: pointer;
            user-select: none;
        }

        .sensor-checkboxes-inline input[type="checkbox"] {
            width: 16px;
            height: 16px;
            cursor: pointer;
        }

        /* Resizer handle */
        .resizer {
            position: absolute;
            right: 0;
            top: 0;
            height: 100%;
            width: 5px;
            background: rgba(15, 23, 42, 0.08);
            cursor: col-resize;
            transition: background 0.2s;
            display: none;
        }

        .resizer:hover,
        .resizing {
            background: var(--accent);
        }

        td {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
            color: var(--text-main);
        }

        tr:last-child td {
            border-bottom: none;
        }

        tr:hover td {
            background: rgba(15, 23, 42, 0.04);
        }

        tr:hover td.col-actions {
            background: var(--surface-soft);
        }

        .badge {
            padding: 4px 8px;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 600;
            background: rgba(29, 78, 216, 0.12);
            color: var(--accent);
        }

        .anydesk-link {
            color: #ef4444;
            text-decoration: none;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .anydesk-link:hover {
            text-decoration: underline;
        }

        .loading {
            text-align: center;
            padding: 4rem;
            color: var(--text-dim);
        }

        .ddns-text {
            font-family: monospace;
            color: #10b981;
            font-size: 0.85rem;
        }

        .ddns-link {
            color: inherit;
            text-decoration: none;
        }

        .ddns-link:hover {
            text-decoration: underline;
        }

        .drawing-link {
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .drawing-link:hover {
            text-decoration: underline;
            color: var(--primary-hover);
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(15, 23, 42, 0.35);
            z-index: 1000;
            backdrop-filter: blur(4px);
            justify-content: center;
            align-items: center;
        }

        .modal-content {
            background: var(--card-bg);
            width: 90%;
            max-width: 600px;
            padding: 2rem;
            border-radius: 20px;
            border: 1px solid var(--border);
            box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
            max-height: 88vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

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

        .modal-body {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
            overflow-y: auto;
            padding-right: 0.5rem;
            flex: 1;
            min-height: 0;
        }

        .form-group {
            margin-bottom: 1rem;
        }

        .form-group.full-width {
            grid-column: span 2;
        }

        label {
            display: block;
            margin-bottom: 0.5rem;
            color: var(--text-dim);
            font-size: 0.8rem;
            font-weight: 600;
        }

        .modal-footer {
            margin-top: 2rem;
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
        }

        #editForm {
            display: flex;
            flex-direction: column;
            gap: 0;
            flex: 1;
            min-height: 0;
        }

        .btn {
            padding: 10px 20px;
            border-radius: 10px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
        }

        .btn-primary {
            background: var(--primary);
            color: #fff;
        }

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

        .btn-secondary {
            background: var(--border);
            color: var(--text-main);
        }

        .edit-btn {
            background: none;
            border: none;
            color: var(--accent);
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .edit-btn:hover {
            background: rgba(29, 78, 216, 0.12);
        }

        th.col-index,
        td.col-index {
            text-align: center;
            color: var(--text-dim);
            font-weight: 600;
            width: 30px;
            min-width: 30px;
            max-width: 30px;
            padding: 0.2rem 0.1rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        th.col-actions,
        td.col-actions {
            text-align: center;
            width: 70px;
            min-width: 70px;
            max-width: 70px;
            padding: 0.2rem 0.1rem;
        }

        /* 현장명 컬럼 왼쪽 고정 (모바일 수평 스크롤 시 항상 표시) */
        th.col-name,
        td.col-name {
            position: sticky;
            left: 0;
            z-index: 2;
            background-clip: padding-box;
            box-shadow: 4px 0 6px -4px rgba(15, 23, 42, 0.2);
        }

        th.col-name {
            background: var(--surface-strong);
            z-index: 3;
        }

        td.col-name {
            background: var(--card-bg);
        }

        tr:hover td.col-name {
            background: rgba(15, 23, 42, 0.04);
        }

        /* 그룹 헤더 행 */
        .group-header-row td {
            background: rgba(99, 102, 241, 0.08);
            color: var(--accent);
            font-weight: 700;
            font-size: 0.85rem;
            padding: 6px 16px;
            border-bottom: 1px solid rgba(99, 102, 241, 0.25);
            border-top: 2px solid rgba(99, 102, 241, 0.2);
            letter-spacing: 0.03em;
        }

        /* 관리청(상위) 헤더 */
        .group-header-office td {
            background: rgba(99, 102, 241, 0.15);
            font-size: 0.9rem;
            border-top: 3px solid rgba(99, 102, 241, 0.4);
        }

        /* 관리사무소(하위) 헤더 */
        .group-header-district td {
            background: rgba(99, 102, 241, 0.05);
            font-size: 0.82rem;
            font-weight: 600;
            border-top: 1px solid rgba(99, 102, 241, 0.15);
        }

        .action-stack {
            display: flex;
            flex-direction: row;
            gap: 8px;
            align-items: center;
            justify-content: center;
        }

        .edit-btn {
            width: 24px;
            height: 24px;
            padding: 0;
        }

        /* Dashboard Styles */
        .dashboard-container {
            background: var(--card-bg);
            border-radius: 16px;
            padding: 2rem;
            margin-top: 2rem;
        }

        .dashboard-header {
            background: var(--surface-soft);
            padding: 1.5rem;
            border-radius: 12px;
            margin-bottom: 2rem;
        }

        .dashboard-header h2 {
            font-family: 'Outfit', sans-serif;
            font-size: 1.5rem;
            margin-bottom: 1rem;
            color: var(--text-main);
        }

        .dashboard-stats {
            display: flex;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }

        .stat-card {
            flex: 1;
            background: white;
            padding: 0.75rem 1rem;
            border-radius: 8px;
            border: 1px solid var(--border);
            text-align: center;
        }

        .stat-number {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 0.25rem;
        }

        .stat-label {
            font-size: 0.85rem;
            color: var(--text-dim);
            font-weight: 500;
        }

        .dashboard-filters {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .filter-group {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .filter-group select {
            padding: 8px 12px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-main);
            font-size: 0.9rem;
            min-width: 200px;
        }

        .dashboard-findings {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .dashboard-finding-item {
            background: white;
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.5rem;
            transition: all 0.2s;
        }

        .dashboard-finding-item:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .finding-site-name {
            display: inline-block;
            background: var(--primary);
            color: white;
            padding: 4px 10px;
            border-radius: 6px;
            font-size: 0.85rem;
            font-weight: 600;
            margin-bottom: 10px;
        }

        /* Inspection Findings Styles */
        .findings-section {
            margin-top: 1.5rem;
            border-top: 1px solid var(--border);
            padding-top: 1.5rem;
            grid-column: span 2;  /* 모달 전체 너비 사용 */
        }

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

        .findings-filters {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .filter-btn {
            padding: 6px 12px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-main);
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .filter-btn:hover {
            background: var(--surface-strong);
        }

        .filter-btn.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .findings-list {
            margin-top: 1rem;
            display: flex;
            flex-direction: column;
            gap: 12px;
            max-height: 400px;
            overflow-y: auto;
        }

        .finding-item {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 15px;
            transition: all 0.2s;
        }

        .finding-item:hover {
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }

        .finding-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 10px;
        }

        .finding-title {
            font-weight: 600;
            color: var(--text-main);
            flex: 1;
            margin-right: 10px;
        }

        .finding-badges {
            display: flex;
            gap: 6px;
            flex-shrink: 0;
        }

        .finding-badge {
            padding: 4px 10px;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .severity-critical {
            background: #fee2e2;
            color: #991b1b;
        }

        .severity-high {
            background: #fed7aa;
            color: #9a3412;
        }

        .severity-medium {
            background: #fef08a;
            color: #854d0e;
        }

        .severity-low {
            background: #d9f99d;
            color: #3f6212;
        }

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

        .status-in_progress {
            background: #fef08a;
            color: #854d0e;
        }

        .status-completed {
            background: #d9f99d;
            color: #3f6212;
        }

        .finding-meta {
            display: flex;
            gap: 15px;
            font-size: 0.85rem;
            color: var(--text-dim);
            margin-bottom: 10px;
            flex-wrap: wrap;
        }

        .finding-meta-item {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .finding-description {
            color: var(--text-main);
            font-size: 0.9rem;
            margin-bottom: 10px;
        }

        .finding-action {
            background: rgba(15, 118, 110, 0.05);
            padding: 10px;
            border-radius: 8px;
            margin-top: 10px;
            font-size: 0.85rem;
        }

        .finding-action-label {
            font-weight: 600;
            color: var(--primary);
            margin-bottom: 5px;
        }

        .finding-actions {
            display: flex;
            gap: 8px;
            margin-top: 10px;
        }

        .findings-form {
            margin-top: 1.5rem;
            background: rgba(15, 23, 42, 0.04);
            padding: 15px;
            border-radius: 12px;
        }

        .findings-form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-top: 10px;
        }

        .findings-form-grid input,
        .findings-form-grid select,
        .findings-form-grid textarea {
            width: 100%;
            padding: 10px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-main);
            outline: none;
        }

        .findings-form-grid textarea {
            grid-column: span 2;
            min-height: 60px;
            resize: vertical;
        }

        .findings-form-grid .full-width {
            grid-column: span 2;
        }

        /* Image Upload Styles */
        .image-upload-section {
            grid-column: span 2;
            margin-top: 10px;
        }

        .image-upload-label {
            display: block;
            font-size: 0.9rem;
            color: var(--text-main);
            margin-bottom: 8px;
            font-weight: 500;
        }

        .image-upload-input {
            display: none;
        }

        .image-upload-button {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.2s;
        }

        .image-upload-button:hover {
            background: var(--primary-hover);
        }

        .image-preview-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 10px;
            margin-top: 10px;
        }

        .image-preview-item {
            position: relative;
            aspect-ratio: 1;
            border-radius: 8px;
            overflow: hidden;
            border: 2px solid var(--border);
            background: var(--surface-soft);
        }

        .image-preview-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .image-preview-delete {
            position: absolute;
            top: 4px;
            right: 4px;
            background: rgba(220, 38, 38, 0.9);
            color: white;
            border: none;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all 0.2s;
        }

        .image-preview-delete:hover {
            background: rgba(220, 38, 38, 1);
            transform: scale(1.1);
        }

        .finding-images {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 10px;
            margin-top: 10px;
        }

        .finding-images-label {
            font-weight: 600;
            color: var(--text-main);
            margin-top: 10px;
            margin-bottom: 5px;
            display: block;
        }

        .finding-image-item {
            position: relative;
            aspect-ratio: 1;
            border-radius: 8px;
            overflow: hidden;
            border: 2px solid var(--border);
            cursor: pointer;
            transition: all 0.2s;
        }

        .finding-image-item:hover {
            border-color: var(--primary);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .finding-image-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* Image Modal */
        .image-modal {
            display: none;
            position: fixed;
            z-index: 10000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
        }

        .image-modal-content {
            position: relative;
            margin: auto;
            display: block;
            max-width: 90%;
            max-height: 90%;
            top: 50%;
            transform: translateY(-50%);
        }

        .image-modal-close {
            position: absolute;
            top: 20px;
            right: 40px;
            color: white;
            font-size: 40px;
            font-weight: bold;
            cursor: pointer;
            z-index: 10001;
        }

        .image-modal-close:hover {
            color: #ccc;
        }

        /* Category View Styles */
        #categoryView {
            padding-top: 1.5rem;
        }

        .category-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .category-table-container {
            background: var(--card-bg);
            border-radius: 16px;
            border: 1px solid var(--border);
            overflow: hidden;
            box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.14);
            max-width: 700px;
        }

        .recent-maintenance-section {
            margin-top: 2rem;
            max-width: 700px;
        }

        .recent-maintenance-title {
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-dim);
            margin-bottom: 0.75rem;
        }

        .recent-item {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            margin-bottom: 0.5rem;
            cursor: pointer;
            transition: background 0.15s;
        }

        .recent-item:hover {
            background: var(--surface-soft);
        }

        .recent-item-date {
            font-size: 0.78rem;
            color: var(--text-dim);
            white-space: nowrap;
            min-width: 70px;
            padding-top: 2px;
        }

        .recent-item-body {
            flex: 1;
            min-width: 0;
        }

        .recent-item-site {
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--accent);
            margin-bottom: 2px;
        }

        .recent-item-meta {
            font-size: 0.78rem;
            color: var(--text-dim);
        }

        .recent-item-issue {
            font-size: 0.85rem;
            color: var(--text-main);
            margin-top: 2px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .category-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.95rem;
            table-layout: fixed;
        }

        .category-table thead th {
            background: var(--surface-strong);
            padding: 1rem 1.5rem;
            text-align: left;
            color: var(--text-dim);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-size: 0.75rem;
            border-bottom: 1px solid var(--border);
            cursor: default;
        }

        .category-table thead th:not(:first-child) {
            text-align: center;
        }

        .category-table tbody tr {
            border-bottom: 1px solid var(--border);
            cursor: pointer;
            transition: background 0.15s;
        }

        .category-table tbody tr:last-child {
            border-bottom: none;
            font-weight: 700;
            cursor: default;
        }

        .category-table tbody tr:not(:last-child):hover {
            background: var(--surface-soft);
        }

        .category-table td {
            padding: 1rem 1.5rem;
            color: var(--text-main);
        }

        .category-table td:not(:first-child) {
            text-align: center;
        }

        .category-name {
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .category-name-arrow {
            color: var(--accent);
            font-size: 0.8rem;
            opacity: 0;
            transition: opacity 0.15s;
        }

        .category-table tbody tr:not(:last-child):hover .category-name-arrow {
            opacity: 1;
        }

        .count-badge {
            display: inline-block;
            padding: 2px 10px;
            border-radius: 999px;
            font-size: 0.85rem;
            font-weight: 600;
        }

        .count-total { background: rgba(15,118,110,0.12); color: var(--primary); }
        .count-active { background: rgba(16,185,129,0.12); color: #059669; }
        .count-inactive { background: rgba(239,68,68,0.1); color: #dc2626; }

        /* Breadcrumb */
        .breadcrumb-bar {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 0 0.5rem;
            font-size: 0.85rem;
            color: var(--text-dim);
        }

        .breadcrumb-back {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            color: var(--accent);
            cursor: pointer;
            font-weight: 600;
            border: none;
            background: none;
            padding: 4px 8px;
            border-radius: 8px;
            transition: background 0.15s;
        }

        .breadcrumb-back:hover {
            background: rgba(29,78,216,0.08);
        }

        .breadcrumb-sep {
            color: var(--border);
        }

        .breadcrumb-current {
            color: var(--text-main);
            font-weight: 600;
        }

        /* Print styles for findings report */
        @media print {
            body {
                background: white;
                padding: 0;
            }

            .sticky-shell,
            .btn,
            .findings-filters,
            .findings-form,
            .finding-actions {
                display: none !important;
            }

            .findings-list {
                max-height: none;
                overflow: visible;
            }

            .finding-item {
                page-break-inside: avoid;
                border: 1px solid #ccc;
                margin-bottom: 10px;
            }
        }

        /* ============================================================
           Responsive: Tablet (≤ 768px)
           ============================================================ */
        @media (max-width: 768px) {
            /* 모바일: 년도, 현장명, 도면, 지자체 담당자만 표시 */
            th.col-anydesk, td.col-anydesk,
            th.col-logger, td.col-logger,
            th.col-cctv, td.col-cctv,
            th.col-security, td.col-security,
            th.col-remarks, td.col-remarks {
                display: none !important;
            }

            /* 컬럼 토글 버튼도 모바일에서는 숨김 */
            .toggle-container {
                display: none;
            }

            body {
                padding: 0.75rem;
            }

            .sticky-shell {
                padding: 0.75rem 0 0.5rem;
            }

            h1 {
                font-size: 1.75rem;
            }

            header {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
                margin-bottom: 0.75rem;
            }

            /* Controls: 검색창 + 버튼들 세로 스택 */
            .controls {
                flex-direction: column;
                align-items: stretch;
                width: 100%;
            }

            .controls .btn,
            .controls a.btn {
                width: 100%;
                justify-content: center;
            }

            .search-box {
                width: 100%;
            }

            /* Table */
            .table-container {
                overflow-x: auto;
                max-height: calc(100vh - 180px);
            }

            /* Column toggle buttons — 더 작게 */
            .toggle-container {
                gap: 0.35rem;
            }

            .toggle-btn {
                padding: 4px 10px;
                font-size: 0.75rem;
            }

            /* Filter bar */
            .filter-bar {
                gap: 0.35rem;
            }

            /* Modal */
            .modal-content {
                padding: 1.25rem;
                width: 96vw;
                max-width: none;
            }

            .modal-body {
                grid-template-columns: 1fr;
                gap: 0;
            }

            .modal-header {
                margin-bottom: 1rem;
            }

            .form-group {
                margin-bottom: 0.6rem;
            }

            .form-group.full-width {
                grid-column: span 1;
            }

            .modal-footer {
                margin-top: 1rem;
                flex-direction: column;
            }

            .modal-footer .btn {
                width: 100%;
                justify-content: center;
            }

            /* Findings form grid */
            .findings-form-grid {
                grid-template-columns: 1fr;
            }

            .findings-form-grid textarea,
            .findings-form-grid .full-width {
                grid-column: span 1;
            }

            /* Category */
            .category-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
            }

            .category-table-container {
                max-width: 100%;
            }

            .category-table thead th,
            .category-table td {
                padding: 0.75rem 1rem;
            }

            /* Dashboard */
            .dashboard-container {
                padding: 1rem;
            }

            .dashboard-header {
                padding: 1rem;
            }

            .dashboard-stats {
                flex-wrap: wrap;
            }

            .stat-card {
                min-width: calc(50% - 0.5rem);
            }

            .dashboard-finding-item {
                padding: 1rem;
            }

            .filter-group {
                flex-direction: column;
                align-items: stretch;
            }

            .filter-group select {
                min-width: unset;
                width: 100%;
            }

            /* User info */
            .user-info {
                font-size: 0.78rem;
                gap: 0.5rem;
            }

            /* Finding header */
            .finding-header {
                flex-direction: column;
                gap: 6px;
                align-items: flex-start;
            }

            .finding-badges {
                flex-wrap: wrap;
            }

            /* Participants */
            .participants-list {
                grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
            }

            /* Sensor checkboxes */
            .sensor-checkboxes {
                grid-template-columns: 1fr 1fr;
            }

            /* Breadcrumb */
            .breadcrumb-bar {
                font-size: 0.78rem;
            }
        }

        /* ============================================================
           Responsive: Phone (≤ 480px)
           ============================================================ */
        @media (max-width: 480px) {
            body {
                padding: 0.5rem;
            }

            h1 {
                font-size: 1.35rem;
            }

            .user-badge {
                display: none;
            }

            /* Controls SVG 아이콘 숨김으로 버튼 텍스트만 표시 */
            .controls .btn svg,
            .controls a.btn svg {
                display: none;
            }

            .controls .btn svg + *,
            .controls a.btn svg + * {
                margin-left: 0 !important;
            }

            .modal-content {
                padding: 1rem;
                border-radius: 14px;
                width: 98vw;
            }

            .btn {
                padding: 8px 14px;
                font-size: 0.88rem;
            }

            .stat-card {
                min-width: 100%;
            }

            .sensor-checkboxes {
                grid-template-columns: 1fr;
            }

            .sensor-checkboxes-inline {
                flex-direction: column;
                gap: 8px;
            }

            .findings-filters {
                gap: 6px;
            }

            .filter-btn {
                padding: 5px 10px;
                font-size: 0.78rem;
            }

            .device-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }

            .device-actions {
                width: 100%;
                justify-content: flex-start;
            }

            .device-actions button {
                flex: 1;
            }

            /* Category table — 숫자 컬럼 최소화 */
            .category-table thead th,
            .category-table td {
                padding: 0.6rem 0.75rem;
                font-size: 0.85rem;
            }

            .count-badge {
                padding: 2px 6px;
                font-size: 0.78rem;
            }

            /* Dashboard header */
            .dashboard-header > div:first-child {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
            }

            .dashboard-header > div:first-child .btn {
                width: 100%;
                justify-content: center;
            }

            /* Toggle container */
            .toggle-btn {
                padding: 3px 8px;
                font-size: 0.72rem;
            }
        }
