/* ====================================================================
   임대료 관리 — 디자인 시스템
   톤: 차분한 회색 + 네이비, PC 우선
   ==================================================================== */

:root {
    /* Color palette — neutral grays */
    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Accent — calm navy/blue */
    --accent-50:  #eff6ff;
    --accent-100: #dbeafe;
    --accent-500: #3b82f6;
    --accent-600: #2563eb;
    --accent-700: #1d4ed8;

    /* Semantic colors */
    --success-50:  #f0fdf4;
    --success-500: #16a34a;
    --success-700: #15803d;
    --danger-50:   #fef2f2;
    --danger-500:  #dc2626;
    --danger-700:  #b91c1c;
    --warning-50:  #fffbeb;
    --warning-500: #d97706;
    --warning-700: #b45309;

    /* Surfaces */
    --bg-app:           var(--gray-50);
    --bg-surface:       #ffffff;
    --bg-sidebar:       var(--gray-900);
    --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
    --bg-sidebar-active: var(--accent-600);

    /* Borders */
    --border-subtle:  var(--gray-200);
    --border-default: var(--gray-300);

    /* Text */
    --text-primary:        var(--gray-900);
    --text-secondary:      var(--gray-700);
    --text-muted:          var(--gray-500);
    --text-on-dark:        rgba(255, 255, 255, 0.92);
    --text-on-dark-muted:  rgba(255, 255, 255, 0.6);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.08);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --radius-xl: 18px;

    /* Transitions */
    --transition-fast: 120ms ease;
    --transition: 180ms ease;
}

/* ====================================================================
   Base
   ==================================================================== */

body {
    background: var(--bg-app);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
        "Apple SD Gothic Neo", "Noto Sans KR", Roboto, "Helvetica Neue",
        Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-600);
    text-decoration: none;
}

a:hover {
    color: var(--accent-700);
    text-decoration: underline;
}

/* ====================================================================
   Layout — Sidebar
   ==================================================================== */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
}

.sidebar__brand-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--accent-600);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar__brand-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-on-dark);
    margin: 0;
}

.sidebar__brand-sub {
    font-size: 0.72rem;
    color: var(--text-on-dark-muted);
    margin: 0;
}

.sidebar__group-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-on-dark-muted);
    padding: 16px 12px 6px;
    font-weight: 600;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-on-dark);
    font-size: 0.92rem;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar__link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-on-dark);
    text-decoration: none;
}

.sidebar__link.is-active {
    background: var(--bg-sidebar-active);
    color: white;
    font-weight: 600;
}

.sidebar__link-icon {
    width: 18px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar__link.is-active .sidebar__link-icon {
    opacity: 1;
}

.sidebar__footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    color: var(--text-on-dark-muted);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
}

.sidebar__user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-600);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar__user-info {
    flex: 1;
    min-width: 0;
}

.sidebar__user-name {
    color: var(--text-on-dark);
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__user-role {
    color: var(--text-on-dark-muted);
    font-size: 0.72rem;
}

.sidebar__logout {
    color: var(--text-on-dark-muted);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.sidebar__logout:hover {
    background: var(--bg-sidebar-hover);
    color: white;
    text-decoration: none;
}

/* ====================================================================
   Layout — Main content area
   ==================================================================== */

.app-main {
    flex: 1;
    min-width: 0;
    padding: 28px 36px;
    max-width: 1600px;
    width: 100%;
}

/* ====================================================================
   Page header
   ==================================================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.page-header__subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.page-header__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ====================================================================
   Stat cards
   ==================================================================== */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card__label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--gray-100);
    color: var(--gray-600);
}

.stat-card__icon--accent { background: var(--accent-50);  color: var(--accent-600); }
.stat-card__icon--success { background: var(--success-50); color: var(--success-700); }
.stat-card__icon--danger  { background: var(--danger-50);  color: var(--danger-700); }
.stat-card__icon--warning { background: var(--warning-50); color: var(--warning-700); }

.stat-card__value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.stat-card__value--success { color: var(--success-700); }
.stat-card__value--danger  { color: var(--danger-700); }

