/* ============================================================
   dashboard.css — 대시보드 전용 스타일
   공통 변수는 common.css 참조
   ============================================================ */

/* dashboard 전용 로컬 변수 */
:root {
    --radius-2xl: 1.25rem; /* 20px — common.css에 없는 값 */
}


/* ============================================================
   0-a. 대시보드 컨테이너
   ============================================================ */

.dashboard-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

@media (max-width: 767px) {
    .dashboard-container { padding: 0 var(--space-sm); }
}


/* ============================================================
   0. 인사 카드
   ============================================================ */

.dashboard-greeting-card {
    background: linear-gradient(135deg, #1f2937 0%, #374151 60%, #4b5563 100%);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(31, 41, 55, 0.35);
    position: relative;
    overflow: hidden;
}

.dashboard-greeting-card::after {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 160px; height: 160px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    pointer-events: none;
}

.greeting-top {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.greeting-icon {
    font-size: 2.8rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
}

.greeting-name {
    font-size: 1.25rem;
    font-weight: var(--fw-bold);
    letter-spacing: -0.3px;
}

.greeting-level {
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

.greeting-date {
    font-size: 1rem;
    font-weight: var(--fw-semibold);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--space-sm);
}

.greeting-last-login {
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, 0.55);
}

.greeting-leave {
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.leave-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-sm);
}

.leave-counts-inline {
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, 0.6);
}

.leave-counts-inline strong {
    color: rgba(255, 255, 255, 0.95);
}

.leave-count-sep {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 2px;
}

/* 월별 바차트 */
.leave-monthly-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    margin-top: var(--space-sm);
}

.lmc-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.lmc-bar-wrap {
    width: 100%;
    height: 28px;
    display: flex;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.lmc-bar {
    width: 100%;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    transition: height 0.4s ease;
}

.lmc-bar-active {
    background: linear-gradient(to top, var(--color-warning), #fde68a);
}

.lmc-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
}

/* 연차 바차트 커스텀 툴팁 */
.lmc-tooltip {
    position: fixed;
    z-index: 9999;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 100px;
}

.lmc-tt-month {
    font-size: 0.7rem;
    font-weight: var(--fw-semibold);
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.lmc-tt-table {
    border-collapse: collapse;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.9);
}

.lmc-tt-table td {
    padding: 2px 6px 2px 0;
}

.lmc-tt-table td:last-child {
    color: var(--color-warning);
    padding-right: 0;
}

.lmc-tt-empty {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}


/* ============================================================
   1. 모던 카드
   ============================================================ */

.modern-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.modern-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}


/* ============================================================
   2. 일정 카드
   ============================================================ */

.modern-schedule-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--color-gray-200);
    border-radius: 24px;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.modern-schedule-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #374151, #9ca3af);
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.modern-schedule-card:hover::before { opacity: 1; }

.modern-schedule-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* 일정 카드 상단 요약 행 */
.schedule-header-row {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-gray-200);
}

/* 상단 요약 영역 */
.schedule-left {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    min-width: 0;
}

.schedule-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #374151, #6b7280);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: var(--fs-2xl);
    box-shadow: 0 4px 15px rgba(55, 65, 81, 0.3);
}

.schedule-info { text-align: left; }

.schedule-count {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-bold);
    color: #374151;
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.schedule-label {
    font-size: var(--fs-md);
    color: var(--color-gray-600);
    font-weight: var(--fw-medium);
    margin-bottom: var(--space-md);
}

.schedule-range {
    font-size: var(--fs-sm);
    color: var(--color-gray-500);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
}

.schedule-range i { color: #6b7280; }

.schedule-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fs-xs);
}

.stat-label { color: var(--color-gray-500); }
.stat-value { color: var(--color-gray-700); font-weight: var(--fw-semibold); }

/* 하단 리스트 영역 */
.schedule-right {
    width: 100%;
    min-height: 40px;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.schedule-section { height: 100%; }


/* ============================================================
   3. 섹션 헤더
   ============================================================ */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--color-gray-200);
}

