/* ============================================================
   admin.css — 관리자 페이지 전용 스타일
   153 사회적 농복중앙회 관리자 패널
   ============================================================ */

/* ── 기본 리셋 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body.admin-body {
    font-family: 'Paperlogy', 'Noto Sans KR', sans-serif;
    background: #F1F5F9;
    color: #1E293B;
    min-height: 100vh;
    display: flex;
}

/* ============================================================
   사이드바
============================================================ */
.adm-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 240px;
    height: 100vh;
    background: #1E293B;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

/* 로고 영역 */
.adm-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid #334155;
}
.adm-logo-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 2px;
}
.adm-logo-sub {
    font-size: 11px;
    color: #94A3B8;
}

/* 메뉴 */
.adm-nav { padding: 12px 0; flex: 1; }

.adm-nav-section {
    padding: 16px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.adm-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 500;
    color: #CBD5E1;
    text-decoration: none;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.adm-nav-item:hover {
    background: #334155;
    color: #ffffff;
}
.adm-nav-item.active {
    background: #0D9989;
    color: #ffffff;
    font-weight: 600;
}
.adm-nav-item svg { flex-shrink: 0; opacity: 0.8; }
.adm-nav-item.active svg { opacity: 1; }

/* 하단 로그아웃 */
.adm-sidebar-footer {
    padding: 16px;
    border-top: 1px solid #334155;
}
.adm-logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    color: #94A3B8;
    background: none;
    border: 1px solid #334155;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.adm-logout-btn:hover {
    background: #334155;
    color: #ffffff;
    border-color: #475569;
}

/* ============================================================
   메인 콘텐츠 영역
============================================================ */
.adm-main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 탑바 */
.adm-topbar {
    background: #ffffff;
    border-bottom: 1px solid #E2E8F0;
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.adm-topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
}
.adm-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748B;
}
.adm-topbar-home {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #64748B;
    font-size: 13px;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.adm-topbar-home:hover {
    background: #f1f5f9;
    color: #0D9989;
}
.adm-topbar-divider {
    width: 1px;
    height: 16px;
    background: #e2e8f0;
}
.adm-user-badge {
    background: #E0FDF4;
    color: #0D9989;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
}

/* 콘텐츠 패딩 */
.adm-content {
    padding: 32px;
    flex: 1;
}

/* ============================================================
   공통 카드
============================================================ */
.adm-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}
.adm-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.adm-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1E293B;
}
.adm-card-body { padding: 24px; }