.stat-card__caption {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ====================================================================
   Alert banner (e.g. overdue notice)
   ==================================================================== */

.alert-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid transparent;
}

.alert-banner--danger {
    background: var(--danger-50);
    border-color: #fecaca;
    color: var(--danger-700);
}

.alert-banner--success {
    background: var(--success-50);
    border-color: #bbf7d0;
    color: var(--success-700);
}

.alert-banner--info {
    background: var(--accent-50);
    border-color: #bfdbfe;
    color: var(--accent-700);
}

.alert-banner__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-banner__body {
    flex: 1;
    font-size: 0.9rem;
}

.alert-banner__title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-banner__action {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.alert-banner__action:hover {
    color: inherit;
    opacity: 0.8;
}

/* ====================================================================
   Generic surface card
   ==================================================================== */

.surface-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.surface-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.surface-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.surface-card__action {
    font-size: 0.82rem;
    color: var(--accent-600);
    font-weight: 500;
}

.surface-card__body {
    padding: 16px 20px;
}

.surface-card__body--flush {
    padding: 0;
}

/* ====================================================================
   Two-column dashboard grid (chart + side panel)
   ==================================================================== */

.dashboard-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1100px) {
    .dashboard-split {
        grid-template-columns: 1fr;
    }
}

/* ====================================================================
   Mini stat (small inline stats inside a card)
   ==================================================================== */

.mini-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.mini-stat-row:last-child {
    border-bottom: 0;
}

.mini-stat-row__label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-stat-row__value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mini-stat-row__value--muted { color: var(--text-muted); font-weight: 500; }
.mini-stat-row__value--success { color: var(--success-700); }
.mini-stat-row__value--danger { color: var(--danger-700); }

/* ====================================================================
   OCR upload page (사업자등록증 자동 입력)
   ==================================================================== */

.ocr-upload {
    text-align: center;
    padding: 30px 20px 20px;
    max-width: 520px;
    margin: 0 auto;
}

.ocr-upload__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-50);
    color: var(--accent-600);
    font-size: 2rem;
    margin-bottom: 16px;
}

.ocr-upload__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.ocr-upload__hint {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0 0 20px;
    line-height: 1.6;
}

.ocr-upload__field {
    margin-bottom: 18px;
}

.ocr-upload__submit {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.ocr-upload__submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.ocr-upload__caption {
    margin: 16px 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ocr-upload__caption i {
    margin-right: 4px;
}

.ocr-divider {
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
}

.ocr-divider::before,
.ocr-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-subtle);
}

.ocr-divider::before { left: 0; }
.ocr-divider::after { right: 0; }

.ocr-direct {
    text-align: center;
    padding: 4px 0 16px;
}

/* ====================================================================
   업태/종목 페어 입력 (최대 5쌍)
   ==================================================================== */

.business-categories {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--gray-50);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
}

.business-categories__header {
    display: grid;
    grid-template-columns: 28px 1fr 2fr 32px;
    gap: 8px;
    padding: 0 4px 4px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}

.business-categories__col-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    padding-left: 4px;
}

.business-categories__col-label--type {
    grid-column: 2;
}

.business-categories__col-label--item {
    grid-column: 3;
}

.business-categories__rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.business-categories__row {
    display: grid;
    grid-template-columns: 28px 1fr 2fr 32px;
    gap: 8px;
    align-items: center;
}

.business-categories__index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 2px;
}

.business-categories__remove {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.business-categories__remove:hover {
    color: #dc3545;
    border-color: #dc3545;
    background: #fff5f5;
}

.business-categories__add {
    align-self: flex-start;
    margin-top: 4px;
}

/* ====================================================================
   담당자 1~5명 다인 입력 (managers field type)
   ==================================================================== */

.managers {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--gray-50);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
}

.managers__header {
    display: grid;
    grid-template-columns: 28px 1fr 1.2fr 1.2fr 1.5fr 32px;
    gap: 8px;
    padding: 0 4px 4px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}

