/* ========== Dashboard ========== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .dashboard-stats { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--accent);
    color: var(--text-on-accent);
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    z-index: 500;
}

.fab:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}

.fab:active {
    transform: translateY(0);
}

.fab svg {
    flex-shrink: 0;
}

/* ========== Sales / POS ========== */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - 108px);
}

.pos-products {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pos-product-search {
    margin-bottom: 16px;
}

.pos-product-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    align-content: start;
}

.pos-product-card {
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}

.pos-product-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.pos-product-card .product-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-product-card .product-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pos-product-card .product-price {
    font-weight: 700;
    color: var(--accent);
    font-size: 1rem;
    margin-top: 6px;
}

.pos-product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cart */
.pos-cart {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.pos-cart-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-price { font-size: 0.75rem; color: var(--text-secondary); }
.cart-item-total { font-weight: 700; font-size: 0.875rem; min-width: 60px; text-align: right; }

.cart-item-remove {
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.cart-item-remove:hover { color: var(--danger); background: var(--danger-light); }

.pos-cart-summary {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
}

.cart-summary-row.total {
    font-size: 1.15rem;
    font-weight: 800;
    padding: 8px 0 4px;
    border-top: 2px solid var(--border);
    margin-top: 4px;
}

.pos-cart-actions {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pos-cart-actions .btn { width: 100%; justify-content: center; }

@media (max-width: 900px) {
    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .pos-cart { max-height: 50vh; }
}

/* ========== Inventory ========== */
.inventory-table-wrap {
    overflow-x: auto;
}

/* ========== Customers ========== */
.customer-detail {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.customer-profile { padding: 20px; }
.customer-profile h2 { font-size: 1.25rem; margin-bottom: 4px; }
.customer-profile .contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.loyalty-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--warning-light);
    color: var(--warning);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 12px;
}

@media (max-width: 768px) {
    .customer-detail { grid-template-columns: 1fr; }
}

/* ========== Repairs ========== */
.repair-status-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.status-filter-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.status-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.status-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.repair-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.repair-timeline {
    padding: 0;
    list-style: none;
}

.timeline-item {
    position: relative;
    padding: 0 0 20px 28px;
    border-left: 2px solid var(--border);
}

.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -7px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
}

.timeline-item .timeline-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.timeline-item .timeline-status {
    font-weight: 600;
    font-size: 0.85rem;
}

.timeline-item .timeline-notes {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .repair-detail-grid { grid-template-columns: 1fr; }
}

/* ========== Settings ========== */
.settings-section {
    margin-bottom: 28px;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.theme-switch {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-switch-track {
    width: 48px;
    height: 26px;
    border-radius: 13px;
    background: var(--border);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.theme-switch-track.active { background: var(--accent); }

.theme-switch-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.theme-switch-track.active .theme-switch-thumb {
    transform: translateX(22px);
}
