/* ============================================================
   NMS — 미래 선교 전략 워크스페이스 스타일시트
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1565c0;
    --primary-light: #1e88e5;
    --primary-dark: #0d47a1;
    --accent: #ff8f00;
    --bg: #f5f7fa;
    --bg-card: #ffffff;
    --text: #212121;
    --text-secondary: #616161;
    --border: #e0e0e0;
    --success: #2e7d32;
    --warning: #e65100;
    --danger: #c62828;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
}

html { font-size: 15px; }
body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Top Bar ---- */
.top-bar {
    background: var(--primary-dark);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.top-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    letter-spacing: 1px;
}
.main-nav { display: flex; gap: 16px; }
.main-nav a { color: rgba(255,255,255,0.85); font-size: 14px; text-decoration: none; padding: 4px 0; }
.main-nav a:hover { color: #fff; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 13px; color: rgba(255,255,255,0.8); }
.mobile-toggle { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

/* ---- Container ---- */
.container { max-width: 1280px; margin: 0 auto; padding: 24px 20px 40px; }

/* ---- Page Header ---- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }
.back-link { font-size: 13px; color: var(--text-secondary); display: inline-block; margin-bottom: 4px; text-decoration: none; }
.back-link:hover { color: var(--primary); }
.project-description { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    text-decoration: none !important;
    line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: rgba(21,101,192,0.06); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b71c1c; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-full { width: 100%; }
.btn-icon { width: 28px; height: 28px; padding: 0; border-radius: 50%; background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; }
.btn-icon:hover { background: var(--primary-light); }

/* ---- Alerts ---- */
.alert { padding: 10px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #ffebee; color: var(--danger); border: 1px solid #ffcdd2; }
.alert-success { background: #e8f5e9; color: var(--success); border: 1px solid #c8e6c9; }

/* ---- Stats Grid ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--bg-card); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.stat-number { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ---- Section ---- */
.section { margin-bottom: 32px; }
.section h2 { font-size: 18px; margin-bottom: 16px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.section-header h2 { margin-bottom: 0; }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
.empty-state p { margin-bottom: 16px; }

/* ---- Project List ---- */
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.project-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s;
    display: block;
    color: inherit;
    text-decoration: none !important;
}
.project-card:hover { box-shadow: var(--shadow-lg); }
.project-card h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }
.project-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.project-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }
.project-actions { margin-top: 12px; display: flex; gap: 8px; }
.tags { background: #e3f2fd; color: var(--primary); padding: 2px 8px; border-radius: 4px; }

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tab {
    padding: 10px 18px;
    background: none;
    border: none;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- STEEP Board ---- */
.steep-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    min-height: 300px;
}
.steep-column {
    background: #f0f4f8;
    border-radius: var(--radius);
    padding: 12px;
    min-height: 200px;
}
.steep-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}
.steep-column-header h3 { font-size: 13px; font-weight: 600; color: var(--primary-dark); }
.steep-cards { display: flex; flex-direction: column; gap: 8px; }

.issue-card {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: box-shadow 0.15s;
    font-size: 13px;
}
.issue-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.issue-card-title { font-weight: 600; margin-bottom: 4px; }
.issue-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-secondary); }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.priority-high { background: var(--danger); }
.priority-medium { background: var(--accent); }
.priority-low { background: var(--success); }
.signal-bar { font-size: 11px; color: var(--text-secondary); }