.managers__col-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    padding-left: 4px;
}

.managers__rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.managers__row {
    display: grid;
    grid-template-columns: 28px 1fr 1.2fr 1.2fr 1.5fr 32px;
    gap: 8px;
    align-items: center;
}

.managers__index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 2px;
}

.managers__remove {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.managers__remove:hover {
    color: #dc3545;
    border-color: #dc3545;
    background: #fff5f5;
}

.managers__add {
    align-self: flex-start;
    margin-top: 4px;
}

.managers__add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ====================================================================
   폼 섹션 구분선 (시각적 그룹화)
   ==================================================================== */

.form-section {
    margin-top: 20px;
    margin-bottom: -8px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}

.form-section:first-of-type {
    margin-top: 8px;
}

.form-section__title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-default, #333);
    letter-spacing: -0.01em;
}

/* ====================================================================
   숫자 강조 (모노스페이스) — 페이지네이션·금액·날짜 등에 사용
   ==================================================================== */

.num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ====================================================================
   페이지네이션 (.pager — sales-admin 스타일과 호환)
   ==================================================================== */

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 8px;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.pager__info {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pager__count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pager__size-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pager__size-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.pager__size {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 3px 10px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    text-decoration: none;
    transition: all 120ms ease;
    line-height: 1.5;
}

.pager__size:hover {
    border-color: var(--accent-500);
    color: var(--accent-700);
    text-decoration: none;
}

.pager__size.is-active {
    background: var(--accent-600);
    border-color: var(--accent-600);
    color: #fff;
    font-weight: 600;
}

.pager__nav {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.pager__btn {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 5px 10px;
    min-width: 34px;
    text-align: center;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
    transition: all 120ms ease;
}

.pager__btn:hover:not(.is-disabled):not(.is-current) {
    border-color: var(--accent-500);
    color: var(--accent-700);
    text-decoration: none;
}

.pager__btn.is-current {
    background: var(--accent-600);
    border-color: var(--accent-600);
    color: #fff;
    font-weight: 600;
}

.pager__btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pager__ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    user-select: none;
}

/* ====================================================================
   GDrive 박스 (호실 폼)
   ==================================================================== */

.gdrive-box {
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    background: white;
}

.gdrive-box code {
    background: var(--gray-100, #f3f4f6);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.78rem;
}

/* GDrive 파일 목록 + 업로드 위젯 */
.gdrive-files {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    background: var(--bg-surface);
}

.gdrive-files__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.gdrive-files .data-table--compact th,
.gdrive-files .data-table--compact td {
    padding: 6px 10px;
    font-size: 0.88rem;
}

.gdrive-files__upload {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-subtle);
}

.gdrive-files__upload .form-control {
    flex: 1;
}

/* ====================================================================
   다중 선택 (multi_select) — 호실 N:N 등
   ==================================================================== */

.multi-select {
    background: var(--gray-50);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px;
}

.multi-select__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.multi-select__search-wrap {
    position: relative;
    flex: 1 1 240px;
    min-width: 200px;
}

.multi-select__search-wrap .form-control {
    padding-left: 32px;
}

.multi-select__search-icon {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: var(--text-muted, #6c757d);
    pointer-events: none;
    font-size: 0.85rem;
}

.multi-select__count {
    margin-right: auto;
}

.multi-select__grid {
    max-height: 240px;
    overflow-y: auto;
}

.multi-select__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px;
}

.multi-select__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 0.88rem;
}

.multi-select__item:hover {
    background: var(--gray-100, #f3f4f6);
}

.multi-select__item input[type="checkbox"] {
    flex-shrink: 0;
    cursor: pointer;
}

.multi-select__item input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #0d6efd;
}

@media (max-width: 768px) {
    .managers__header { display: none; }
    .managers__row {
        grid-template-columns: 28px 1fr 32px;
        grid-template-areas:
            "idx name remove"
            ". phone phone"
            ". mobile mobile"
            ". email email";
        row-gap: 4px;
    }
    .managers__row > .managers__index { grid-area: idx; }
    .managers__row > input[name^="manager_name_"] { grid-area: name; }
    .managers__row > input[name^="manager_phone_"] { grid-area: phone; }
    .managers__row > input[name^="manager_mobile_"] { grid-area: mobile; }
    .managers__row > input[name^="manager_email_"] { grid-area: email; }
    .managers__row > .managers__remove { grid-area: remove; }
}

