:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --secondary: #1e293b;
    --accent: #f59e0b;
    --bg-main: #f8fafc;
    --bg-sidebar: #0f172a;
    --text-light: #f1f5f9;
    --text-dark: #334155;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --glass: rgba(255, 255, 255, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 2rem;
    margin-bottom: 3rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--primary);
}

nav {
    flex: 1;
}

.nav-item {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.7;
}

.nav-item:hover, .nav-item.active {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.05);
    border-right: 4px solid var(--primary);
}

.sidebar-footer {
    padding: 2rem;
    font-size: 0.8rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #334155;
    border-radius: 3px;
    margin: 10px 0;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary);
}

/* Main Content */
.content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem 3rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
    color: #64748b;
}

/* Tab Management */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.metric-card.gold {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
}

.metric-card h3 {
    font-size: 0.85rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.metric-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.trend {
    font-size: 0.8rem;
    font-weight: 600;
}

.trend.up { color: #10b981; }
.trend.down { color: #ef4444; }

.subtext { font-size: 0.75rem; opacity: 0.6; }

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.chart-container h3 {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Roadmap */
.roadmap {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    display: flex;
    gap: 15px;
    position: relative;
}

.step::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 20px;
    width: 2px;
    height: calc(100% + 5px);
    background: #e2e8f0;
}

.step:last-child::before { display: none; }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    margin-top: 5px;
    z-index: 1;
}

.step.completed .dot { background: var(--primary); }
.step.active .dot { background: var(--accent); }

.info h4 { font-size: 0.9rem; margin-bottom: 2px; }
.info p { font-size: 0.8rem; color: #64748b; }

/* Trend List */
.trend-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trend-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 10px;
    transition: 0.2s;
}

.trend-item:hover { transform: scale(1.02); background: #f1f5f9; }

.rank {
    font-weight: 800;
    color: var(--primary);
    width: 30px;
}

.name { flex: 1; font-size: 0.9rem; }
.score { font-weight: 700; font-size: 0.85rem; }

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.75rem; }

/* Tables */
.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    text-align: left;
    padding: 1rem;
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
}

td {
    padding: 1rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

/* Copywriter Tab UI */
.copy-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
}

.input-form {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.output-preview {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.preview-content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* OEM & CRM */
.calc-card, .crm-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.crm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.msg-preview {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin: 1rem 0;
    color: #475569;
}
