/* =====================================================
   SEWU ALUMINIUM - Inventory Management System
   Custom Styles
   ===================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #1e293b;
    --light: #f8fafc;
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f1f5f9;
    color: #334155;
    min-height: 100vh;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header h3 i {
    color: var(--primary);
}

.sidebar-brand {
    display: inline-block;
    text-decoration: none;
}

.sidebar-brand img {
    height: 38px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}


.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    list-style: none;
}

.nav-header {
    padding: 1rem 1.25rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
}

.nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item .nav-link.active {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.user-info i {
    font-size: 1.25rem;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-navbar {
    height: var(--topbar-height);
    background: #fff;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

.page-content {
    padding: 1.5rem;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.stat-card.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-card .stat-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.2;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* =====================================================
   TABLES
   ===================================================== */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom-width: 1px;
    padding: 0.75rem;
}

.table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 0.5rem;
}

.input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   BADGE
   ===================================================== */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge-stock-low {
    background: #fef2f2;
    color: #dc2626;
}

.badge-stock-ok {
    background: #f0fdf4;
    color: #16a34a;
}

/* =====================================================
   POS SPECIFIC STYLES
   ===================================================== */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    height: calc(100vh - var(--topbar-height) - 3rem);
}

.pos-products {
    overflow-y: auto;
}

.pos-cart {
    display: flex;
    flex-direction: column;
}

.product-search-result {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.15s;
}

.product-search-result:hover {
    background: #f8fafc;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.cart-item .item-name {
    flex: 1;
}

.cart-item .item-qty {
    width: 60px;
    text-align: center;
}

.cart-summary {
    padding: 1rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.cart-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--primary);
}

.login-logo h2 {
    margin-top: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {

    .sidebar,
    .top-navbar,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* =====================================================
   UTILITIES
   ===================================================== */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}