/* ====================================================================
   File preview (사업자등록증 등 첨부 파일)
   ==================================================================== */

.file-preview {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px;
    background: var(--gray-50);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.file-preview__thumb {
    position: relative;
    display: block;
    width: 200px;
    height: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    transition: transform var(--transition);
}

.file-preview__thumb:hover {
    transform: scale(1.02);
    text-decoration: none;
}

.file-preview__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
}

.file-preview__thumb--pdf {
    background: #f8f9fb;
}

.file-preview__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0));
    color: #fff;
    padding: 24px 12px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.file-preview__thumb:hover .file-preview__overlay {
    opacity: 1;
}

.file-preview__meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.file-preview__name {
    font-size: 0.86rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-preview__name i {
    color: var(--text-muted);
    flex-shrink: 0;
}

.file-preview__remove {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
    margin-top: auto;
}

/* ====================================================================
   Compact form (회사 폼 등 입력 항목 많을 때)
   ==================================================================== */

.compact-form .form-control,
.compact-form .form-select {
    padding: 6px 10px;
    font-size: 0.86rem;
    min-height: 34px;
}

.compact-form .form-label {
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.compact-form .input-group-text {
    padding: 4px 10px;
    font-size: 0.86rem;
    min-width: 32px;
}

.compact-form .form-text {
    font-size: 0.72rem;
    margin-top: 2px;
}

.compact-form .row.g-3 {
    --bs-gutter-y: 0.75rem;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead th {
    background: var(--gray-50);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}

.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table--clickable tbody tr {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.data-table--clickable tbody tr:focus {
    outline: 2px solid var(--accent-500);
    outline-offset: -2px;
    background: var(--accent-50);
}

.data-table .text-end { text-align: right; }
.data-table .text-center { text-align: center; }
.data-table .text-muted { color: var(--text-muted); }

.data-table__empty {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 16px;
}

/* ====================================================================
   Chart container
   ==================================================================== */

.chart-container {
    position: relative;
    height: 280px;
    padding: 8px 0;
}

/* ====================================================================
   Buttons (overrides Bootstrap a bit for tone consistency)
   ==================================================================== */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--accent-600);
    border-color: var(--accent-600);
}

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

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-default);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    color: var(--text-primary);
    border-color: var(--gray-400);
}

/* ====================================================================
   Forms
   ==================================================================== */

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border-default);
    color: var(--text-primary);
    font-size: 0.92rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.86rem;
    margin-bottom: 6px;
}

.input-group-text {
    background: var(--gray-100);
    border-color: var(--border-default);
    color: var(--text-secondary);
    min-width: 40px;
    justify-content: center;
}

/* ====================================================================
   Status badges
   ==================================================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    min-width: 64px;
    justify-content: center;
}

.status-badge--success { background: var(--success-50); color: var(--success-700); }
.status-badge--danger  { background: var(--danger-50);  color: var(--danger-700); }
.status-badge--warning { background: var(--warning-50); color: var(--warning-700); }
.status-badge--neutral { background: var(--gray-100);   color: var(--gray-700); }

/* ====================================================================
   Legacy admin-table (used in list pages — keep for now)
   ==================================================================== */

.admin-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
    font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
    vertical-align: middle;
}

.admin-table .col-compact {
    width: 1%;
    white-space: nowrap;
}

.admin-table .col-money {
    width: 1%;
    min-width: 120px;
}

.admin-table .col-normal {
    min-width: 120px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-table .col-wide {
    min-width: 220px;
    max-width: 420px;
    white-space: normal;
    word-break: keep-all;
}

/* Card wrapper used on list/form pages — keep for now */
.table-card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    background: var(--bg-surface);
}
