/* Clean & Professional POS System - Zircon Brass Edition */

:root {
    --primary: #1a3a52;
    --primary-light: #2d5a7b;
    --primary-dark: #0f1f2e;
    --accent: #d4af37;
    --accent-light: #e8c547;
    
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    
    --bg: #f8f9fa;
    --bg-white: #fff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #ecf0f1;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --shadow-xl: 0 16px 40px rgba(0,0,0,0.2);
    
    --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
}

/* ========== HEADER ========== */
.header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
}

.header > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.header img {
    height: 45px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    flex-shrink: 0;
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.header p {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.header-nav span {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.95;
    white-space: nowrap;
}

.header-nav a {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.header-nav a:hover {
    background: rgba(255,255,255,0.25);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    margin-bottom: 80px;
}

.container {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* ========== DASHBOARD GRID ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.stat-card .stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 8px 0;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-card.accent .stat-icon,
.stat-card.accent .stat-number {
    color: var(--accent);
}

.stat-card.success .stat-icon,
.stat-card.success .stat-number {
    color: var(--success);
}

.stat-card.danger .stat-icon,
.stat-card.danger .stat-number {
    color: var(--danger);
}

/* ========== QUICK ACTIONS ========== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.action-btn {
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    border-color: var(--accent);
    background: rgba(212, 175, 55, 0.03);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

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

.action-btn:hover i {
    color: var(--accent);
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.25rem;
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 12px;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--primary);
}

/* ========== BUTTONS ========== */
.btn {
    padding: 12px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

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

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary);
    border: 2px solid var(--primary);
}

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

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

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--primary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg-white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* ========== PRODUCT GRID ========== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.product-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-bottom: 3px solid var(--accent);
}

.product-image {
    width: 100%;
    height: 125px;
    background: linear-gradient(135deg, var(--bg) 0%, #f0f0f0 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary);
}

.product-image img{width:100%}

.product-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    color: var(--text);
}

.product-price {
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 700;
}

.product-stock {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ========== TABLES ========== */
table {
    width: 100%;
    border-collapse: collapse;
    /* margin-top: 16px; */
}

th {
    background: var(--primary);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover {
    background: rgba(212, 175, 55, 0.05);
}

/* ========== ALERTS ========== */
#alerts-container {
    position: fixed;
    /* top: 75px; */
    left: 15px;
    right: 15px;
    max-width: calc(100% - 30px);
    z-index: 150;
    max-height: 90vh;
    overflow-y: auto;
}

.alert {
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    /* display: flex; */
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    width: 100%;
    min-width: 0;
    background-clip: padding-box;
}

.alert-success .alert-close{float:right; font-size:25px; color:#a01212; background: #27ae60; border:none;}
.alert-close{float:right; font-size:25px; border:none;}

.alert > :first-child {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert strong {
    /* display: block; */
    margin-bottom: 4px;
    font-weight: 600;
}

.alert-success {
    background: var(--success);
    color: #fff;
    border-left-color: var(--success);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #a93226;
    border-left-color: var(--danger);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.15);
    color: #7d5f0e;
    border-left-color: var(--warning);
}

.alert-info {
    background: rgba(52, 152, 219, 0.15);
    color: #0b5394;
    border-left-color: var(--info);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 4px 8px;
    margin-left: auto;
    flex-shrink: 0;
    line-height: 1;
    /* display: flex; */
    align-items: center;
    justify-content: center;
    float:right;
}

.btn-close:hover {
    opacity: 1;
}

/* ========== MODALS ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay .modal {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: block;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 12px;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    margin: 20px 0;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.hidden {
    display: none !important;
}

.tab-content.active {
    display: block;
}

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-top: 3px solid var(--accent);
    display: flex;
    justify-content: space-around;
    z-index: 99;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    gap: 4px;
    transition: var(--transition);
}

.bottom-nav a:hover,
.bottom-nav a.active {
    color: var(--accent);
}

.bottom-nav i {
    font-size: 1.5rem;
}

/* ========== CART SUMMARY ========== */
.cart-summary {
    background: var(--bg-white);
    border: none;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
    position: sticky;
    top: 70px;
    z-index: 50;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--accent);
}

.cart-summary-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.cart-item-details {
    font-size: 0.85rem;
    color: var(--text-light);
}

.cart-item-total {
    text-align: right;
    font-weight: 700;
    color: var(--accent);
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 15px;
    padding: 5px 10px;
    margin-left: 10px;
    transition: var(--transition);
}

.cart-item-remove:hover {
    background: rgba(231, 76, 60, 0.1);
    transform: scale(1.2);
}

.cart-totals {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--border);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 500;
}

.cart-total-row.grand-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--accent);
}

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.p-3 { padding: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .header {
        gap: 8px;
    }

    .header > div:first-child {
        min-width: 150px;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    .header-nav {
        gap: 8px;
    }

    .header-nav span {
        font-size: 0.75rem;
    }

    .header-nav a {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .main-content {
        padding: 16px;
    }

    .container {
        padding: 16px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: 70px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px;
        gap: 6px;
    }

    .header img {
        height: 35px;
    }

    .header h1 {
        font-size: 0.95rem;
    }

    .header > div:first-child {
        min-width: 120px;
    }

    .header-nav {
        gap: 6px;
    }

    /* .header-nav span {
        display: none;
    } */

    .header-nav a {
        padding: 6px 8px;
        font-size: 0.7rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .action-btn {
        padding: 12px;
        font-size: 0.75rem;
    }

    .action-btn i {
        font-size: 1.5rem;
    }

    .modal-content {
        width: 95%;
        padding: 16px;
    }

    #alerts-container {
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
        top: 75px;
    }

    .alert {
        padding: 12px 14px;
        margin-bottom: 10px;
        font-size: 0.9rem;
        /* flex-direction: column; */
    }

    .alert strong {
        margin-bottom: 6px;
    }

    .btn-close {
        font-size: 1.2rem;
        margin-left: 0;
        margin-top: 6px;
        align-self: flex-end;
    }
}
/* ========== SELECT2 STYLING ========== */
.select2-container--default {
    width: inherit;
}

.select2-container--default .select2-selection--single {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 4px;
    height: 38px;
    padding: 0;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 58, 82, 0.1);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text);
    padding: 8px 12px;
    line-height: 22px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-light);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 28px;
    right: 4px;
    width: 20px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--primary) transparent transparent transparent;
    top: 65%;
}

