/* ============================================================
   dashboard.css — Dashboard Page Styles
   YLS B2B ERP · Laravel 12
============================================================ */

/* ── STAT CARDS ────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 22px 18px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: default;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(249,115,22,.03) 100%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(249,115,22,.2);
}

.stat-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

/* Stat Icon */
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon--orange { background: var(--accent-light);  color: var(--accent); }
.stat-icon--blue   { background: var(--info-light);    color: var(--info); }
.stat-icon--green  { background: var(--success-light); color: var(--success); }
.stat-icon--purple { background: var(--purple-light);  color: var(--purple); }

/* Trend Badge */
.stat-trend {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: .7125rem;
    font-weight: 600;
}

.stat-trend--up      { background: var(--success-light); color: var(--success); }
.stat-trend--down    { background: var(--danger-light);  color: var(--danger); }
.stat-trend--neutral { background: var(--border-light);  color: var(--text-muted); }

/* Stat Values */
.stat-card__value {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.6px;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-card__value--danger { color: var(--danger); }

.stat-card__label {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.stat-card__footer {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.stat-card__footer-label { font-size: .75rem; color: var(--text-muted); }
.stat-card__footer-value { font-size: .75rem; color: var(--text-secondary); font-weight: 600; }

/* Sparkline */
.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 24px;
    margin-left: auto;
}

.sparkline__bar {
    display: block;
    width: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: var(--transition);
}

.sparkline__bar--hi { background: var(--accent); }
.sparkline__bar--md { background: rgba(249,115,22,.4); }

/* ── QUICK ACTIONS ─────────────────────────────────────────── */
.quick-actions-section { margin-bottom: 24px; }

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.quick-action-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    font-family: var(--font-body);
}

.quick-action-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #F43F5E);
    transform: scaleX(0);
    transition: var(--transition);
}

.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(249,115,22,.2);
}

.quick-action-card:hover::after { transform: scaleX(1); }

.qa-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qa-icon--orange { background: var(--accent-light);  color: var(--accent); }
.qa-icon--blue   { background: var(--info-light);    color: var(--info); }
.qa-icon--green  { background: var(--success-light); color: var(--success); }
.qa-icon--purple { background: var(--purple-light);  color: var(--purple); }

.qa-label { font-size: .8125rem; font-weight: 600; color: var(--text-primary); }
.qa-desc  { font-size: .73rem; color: var(--text-muted); line-height: 1.4; }

/* ── SECTION GRIDS ─────────────────────────────────────────── */
.section-grid-2 {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    margin-bottom: 24px;
}

.section-grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* ── ORDERS TABLE ──────────────────────────────────────────── */
.td-date { color: var(--text-secondary); font-size: .8rem; }

/* ── NOTIFICATIONS ─────────────────────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: 2px; }

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.notif-item:hover { background: var(--bg); }

.notif-item--unread::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 8px;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
}

.notif-item--unread { padding-left: 20px; }

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon--orange { background: var(--accent-light);  color: var(--accent); }
.notif-icon--green  { background: var(--success-light); color: var(--success); }
.notif-icon--blue   { background: var(--info-light);    color: var(--info); }
.notif-icon--yellow { background: var(--warning-light); color: var(--warning); }

.notif-content  { flex: 1; min-width: 0; }
.notif-title    { font-size: .8125rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; line-height: 1.3; }
.notif-desc     { font-size: .75rem; color: var(--text-muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time     { font-size: .68rem; color: var(--text-muted); flex-shrink: 0; margin-top: 1px; }
.notif-divider  { height: 1px; background: var(--border-light); margin: 6px 0; }

/* ── PERFORMANCE BARS ──────────────────────────────────────── */
.perf-bar-list   { display: flex; flex-direction: column; gap: 14px; }

.perf-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.perf-bar-label { font-size: .8125rem; font-weight: 500; color: var(--text-secondary); }
.perf-bar-val   { font-size: .8125rem; font-weight: 700; color: var(--text-primary); }

.perf-bar-track {
    height: 6px;
    background: var(--border-light);
    border-radius: 99px;
    overflow: hidden;
}

.perf-bar-fill {
    height: 100%;
    border-radius: 99px;
    width: 0;
    transition: width .9s cubic-bezier(.4,0,.2,1);
}

.perf-bar-fill--accent  { background: var(--accent); }
.perf-bar-fill--success { background: var(--success); }
.perf-bar-fill--info    { background: var(--info); }
.perf-bar-fill--warning { background: var(--warning); }

/* ── PRODUCTS GRID (dashboard) ─────────────────────────────── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ── MINI BAR CHART ────────────────────────────────────────── */
.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
}

.chart-area { padding: 16px 20px 20px; }

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 100px;
    padding-bottom: 8px;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.chart-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    background: var(--accent);
    opacity: .75;
    transition: opacity .2s, transform .2s;
    cursor: pointer;
    min-height: 4px;
}

.chart-bar:hover     { opacity: 1; transform: scaleY(1.04); transform-origin: bottom; }
.chart-bar--alt      { background: var(--info); }

.chart-bar-label {
    font-size: .62rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 4px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .73rem;
    color: var(--text-muted);
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.chart-legend-dot--accent { background: var(--accent); }
.chart-legend-dot--info   { background: var(--info); }

/* ── ACTIVITY FEED ─────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; }

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    position: relative;
}

.activity-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 42px;
    bottom: 0;
    width: 1px;
    background: var(--border-light);
}

.activity-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.activity-dot--orange { background: var(--accent-light);  color: var(--accent); }
.activity-dot--green  { background: var(--success-light); color: var(--success); }
.activity-dot--blue   { background: var(--info-light);    color: var(--info); }
.activity-dot--red    { background: var(--danger-light);  color: var(--danger); }

.activity-body   { flex: 1; padding-top: 4px; }
.activity-text   { font-size: .8125rem; color: var(--text-secondary); line-height: 1.4; }
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time   { font-size: .72rem; color: var(--text-muted); margin-top: 3px; }
