/*
 * SW4U Business Manager - Custom Overrides for Velzon
 * Brand color: Professional blue #2c5aa0
 * Font: Inter (override Velzon default)
 */

/* ============================================================
   Font Override - Inter
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body, .navbar-menu, .topbar {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* ============================================================
   SW4U Brand Colors
   ============================================================ */
:root {
    --sw4u-primary: #2c5aa0;
    --sw4u-primary-rgb: 44, 90, 160;
    --sw4u-primary-dark: #1e3f73;
    --sw4u-primary-light: #4a7bc5;
    --sw4u-accent: #e8a838;
    --sw4u-success: #0ab39c;
    --sw4u-sidebar-bg: #1a2332;
    --sw4u-sidebar-hover: #243447;
}

/* ============================================================
   Sidebar Customization
   ============================================================ */
.navbar-menu {
    background: var(--sw4u-sidebar-bg) !important;
}

.navbar-menu .navbar-nav .nav-link.active,
.navbar-menu .navbar-nav .nav-link:hover {
    color: #fff !important;
    background: var(--sw4u-sidebar-hover) !important;
}

/* Make logo white on dark backgrounds (sidebar + auth) */
.navbar-brand-box img,
.sw4u-auth-logo {
    filter: invert(1) hue-rotate(180deg);
}

/* ============================================================
   Phase badges (greyed-out nav items)
   ============================================================ */
.nav-link.phase-locked {
    opacity: 0.35 !important;
    pointer-events: none !important;
    cursor: default;
}

.nav-link .phase-badge {
    font-size: 0.6rem;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    font-weight: 500;
}

/* ============================================================
   Cards & Components
   ============================================================ */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* ============================================================
   Tables
   ============================================================ */
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #878a99;
}

.table td {
    vertical-align: middle;
}

.table .action-btns .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* ============================================================
   Stock Badges
   ============================================================ */
.badge-stock-in { background: rgba(10, 179, 156, 0.15); color: #0ab39c; }
.badge-stock-low { background: rgba(247, 184, 75, 0.15); color: #f7b84b; }
.badge-stock-out { background: rgba(240, 101, 72, 0.15); color: #f06548; }

/* ============================================================
   Auth Pages - Dark Theme
   ============================================================ */
.sw4u-auth-dark {
    background: #000 !important;
    min-height: 100vh;
    padding-top: 0 !important;
}

.sw4u-auth-dark .auth-page-content {
    padding-top: 3rem;
}

.sw4u-auth-logo {
    max-width: 280px;
    height: auto;
}

.sw4u-login-card {
    background: #111 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.sw4u-dark-input {
    background: #1a1a1a !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

.sw4u-dark-input::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

.sw4u-dark-input:focus {
    background: #1a1a1a !important;
    border-color: var(--sw4u-accent) !important;
    box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.15) !important;
    color: #fff !important;
}

.btn-sw4u-login {
    background: var(--sw4u-accent) !important;
    border-color: var(--sw4u-accent) !important;
    color: #000 !important;
    font-weight: 600;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
}

.btn-sw4u-login:hover {
    background: #d4952e !important;
    border-color: #d4952e !important;
    color: #000 !important;
}

.sw4u-auth-dark .footer {
    background: transparent !important;
    border-top: none !important;
}

.sw4u-auth-dark .form-check-input {
    background-color: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.12);
}

.sw4u-auth-dark .form-check-input:checked {
    background-color: var(--sw4u-accent);
    border-color: var(--sw4u-accent);
}

/* ============================================================
   Buttons - SW4U Primary
   ============================================================ */
.btn-sw4u {
    background: var(--sw4u-primary);
    border-color: var(--sw4u-primary);
    color: #fff;
}

.btn-sw4u:hover {
    background: var(--sw4u-primary-dark);
    border-color: var(--sw4u-primary-dark);
    color: #fff;
}

/* ============================================================
   Page Title
   ============================================================ */
.page-title-box {
    padding-bottom: 15px;
}

.page-title-box h4 {
    font-weight: 600;
    font-size: 1.1rem;
}

/* ============================================================
   Flash Messages
   ============================================================ */
.flash-alert {
    animation: slideInDown 0.3s ease-out;
}

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

/* ============================================================
   Barcode Label Print Styles
   ============================================================ */
@media print {
    .no-print, .topbar, .navbar-menu, .footer, .page-title-box, .flash-alert {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .barcode-label {
        width: 70mm;
        height: 40mm;
        padding: 3mm;
        border: 1px dashed #ccc;
        page-break-inside: avoid;
        text-align: center;
    }

    .barcode-label .product-name {
        font-size: 9pt;
        font-weight: 600;
        margin-bottom: 2mm;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .barcode-label img {
        max-width: 58mm;
        height: auto;
    }

    .barcode-label .barcode-text {
        font-size: 8pt;
        font-family: monospace;
        margin-top: 1mm;
    }

    .barcode-label .sku-text {
        font-size: 7pt;
        color: #666;
    }
}

/* ============================================================
   Responsive Tweaks
   ============================================================ */
@media (max-width: 768px) {
    .page-title-box {
        padding-bottom: 10px;
    }

    .table-responsive {
        font-size: 0.85rem;
    }
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #878a99;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ============================================================
   Footer Heart Animation
   ============================================================ */
.footer-heart {
    display: inline-block;
    color: #e74c3c;
    font-size: 1.1em;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    10% { transform: scale(1.2); }
    20% { transform: scale(1); }
    30% { transform: scale(1.2); }
    40% { transform: scale(1); }
    100% { transform: scale(1); }
}

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

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

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

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