/* =========================================================
   PACS Trouble Wiki - Clean Theme CSS
   Theme: Mist SaaS + Light Slate Sidebar
   Notes:
   - 전역 button 스타일 금지: Toast UI Editor 툴바 보호
   - 중복 override 제거
   - 사이드바/본문 간격 있는 카드형 레이아웃
   ========================================================= */

:root {
    --app-bg: #eef4f8;
    --app-bg-2: #e7f2f6;
    --panel: #fbfcfe;
    --panel-2: #f7f9fc;
    --sidebar: rgba(248, 250, 252, 0.88);
    --sidebar-2: rgba(226, 232, 240, 0.82);
    --text: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #d5dde8;
    --line-soft: #e4eaf2;
    --accent: #22d3ee;
    --accent-2: #60a5fa;
    --accent-3: #14b8a6;
    --danger: #dc2626;
    --warning-bg: #fee2e2;
    --shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
    --shadow-strong: 0 20px 48px rgba(15, 23, 42, 0.10);
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Arial, 'Malgun Gothic', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 82% 0%, rgba(34, 211, 238, 0.15), transparent 30%),
        radial-gradient(circle at 13% 88%, rgba(96, 165, 250, 0.12), transparent 34%),
        linear-gradient(135deg, var(--app-bg), var(--app-bg-2));
}

a {
    color: inherit;
}

/* =========================================================
   Layout
   ========================================================= */

.main-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    min-height: 100vh;
    padding: 18px 24px 24px 18px;
}

.sidebar {
    width: 272px;
    min-width: 272px;
    height: calc(100vh - 42px);
    min-height: calc(100vh - 42px);
    overflow-y: auto;
    position: sticky;
    top: 18px;
    padding: 24px 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    border: 1px solid rgba(203, 213, 225, 0.95);
    box-shadow: 10px 0 34px rgba(100, 116, 139, 0.16);
    backdrop-filter: blur(14px);
}

.content {
    flex: 1;
    min-width: 0;
    padding: 0;
}

.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.content > .container {
    width: 100%;
    max-width: none;
    padding: 0;
}

/* 단독 페이지용: login 등 main-layout 밖에서 쓰는 container */
body > .container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 42px;
}

/* =========================================================
   Typography
   ========================================================= */

h1, h2, h3 {
    color: var(--text);
    letter-spacing: -0.03em;
}

h1 {
    margin-top: 0;
}

label {
    display: block;
    margin-top: 16px;
    margin-bottom: 7px;
    font-weight: 850;
    color: var(--text-soft);
}

.subtitle {
    margin-top: 8px;
    color: var(--muted);
}

.empty {
    text-align: center;
    color: var(--muted);
}

/* =========================================================
   Sidebar / Logo
   ========================================================= */

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 10px;
    margin-bottom: 18px;
    text-decoration: none;
    color: var(--text);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.70);
    border: 1px solid rgba(203, 213, 225, 0.85);
    box-shadow: 0 10px 24px rgba(100, 116, 139, 0.12);
}

.sidebar-logo:hover {
    background: rgba(255, 255, 255, 0.92);
}

.logo-image {
    width: 68px;
    height: 68px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 7px 14px rgba(14, 165, 233, 0.22));
}

.logo-icon,
.logo-mark {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    font-weight: 950;
    box-shadow: 0 12px 28px rgba(34, 211, 238, 0.24);
    flex-shrink: 0;
}

.logo-title {
    font-size: 20px;
    font-weight: 950;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.sidebar-divider,
.sidebar hr {
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    margin: 20px 0;
}

.sidebar-title {
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.04em;
    color: #475569;
    margin: 18px 0 10px 0;
}

.sidebar-section-title {
    font-size: 18px;
    font-weight: 950;
    color: var(--text);
    line-height: 1.15;
    margin: 20px 0 12px 0;
}

.sidebar-section-title span {
    display: block;
}

.side-link {
    display: block;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 12px;
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 750;
    background: transparent;
}

.side-link:hover {
    background: rgba(255, 255, 255, 0.75);
    color: var(--text);
}

.side-link.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0f172a;
    font-weight: 950;
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.22);
}

.popular-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 10px;
}

