/* css/home.css — Home Dashboard specific styles */

/* ── Header extras ── */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ── Stats bar ── */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.stat-pill {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.2rem 1.6rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: .3s;
}

.stat-pill:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 1.8rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: .5;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
}

/* ── Section header ── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header .section-title {
    margin-bottom: 0;
}

/* ── Device grid ── */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.device-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 1.8rem;
    transition: .3s;
    position: relative;
    overflow: hidden;
}

.device-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: .3s;
}

.device-card:hover {
    border-color: rgba(79, 172, 254, .3);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}

.device-card:hover::before {
    opacity: 1;
}

.device-card.online {
    border-color: rgba(0, 255, 163, .2);
}

.device-card.online::before {
    background: linear-gradient(90deg, var(--success), var(--primary));
    opacity: 1;
}

.device-card.offline::before {
    background: linear-gradient(90deg, #555, #333);
    opacity: 1;
}

/* ── Card header ── */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.4rem;
}

.device-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .3rem;
}

.device-token {
    font-size: .72rem;
    font-family: monospace;
    opacity: .4;
    letter-spacing: .5px;
}

/* ── Status badge ── */
.status-badge {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .9rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}

.status-badge.online {
    background: rgba(0, 255, 163, .1);
    color: var(--success);
}

.status-badge.offline {
    background: rgba(255, 255, 255, .06);
    color: #888;
}

.status-badge .status-dot {
    width: 8px;
    height: 8px;
}

.status-badge.online .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

.status-badge.offline .status-dot {
    background: #555;
    animation: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .4;
    }
}

/* ── Device metrics row ── */
.device-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .8rem;
    margin-bottom: 1.4rem;
}

.metric {
    background: rgba(0, 0, 0, .2);
    border-radius: 12px;
    padding: .9rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, .04);
}

.metric-val {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

.metric-lbl {
    font-size: .6rem;
    opacity: .45;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-top: .35rem;
}

/* ── Today punches ── */
.today-punches {
    background: rgba(0, 242, 254, .06);
    border: 1px solid rgba(0, 242, 254, .12);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
}

.punch-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.punch-label {
    font-size: .8rem;
    opacity: .6;
}

/* ── Card actions ── */
.card-actions {
    display: flex;
    gap: .8rem;
}

.card-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    opacity: .4;
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: 1fr 1fr;
    }

    .device-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }
}