.section-title-wrapper {
    display: flex;
    align-items: center;
}

.section-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-gray-600);
}

.section-title.small { font-size: 0.95rem; }

.section-badge {
    background: #495057;
    color: #ffffff;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    padding: 0.2rem var(--space-sm);
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(73, 80, 87, 0.2);
    margin-left: var(--space-sm);
}

.section-badge-schedule {
    background: linear-gradient(135deg, var(--color-success), #20c997);
    box-shadow: 0 2px 4px rgba(25, 135, 84, 0.2);
}

.section-badge-leave {
    background: linear-gradient(135deg, var(--color-warning), #fbbf24);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
    color: #664d03;
}

.section-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}


/* ============================================================
   4. 일정 아이템
   ============================================================ */

.schedule-item {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition-base);
}

.schedule-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(4px);
}

.schedule-item-event {
    border-left: 3px solid var(--color-success);
}

.schedule-item-leave {
    border-left: 3px solid var(--color-warning);
}

.schedule-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.schedule-item-content { flex: 1; }

.schedule-item-title {
    font-size: 0.9rem;
    font-weight: var(--fw-semibold);
    color: var(--color-gray-800);
}

.schedule-item-datetime {
    font-size: var(--fs-sm);
    color: var(--color-gray-500);
    font-weight: var(--fw-medium);
    white-space: nowrap;
    margin-left: auto;
}

.schedule-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80px;
    color: var(--color-gray-400);
    gap: var(--space-sm);
}

.schedule-empty i    { font-size: var(--fs-2xl); }
.schedule-empty span { font-size: 0.9rem; }


/* ============================================================
   5. 바로가기 카드
   ============================================================ */

.quick-actions-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    transition: var(--transition-slow);
    box-shadow: var(--shadow-xs);
    position: relative;
}

.quick-actions-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #374151, #9ca3af);
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.quick-actions-card:hover::before { opacity: 1; }

.quick-actions-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.quick-actions-header {
    padding: var(--space-lg) var(--space-xl) var(--space-sm);
    border-bottom: 1px solid var(--color-gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quick-actions-header h6 {
    margin: 0;
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--color-gray-800);
    display: flex;
    align-items: center;
}

.quick-actions-body { padding: var(--space-xl); }

.quick-action-grid {
    display: flex;
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 100px;
    min-height: 110px;
    padding: var(--space-xl) var(--space-md);
    background: var(--bg-light);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--color-gray-700);
    transition: var(--transition-base);
    font-weight: var(--fw-semibold);
    gap: var(--space-sm);
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, #495057, #343a40);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(73, 80, 87, 0.25);
    text-decoration: none;
    border-color: transparent;
}

.quick-action-btn i {
    font-size: 1.8rem;
    color: #495057;
    transition: color var(--transition-base);
}

.quick-action-btn:hover i { color: #ffffff; }

.quick-action-btn span {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
}


/* ============================================================
   6. 피처 카드 (로그아웃 상태 시스템 소개)
   ============================================================ */

.feature-card {
    background: #ffffff;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    height: 100%;
    transition: var(--transition-base);
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: var(--space-md);
}

.feature-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: var(--color-gray-800);
    margin-bottom: var(--space-xs);
}

.feature-desc {
    font-size: var(--fs-xs);
    color: var(--color-gray-500);
    line-height: 1.5;
}


/* ============================================================
   7. 데모 버튼
   ============================================================ */