.popular-item {
    display: block;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(226, 232, 240, 0.75);
    font-size: 13px;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popular-item:hover {
    background: rgba(255, 255, 255, 0.92);
    color: #0284c7;
}

.popular-item span {
    color: var(--muted);
}

/* =========================================================
   Header / Search
   ========================================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    padding: 22px 26px;
    border-radius: var(--radius-lg);
    background: rgba(251, 252, 254, 0.92);
    border: 1px solid rgba(216, 222, 232, 0.95);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.page-header h1 {
    margin: 0;
    font-size: 32px;
}

.header-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.login-user {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    margin-bottom: 20px;
}

.search-form input {
    flex: 1;
}

.large-search {
    margin-top: 0;
    margin-bottom: 20px;
}

/* =========================================================
   Form Elements
   ========================================================= */

input,
select,
textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #cfd7e3;
    border-radius: 11px;
    background: #fbfcfe;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-3);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.13);
}

input::placeholder,
textarea::placeholder {
    color: #8b98aa;
}

.select-config-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.select-config-row select {
    flex: 1;
}

.form-help {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.case-form {
    max-width: 1180px;
}

/* =========================================================
   Buttons
   NOTE: button 전역 스타일 금지. Toast UI Editor 보호.
   ========================================================= */

.btn,
.actions button,
.detail-actions button,
.top-actions button,
.config-btn,
.modal-add-row button,
.master-pagination button,
.mini-btn,
.order-btn,
.danger-btn,
.save-btn,
.delete-btn,
.primary-btn {
    display: inline-block;
    padding: 9px 13px;
    border: 1px solid #cfd7e3;
    border-radius: 11px;
    background: #fbfcfe;
    color: var(--text-soft);
    text-decoration: none;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.2;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.03);
}

.btn:hover,
.actions button:hover,
.detail-actions button:hover,
.top-actions button:hover,
.config-btn:hover,
.modal-add-row button:hover,
.master-pagination button:hover,
.mini-btn:hover,
.order-btn:hover,
.danger-btn:hover,
.save-btn:hover,
.delete-btn:hover,
.primary-btn:hover {
    background: #f1f5f9;
    opacity: 1;
}

.primary,
.primary-btn,
.btn.primary {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.primary:hover,
.primary-btn:hover,
.btn.primary:hover {
    background: #0b1220;
}

.logout-btn {
    background: #64748b;
    color: #ffffff;
    border-color: #64748b;
}

.logout-btn:hover {
    background: #475569;
}

.danger,
.danger-btn,
.delete-btn {
    background: var(--danger) !important;
    color: #ffffff !important;
    border-color: var(--danger) !important;
}

.config-btn {
    background: #334155;
    color: #ffffff;
    border-color: #334155;
    white-space: nowrap;
}

.modal-add-row button,
.save-btn {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

.actions,
.detail-actions,
.top-actions {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* =========================================================
   Cards / Lists
   ========================================================= */

.case-list {
    margin-top: 0;
    display: grid;
    gap: 14px;
}

.case-card,
.empty-card {
    background: rgba(251, 252, 254, 0.96);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.case-card {
    padding: 18px;
    cursor: pointer;
    transition: 0.18s ease;
}

.case-card:hover {
    background: #ffffff;
    border-color: rgba(20, 184, 166, 0.42);
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
}

.case-card h3 {
    margin: 12px 0;
    font-size: 20px;
    color: var(--text);
}

.case-top {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.case-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 14px;
}

.empty-card {
    padding: 40px;
    text-align: center;
    color: var(--text-soft);
}

.case-card-body {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: stretch;
}

.case-card-main {
    flex: 1;
    min-width: 0;
}

.case-thumb {
    width: 150px;
    height: 105px;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f6;
    border: 1px solid var(--line);
    flex-shrink: 0;
}

.case-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================================
   Badges / Tags
   ========================================================= */

.badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.case-top .badge {
    transition: all 0.15s ease;
}

.case-top .badge:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
}

.product-badge {
    background: #ccfbf1;
    color: #115e59;
}

.category-badge {
    background: #e0f2fe;
    color: #075985;
}

.error-badge {
    background: #fee2e2;
    color: #991b1b;
}

.tag-link {
    display: inline-block;
    margin-right: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 12px;
    text-decoration: none;
}

.tag-link:hover {
    background: var(--accent-3);
    color: #052e2b;
}

/* =========================================================
   Tables / Detail
   ========================================================= */

.list-table,
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.list-table th,
.list-table td,
.info-table th,
.info-table td {
    border: 1px solid var(--line-soft);
    padding: 9px;
    vertical-align: top;
    color: var(--text);
    background: var(--panel);
}

.list-table th,
.info-table th {
    background: #eef2f6;
    color: var(--text-soft);
}

.info-table th {
    width: 140px;
}

.detail-content {
    max-width: 1100px;
}

.detail-content .info-table,
.detail-content .html-box {
    width: 100%;
    max-width: 100%;
}

.html-box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
    min-height: 60px;
    overflow-x: auto;
    color: var(--text);
    box-shadow: var(--shadow);
}

.html-box img {
    max-width: 100%;
}

/* =========================================================
   Attachments / Images
   ========================================================= */

.attach-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attach-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    background: var(--panel);
}

.attach-item:hover {
    background: #ffffff;
}

.attach-name {
    font-weight: 700;
}

.attach-size {
    color: var(--muted);
    font-size: 13px;
}

.empty-attach {
    color: var(--muted-2);
    padding: 12px 0;
}

.thumb-gallery {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.thumb-item {
    width: 220px;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #eef2f6;
    cursor: zoom-in;
    flex-shrink: 0;
    transition: 0.15s ease;
}

.thumb-item:hover {
    border-color: var(--accent-2);
    transform: translateY(-1px);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.82);
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.image-preview-modal img {
    max-width: 95vw;
    max-height: 92vh;
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
    background: white;
    cursor: zoom-out;
}

/* =========================================================
   Modal / Master Management
   ========================================================= */

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9998;
}

.master-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    width: 820px;
    max-width: calc(100vw - 80px);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    transform: translate(-50%, -50%);
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
    z-index: 9999;
    box-shadow: 0 24px 90px rgba(15, 23, 42, 0.24);
}

