/* HJ Mobile ERP Custom Styles */

:root {
    --sidebar-width: 250px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f9;
}

.content-wrapper {
    background-color: #f4f6f9;
}

.main-header .navbar-nav .nav-item .nav-link {
    color: #6c757d;
}

.card {
    border-radius: 0.5rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    margin-bottom: 1rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,.125);
    padding: 0.75rem 1.25rem;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-top: none;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
}

.btn {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

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

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.form-control:focus,
.select2-container--bootstrap-5 .select2-selection:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.stat-card {
    border-left: 4px solid;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-primary { border-left-color: #007bff; }
.stat-card-success { border-left-color: #28a745; }
.stat-card-warning { border-left-color: #ffc107; }
.stat-card-danger { border-left-color: #dc3545; }
.stat-card-info { border-left-color: #17a2b8; }

/* POS Styles */
.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
}

.pos-product-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pos-product-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.pos-product-card .product-name {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 5px 0;
}

.pos-product-card .product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #28a745;
}

.pos-cart-table {
    max-height: 350px;
    overflow-y: auto;
}

.pos-cart-table table {
    margin-bottom: 0;
}

.pos-total-bar {
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
    padding: 15px;
}

.pos-total-bar .total-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.pos-total-bar .total-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.pos-total-bar .grand-total {
    font-size: 1.5rem;
    font-weight: 800;
    color: #28a745;
}

/* Invoice Print Styles */
@media print {
    .main-header, .main-sidebar, .main-footer, .content-header,
    .btn, .no-print { display: none !important; }
    .content-wrapper { margin-left: 0 !important; }
    .card { box-shadow: none !important; border: none !important; }
    body { font-size: 12px; }
    .invoice-table td, .invoice-table th { padding: 5px; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Select2 inside modals */
.modal .select2-container--bootstrap-5 {
    z-index: 9999;
}
.modal .select2-container--bootstrap-5 .select2-dropdown {
    z-index: 10000;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.spinner-overlay.active {
    display: flex;
}

/* Two-column form layout */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.form-row > .form-group {
    flex: 1;
    min-width: 200px;
}

/* DataTables adjustments */
.dt-container .dt-paging .paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

.dt-buttons .btn {
    margin-right: 5px;
}

/* Sidebar scroll */
.app-sidebar {
    display: flex;
    flex-direction: column;
}
.app-sidebar .sidebar-brand {
    flex-shrink: 0;
}
.app-sidebar .sidebar-wrapper {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}

/* Fixed header/footer - main content scrolls */
.layout-navbar-fixed .app-wrapper {
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    overflow: hidden;
}
.layout-navbar-fixed .app-main {
    overflow-y: auto;
    min-height: 0;
}

/* Mini sidebar: hide all nav-link text, show only icon */
.sidebar-mini.sidebar-collapse .app-sidebar .nav-link p {
    display: none;
}
.sidebar-mini .app-sidebar:hover .nav-link p {
    display: inline;
}
