/* ======================================
   공통 관리자 스타일
   모든 템플릿에서 공유
   ====================================== */

/* Admin Page Styles */
.admin-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem;
}

.admin-login-box {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 450px;
    width: 100%;
}

.admin-login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-login-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.admin-login-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.admin-login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--bg-light);
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.admin-login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.admin-login-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.admin-login-info {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 4px;
}

.admin-login-info p {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.admin-login-info small {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Admin Header */
.admin-header {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.admin-header-actions {
    display: flex;
    gap: 1rem;
}

/* Admin Main */
.admin-main {
    padding: 2rem 0;
    min-height: calc(100vh - 100px);
    background: var(--bg-light);
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.admin-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
}

.admin-tab:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.admin-tab.active {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    border-color: transparent;
}

/* Admin Section */
.admin-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-light);
}

.admin-section-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Admin Cards */
.admin-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .admin-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .admin-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .admin-cards {
        grid-template-columns: 1fr;
    }
}

.admin-card {
    background: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.admin-card:hover {
    box-shadow: var(--shadow-md);
}

.admin-card-preview {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #ddd;
    position: relative;
}

.admin-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-card-preview.video-preview {
    position: relative;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.admin-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-input,
.admin-textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.admin-input:focus,
.admin-textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.admin-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-save {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-danger-sm {
    padding: 0.5rem 1rem;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger-sm:hover {
    background: #c53030;
}

.btn-save {
    background: #48bb78;
    color: white;
    font-size: 1.1rem;
    padding: 1rem 3rem;
}

.btn-save:hover {
    background: #38a169;
}

/* Admin Save Section */
.admin-save-section {
    margin-top: 3rem;
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.save-info {
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Hero Image Admin Section */
.hero-preview-container {
    margin-bottom: 2rem;
}

.hero-preview {
    position: relative;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

.hero-preview-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.hero-preview-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-preview-content p {
    opacity: 0.9;
}

.hero-settings {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
}

.hero-settings .form-group {
    margin-bottom: 1.5rem;
}

.hero-settings label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.input-help {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.6;
}

.hero-presets {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.hero-presets p {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.preset-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.preset-btn:hover {
    border-color: var(--secondary-color);
    background: rgba(49, 130, 206, 0.1);
}

@media (max-width: 768px) {
    .admin-login-box {
        padding: 2rem;
    }

    .admin-header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .admin-header-actions {
        width: 100%;
        justify-content: center;
    }

    .admin-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-cards {
        grid-template-columns: 1fr;
    }

    .admin-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn-save {
        width: 100%;
    }
}

/* 파일 업로드 스타일 */
.file-upload-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
}

.upload-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    color: #0369a1;
}

.hero-upload-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.or-divider {
    color: var(--text-light);
    font-size: 0.9rem;
}

.flex-input {
    flex: 1;
    min-width: 200px;
}

.btn-clear {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-clear:hover {
    background: #dc2626;
}

.url-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.url-input-group .admin-input {
    flex: 1;
}

.btn-upload-sm {
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.btn-upload-sm:hover {
    background: var(--primary-color);
}

.base64-input {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #166534 !important;
    font-size: 0.8rem;
}

.base64-input::placeholder {
    color: #166534;
}

.btn-secondary {
    background: #64748b;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #475569;
}

/* 로딩/에러 메시지 */
.loading-message {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.file-upload-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Featured Photo Checkbox */
.featured-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.featured-checkbox:hover:not(.disabled) {
    background: #e0f2fe;
}

.featured-checkbox.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.featured-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--secondary-color);
}

.featured-checkbox span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.featured-card {
    border: 2px solid var(--secondary-color) !important;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.2) !important;
}

.featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--secondary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
}

.featured-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.order-buttons {
    display: flex;
    gap: 0.3rem;
}

.btn-order {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-order:hover:not(:disabled) {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.btn-order:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ======================================
   페이지 콘텐츠 관리 스타일
   ====================================== */

.page-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.subtab {
    padding: 0.8rem 1.5rem;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    color: var(--text-light);
}

.subtab:hover {
    background: white;
    color: var(--primary-color);
    border-color: var(--secondary-color);
}

.subtab.active {
    background: var(--secondary-color);
    color: white;
}

.page-content-editor h3 {
    color: var(--primary-color);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-light);
    font-size: 1.2rem;
}

.page-content-editor h3:first-child {
    margin-top: 0;
}

.content-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.content-item {
    display: grid;
    grid-template-columns: 60px 1fr 2fr auto;
    gap: 0.8rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 4px;
}

.icon-input {
    width: 60px !important;
    text-align: center;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .content-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .icon-input {
        width: 100% !important;
    }

    .page-subtabs {
        flex-direction: column;
    }

    .subtab {
        width: 100%;
        text-align: center;
    }
}

/* Accordion Styles */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.accordion-item {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.accordion-header {
    width: 100%;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #f9fafb;
}

.accordion-icon {
    font-size: 1.25rem;
    font-weight: 300;
    color: #9ca3af;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 1.25rem;
}

.accordion-item.open .accordion-content {
    max-height: 600px;
    padding: 0 1.25rem 1.25rem;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-grid .form-group.full-width {
    grid-column: span 2;
}

.form-grid .form-group label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

/* Welcome Cards Editor */
.welcome-cards-editor {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.welcome-cards-editor > label {
    font-size: 0.85rem;
    color: #6b7280;
    display: block;
    margin-bottom: 0.75rem;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.card-item .icon-input {
    width: 50px !important;
    flex-shrink: 0;
    text-align: center;
}

.card-item .flex-grow {
    flex: 1;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: #fecaca;
}

.btn-add {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-add:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #374151;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .form-group.full-width {
        grid-column: span 1;
    }

    .card-item {
        flex-wrap: wrap;
    }

    .card-item .flex-grow {
        width: 100%;
        flex: none;
    }
}

/* 메인 탭 & 서브탭 스타일 */
.main-tabs {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    padding: 0.75rem;
    border-radius: 16px;
    margin-bottom: 0;
    gap: 0.5rem;
}

.main-tabs .admin-tab {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.05rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
}

.main-tabs .admin-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.main-tabs .admin-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-subtabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
    margin-bottom: 1.5rem;
    margin-top: -0.5rem;
    flex-wrap: wrap;
}

.subtab-btn {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
}

.subtab-btn:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    border-color: var(--secondary-color);
}

.subtab-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* 심플 폼 스타일 */
.simple-form {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.form-divider {
    border: none;
    height: 1px;
    background: #e5e7eb;
    margin: 1.5rem 0;
}

@media (max-width: 768px) {
    .main-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .main-tabs .admin-tab {
        text-align: center;
    }

    .admin-subtabs {
        flex-direction: column;
    }

    .subtab-btn {
        text-align: center;
        width: 100%;
    }
}

/* 새로운 3탭 관리자 스타일 */
.main-tabs .admin-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
}

.main-tabs .admin-tab .tab-icon {
    font-size: 1.5rem;
}

.main-tabs .admin-tab .tab-text {
    font-size: 1rem;
    font-weight: 600;
}

.main-tabs .admin-tab .tab-hint {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 400;
}

.main-tabs .admin-tab.active .tab-hint {
    opacity: 0.6;
    color: var(--text-light);
}

/* 섹션 힌트 - 어디에 표시되는지 안내 */
.section-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: #f0f9ff;
    border-left: 3px solid var(--secondary-color);
    border-radius: 0 8px 8px 0;
}

/* 소식 카드 스타일 */
.news-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-card {
    flex-direction: row !important;
}

.news-card .admin-card-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem;
    align-items: start;
}

.news-card .admin-textarea {
    grid-column: 1 / -1;
}

.news-card .btn-danger-sm {
    align-self: start;
}

/* ======================================
   새로운 관리자 사이드바 레이아웃
   ====================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
}

/* 사이드바 - 모던 스타일 */
.admin-sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}

.sidebar-header h1 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.125rem;
}

.sidebar-header span {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
}

/* 네비게이션 그룹 */
.nav-group {
    margin-bottom: 1.25rem;
}

.nav-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    letter-spacing: 0.02em;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.sidebar-nav button {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 1.25rem;
    background: none;
    border: none;
    border-radius: 4px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    margin-bottom: 2px;
}

.sidebar-nav button:hover {
    background: #f3f4f6;
    color: #111827;
}

.sidebar-nav button.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #f3f4f6;
}

.sidebar-btn {
    display: block;
    width: 100%;
    padding: 0.625rem;
    margin-bottom: 0.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.sidebar-btn.logout {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.sidebar-btn.logout:hover {
    background: #fee2e2;
}

/* 메인 콘텐츠 */
.admin-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    background: #f9fafb;
}

.mobile-header {
    display: none;
}

.content-inner {
    padding: 2rem;
    max-width: 1200px;
}

/* 섹션 헤더 */
.content-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.content-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.content-section .hint {
    font-size: 0.875rem;
    color: #64748b;
}

/* 카드 그리드 (관리자) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.item-card {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.item-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.item-card.featured {
    border: 2px solid #3b82f6;
}

.card-image {
    position: relative;
    aspect-ratio: 4/3;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-image .badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-image.video {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image .play-icon {
    position: absolute;
    font-size: 2rem;
    color: white;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-body {
    padding: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-body .input {
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
}

.card-body .checkbox-label {
    font-size: 0.75rem;
}

.card-body .btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
}

/* 입력 필드 */
.admin-layout .input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.admin-layout .input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.admin-layout .textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
}

.admin-layout .textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.admin-layout .icon-input {
    width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.admin-layout .flex-1 {
    flex: 1;
}

/* 체크박스 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* 버튼 */
.admin-layout .btn-primary {
    background: #3b82f6;
    color: white;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-layout .btn-primary:hover {
    background: #2563eb;
}

.admin-layout .btn-primary.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-delete {
    background: #fef2f2;
    color: #ef4444;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #fee2e2;
}

.btn-delete-sm {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.btn-delete-sm:hover {
    color: #ef4444;
}

.btn-add {
    background: #f1f5f9;
    color: #475569;
    padding: 0.625rem 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-add:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* 뉴스 리스트 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #f3f4f6;
}

.news-item .input,
.news-item .textarea {
    margin-bottom: 0.75rem;
}

.news-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.news-footer .input {
    margin-bottom: 0 !important;
    flex: 0 0 160px;
}

.news-footer .btn-delete {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    margin: 0;
}

.date-input {
    width: 160px;
}

/* 페이지 탭 */
.page-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-tabs button {
    padding: 0.625rem 1.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.page-tabs button:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.page-tabs button.active {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

/* 페이지 에디터 */
.page-editor {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.page-editor h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.page-editor h3:first-child {
    margin-top: 0;
}

.list-editor {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.list-item-block {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item-block .list-item-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.list-item-block textarea {
    width: 100%;
    resize: vertical;
    min-height: 50px;
}

/* 설정 그룹 */
.settings-group {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.settings-group h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-field {
    flex: 1;
}

.form-field.full {
    flex: 100%;
}

.form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.5rem;
}

/* 히어로 프리뷰 */
.admin-layout .hero-preview {
    position: relative;
    height: 150px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
}

.hero-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.hero-text h4 {
    font-size: 1.5rem;
    font-weight: 700;
}

.hero-text p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.hero-overlay-light {
    background: rgba(255, 255, 255, 0.6) !important;
}

.hero-text.text-dark {
    color: #1a202c;
}

.hero-text.text-dark h4,
.hero-text.text-dark p {
    color: #1a202c;
}

/* 이미지 노출 설정 - 드래그 미리보기 */
.img-setting-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    margin-top: 1.25rem;
    color: #374151;
}

.img-crop-preview {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: #e5e7eb;
    cursor: grab;
    user-select: none;
}

.img-crop-preview:active {
    cursor: grabbing;
}

.img-crop-image {
    position: absolute;
    inset: 0;
    background-size: cover;
}

.img-crop-preview .hero-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    z-index: 2;
}

.img-crop-preview .hero-text h4 {
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.img-crop-preview .hero-text p {
    font-size: 0.85rem;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.img-crop-preview .hero-text.text-dark h4,
.img-crop-preview .hero-text.text-dark p {
    color: #1a202c;
    text-shadow: none;
}

.img-crop-preview .hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.img-crop-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: white;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    pointer-events: none;
    opacity: 0.8;
}

.height-slider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.height-slider .slider-label {
    font-size: 0.82rem;
    color: #6b7280;
    min-width: 28px;
}

.height-slider input[type="range"] {
    flex: 1;
    accent-color: #3b82f6;
    height: 4px;
}

.height-slider .slider-value {
    font-size: 0.78rem;
    color: #9ca3af;
    min-width: 42px;
    text-align: right;
}

/* 라디오 그룹 */
.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 이미지 업로드 */
.image-upload {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-upload {
    background: #f1f5f9;
    color: #475569;
    padding: 0.625rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-upload:hover {
    background: #e2e8f0;
}

.btn-upload.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 저장 섹션 */
.save-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.btn-save {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 관리자 페이지에서 홈페이지용 헤더/메뉴 숨김 */
.admin-layout .header {
    display: none;
}

/* 모바일 하단 네비게이션 */
.admin-layout > .mobile-nav {
    display: none;
}

/* ========== 모바일 반응형 ========== */
@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }

    .admin-content {
        margin-left: 0;
        padding-bottom: 70px;
    }

    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        background: white;
        border-bottom: 1px solid #e2e8f0;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .mobile-header h1 {
        font-size: 1.1rem;
        font-weight: 600;
    }

    .save-btn-mobile {
        background: #3b82f6;
        color: white;
        padding: 0.5rem 1rem;
        border: none;
        border-radius: 4px;
        font-size: 0.9rem;
        font-weight: 500;
    }

    .content-inner {
        padding: 1rem;
    }

    .admin-layout .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        padding: 0.5rem 0.25rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .admin-layout .mobile-nav::-webkit-scrollbar {
        display: none;
    }

    .admin-layout .mobile-nav button {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1rem 1.25rem;
        background: none;
        border: none;
        color: #6b7280;
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.15s ease;
        white-space: nowrap;
    }

    .admin-layout .mobile-nav button.active {
        color: #2563eb;
        font-weight: 600;
    }

    .admin-layout .mobile-nav button:active {
        background: #f3f4f6;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .list-item {
        flex-wrap: wrap;
    }

    .list-item .input {
        min-width: 100px;
    }

    .list-item .flex-1 {
        width: 100%;
        flex: none;
    }

    .save-section {
        display: none;
    }

    .page-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .page-tabs button {
        flex-shrink: 0;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }
}

/* ======================================
   템플릿 선택 UI
   ====================================== */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.template-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.template-card.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.template-preview {
    height: 180px;
    background: #f8fafc;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.template-preview-inner {
    height: 100%;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.preview-header {
    height: 20px;
    background: #3b82f6;
}

.preview-hero {
    height: 50px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.preview-content {
    padding: 10px;
    display: flex;
    gap: 8px;
}

.preview-card {
    flex: 1;
    height: 40px;
    background: #f1f5f9;
    border-radius: 4px;
}

/* 템플릿 2 프리뷰 스타일 - 모던 미니멀 (따뜻한 톤) */
.template-2-preview .preview-header {
    background: #1A1A1A;
}

.template-2-preview .preview-hero {
    background: #F5F4F2;
    height: 60px;
}

.template-2-preview .preview-content {
    background: #FAFAF9;
}

.template-2-preview .preview-card {
    background: #fff;
    border: 1px solid #E8E6E3;
    border-left: 3px solid #8B7355;
}

/* 템플릿 3 프리뷰 스타일 - 매거진 레이아웃 */
.template-3-preview .preview-header {
    background: #2d3748;
}

.template-3-preview .preview-hero {
    background: linear-gradient(135deg, #4a5568 0%, #718096 100%);
    height: 45px;
}

.template-3-preview .preview-content {
    background: #f7fafc;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 6px;
    padding: 8px;
}

.template-3-preview .preview-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    height: 25px;
    border-radius: 2px;
}

.template-3-preview .preview-card:first-child {
    height: 50px;
    grid-row: span 2;
}

.template-3-preview .preview-card:nth-child(2),
.template-3-preview .preview-card:nth-child(3) {
    background: #edf2f7;
}

.template-info {
    padding: 1.25rem;
}

.template-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.template-info p {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.template-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 20px;
}

.template-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.template-actions .hint {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #64748b;
}

/* 모바일 홈 섹션 순서 */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.order-num {
    width: 24px;
    height: 24px;
    background: #64748b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.order-name {
    flex: 1;
    font-size: 0.95rem;
}

.order-btns {
    display: flex;
    gap: 0.25rem;
}

.order-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5e1;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-btn:hover:not(:disabled) {
    background: #e2e8f0;
}

.order-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