.master-modal h2 {
    margin-top: 0;
    margin-bottom: 16px;
}

.modal-close {
    float: right;
}

.modal-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.modal-add-row input {
    flex: 1;
}

.modal-search-row {
    margin-bottom: 14px;
}

.modal-search-row input {
    width: 100%;
}

.master-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
}

.master-table th,
.master-table td {
    border: 1px solid var(--line-soft);
    padding: 8px;
    font-size: 14px;
    color: var(--text);
}

.master-table th {
    background: #eef2f6;
    color: var(--text-soft);
}

.master-table input {
    width: 100%;
}

.disabled-row {
    opacity: 0.45;
}

.order-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.order-btn {
    padding: 5px 8px;
    border-radius: 8px;
}

.mini-btn {
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
}

.master-pagination {
    margin-top: 16px;
    text-align: center;
}

.master-pagination button {
    margin: 0 3px;
    padding: 7px 11px;
    border-radius: 8px;
}

.master-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.master-pagination .active-page,
.active-page {
    background: #111827 !important;
    color: #ffffff !important;
    font-weight: 800;
}

/* =========================================================
   Login
   ========================================================= */

.login-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    width: 400px;
    background: rgba(251, 252, 254, 0.96);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-strong);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
}

.login-box input {
    width: 100%;
    margin-bottom: 15px;
}

.login-box button {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #111827;
    border-radius: 11px;
    background: #111827;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.login-error {
    color: var(--danger);
    margin-bottom: 15px;
}

/* =========================================================
   Toast UI Editor
   전역 button 스타일을 사용하지 않으므로 기본 아이콘 유지
   ========================================================= */

.toastui-editor-defaultUI {
    background: #ffffff !important;
    border: 1px solid #cfd7e3 !important;
    border-radius: 14px !important;
    overflow: hidden;
}

.toastui-editor-toolbar {
    background: #f8fafc !important;
    border-bottom: 1px solid #d8dee8 !important;
}

.toastui-editor-main,
.toastui-editor-md-container,
.toastui-editor-ww-container {
    background: #ffffff !important;
}

.toastui-editor-contents {
    color: #111827 !important;
}

.toastui-editor-mode-switch {
    background: #f8fafc !important;
    border-top: 1px solid #d8dee8 !important;
}

.toastui-editor-mode-switch .tab-item {
    background: #f8fafc !important;
    color: #475569 !important;
}

.toastui-editor-mode-switch .tab-item.active {
    background: #ffffff !important;
    color: #0f172a !important;
    font-weight: 700;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 980px) {
    .main-layout {
        flex-direction: column;
        gap: 16px;
        padding: 14px;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 0;
        position: relative;
        top: auto;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-form,
    .select-config-row,
    .case-card-body {
        flex-direction: column;
        align-items: stretch;
    }

    .case-thumb {
        width: 100%;
        height: 180px;
    }
}

/* =========================================================
   Master Manage Button Color Fix
   병원 관리 / 제품 관리 버튼 hover 색상 확실히 변경
   ========================================================= */

.select-config-row .config-btn {
    background: #334155 !important;
    color: #ffffff !important;
    border: 1px solid #334155 !important;
    opacity: 1 !important;
}

.select-config-row .config-btn:hover {
    background: #0f766e !important;
    color: #ffffff !important;
    border-color: #0f766e !important;
    opacity: 1 !important;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.16) !important;
}