/* ---- Scenario Grid ---- */
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.scenario-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--border);
}
.scenario-card.optimistic { border-left-color: var(--success); }
.scenario-card.baseline { border-left-color: var(--primary); }
.scenario-card.pessimistic { border-left-color: var(--danger); }
.scenario-type { font-size: 11px; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.scenario-card h3 { font-size: 15px; margin-bottom: 12px; }
.scenario-section { margin-bottom: 8px; }
.scenario-section strong { font-size: 12px; color: var(--text-secondary); display: block; margin-bottom: 2px; }
.scenario-section p { font-size: 13px; }
.scenario-actions { margin-top: 12px; display: flex; gap: 8px; }

/* ---- Timeline / Roadmap ---- */
.timeline { position: relative; }
.milestone-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.milestone-status {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
}
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.status-planned { background: #e0e0e0; color: #424242; }
.status-in_progress { background: #bbdefb; color: #0d47a1; }
.status-done { background: #c8e6c9; color: #1b5e20; }
.status-cancelled { background: #ffcdd2; color: #b71c1c; }
.milestone-body { flex: 1; }
.milestone-body h3 { font-size: 15px; margin-bottom: 4px; }
.milestone-body p { font-size: 13px; color: var(--text-secondary); }
.milestone-meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; display: flex; gap: 16px; }
.milestone-actions { flex-shrink: 0; display: flex; gap: 8px; }

/* ---- Persona ---- */
.persona-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.persona-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.persona-header h3 { font-size: 16px; }
.persona-header .age { font-size: 13px; color: var(--text-secondary); }
.persona-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.persona-field label { font-size: 12px; color: var(--text-secondary); display: block; margin-bottom: 2px; }
.persona-field p { font-size: 13px; }
.journey-stages { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.journey-stages h4 { font-size: 14px; margin-bottom: 8px; }
.journey-stage { background: #f0f4f8; border-radius: 6px; padding: 12px; margin-bottom: 8px; }
.journey-stage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.journey-stage-header h5 { font-size: 13px; font-weight: 600; }
.journey-message { background: var(--bg-card); border-radius: 4px; padding: 8px 10px; margin: 4px 0; font-size: 13px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.message-type { font-size: 10px; padding: 1px 6px; border-radius: 3px; background: #e3f2fd; color: var(--primary); flex-shrink: 0; }

/* ---- Profile Cards ---- */
.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.profile-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.profile-header h3 { font-size: 16px; }
.profile-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.profile-info-item label { font-size: 11px; color: var(--text-secondary); display: block; }
.profile-info-item span { font-size: 13px; }
.training-list { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.training-list h4 { font-size: 14px; margin-bottom: 8px; }
.training-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }

/* ---- Domestic / Channel ---- */
.domestic-card, .channel-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.domestic-card h3, .channel-card h3 { font-size: 16px; margin-bottom: 12px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }
.info-grid label { font-size: 11px; color: var(--text-secondary); display: block; }
.info-grid p { font-size: 13px; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.category-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; background: #e8eaf6; color: #283593; }
.risk-note { background: #fff3e0; border-radius: 4px; padding: 8px 12px; font-size: 13px; margin-top: 8px; color: var(--warning); }

/* ---- Notes ---- */
.note-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}
.note-card p { font-size: 14px; white-space: pre-wrap; margin-bottom: 8px; }
.note-meta { font-size: 12px; color: var(--text-secondary); display: flex; justify-content: space-between; }
.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    font-size: 13px;
}
.attachment-item a { flex: 1; }
.file-size { color: var(--text-secondary); font-size: 12px; flex-shrink: 0; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}
.form-group textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---- Modal ---- */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 680px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-secondary); padding: 4px; }
.modal-close:hover { color: var(--text); }

/* ---- Auth Page ---- */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.auth-card h1 { font-size: 28px; color: var(--primary-dark); margin-bottom: 4px; }
.auth-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.auth-card .form-group { text-align: left; }
.auth-link { margin-top: 16px; font-size: 13px; }

/* ---- Footer ---- */
.site-footer { text-align: center; padding: 24px 20px; font-size: 12px; color: var(--text-secondary); border-top: 1px solid var(--border); margin-top: 40px; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .steep-board { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .steep-board { grid-template-columns: repeat(2, 1fr); }
    .main-nav { display: none; }
    .mobile-toggle { display: block; }
    .user-name { display: none; }
    .project-list { grid-template-columns: 1fr; }
    .scenario-grid { grid-template-columns: 1fr; }
    .persona-fields { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .modal-content { padding: 20px; }
    .page-header { flex-direction: column; }
}
@media (max-width: 480px) {
    .steep-board { grid-template-columns: 1fr; }
    .container { padding: 16px 12px 32px; }
    .tabs { gap: 0; }
    .tab { padding: 8px 12px; font-size: 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Utility ---- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