/* ============================================================
   대시보드 통계 카드
============================================================ */
.adm-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.adm-stat-card {
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.adm-stat-label { font-size: 13px; color: #64748B; font-weight: 500; }
.adm-stat-value { font-size: 28px; font-weight: 700; color: #1E293B; }
.adm-stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 4px;
}
.adm-stat-icon.teal  { background: #CCFBF1; color: #0D9989; }
.adm-stat-icon.blue  { background: #DBEAFE; color: #2563EB; }
.adm-stat-icon.green { background: #DCFCE7; color: #16A34A; }
.adm-stat-icon.amber { background: #FEF3C7; color: #D97706; }

/* ============================================================
   테이블
============================================================ */
.adm-table-wrap { overflow-x: auto; }
.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.adm-table th {
    background: #F8FAFC;
    padding: 12px 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #E2E8F0;
    white-space: nowrap;
}
.adm-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #F1F5F9;
    color: #374151;
    vertical-align: middle;
    text-align: center;
}
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tbody tr { cursor: pointer; }
.adm-table tr:hover td { background: #F8FAFC; }
.adm-table .col-thumb { width: 70px; }
.adm-table .col-order { width: 80px; }
.adm-table .col-status { width: 90px; }
.adm-table .col-date { width: 140px; white-space: nowrap; }
.adm-table .col-actions { width: 120px; white-space: nowrap; }

/* 썸네일 */
.adm-thumb {
    width: 56px; height: 40px;
    object-fit: cover;
    border-radius: 6px;
    background: #F1F5F9;
    display: block;
}
.adm-thumb-empty {
    width: 56px; height: 40px;
    background: #F1F5F9;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: #CBD5E1;
    font-size: 11px;
}

/* 상태 뱃지 */
.adm-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.adm-badge.on  { background: #CCFBF1; color: #0D9989; }
.adm-badge.off { background: #F1F5F9; color: #94A3B8; }

/* ============================================================
   버튼
============================================================ */
.adm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.adm-btn-primary  { background: #0D9989; color: #fff; }
.adm-btn-primary:hover  { background: #0A7A6E; }
.adm-btn-secondary { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }
.adm-btn-secondary:hover { background: #E2E8F0; }
.adm-btn-danger   { background: #FEE2E2; color: #DC2626; }
.adm-btn-danger:hover   { background: #FECACA; }
.adm-btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.adm-btn-ghost { background: none; color: #64748B; padding: 5px 8px; font-size: 12px; border-radius: 6px; }
.adm-btn-ghost:hover { background: #F1F5F9; color: #1E293B; }

/* ============================================================
   폼
============================================================ */
.adm-form-group { margin-bottom: 20px; }
.adm-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.adm-form-label .req { color: #EF4444; margin-left: 2px; }
.adm-form-input,
.adm-form-select,
.adm-form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1E293B;
    background: #ffffff;
    transition: border-color 0.15s;
    outline: none;
}
.adm-form-input:focus,
.adm-form-select:focus,
.adm-form-textarea:focus { border-color: #0D9989; box-shadow: 0 0 0 3px rgba(13,153,137,0.1); }
.adm-form-textarea { resize: vertical; min-height: 120px; }
.adm-form-hint { font-size: 12px; color: #94A3B8; margin-top: 4px; }

/* 이미지 미리보기 */
.adm-img-preview {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 8px;
    border: 1.5px solid #E2E8F0;
    background: #F8FAFC;
    margin-top: 8px;
    display: none;
}
.adm-img-preview.show { display: block; }

/* 토글 스위치 */
.adm-toggle-wrap { display: flex; align-items: center; gap: 10px; }
.adm-toggle {
    position: relative;
    width: 44px; height: 24px;
    cursor: pointer;
}
.adm-toggle input { opacity: 0; width: 0; height: 0; }
.adm-toggle-slider {
    position: absolute;
    inset: 0;
    background: #CBD5E1;
    border-radius: 999px;
    transition: background 0.2s;
}
.adm-toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.adm-toggle input:checked + .adm-toggle-slider { background: #0D9989; }
.adm-toggle input:checked + .adm-toggle-slider::before { transform: translateX(20px); }
.adm-toggle-label { font-size: 13px; color: #64748B; }

/* 폼 액션 버튼 행 */
.adm-form-actions {
    display: flex;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid #F1F5F9;
    margin-top: 24px;
}

/* ============================================================
   페이지네이션
============================================================ */
.adm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 20px 0 4px;
}
.adm-page-btn {
    min-width: 34px; height: 34px;
    padding: 0 10px;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.15s;
}
.adm-page-btn:hover { background: #F1F5F9; }
.adm-page-btn.active { background: #0D9989; color: #fff; border-color: #0D9989; font-weight: 600; }
.adm-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   빈 상태
============================================================ */
.adm-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94A3B8;
}
.adm-empty-icon { font-size: 40px; margin-bottom: 12px; }
.adm-empty-text { font-size: 14px; }

/* ============================================================
   알림 토스트
============================================================ */
.adm-toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: #1E293B;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}
.adm-toast.show { opacity: 1; transform: translateY(0); }
.adm-toast.success { background: #0D9989; }
.adm-toast.error   { background: #DC2626; }

/* ============================================================
   로그인 페이지
============================================================ */
.adm-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F1F5F9;
}
.adm-login-box {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}
.adm-login-title {
    font-size: 22px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 4px;
}
.adm-login-sub { font-size: 13px; color: #94A3B8; margin-bottom: 28px; }
.adm-login-error {
    background: #FEF2F2;
    color: #DC2626;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ============================================================
   파일 업로드 UI
============================================================ */
.adm-upload-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.adm-upload-row .adm-form-input {
    flex: 1;
    min-width: 0;
}
.adm-upload-btn {
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}
.adm-upload-status {
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
    word-break: break-all;
}