/* =========================================================
   Tom Select - 병원명 검색 드롭다운
   ========================================================= */

.ts-wrapper {
    width: 100%;
}

.ts-control {
    min-height: 41px;
    padding: 8px 11px !important;
    border: 1px solid #cfd7e3 !important;
    border-radius: 11px !important;
    background: #fbfcfe !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

.ts-control input {
    color: #0f172a !important;
}

.ts-wrapper.focus .ts-control {
    border-color: #14b8a6 !important;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.13) !important;
}

.ts-dropdown {
    border: 1px solid #cfd7e3 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12) !important;
    overflow: hidden;
}

.ts-dropdown-content {
    max-height: 360px !important;  /* 약 10개 정도 */
    overflow-y: auto !important;
}

.ts-dropdown .option {
    padding: 9px 12px !important;
    font-size: 14px;
}

.ts-dropdown .option:hover,
.ts-dropdown .active {
    background: #e0f2fe !important;
    color: #075985 !important;
}

.ts-dropdown .no-results {
    padding: 10px 12px;
    color: #64748b;
}

/* =========================================================
   Today TODO / Important Notice
   ========================================================= */

.todo-panel {
    margin: 0 0 20px 0;
    padding: 20px 22px;
    border-radius: 22px;
    background: rgba(251, 252, 254, 0.94);
    border: 1px solid rgba(216, 222, 232, 0.95);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.todo-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 950;
}

.todo-header p {
    margin: 6px 0 0 0;
    color: var(--muted);
    font-size: 14px;
}

.todo-add-form {
    display: grid;
    grid-template-columns: 1fr 130px 90px;
    gap: 8px;
    margin-bottom: 14px;
}

.todo-add-form button {
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0f172a;
    font-weight: 950;
    cursor: pointer;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: #ffffff;
}

.todo-item.done {
    opacity: 0.55;
}

.todo-item.done .todo-title {
    text-decoration: line-through;
}

.todo-main {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.todo-title {
    font-weight: 800;
    color: var(--text);
    word-break: break-all;
}

.todo-priority {
    flex-shrink: 0;
    min-width: 44px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
    text-align: center;
}

.priority-normal {
    background: #e2e8f0;
    color: #334155;
}

.priority-important {
    background: #fef3c7;
    color: #92400e;
}

.priority-urgent {
    background: #fee2e2;
    color: #b91c1c;
}

.todo-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.todo-actions form {
    margin: 0;
}

.todo-complete-btn,
.todo-delete-btn {
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.todo-complete-btn {
    background: #e0f2fe;
    color: #075985;
}

.todo-delete-btn {
    background: #fee2e2;
    color: #b91c1c;
}

.todo-empty {
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}


/* =========================================================
   Sidebar Bottom Actions
   ========================================================= */

.sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-bottom-actions {
    margin-top: auto;
    padding-top: 18px;
}

.sidebar-import-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 13px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.68);
    color: #334155;
    font-size: 13px;
    font-weight: 950;
    text-decoration: none;
    letter-spacing: -0.01em;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.sidebar-import-link:hover {
    background: #ffffff;
    color: #0f172a;
    transform: translateY(-1px);
}


/* =========================================================
   Sidebar Scrollbar / Search Form Button Fix
   ========================================================= */

/* 사이드바 스크롤바는 기본 숨김, 마우스 올릴 때만 표시 */
.sidebar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.sidebar:hover {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

.sidebar:hover::-webkit-scrollbar {
    width: 8px;
}

.sidebar:hover::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
}

.sidebar:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 65, 85, 0.55);
}

/* 사이드바 하단 Import 버튼은 하단에 붙되 잘리지 않게 */
.sidebar-bottom-actions {
    margin-top: auto;
    padding-top: 18px;
    padding-bottom: 4px;
}

.sidebar-import-link {
    min-height: 40px;
    font-size: 12px;
}