.select2-container--default .select2-dropdown {
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    margin-top: -1px;
    z-index: 9999 !important;
    max-height: 400px !important;
    overflow: hidden;
    position: absolute !important;
    /* width: 100% !important; */
}

.select2-container--default .select2-dropdown.select2-dropdown--below {
    margin-top: -1px;
    border-radius: 0 0 4px 4px;
    top: 100% !important;
}

.select2-container--default .select2-dropdown.select2-dropdown--above {
    border-radius: 4px 4px 0 0;
    margin-top: 0;
    margin-bottom: -1px;
    bottom: 100% !important;
}

.select2-container--default .select2-results {
    max-height: 380px;
    overflow-y: auto;
}

.select2-container--default .select2-results > .select2-results__options {
    max-height: 380px;
}

.select2-container--default .select2-results__option {
    padding: 10px 12px;
    color: var(--text);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--primary);
    color: white;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background: var(--bg);
    color: var(--text);
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 12px;
    font-family: inherit;
    color: var(--text);
    font-size: 14px;
    width: 100% !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 58, 82, 0.1);
}

.select2-container--default .select2-selection--multiple {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 58, 82, 0.1);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--primary);
    border: none;
    border-radius: 3px;
    color: white;
    padding: 4px 8px;
    margin: 2px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white;
    margin-right: 4px;
    cursor: pointer;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #f0f0f0;
}

/* Mobile-friendly dropdown sizing */
@media (max-width: 768px) {
    .select2-container--default .select2-dropdown {
        max-height: 250px !important;
    }
    
    .select2-container--default .select2-results {
        max-height: 230px !important;
    }
    
    .select2-container--default .select2-results > .select2-results__options {
        max-height: 230px !important;
    }
}

.stockbox{ background: #f6f6f6; padding-top: 10px; text-align: center;}

