/**
 * Tom's Java Jive - Admin Panel Styles
 */

:root {
    /* Admin Colors */
    --admin-sidebar-bg: #1F2937;
    --admin-sidebar-hover: #374151;
    --admin-sidebar-active: var(--color-primary);
    --admin-header-bg: #FFFFFF;
    --admin-content-bg: #F9FAFB;
    --admin-text-light: #9CA3AF;
}

/* ================================
   Admin Layout
   ================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

.admin-logo img {
    height: 32px;
}

.admin-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.admin-nav-section {
    margin-bottom: 1.5rem;
}

.admin-nav-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-light);
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.8);
    transition: all 0.2s ease;
}

.admin-nav-item:hover {
    background: var(--admin-sidebar-hover);
    color: white;
}

.admin-nav-item.active {
    background: var(--admin-sidebar-active);
    color: white;
}

.admin-nav-item i {
    width: 20px;
    text-align: center;
}

.admin-nav-badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-error);
    color: white;
    border-radius: 9999px;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    background: var(--admin-content-bg);
    min-height: 100vh;
}

.admin-header {
    background: var(--admin-header-bg);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    min-width: 300px;
}

.admin-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.admin-user:hover {
    background: var(--color-background);
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.admin-content {
    padding: 1.5rem;
}

/* ================================
   Admin Cards
   ================================ */
.admin-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.admin-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.admin-card-body {
    padding: 1.5rem;
}

/* ================================
   Stats Cards
   ================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card-icon.primary {
    background: rgba(232, 106, 51, 0.1);
    color: var(--color-primary);
}

.stat-card-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.stat-card-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.stat-card-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ================================
   Admin Tables
   ================================ */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.admin-table th {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    background: var(--color-background);
}

.admin-table tbody tr:hover {
    background: var(--color-background);
}

.admin-table td a {
    color: var(--color-primary);
    font-weight: 500;
}

/* ================================
   Page Header
   ================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    margin: 0;
}

/* ================================
   Form Improvements for Admin
   ================================ */
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.admin-form-grid .full-width {
    grid-column: 1 / -1;
}

/* ================================
   Responsive Admin
   ================================ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text);
}

@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .admin-search {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-form-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        display: block;
        overflow-x: auto;
    }
}

/* ================================
   POS Specific Styles
   ================================ */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    height: calc(100vh - 140px);
}

.pos-products {
    overflow-y: auto;
}

.pos-cart {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
}

.pos-cart-header {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.pos-cart-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.pos-cart-footer {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-background);
}

.pos-totals {
    margin-bottom: 1rem;
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.pos-total-row.grand-total {
    font-size: 1.25rem;
    font-weight: 700;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.pos-product-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pos-product-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.pos-product-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.pos-product-name {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.pos-product-price {
    font-size: 0.875rem;
    color: var(--color-primary);
    font-weight: 600;
}

/* Payment Buttons */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.payment-btn {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-btn:hover {
    border-color: var(--color-primary);
}

.payment-btn.selected {
    border-color: var(--color-primary);
    background: rgba(232, 106, 51, 0.05);
}

.payment-btn i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .pos-cart {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 50vh;
        transform: translateY(calc(100% - 60px));
        transition: transform 0.3s ease;
        z-index: 100;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .pos-cart.expanded {
        transform: translateY(0);
    }
}
