/* =========================================
   POS System - Custom Blue & White Theme
   Loaded after bootstrap.min.css
   ========================================= */

:root {
    --brand-blue: #0b5ed7;
    --brand-blue-dark: #0842a0;
    --brand-blue-light: #eaf2ff;
    --brand-white: #ffffff;
}
@font-face {
    font-family: 'DM Sans';
    src: url('./DM.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
body {
    background-color: var(--brand-white);
       font-family: 'DM Sans';
    min-height: 100vh;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background-color: var(--brand-white);
    border: 1px solid #d9e6fb;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(11, 94, 215, 0.12);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.auth-card-header {
    background-color: var(--brand-blue);
    color: var(--brand-white);
    text-align: center;
    padding: 28px 24px 22px;
}

.auth-card-header .brand-icon {
    width: 52px;
    height: 52px;
    background-color: var(--brand-white);
    color: var(--brand-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
    font-weight: 700;
}

.auth-card-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-card-header p {
    font-size: 0.88rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.auth-card-body {
    padding: 30px 32px 32px;
}

.form-label {
    color: var(--brand-blue);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    border: 1.5px solid #bcd3f7;
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--brand-blue-dark);
    font-size: 0.95rem;
}

.form-control::placeholder {
    color: #9db9e8;
}

.form-control:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 0.2rem rgba(11, 94, 215, 0.15);
    color: var(--brand-blue-dark);
}

.input-group-text {
    background-color: var(--brand-blue-light);
    border: 1.5px solid #bcd3f7;
    color: var(--brand-blue);
}

.btn-brand {
    background-color: var(--brand-blue);
    border: none;
    color: var(--brand-white);
    font-weight: 600;
    padding: 11px;
    border-radius: 8px;
    width: 100%;
    transition: background-color 0.15s ease-in-out;
}

.btn-brand:hover,
.btn-brand:focus {
    background-color: var(--brand-blue-dark);
    color: var(--brand-white);
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #4a5568;
}

.auth-switch a {
    color: var(--brand-blue);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover {
    color: var(--brand-blue-dark);
    text-decoration: underline;
}

.alert-brand-danger {
    background-color: var(--brand-blue-light);
    border: 1px solid var(--brand-blue);
    color: var(--brand-blue-dark);
    border-radius: 8px;
    font-size: 0.88rem;
}

.alert-brand-success {
    background-color: #e6f7ec;
    border: 1px solid #28a745;
    color: #1e7e34;
    border-radius: 8px;
    font-size: 0.88rem;
}

.password-toggle {
    cursor: pointer;
    background-color: var(--brand-blue-light);
    border: 1.5px solid #bcd3f7;
    border-left: none;
    color: var(--brand-blue);
}

.password-toggle:hover {
    background-color: #d9e6fb;
}

/* =========================================
   Dashboard Layout (sidebar + topbar)
   ========================================= */

.app-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: #f4f8ff;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background-color: var(--brand-blue);
    color: var(--brand-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform 0.2s ease-in-out;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    font-weight: 700;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-icon-sm {
    width: 34px;
    height: 34px;
    background-color: var(--brand-white);
    color: var(--brand-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background-color 0.15s ease-in-out;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--brand-white);
}

.sidebar-nav a.active {
    background-color: var(--brand-white);
    color: var(--brand-blue);
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.logout-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.logout-link:hover {
    color: var(--brand-white);
}

.main-content {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background-color: var(--brand-white);
    border-bottom: 1px solid #e2ecfc;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-blue-dark);
    margin: 0;
    flex: 1;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--brand-blue);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--brand-blue-light);
    color: var(--brand-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-name {
    color: var(--brand-blue-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.page-content {
    padding: 26px 28px 40px;
}

/* Cards used on dashboard / forms */
.panel {
    background-color: var(--brand-white);
    border: 1px solid #e2ecfc;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(11, 94, 215, 0.06);
    padding: 22px 24px;
    margin-bottom: 24px;
}

.panel-title {
    color: var(--brand-blue-dark);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 18px;
}

.stat-card {
    background-color: var(--brand-white);
    border: 1px solid #e2ecfc;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 14px rgba(11, 94, 215, 0.06);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background-color: var(--brand-blue-light);
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-blue-dark);
}

.stat-label {
    font-size: 0.82rem;
    color: #6b7a99;
}

/* Tables */
.table-brand thead {
    background-color: var(--brand-blue-light);
}

.table-brand thead th {
    color: var(--brand-blue-dark);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: none;
    white-space: nowrap;
}

.table-brand td {
    vertical-align: middle;
    font-size: 0.9rem;
    color: #33415c;
}

.badge-low-stock {
    background-color: #ffe8e8;
    color: #d92c2c;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge-in-stock {
    background-color: #e6f7ec;
    color: #1e7e34;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge-active {
    background-color: #e6f7ec;
    color: #1e7e34;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge-inactive {
    background-color: #f1f3f5;
    color: #6c757d;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.action-btn {
    border: none;
    background: none;
    padding: 4px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
}

.action-btn.edit {
    color: var(--brand-blue);
}

.action-btn.edit:hover {
    background-color: var(--brand-blue-light);
}

.action-btn.delete {
    color: #d92c2c;
}

.action-btn.delete:hover {
    background-color: #ffe8e8;
}

@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .app-wrapper.sidebar-open .sidebar {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

/* =========================================
   Record Sale (POS) page
   ========================================= */

.pos-search {
    margin-bottom: 16px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

.product-card {
    background-color: var(--brand-white);
    border: 1.5px solid #e2ecfc;
    border-radius: 10px;
    padding: 14px 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.12s ease-in-out, box-shadow 0.12s ease-in-out;
}

.product-card:hover {
    border-color: var(--brand-blue);
    box-shadow: 0 4px 12px rgba(11, 94, 215, 0.12);
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-card .p-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--brand-blue-dark);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .p-price {
    font-weight: 700;
    color: var(--brand-blue);
    font-size: 0.95rem;
}

.product-card .p-stock {
    font-size: 0.74rem;
    color: #8493ab;
    margin-top: 2px;
}

.cart-panel {
    position: sticky;
    top: 20px;
}

.cart-empty {
    text-align: center;
    color: #8493ab;
    padding: 30px 10px;
    font-size: 0.9rem;
}

.cart-qty-input {
    width: 64px;
    padding: 4px 6px;
    border: 1.5px solid #bcd3f7;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
}

.cart-remove {
    background: none;
    border: none;
    color: #d92c2c;
    font-weight: 700;
    font-size: 0.95rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 4px;
    border-top: 2px solid var(--brand-blue-light);
    margin-top: 10px;
}

.cart-total-label {
    font-weight: 700;
    color: var(--brand-blue-dark);
    font-size: 1rem;
}

.cart-total-value {
    font-weight: 800;
    color: var(--brand-blue);
    font-size: 1.3rem;
}

.payment-method-option {
    border: 1.5px solid #bcd3f7;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-blue-dark);
    text-align: center;
    flex: 1;
}

.payment-method-option input {
    display: none;
}

.payment-method-option.selected {
    background-color: var(--brand-blue);
    color: var(--brand-white);
    border-color: var(--brand-blue);
}

.payment-line {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.payment-balance {
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-top: 8px;
}

.payment-balance.ok {
    background-color: #e6f7ec;
    color: #1e7e34;
}

.payment-balance.pending {
    background-color: #fff4e5;
    color: #b35c00;
}

/* Receipt (print) */
.receipt-box {
    max-width: 380px;
    margin: 0 auto;
    background-color: var(--brand-white);
    border: 1px dashed #bcd3f7;
    border-radius: 10px;
    padding: 24px 22px;
    font-size: 0.88rem;
    color: #33415c;
}

.receipt-box h3 {
    text-align: center;
    color: var(--brand-blue);
    font-weight: 800;
    margin-bottom: 2px;
}

.receipt-box .receipt-sub {
    text-align: center;
    color: #8493ab;
    font-size: 0.78rem;
    margin-bottom: 16px;
}

.receipt-box table {
    width: 100%;
    font-size: 0.84rem;
    margin-bottom: 10px;
}

.receipt-box hr {
    border-top: 1px dashed #bcd3f7;
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 1rem;
    color: var(--brand-blue-dark);
}

@media print {
    .no-print { display: none !important; }
    .sidebar, .topbar { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
}
