/* ============================================================
   소싱검수 자동화 - Dark Theme Stylesheet
   ============================================================ */

/* ----------------------------------------------------------
   Reset & Base
   ---------------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: #0e1117;
    color: #fafafa;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h2 {
    font-size: 20px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 24px;
}

/* ----------------------------------------------------------
   Container & Layout
   ---------------------------------------------------------- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
}

.app-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

/* ----------------------------------------------------------
   Panel (replaces .mockup for the real app)
   ---------------------------------------------------------- */
.panel {
    background: #1a1d24;
    border-radius: 12px;
    border: 1px solid #333;
    padding: 24px;
    margin-bottom: 24px;
}

.panel-header {
    background: #262730;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #fafafa;
}

/* ----------------------------------------------------------
   Main Tabs (1단계 / 2단계)
   ---------------------------------------------------------- */
.app-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #262730;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
}

.app-tab {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    white-space: nowrap;
}

.app-tab.active {
    background: #ff4b4b;
    color: #fff;
}

.app-tab:hover:not(.active) {
    color: #fafafa;
    background: rgba(255, 255, 255, 0.05);
}

/* ----------------------------------------------------------
   Sub Tabs (데이터 가져오기 / 2-1 / 2-2 / 2-3 / 내보내기)
   ---------------------------------------------------------- */
.sub-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sub-tab {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border: 1px solid #333;
    background: transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sub-tab.active {
    border-color: #ff4b4b;
    color: #ff4b4b;
    background: rgba(255, 75, 75, 0.1);
}

.sub-tab:hover:not(.active) {
    color: #fafafa;
    border-color: #555;
}

/* ----------------------------------------------------------
   View Tabs (pill style - 전체 / 적합 / 부적합 / 검수)
   ---------------------------------------------------------- */
.view-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.view-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #333;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.view-tab.active {
    border-color: #60a5fa;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.view-tab:hover:not(.active) {
    color: #fafafa;
    border-color: #555;
}

