/* Admin Panel - Modern Sidebar Layout */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d21;
    --sidebar-hover: #2d3138;
    --sidebar-active: #3b82f6;
    --content-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--content-bg);
    margin: 0;
    padding: 0;
}

/* Admin Wrapper */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-size: 0.925rem;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 16px 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-light);
    overflow: hidden;
}

.sidebar-footer .user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

.logout-btn {
    color: var(--text-light);
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

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

.stat-card .stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-card .stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-card .stat-icon.purple { background: #f3e8ff; color: #9333ea; }
.stat-card .stat-icon.orange { background: #ffedd5; color: #ea580c; }

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

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

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    padding: 12px 16px;
}

.table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: #f1f5f9;
}

.table-responsive {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--sidebar-active);
    border-color: var(--sidebar-active);
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Alerts */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 14px 18px;
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    gap: 4px;
}

.page-link {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
}

.page-item.active .page-link {
    background: var(--sidebar-active);
    border-color: var(--sidebar-active);
}

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

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
}

/* Links */
.product-redirect {
    color: var(--sidebar-active);
    text-decoration: none;
    font-weight: 500;
}

.product-redirect:hover {
    text-decoration: underline;
}

/* Image placeholders */
.image-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background: var(--content-bg);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-placeholder:hover {
    border-color: var(--sidebar-active);
    background: #f1f5f9;
}

/* Receipt Info */
.receipt-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.receipt-info .info-row:last-child {
    border-bottom: none;
}

.receipt-info .info-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.receipt-info .info-value {
    font-weight: 500;
    text-align: right;
}

.shop-detail-logo {
    max-width: 150px;
    max-height: 80px;
    object-fit: contain;
}

.shop-logo-placeholder-lg {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    font-size: 2rem;
    margin: 0 auto;
}

.receipt-image {
    max-width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* OCR Data */
.ocr-data-grid {
    max-height: 400px;
    overflow-y: auto;
}

.ocr-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.ocr-row:last-child {
    border-bottom: none;
}

.ocr-product {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 16px;
}

.ocr-price {
    font-weight: 500;
    color: var(--text-primary);
}

/* Shop Logo */
.shop-logo {
    height: 60px;
    display: flex;
    align-items: center;
}

.shop-logo-img {
    max-width: 120px;
    max-height: 60px;
    object-fit: contain;
}

.shop-logo-placeholder {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-header span,
    .nav-item span,
    .sidebar-footer .user-info span {
        display: none;
    }

    .sidebar-header {
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .main-content {
        margin-left: 70px;
        padding: 20px;
    }
}
