body {
    margin: 0;
    background: #0f172a;
    color: #e5e7eb;
    font-family: Arial, 'Malgun Gothic', sans-serif;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
}

h1, h2 {
    color: #f8fafc;
}

label {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
    font-weight: 700;
    color: #93c5fd;
}

input, select, textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #111827;
    color: #e5e7eb;
}

button, .btn {
    display: inline-block;
    padding: 9px 13px;
    border: 0;
    border-radius: 6px;
    background: #334155;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

button:hover, .btn:hover {
    opacity: 0.9;
}

.primary, .primary-btn {
    background: #2563eb;
}

.danger-btn, .danger {
    background: #dc2626 !important;
}

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

.search-form {
    display: flex;
    gap: 8px;
    flex: 1;
}

.search-form input {
    flex: 1;
}

.list-table, .info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    background: #111827;
}

.list-table th, .list-table td,
.info-table th, .info-table td {
    border: 1px solid #334155;
    padding: 9px;
    vertical-align: top;
}

.list-table th, .info-table th {
    background: #1f2937;
}

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

.empty {
    text-align: center;
    color: #94a3b8;
}

.html-box {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 14px;
    min-height: 60px;
    overflow-x: auto;
}

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

/* Toast UI */
.toastui-editor-defaultUI {
    background: #fff;
    color: #111827;
}

/* 제품/병원 선택 + 관리 버튼 */
.select-config-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

.config-btn {
    padding: 9px 13px;
    background: #2563eb;
    color: white;
    white-space: nowrap;
}

/* 모달 */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    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: #111827;
    color: #e5e7eb;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    z-index: 9999;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
}

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

.modal-close {
    float: right;
    background: #475569;
}

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

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

.modal-add-row button {
    background: #16a34a;
}

/* 제품/병원 관리 테이블 */
.master-table {
    width: 100%;
    border-collapse: collapse;
    background: #111827;
}

.master-table th,
.master-table td {
    border: 1px solid #334155;
    padding: 8px;
    font-size: 14px;
}

.master-table th {
    background: #1f2937;
}

.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: 5px;
    background: #475569;
    color: white;
}

.order-btn:hover {
    background: #64748b;
}

/* 작은 버튼 */
.mini-btn {
    padding: 6px 8px;
    border-radius: 5px;
    font-size: 13px;
    white-space: nowrap;
}

.save-btn {
    background: #2563eb;
}

.delete-btn {
    background: #dc2626;
}
.main-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: #020617;
    border-right: 1px solid #1e293b;
    padding: 28px 18px;
    box-sizing: border-box;
}

.sidebar h2 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 20px;
}

.side-link {
    display: block;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    background: transparent;
}

.side-link:hover {
    background: #1e293b;
    color: white;
}

.side-link.active {
    background: #2563eb;
    color: white;
    font-weight: 700;
}

.content {
    flex: 1;
    padding: 32px 42px;
    box-sizing: border-box;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

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

.subtitle {
    margin-top: 8px;
    color: #94a3b8;
}

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

.case-card {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    transition: 0.15s;
}

.case-card:hover {
    background: #172033;
    border-color: #60a5fa;
    transform: translateY(-1px);
}

.case-card h3 {
    margin: 12px 0;
    font-size: 20px;
    color: #e0f2fe;
}

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

.badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.product-badge {
    background: #1d4ed8;
    color: #dbeafe;
}

.category-badge {
    background: #334155;
    color: #e2e8f0;
}

.error-badge {
    background: #7f1d1d;
    color: #fecaca;
}

.case-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: #cbd5e1;
    font-size: 14px;
}

.empty-card {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 40px;
    text-align: center;
    color: #94a3b8;
}
.main-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    background: #020617;
    border-right: 1px solid #1e293b;
    padding: 28px 18px;
    box-sizing: border-box;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 18px;
}

.side-link {
    display: block;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    background: transparent;
}

.side-link:hover {
    background: #1e293b;
    color: white;
}

.side-link.active {
    background: #2563eb;
    color: white;
    font-weight: 700;
}

.content {
    flex: 1;
    padding: 32px 42px;
    box-sizing: border-box;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

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

.subtitle {
    margin-top: 8px;
    color: #94a3b8;
}

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

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

.case-card {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    transition: 0.15s;
}

.case-card:hover {
    background: #172033;
    border-color: #60a5fa;
    transform: translateY(-1px);
}

.case-card h3 {
    margin: 12px 0;
    font-size: 20px;
    color: #e0f2fe;
}

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

.badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.product-badge {
    background: #1d4ed8;
    color: #dbeafe;
}

.category-badge {
    background: #334155;
    color: #e2e8f0;
}

.error-badge {
    background: #7f1d1d;
    color: #fecaca;
}

.case-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: #cbd5e1;
    font-size: 14px;
}

.empty-card {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 40px;
    text-align: center;
    color: #94a3b8;
}
.master-pagination {
    margin-top: 15px;
    text-align: center;
}

.master-pagination button {
    margin: 0 3px;
}

.active-page {
    background: #2563eb !important;
}
.master-pagination {
    margin-top: 16px;
    text-align: center;
}

.master-pagination button {
    margin: 0 3px;
    padding: 7px 11px;
    border-radius: 6px;
    background: #334155;
    color: white;
}

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

.master-pagination .active-page {
    background: #2563eb !important;
    font-weight: 700;
}
.modal-search-row {
    margin-bottom: 14px;
}

.modal-search-row input {
    width: 100%;
    padding: 9px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #020617;
    color: #e5e7eb;
}
.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: #020617;
    border: 1px solid #334155;
    flex-shrink: 0;
}

.case-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.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 #334155;
    background: #020617;
    cursor: zoom-in;
    flex-shrink: 0;
}

.thumb-item:hover {
    border-color: #60a5fa;
    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;
    box-sizing: border-box;
}

.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;
}
.login-container{
    width:100%;
    height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
}

.login-box{
    width:400px;
    background:#111827;
    border:1px solid #334155;
    border-radius:12px;
    padding:40px;
}

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

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

.login-box button{
    width:100%;
}

.login-error{
    color:#ff4d4f;
    margin-bottom:15px;
}
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logout-btn {
    background: #4b5563;
    color: white;
    text-decoration: none;
}

.logout-btn:hover {
    background: #374151;
}
.login-user {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
}

.logout-btn {
    background: #4b5563;
    color: white;
    text-decoration: none;
}

.logout-btn:hover {
    background: #374151;
}
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}