
:root {
    --primary-blue: #2563eb;
    --secondary-blue: #3b82f6;
    --light-blue: #f1f5f9;
    --accent-blue: #1d4ed8;
    --dark-blue: #1e40af;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.navbar {
    background: var(--white) !important;
    border: none;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--primary-blue) !important;
    letter-spacing: -0.025em;
}

.navbar-brand i {
    color: var(--primary-blue);
    margin-right: 0.5rem;
}

.btn-outline-light {
    border: 1px solid var(--primary-blue);
    font-weight: 500;
    background: transparent;
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-outline-light:hover {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    background: var(--white);
    padding: 0 1rem;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 1rem 1.5rem;
    margin-right: 0;
    background: transparent;
    position: relative;
    font-size: 0.875rem;
}

.nav-tabs .nav-link:hover {
    background: var(--gray-50);
    color: var(--primary-blue);
    border: none;
}

.nav-tabs .nav-link.active {
    background: transparent;
    color: var(--primary-blue);
    border: none;
    font-weight: 600;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-blue);
}

.tab-content {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 2rem;
    min-height: 70vh;
}

h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    letter-spacing: -0.025em;
}

.btn {
    border: 1px solid;
    font-weight: 500;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.btn-primary:hover {
    background: var(--dark-blue);
    color: var(--white);
    border-color: var(--dark-blue);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.btn-success:hover {
    background: #059669;
    color: var(--white);
    border-color: #059669;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
    border-color: var(--warning);
}

.btn-warning:hover {
    background: #d97706;
    color: var(--white);
    border-color: #d97706;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
    color: var(--white);
    border-color: #dc2626;
}

.btn-secondary {
    background: var(--gray-100);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--text-primary);
    border-color: var(--gray-300);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--white);
}

.table {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.875rem;
}

.table-dark {
    background: var(--primary-blue);
    color: var(--white);
}

.table-dark th {
    border: none;
    font-weight: 600;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td,
.table th {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: var(--gray-50);
}

.table td:first-child,
.table th:first-child {
    text-align: left;
}

.table td:not(:first-child),
.table th:not(:first-child) {
    text-align: center;
}

.card {
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.card-body {
    padding: 1.5rem;
}

.form-control {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    background: var(--white);
    color: var(--text-primary);
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-select {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    background: var(--white);
    color: var(--text-primary);
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.modal-content {
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--gray-50);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px 12px 0 0;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.025em;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
    border-radius: 0 0 12px 12px;
}

.btn-close {
    background: var(--white);
    border: 1px solid var(--border-color);
    opacity: 1;
    border-radius: 4px;
    padding: 0.5rem;
    filter: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m8.746 8 3.1-3.1a.527.527 0 1 0-.746-.746L8 7.254l-3.1-3.1a.527.527 0 1 0-.746.746L7.254 8l-3.1 3.1a.527.527 0 1 0 .746.746L8 8.746l3.1 3.1a.527.527 0 1 0 .746-.746L8.746 8z'/%3e%3c/svg%3e");
}

.btn-close:hover {
    background: var(--gray-100);
    opacity: 1;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333'%3e%3cpath d='m8.746 8 3.1-3.1a.527.527 0 1 0-.746-.746L8 7.254l-3.1-3.1a.527.527 0 1 0-.746.746L7.254 8l-3.1 3.1a.527.527 0 1 0 .746.746L8 8.746l3.1 3.1a.527.527 0 1 0 .746-.746L8.746 8z'/%3e%3c/svg%3e");
}

.btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m8.746 8 3.1-3.1a.527.527 0 1 0-.746-.746L8 7.254l-3.1-3.1a.527.527 0 1 0-.746.746L7.254 8l-3.1 3.1a.527.527 0 1 0 .746.746L8 8.746l3.1 3.1a.527.527 0 1 0 .746-.746L8.746 8z'/%3e%3c/svg%3e");
}

.current-image-preview {
    max-width: 100%;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    object-fit: contain;
    background: var(--gray-50);
}

#current-image {
    max-width: 100%;
}

#current-image img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    object-fit: contain;
    background: var(--gray-50);
}

.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    border-radius: 4px;
}

.badge.bg-success {
    background: var(--success) !important;
    color: var(--white) !important;
}

.badge.bg-warning {
    background: var(--warning) !important;
    color: var(--white) !important;
}

.badge.bg-danger {
    background: var(--danger) !important;
    color: var(--white) !important;
}

.sale-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sale-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-blue);
}

.sale-total {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--success);
}

.sale-date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.internal-cart-item {
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px;
}

.stock-status {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.stock-ok {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stock-low {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stock-out {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stock-adjustment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-input {
    width: 80px;
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    text-align: center;
    background: var(--white);
    font-size: 0.875rem;
    border-radius: 4px;
}

.stock-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    outline: none;
}

.stock-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.alert-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-primary);
    font-weight: 500;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    width: 100%;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    opacity: 0.6;
    display: block;
}

.empty-state p {
    margin: 0;
    font-weight: 500;
}

.search-container-admin {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    overflow: visible;
}

.search-bar-admin {
    position: relative;
    width: 100%;
    max-width: 400px;
    overflow: visible;
}

.search-bar-admin i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
    font-size: 0.875rem;
}

.search-input-admin {
    padding-left: 2.25rem !important;
    padding-right: 3rem !important;
    border: 1px solid var(--border-color) !important;
    background: var(--white) !important;
    color: var(--text-primary) !important;
    font-size: 0.875rem !important;
    border-radius: 6px !important;
}

.search-input-admin:focus {
    border-color: var(--primary-blue) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.search-clear-admin {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    z-index: 3;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear-admin:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.product-search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.product-search-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.product-search-item:last-child {
    border-bottom: none;
}

.product-search-item:hover {
    background: var(--gray-50);
}

.product-search-item-info {
    flex: 1;
}

.product-search-item-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.product-search-item-details {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.product-search-item-stock {
    font-size: 0.75rem;
    font-weight: 500;
}

.product-search-item-stock.in-stock {
    color: var(--success);
}

.product-search-item-stock.low-stock {
    color: var(--warning);
}

.product-search-item-stock.out-of-stock {
    color: var(--danger);
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cursor-pointer {
    cursor: pointer;
}

@media (max-width: 768px) {
    .tab-content {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .table {
        font-size: 0.75rem;
    }

    .table td,
    .table th {
        padding: 0.5rem;
    }
}

@media (max-width: 576px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .tab-content {
        padding: 0.75rem;
    }

    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }
}

.products-table .product-image-col {
    display: none;
}