/* Variant: active green (적합) */
.view-tab.active-green {
    border-color: #4ade80;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

/* Variant: active yellow (검수) */
.view-tab.active-yellow {
    border-color: #fbbf24;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

/* Variant: active teal (해운) */
.view-tab.active-teal {
    border-color: #2dd4bf;
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.1);
}

/* ----------------------------------------------------------
   Metrics
   ---------------------------------------------------------- */
.metrics {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.metric {
    padding: 14px 20px;
    background: #262730;
    border-radius: 8px;
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.metric-label {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    white-space: nowrap;
}

/* ----------------------------------------------------------
   Data Table
   ---------------------------------------------------------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #333;
    color: #888;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background: #1a1d24;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #262730;
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tr.row-fail td {
    background: rgba(248, 113, 113, 0.04);
}

.data-table tr.row-review td {
    background: rgba(251, 191, 36, 0.04);
}

.data-table tr.row-pass td {
    background: transparent;
}

/* ----------------------------------------------------------
   Badges
   ---------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.badge-pass {
    background: #1a3a2a;
    color: #4ade80;
}

.badge-fail {
    background: #3a1a1a;
    color: #f87171;
}

.badge-review {
    background: #3a3a1a;
    color: #fbbf24;
}

.badge-air {
    background: #1a2a3a;
    color: #60a5fa;
}

.badge-sea {
    background: #1a3a3a;
    color: #2dd4bf;
}

.badge-match {
    background: #1a3a2a;
    color: #4ade80;
}

.badge-mismatch {
    background: #3a1a1a;
    color: #f87171;
}

.badge-pending {
    background: #262730;
    color: #555;
}

.badge-error {
    background: #2a1a1a;
    color: #f97316;
}

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #ff4b4b;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #e63c3c;
}

.btn-secondary {
    background: #262730;
    color: #fafafa;
    border: 1px solid #333;
}

.btn-secondary:hover:not(:disabled) {
    background: #333;
    border-color: #555;
}

.btn-success {
    background: #16a34a;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #15803d;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-info {
    background: #2563eb;
    color: #fff;
}

.btn-info:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
}

.btn-icon {
    padding: 6px;
    font-size: 14px;
    min-width: 30px;
    justify-content: center;
}

/* Quick approve / reject inline buttons */
.btn-approve {
    background: #1a3a2a;
    color: #4ade80;
    border: 1px solid #16a34a;
}

.btn-approve:hover:not(:disabled) {
    background: #1e4a32;
}

.btn-reject {
    background: #3a1a1a;
    color: #f87171;
    border: 1px solid #dc2626;
}

.btn-reject:hover:not(:disabled) {
    background: #4a1c1c;
}

/* ----------------------------------------------------------
   Input Groups & Rows
   ---------------------------------------------------------- */
.input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.input-group input,
.input-group select,
.input-group textarea {
    padding: 8px 12px;
    border: 1px solid #333;
    background: #262730;
    color: #fafafa;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    outline: none;
    width: 140px;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: #60a5fa;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #555;
}

.input-group select option {
    background: #262730;
    color: #fafafa;
}

.input-group input[type="number"] {
    -moz-appearance: textfield;
}

.input-group input[type="number"]::-webkit-outer-spin-button,
.input-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ----------------------------------------------------------
   Scroll Area
   ---------------------------------------------------------- */
.scroll-area {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #333;
    border-radius: 8px;
}

.scroll-area::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scroll-area::-webkit-scrollbar-track {
    background: #1a1d24;
}

.scroll-area::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.scroll-area::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* ----------------------------------------------------------
   Progress Bar
   ---------------------------------------------------------- */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    margin: 12px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4b4b, #ff8b4b);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.progress-fill.fill-green {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.progress-fill.fill-blue {
    background: linear-gradient(90deg, #2563eb, #60a5fa);
}

/* ----------------------------------------------------------
   Notes
   ---------------------------------------------------------- */
.note {
    background: #262730;
    border-left: 3px solid #60a5fa;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: #999;
    line-height: 1.7;
}

.note strong {
    color: #fafafa;
}

/* ----------------------------------------------------------
   Status Dots
   ---------------------------------------------------------- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    flex-shrink: 0;
}

.dot-green {
    background: #4ade80;
    box-shadow: 0 0 4px rgba(74, 222, 128, 0.5);
}

.dot-yellow {
    background: #fbbf24;
    box-shadow: 0 0 4px rgba(251, 191, 36, 0.5);
}

.dot-red {
    background: #f87171;
    box-shadow: 0 0 4px rgba(248, 113, 113, 0.5);
}

.dot-blue {
    background: #60a5fa;
    box-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
}

/* ----------------------------------------------------------
   Image Compare
   ---------------------------------------------------------- */
.img-compare {
    display: flex;
    gap: 8px;
    align-items: center;
}

.img-placeholder {
    width: 60px;
    height: 60px;
    background: #262730;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #555;
    border: 1px solid #333;
    overflow: hidden;
    flex-shrink: 0;
}

.img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similarity-bar {
    width: 60px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.similarity-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.similarity-value {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

/* ----------------------------------------------------------
   Export Cards
   ---------------------------------------------------------- */
.export-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.export-card {
    padding: 24px;
    background: #262730;
    border-radius: 12px;
    border: 1px solid #333;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-card:hover {
    border-color: #ff4b4b;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.export-card h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

.export-card .limit {
    font-size: 13px;
    color: #888;
}

.export-card .count {
    font-size: 32px;
    font-weight: 700;
    margin: 12px 0;
    line-height: 1.1;
}

.export-card .count span {
    font-size: 14px;
    color: #888;
    font-weight: 400;
}

/* ----------------------------------------------------------
   Divider
   ---------------------------------------------------------- */
.divider,
hr.divider {
    border: none;
    border-top: 1px solid #262730;
    margin: 20px 0;
}

/* ----------------------------------------------------------
   Alerts
   ---------------------------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.alert-success {
    background: #1a3a2a;
    color: #4ade80;
    border: 1px solid #16a34a;
}

.alert-error {
    background: #3a1a1a;
    color: #f87171;
    border: 1px solid #dc2626;
}

.alert-warning {
    background: #3a3a1a;
    color: #fbbf24;
    border: 1px solid #ca8a04;
}

.alert-info {
    background: #1a2a3a;
    color: #60a5fa;
    border: 1px solid #2563eb;
}

/* ----------------------------------------------------------
   Quick Keyword Bar
   ---------------------------------------------------------- */
.keyword-bar {
    background: #262730;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #333;
}

.keyword-bar input {
    background: transparent;
    border: none;
    color: #fafafa;
    outline: none;
    font-size: 12px;
    font-family: inherit;
    min-width: 200px;
    flex: 1;
}

.keyword-bar input::placeholder {
    color: #555;
}

/* ----------------------------------------------------------
   Loading Spinner
   ---------------------------------------------------------- */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #333;
    border-top-color: #ff4b4b;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.loading-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.loading-center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------
   htmx Indicators
   ---------------------------------------------------------- */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.htmx-request.htmx-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Overlay spinner for panels */
.htmx-request .loading-overlay {
    display: flex;
}

.loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(14, 17, 23, 0.6);
    border-radius: inherit;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ----------------------------------------------------------
   Checkbox Styling
   ---------------------------------------------------------- */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ff4b4b;
    cursor: pointer;
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   Toast Container & Toasts
   ---------------------------------------------------------- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 400px;
    pointer-events: all;
    cursor: pointer;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: #1a3a2a;
    color: #4ade80;
    border: 1px solid #16a34a;
}

.toast-error {
    background: #3a1a1a;
    color: #f87171;
    border: 1px solid #dc2626;
}

.toast-warning {
    background: #3a3a1a;
    color: #fbbf24;
    border: 1px solid #ca8a04;
}

.toast-info {
    background: #1a2a3a;
    color: #60a5fa;
    border: 1px solid #2563eb;
}

/* ----------------------------------------------------------
   Color Utility Classes (matching workflow steps)
   ---------------------------------------------------------- */
.c-blue   { background: #1e3a5f; color: #60a5fa; border-color: #2563eb; }
.c-green  { background: #1a3a2a; color: #4ade80; border-color: #16a34a; }
.c-orange { background: #3a2a1a; color: #fb923c; border-color: #ea580c; }
.c-purple { background: #2a1a3a; color: #c084fc; border-color: #9333ea; }
.c-red    { background: #3a1a1a; color: #f87171; border-color: #dc2626; }
.c-teal   { background: #1a3a3a; color: #2dd4bf; border-color: #0d9488; }

.text-green  { color: #4ade80; }
.text-red    { color: #f87171; }
.text-yellow { color: #fbbf24; }
.text-blue   { color: #60a5fa; }
.text-teal   { color: #2dd4bf; }
.text-purple { color: #c084fc; }
.text-orange { color: #fb923c; }
.text-muted  { color: #888; }

/* ----------------------------------------------------------
   Workflow Layout (for workflow visualization page)
   ---------------------------------------------------------- */
.workflow {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: center;
    padding: 40px 20px;
}

.wf-step {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 900px;
}

.wf-num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.wf-card {
    flex: 1;
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid #333;
    background: #1a1d24;
}

.wf-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.wf-card p {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
}

.wf-arrow {
    width: 48px;
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.wf-arrow svg {
    width: 24px;
    height: 24px;
    fill: #555;
}

.wf-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 4px;
    margin-top: 6px;
}

/* ----------------------------------------------------------
   Tag Color Variants
   ---------------------------------------------------------- */
.tag-blue   { background: #1e3a5f; color: #60a5fa; }
.tag-green  { background: #1a3a2a; color: #4ade80; }
.tag-orange { background: #3a2a1a; color: #fb923c; }
.tag-purple { background: #2a1a3a; color: #c084fc; }
.tag-red    { background: #3a1a1a; color: #f87171; }
.tag-teal   { background: #1a3a3a; color: #2dd4bf; }

/* ----------------------------------------------------------
   Inline Edit / Modal Panel
   ---------------------------------------------------------- */
.inline-edit-panel {
    background: #262730;
    border: 1px solid #9333ea;
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
}

.inline-edit-panel .panel-label {
    font-size: 14px;
    font-weight: 600;
    color: #c084fc;
    margin-bottom: 12px;
}

/* Price preview box */
.price-preview {
    padding: 8px 16px;
    background: #1a1d24;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

.price-preview .price-label {
    color: #888;
    font-size: 12px;
}

.price-preview .price-value {
    font-size: 18px;
    font-weight: 700;
    color: #2dd4bf;
}

/* ----------------------------------------------------------
   Column Mapping Preview Grid
   ---------------------------------------------------------- */
.mapping-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    font-size: 12px;
}

.mapping-card {
    background: #262730;
    padding: 14px;
    border-radius: 8px;
    line-height: 1.8;
}

.mapping-card .mapping-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.mapping-card .mapping-row {
    color: #888;
}

/* ----------------------------------------------------------
   Spacer / Flex Helpers
   ---------------------------------------------------------- */
.flex-1 { flex: 1; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-bold   { font-weight: 700; }
.font-sm     { font-size: 12px; }
.font-xs     { font-size: 11px; }

/* ----------------------------------------------------------
   Responsive Adjustments
   ---------------------------------------------------------- */
@media (max-width: 1024px) {
    .export-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .mapping-grid {
        grid-template-columns: 1fr 1fr;
    }

    .metrics {
        flex-wrap: wrap;
    }

    .metric {
        min-width: calc(50% - 6px);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .app-title {
        font-size: 20px;
    }

    .app-tabs {
        width: 100%;
    }

    .app-tab {
        flex: 1;
        text-align: center;
        font-size: 13px;
        padding: 8px 12px;
    }

    .input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group input,
    .input-group select {
        width: 100%;
    }

    .export-cards {
        grid-template-columns: 1fr;
    }

    .mapping-grid {
        grid-template-columns: 1fr;
    }

    .metrics {
        gap: 8px;
    }

    .metric {
        min-width: calc(50% - 4px);
        padding: 10px 12px;
    }

    .metric-value {
        font-size: 20px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 8px;
    }
}

@media (max-width: 480px) {
    .view-tabs {
        gap: 4px;
    }

    .view-tab {
        padding: 5px 10px;
        font-size: 11px;
    }

    .sub-tab {
        font-size: 12px;
        padding: 6px 12px;
    }

    .metric {
        min-width: 100%;
    }
}

/* ----------------------------------------------------------
   Work Log Panel (하단 고정)
   ---------------------------------------------------------- */
.log-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #12141a;
    border-top: 2px solid #4ade80;
    transition: height 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.log-panel-collapsed {
    height: 38px;
    border-top-color: #444;
}

.log-panel-collapsed.has-unread {
    border-top-color: #f59e0b;
}

.log-panel-expanded {
    height: 300px;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #1a1d24;
    cursor: pointer;
    flex-shrink: 0;
    border-bottom: 1px solid #262730;
    user-select: none;
}

.log-header:hover {
    background: #222530;
}

.log-title {
    font-size: 13px;
    font-weight: 700;
    color: #ccc;
    letter-spacing: 0.5px;
}

.log-badge {
    background: #f59e0b;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    animation: badge-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.log-toggle {
    font-size: 10px;
    color: #666;
}

.log-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.log-body::-webkit-scrollbar {
    width: 5px;
}

.log-body::-webkit-scrollbar-track {
    background: #12141a;
}

.log-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.log-entry {
    padding: 1px 16px;
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.log-entry:hover {
    background: rgba(255,255,255,0.02);
}

.log-ts {
    color: #555;
    font-size: 11px;
    flex-shrink: 0;
}

.log-task {
    color: #60a5fa;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.log-msg {
    color: #ccc;
}

.log-detail {
    color: #666;
    font-size: 11px;
    margin-left: 4px;
}

/* Log level colors */
.log-info .log-msg { color: #ccc; }
.log-success .log-msg { color: #4ade80; }
.log-warning .log-msg { color: #fbbf24; }
.log-error .log-msg { color: #f87171; }
.log-progress .log-msg { color: #60a5fa; }
.log-progress .log-task { color: #c084fc; }

/* 로그 패널이 있을 때 메인 컨텐츠 하단 여백 */
body {
    padding-bottom: 50px;
}
