:root {
    --drawer-width: 280px;
    --header-height: 64px;
    --primary: #1976d2;
    --accent: #ed7101;
    --border: #d3d3d3;
    --muted: #696969;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
    background: #fafafa;
    color: #111;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    z-index: 20;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-header__icon {
    font-size: 28px;
}

.app-header__title {
    font-size: 1.25rem;
    font-weight: 600;
}

.app-header__actions {
    display: flex;
    gap: 8px;
}

.has-drawer .app-drawer {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--drawer-width);
    height: calc(100vh - var(--header-height));
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
    z-index: 10;
}

.has-drawer .app-main {
    margin-left: var(--drawer-width);
    margin-top: var(--header-height);
    padding: 24px;
    min-height: calc(100vh - var(--header-height));
}

.app-drawer__profile {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.app-drawer__role {
    font-size: 0.75rem;
    color: var(--muted);
}

.app-drawer__name {
    font-weight: 600;
    margin-top: 4px;
}

.app-nav__group {
    margin-bottom: 20px;
}

.app-nav__title {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.app-nav__link {
    display: block;
    padding: 8px 0;
    color: #111;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-ghost {
    border: none;
    background: transparent;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.field input,
.field select {
    min-width: 200px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.table-wrap {
    overflow-x: auto;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table.data th,
table.data td {
    border-bottom: 1px solid #eee;
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

table.data th {
    background: #f5f5f5;
    font-weight: 600;
}

.pager {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
}

.pager button {
    min-width: 36px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #f0f2f5;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
    font-size: 1.35rem;
    margin: 0 0 24px;
}

.login-card .field {
    margin-bottom: 16px;
}

.login-card input {
    width: 100%;
}

.error-text {
    color: #c62828;
    font-size: 0.85rem;
    margin-top: 4px;
}

.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.dialog-backdrop.open {
    display: flex;
}

.dialog {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    max-width: 360px;
    width: 90%;
}

.webview-page {
    background: #fff;
    min-height: 100vh;
    padding-bottom: 80px;
}

.webview-section {
    padding: 16px;
    border: 1px solid var(--border);
    margin: 16px;
}

.webview-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.webview-meta {
    margin-top: 12px;
    font-size: 1rem;
}

.webview-meta .sub {
    color: #979797;
    font-size: 0.9rem;
}

.webview-date {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 400;
}

.font-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-top: 1px solid var(--border);
    margin: 40px 16px 0;
}

.font-tags {
    display: flex;
    gap: 8px;
}

.font-tag {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid #979797;
    cursor: pointer;
    font-size: 1rem;
}

.font-tag.active {
    border: 2px solid var(--accent);
    color: var(--accent);
    font-weight: 700;
}

.area-block {
    margin: 16px;
    padding: 16px;
    background: #f4f4f4;
    border-radius: 8px;
}

.area-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.area-label {
    width: 40px;
    color: #979797;
    flex-shrink: 0;
}

.area-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.disclaimer {
    padding: 0 16px;
    color: var(--muted);
    font-size: 0.9rem;
}

.ql-container.ql-snow {
    border: none;
}

/* 치료정보 폼 (등록/수정) */
.breadcrumb {
    margin: 0 0 12px;
    font-size: 0.95rem;
}

.form-grid.treatment-form {
    display: grid;
    grid-template-columns: minmax(100px, 160px) 1fr;
    gap: 16px 20px;
    align-items: start;
    margin-top: 8px;
}

.form-grid__label.full-row,
.attr-stack.full-row {
    grid-column: 1 / -1;
}

.form-grid__label {
    font-weight: 600;
    padding-top: 8px;
}

.input-full {
    width: 100%;
    max-width: 720px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

.editor-wrap {
    max-width: 900px;
}

.editor-wrap .ql-toolbar.ql-snow {
    border-radius: 8px 8px 0 0;
}

.editor-wrap .ql-container.ql-snow {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    min-height: 320px;
}

.checkbox-stack,
.radio-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-row .checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.attr-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.attr-group {
    display: grid;
    grid-template-columns: minmax(100px, 160px) 1fr;
    gap: 8px 16px;
    align-items: start;
}

.attr-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dropzone-box {
    max-width: 360px;
    min-height: 120px;
    border: 2px dashed #979797;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: pointer;
    background: #fafafa;
}

.dropzone-box:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.form-actions-row {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 28px;
    flex-wrap: wrap;
}

.form-actions-row.three {
    justify-content: space-between;
}

.btn-success {
    background: #00ab55;
    color: #fff;
    border-color: #00ab55;
}

.btn-danger-outline {
    border: 1px solid #c62828;
    background: #fff;
    color: #c62828;
}

.btn-danger-fill {
    background: #e53935;
    color: #fff;
    border-color: #e53935;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.85rem;
}

/* 서비스 승인 타일 */
.approve-groups {
    margin-top: 20px;
}

.approve-section {
    margin-bottom: 24px;
}

.approve-section__title {
    margin: 0 0 12px;
    font-size: 1rem;
}

.approve-pair-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.approve-tile {
    flex: 1;
    text-align: left;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #d6d6dc;
    background: #fff;
    color: #68667c;
    cursor: pointer;
    font-size: 0.95rem;
}

.approve-tile--on {
    border-color: #00a8a4;
    color: #00a8a4;
    font-weight: 600;
    box-shadow: 0 0 0 1px #00a8a4 inset;
}

.approve-tile-spacer {
    flex: 1;
}

.muted-note {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 16px;
    line-height: 1.5;
}

.muted-note code {
    font-size: 0.85em;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
}

.nav-count {
    font-weight: 600;
    color: var(--primary);
}