.demo-btn {
    background: linear-gradient(135deg, var(--color-warning), #fbbf24);
    color: #ffffff;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: var(--fw-semibold);
    font-size: 0.9rem;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

.demo-btn:hover {
    background: linear-gradient(135deg, #d97706, var(--color-warning));
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}


/* ============================================================
   7. 반응형
   ============================================================ */

@media (max-width: 767px) {
    .modern-schedule-card {
        gap: var(--space-lg);
        padding: var(--space-lg);
    }

    .schedule-count   { font-size: 2rem; }
    .schedule-item    { padding: var(--space-sm); }

    .schedule-item-title    { font-size: var(--fs-sm); }
    .schedule-item-datetime { font-size: var(--fs-xs); }

    .quick-actions-header { padding: var(--space-md) var(--space-lg) var(--space-xs); }
    .quick-actions-body   { padding: var(--space-lg) var(--space-sm); }

    .quick-action-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .quick-action-btn {
        min-height: 90px;
        padding: var(--space-md) var(--space-xs);
    }

    .quick-action-btn i { font-size: 1.4rem; }
    .quick-action-btn span { font-size: var(--fs-sm); }
}


/* ============================================================
   Superadmin 전용 위젯 — 다크 KPI 테마
   ============================================================ */

/* --- 다크 페이지 오버레이 (superadmin 분기 전용) --- */
.sa-dark-page {
    background: #0f1117;
    min-height: calc(100vh - 60px);
    /* dashboard-container padding(1.5rem) + content-wrapper padding(24px=1.5rem) 상쇄 */
    margin: -1.5rem -3rem -2.5rem;
    padding: 1.5rem 3rem 2.5rem;
}

/* --- KPI 띠 --- */
.sa-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.sa-kpi-card {
    background: #1a1d29;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 10px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-base);
    cursor: default;
}

.sa-kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sa-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.1);
}

.sa-kpi-card:hover::before { opacity: 1; }

/* 각 KPI 카드 액센트 색상 */
.sa-kpi-card.sa-kpi-dispatch::before { background: linear-gradient(90deg, #34d399, #10b981); }
.sa-kpi-card.sa-kpi-today::before       { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.sa-kpi-card.sa-kpi-issues::before      { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.sa-kpi-card.sa-kpi-leave::before       { background: linear-gradient(90deg, #fb923c, #ea580c); }
.sa-kpi-card.sa-kpi-saleslog::before    { background: linear-gradient(90deg, #38bdf8, #0284c7); }

.sa-kpi-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    margin-bottom: 0;
}

.sa-kpi-dispatch .sa-kpi-icon  { background: rgba(52, 211, 153, 0.12); color: #34d399; }
.sa-kpi-today    .sa-kpi-icon  { background: rgba(96, 165, 250, 0.12); color: #60a5fa; }
.sa-kpi-issues   .sa-kpi-icon  { background: rgba(167, 139, 250, 0.12); color: #a78bfa; }
.sa-kpi-leave    .sa-kpi-icon  { background: rgba(251, 146, 60, 0.12); color: #fb923c; }
.sa-kpi-saleslog .sa-kpi-icon  { background: rgba(56, 189, 248, 0.12); color: #38bdf8; }

.sa-kpi-num {
    font-size: 1.5rem;
    font-weight: var(--fw-bold);
    line-height: 1;
    letter-spacing: -0.5px;
}

.sa-kpi-dispatch .sa-kpi-num  { color: #34d399; }
.sa-kpi-today    .sa-kpi-num  { color: #60a5fa; }
.sa-kpi-issues   .sa-kpi-num  { color: #a78bfa; }
.sa-kpi-leave    .sa-kpi-num  { color: #fb923c; }
.sa-kpi-saleslog .sa-kpi-num  { color: #38bdf8; }

.sa-kpi-label {
    font-size: 0.72rem;
    color: #8a90a3;
    font-weight: var(--fw-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sa-kpi-sublabel {
    font-size: 0.66rem;
    color: #525870;
    margin-top: 0;
}

/* --- 오늘 휴가자 KPI 칩 --- */
.sa-leave-names {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    overflow: hidden;
    max-height: 44px;
}
.sa-leave-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: var(--fw-medium);
    line-height: 1.4;
    background: rgba(251, 146, 60, 0.12);
    color: #fdba74;
    border: 1px solid rgba(251, 146, 60, 0.25);
}
.sa-leave-chip small {
    font-size: 0.6rem;
    opacity: 0.75;
    margin-left: 2px;
}
/* 반차는 톤 다운 */
.sa-leave-chip.sa-leave-morning_half,
.sa-leave-chip.sa-leave-afternoon_half {
    background: rgba(56, 189, 248, 0.10);
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.22);
}
.sa-leave-empty {
    font-size: 0.7rem;
    color: #525870;
}

/* --- 위젯 카드 (공통 다크) --- */
.sa-widget-card {
    background: #1a1d29;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.sa-widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: var(--space-md);
}

.sa-widget-header i { font-size: 1rem; }

.sa-widget-title {
    font-weight: var(--fw-semibold);
    font-size: 0.875rem;
    color: #e6e8ee;
}

.sa-widget-sub {
    font-size: 0.78rem;
    color: #8a90a3;
}
.sa-widget-sub strong { color: #60a5fa; font-size: 0.88rem; }

.sa-widget-more {
    font-size: 0.76rem;
    color: #525870;
    text-decoration: none;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.sa-widget-more:hover { color: #a78bfa; }

.sa-widget-section-title {
    font-size: 0.68rem;
    color: #525870;
    font-weight: var(--fw-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: var(--space-sm) 0 var(--space-xs);
}

.sa-empty {
    color: #525870;
    font-size: 0.82rem;
    padding: var(--space-md) 0;
    text-align: center;
}

/* --- 기간 네비게이션 --- */
.sa-period-nav {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 2px;
}

.sa-nav-btn {
    background: transparent;
    border: 0;
    color: #8a90a3;
    width: 22px;
    height: 22px;
    line-height: 1;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}
.sa-nav-btn:hover { background: rgba(255, 255, 255, 0.08); color: #e6e8ee; }

.sa-nav-label {
    background: transparent;
    border: 0;
    color: #c5c9d6;
    font-size: 0.76rem;
    font-weight: var(--fw-semibold);
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.sa-nav-label:hover { background: rgba(255, 255, 255, 0.08); color: #e6e8ee; }

/* --- 출고 카운트 (위젯 내) --- */
.sa-dispatch-counts {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-sm) 0;
}
.sa-count-block { text-align: center; }
.sa-count-num {
    font-size: 2rem;
    font-weight: var(--fw-bold);
    color: #34d399;
    line-height: 1.1;
    letter-spacing: -0.5px;
}
.sa-count-label {
    font-size: 0.72rem;
    color: #8a90a3;
    margin-top: 3px;
}
.sa-count-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.07);
}

/* --- 출고 TOP 거래처 바 차트 --- */
.sa-top-list { display: flex; flex-direction: column; gap: 5px; }

.sa-top-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 4px;
    border-radius: 6px;
    font-size: 0.82rem;
    transition: background 0.15s;
}
.sa-top-item:hover { background: rgba(255, 255, 255, 0.04); }

.sa-top-rank {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #8a90a3;
    font-size: 0.68rem;
    font-weight: var(--fw-bold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sa-top-name { flex: 1; color: #c5c9d6; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-top-count { color: #34d399; font-size: 0.76rem; font-weight: var(--fw-semibold); flex-shrink: 0; }

/* 바 시각화 */
.sa-top-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px;
    border-radius: 6px;
    font-size: 0.82rem;
    transition: background 0.15s;
}
.sa-top-bar-wrap:hover { background: rgba(255, 255, 255, 0.04); }

.sa-top-bar-rank {
    width: 16px;
    text-align: center;
    color: #525870;
    font-size: 0.68rem;
    font-weight: var(--fw-bold);
    flex-shrink: 0;
}
.sa-top-bar-name {
    width: 90px;
    color: #c5c9d6;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
.sa-top-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}
.sa-top-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.4s ease;
}
.sa-top-bar-count {
    color: #34d399;
    font-size: 0.74rem;
    font-weight: var(--fw-semibold);
    flex-shrink: 0;
    min-width: 28px;
    text-align: right;
}

/* --- 작성자 칩 --- */
.sa-employee-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 2px;
}
.sa-emp-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    border: 1px solid;
}
.sa-emp-chip i { font-size: 0.68rem; }

.sa-emp-done {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.2);
    color: #34d399;
}
.sa-emp-todo {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

/* --- workhub 이슈 --- */
.sa-issue-list { display: flex; flex-direction: column; gap: 3px; }

.sa-issue-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.sa-issue-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.sa-issue-priority {
    font-size: 0.68rem;
    font-weight: var(--fw-bold);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.sa-priority-1 { background: rgba(248, 113, 113, 0.12); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.2); }
.sa-priority-2 { background: rgba(251, 146, 60, 0.12); color: #fb923c; border: 1px solid rgba(251, 146, 60, 0.2); }
.sa-priority-3 { background: rgba(250, 204, 21, 0.10); color: #facc15; border: 1px solid rgba(250, 204, 21, 0.2); }
.sa-priority-4 { background: rgba(96, 165, 250, 0.10); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.2); }

.sa-issue-title {
    flex: 1;
    font-size: 0.84rem;
    color: #c5c9d6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sa-issue-due {
    font-size: 0.72rem;
    color: #525870;
    flex-shrink: 0;
}
.sa-issue-pin { color: #facc15; font-size: 0.75rem; }

/* --- 7일 영업일지 트렌드 --- */
.sa-trend-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    padding-top: var(--space-sm);
    flex: 1;
}
.sa-trend-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 4px;
}
.sa-trend-bar-wrap {
    width: 100%;
    height: 88px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 4px 4px 0 0;
}
.sa-trend-bar {
    width: 65%;
    min-height: 3px;
    background: linear-gradient(to top, #0369a1, #38bdf8);
    border-radius: 3px 3px 0 0;
    transition: height 0.35s ease;
}
.sa-trend-bar.sa-trend-today {
    background: linear-gradient(to top, #ea580c, #fb923c);
    box-shadow: 0 0 8px rgba(251, 146, 60, 0.3);
}
.sa-trend-today-label {
    color: #fb923c !important;
    font-weight: var(--fw-bold);
}
.sa-trend-label {
    font-size: 0.68rem;
    color: #8a90a3;
    font-weight: var(--fw-semibold);
}
.sa-trend-date {
    font-size: 0.6rem;
    color: #525870;
}

/* --- 다크 바로가기 카드 --- */
.sa-quick-card {
    background: #1a1d29;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-base);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.sa-quick-header {
    padding: 12px 20px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sa-quick-header-title {
    font-size: 0.82rem;
    font-weight: var(--fw-semibold);
    color: #8a90a3;
    letter-spacing: 0.02em;
}

.sa-quick-body { padding: 14px 20px 16px; }

.sa-quick-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sa-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 88px;
    min-height: 88px;
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: #8a90a3;
    transition: var(--transition-base);
    gap: 6px;
}

.sa-quick-btn:hover {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.25);
    color: #c4b5fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.15);
    text-decoration: none;
}

.sa-quick-btn i {
    font-size: 1.4rem;
    transition: color var(--transition-base);
}

.sa-quick-btn span {
    font-size: 0.75rem;
    font-weight: var(--fw-medium);
    text-align: center;
}

/* --- 도넛 차트 (출고 현황 / 오늘 거래처 분류) --- */
.sa-donut-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 4px 0 8px;
}

.sa-donut-canvas {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}
.sa-donut-canvas-sm { width: 170px; height: 170px; }

.sa-donut-canvas canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.sa-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
}
.sa-donut-num {
    font-size: 1.85rem;
    font-weight: 700;
    color: #e6e8ee;
    line-height: 1;
    letter-spacing: -0.02em;
}
.sa-donut-canvas-sm .sa-donut-num { font-size: 1.55rem; }
.sa-donut-label {
    font-size: 0.7rem;
    color: #8a90a3;
    margin-top: 4px;
    letter-spacing: 0.05em;
}

.sa-donut-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.sa-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #cbd5e1;
    transition: background var(--transition-base);
}
.sa-legend-item:hover { background: rgba(255,255,255,0.03); }

.sa-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #475569;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.04);
}

.sa-legend-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e6e8ee;
}

.sa-legend-count {
    font-weight: 600;
    color: #e6e8ee;
    font-variant-numeric: tabular-nums;
}

.sa-legend-others { opacity: 0.7; }
.sa-legend-others .sa-legend-name { color: #8a90a3; }

/* --- 카드 본문 1:1 분할 --- */
.sa-card-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: stretch;
}
.sa-card-split-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-height: 280px;
    min-height: 0;
}
/* 좌측 영역: 콘텐츠가 넘치면 col 자체가 스크롤 */
.sa-card-split-left { overflow-y: auto; }
.sa-card-split-left::-webkit-scrollbar { width: 6px; }
.sa-card-split-left::-webkit-scrollbar-track { background: transparent; }
.sa-card-split-left::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
/* 우측 영역: 디테일 패널이 내부에서 자체 스크롤 (헤더 고정) */
.sa-card-split-right { overflow: hidden; }
.sa-card-placeholder {
    flex: 1;
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #525870;
    font-size: 0.8rem;
}

/* --- 디테일 패널 (출고증 리스트) --- */
.sa-detail-panel {
    flex: 1;
    min-height: 0;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sa-detail-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #525870;
    font-size: 0.78rem;
    padding: 16px;
    text-align: center;
}
.sa-detail-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}
.sa-detail-title {
    color: #e6e8ee;
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.sa-detail-count {
    color: #94a3b8;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}
.sa-detail-close {
    background: transparent;
    border: 0;
    color: #8a90a3;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    border-radius: 4px;
}
.sa-detail-close:hover { background: rgba(255,255,255,0.06); color: #e6e8ee; }
.sa-detail-rows {
    flex: 1;
    overflow-y: auto;
    padding: 4px 6px;
}
.sa-detail-rows::-webkit-scrollbar { width: 6px; }
.sa-detail-rows::-webkit-scrollbar-track { background: transparent; }
.sa-detail-rows::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.sa-detail-row {
    display: grid;
    grid-template-columns: 38px 1fr 50px;
    gap: 6px;
    align-items: center;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.76rem;
    color: #cbd5e1;
}
.sa-detail-row:hover { background: rgba(255,255,255,0.03); }
.sa-detail-row--time { grid-template-columns: 62px 1fr 50px; }
.sa-detail-date { color: #94a3b8; font-variant-numeric: tabular-nums; }
.sa-detail-company {
    color: #e6e8ee;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sa-detail-staff { color: #8a90a3; text-align: right; }
.sa-detail-in .sa-detail-date { color: #38bdf8; }
.sa-detail-disposal .sa-detail-date { color: #f87171; }
.sa-detail-more {
    padding: 6px 10px;
    color: #525870;
    font-size: 0.7rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.04);
}

/* --- 클릭 가능 항목 --- */
.sa-clickable { cursor: pointer; }
.sa-clickable.is-active {
    background: rgba(96, 165, 250, 0.10) !important;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}
@media (max-width: 991px) {
    .sa-card-split { grid-template-columns: 1fr; }
    .sa-card-split-col { max-height: 240px; }
}

/* 분할 시 좌측 바 리스트 타이트 모드 */
.sa-card-split-left .sa-bar-row {
    grid-template-columns: 18px minmax(50px, 78px) 1fr 32px;
    gap: 6px;
    padding: 3px 4px;
    font-size: 0.78rem;
}
.sa-card-split-left .sa-bar-rank { font-size: 0.7rem; }
.sa-card-split-left .sa-bar-track { height: 8px; min-width: 24px; }
.sa-card-split-left .sa-bar-list {
    /* 부모(.sa-card-split-left)가 max-height 280 + 스크롤 담당 → 내부 스크롤 비활성 */
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

/* 분할 시 우측 카드(도넛/legend/작성자) 타이트 모드 */
.sa-card-split-left .sa-donut-wrap {
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.sa-card-split-left .sa-donut-canvas-sm {
    width: 130px;
    height: 130px;
}
.sa-card-split-left .sa-donut-canvas-sm .sa-donut-num { font-size: 1.3rem; }
.sa-card-split-left .sa-donut-legend {
    width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: space-between;
}
.sa-card-split-left .sa-legend-item {
    flex: 0 1 auto;
    min-width: 0;
    padding: 1px 2px;
    font-size: 0.7rem;
    gap: 3px;
}
.sa-card-split-left .sa-legend-dot {
    width: 7px;
    height: 7px;
    box-shadow: none;
}
.sa-card-split-left .sa-legend-name {
    flex: 0 0 auto;
    font-size: 0.7rem;
}
.sa-card-split-left .sa-legend-count { font-size: 0.7rem; }
.sa-card-split-left .sa-employee-grid { gap: 4px; }
.sa-card-split-left .sa-emp-chip {
    font-size: 0.72rem;
    padding: 3px 8px;
}

/* --- 가로 바 랭킹 리스트 (출고 품목 TOP) --- */
.sa-bar-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 6px;
    margin-top: 4px;
}
.sa-bar-list::-webkit-scrollbar { width: 6px; }
.sa-bar-list::-webkit-scrollbar-track { background: transparent; }
.sa-bar-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}
.sa-bar-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

.sa-bar-row {
    display: grid;
    grid-template-columns: 22px minmax(80px, 140px) 1fr 44px;
    align-items: center;
    gap: 10px;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background var(--transition-base);
}
.sa-bar-row:hover { background: rgba(255,255,255,0.03); }

.sa-bar-rank {
    color: #94a3b8;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
}
.sa-bar-name {
    color: #e6e8ee;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sa-bar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
    min-width: 40px;
}
.sa-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #34d399, #22d3ee);
    border-radius: 4px;
    transition: width 0.4s ease;
}
.sa-bar-count {
    color: #e6e8ee;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- 반응형 --- */
@media (max-width: 991px) {
    .sa-widget-card { padding: var(--space-md); }
    .sa-dispatch-counts { gap: var(--space-md); }
    .sa-count-num { font-size: 1.6rem; }
    .sa-kpi-num { font-size: 1.4rem; }
    .sa-top-bar-name { width: 70px; }
    .sa-donut-canvas { width: 170px; height: 170px; }
    .sa-donut-canvas-sm { width: 150px; height: 150px; }
}

@media (max-width: 767px) {
    .sa-dark-page {
        /* 모바일: content-wrapper padding 16px 상쇄 (좌우), 상단은 topbar 아래부터 */
        margin: -1rem -1rem -1.5rem;
        padding: 1rem 1rem 1.5rem;
    }
    .sa-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .sa-kpi-num { font-size: 1.35rem; }
    .sa-kpi-card { padding: 8px 12px 8px; }
    .sa-quick-grid { gap: 8px; }
    .sa-quick-btn { min-width: 72px; min-height: 78px; padding: 10px 6px; }
    .sa-quick-btn i { font-size: 1.2rem; }
    .sa-quick-btn span { font-size: 0.7rem; }
    .sa-donut-wrap { flex-direction: column; gap: 12px; }
    .sa-donut-canvas { width: 180px; height: 180px; }
    .sa-donut-canvas-sm { width: 160px; height: 160px; }
    .sa-donut-legend { width: 100%; }
}