/* 검색 버튼 UI 복구 */
.search-form button,
.search-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 66px;
    padding: 0 14px;
    border: 1px solid #cfd7e3;
    border-radius: 11px;
    background: #fbfcfe;
    color: #0f172a;
    font-size: 14px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.03);
}

.search-form button:hover,
.search-form .btn:hover {
    background: #f1f5f9;
    border-color: #b8c4d4;
}

.search-form input[type="text"] {
    height: 40px;
}

.large-search {
    gap: 8px;
    align-items: center;
}


/* =========================================================
   Master Order Input / Wiki Type
   ========================================================= */

.order-setter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.order-setter input {
    width: 54px;
    height: 30px;
    padding: 0 7px;
    text-align: center;
    border-radius: 9px;
}

.order-setter button {
    height: 30px;
    padding: 0 9px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.order-setter button:hover {
    background: #e0f2fe;
    color: #075985;
}

.wiki-type-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wiki-type-row select {
    width: 160px;
    flex-shrink: 0;
}

.wiki-type-help {
    color: var(--muted);
    font-size: 13px;
}

.notice-only {
    display: none;
}

.notice-simple-box textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.6;
}


/* =========================================================
   Master Fixed Order Toolbar / TIP Form
   ========================================================= */

.master-order-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 12px 0 12px;
    padding: 10px;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.96);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.master-order-toolbar span {
    flex: 1;
    min-width: 0;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.master-order-toolbar button,
.select-master-btn {
    height: 30px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.master-order-toolbar button:hover,
.select-master-btn:hover {
    background: #e0f2fe;
    color: #075985;
}

.selected-master-row td {
    background: #e0f2fe !important;
}

.selected-master-row td:first-child {
    border-left: 4px solid #0284c7;
}

.tip-simple-box textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.6;
}


/* =========================================================
   Wiki Type Segmented Control / Master Select Fix
   ========================================================= */

.wiki-type-segment {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border: 1px solid #99f6e4;
    border-radius: 16px;
    background: #ccfbf1;
    gap: 4px;
}

.wiki-type-option {
    min-width: 76px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #334155;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.wiki-type-option.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10);
}

.wiki-type-option:hover {
    background: rgba(255, 255, 255, 0.72);
}

.select-master-btn {
    pointer-events: auto;
}

#masterTableBody tr {
    cursor: pointer;
}

#masterTableBody tr:hover td {
    background: #f0f9ff;
}

.selected-master-row td {
    background: #dbeafe !important;
}


/* =========================================================
   Batch UI Feature Refinement
   ========================================================= */

/* 파일 첨부 버튼 디자인 */
.file-upload-input {
    width: 100%;
    padding: 9px;
    border: 1px solid #cfd7e3;
    border-radius: 14px;
    background: #fbfcfe;
}

.file-upload-input::file-selector-button {
    height: 34px;
    margin-right: 12px;
    padding: 0 14px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0f172a;
    font-weight: 950;
    cursor: pointer;
}

.file-upload-input::file-selector-button:hover {
    filter: brightness(0.97);
}

/* 장애 유형에서는 원인/확인SQL 영역을 기본 숨김 보정 */
#cause_editor,
#check_sql_editor {
    display: none;
}

/* 제품/병원명 관리 이름 편집 */
.master-name-edit {
    display: grid;
    grid-template-columns: 1fr 54px;
    gap: 7px;
    align-items: center;
}

.master-name-edit input {
    height: 32px;
    padding: 0 9px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
}

.master-name-edit button {
    height: 32px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.master-name-edit button:hover {
    background: #e0f2fe;
    color: #075985;
}

.side-tip-link {
    margin-bottom: 4px;
}


/* =========================================================
   Sidebar Section Font Alignment
   ========================================================= */

.sidebar-section-title {
    font-size: 17px;
    font-weight: 950;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.sidebar-section-title span:first-child {
    font-size: 17px;
    font-weight: 950;
}


/* =========================================================
   Separate TIP Register Page
   ========================================================= */

.tip-form-container .tip-form-desc {
    margin: -6px 0 22px;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.tip-case-form .tip-body {
    min-height: 260px;
    resize: vertical;
    line-height: 1.65;
    font-family: inherit;
}

.file-upload-input {
    width: 100%;
    padding: 12px;
    border: 1px dashed #9ec9e8;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fbff, #eef9ff);
    color: #334155;
    font-weight: 800;
}

.file-upload-input::file-selector-button {
    height: 36px;
    margin-right: 14px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #ffffff;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 7px 14px rgba(37, 99, 235, 0.18);
}
