@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    /* Brand Colors (Batik Alhazmi Theme) */
    --color-primary: #C5A880;
    --color-primary-dark: #8C6F4F;
    --color-primary-light: #E3D5C5;
    --color-espresso: #25160F;
    --color-charcoal: #1E1A17;
    --color-linen: #FAF6F0;
    --color-white: #FFFFFF;
    
    /* Semantic Colors */
    --color-success: #27AE60;
    --color-warning: #F39C12;
    --color-danger: #C0392B;
    --color-info: #2980B9;
    
    /* Layout Constants */
    --sidebar-width: 280px;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-sans: 'Outfit', sans-serif;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(37, 22, 15, 0.1), 0 10px 10px -5px rgba(37, 22, 15, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-linen);
    color: var(--color-charcoal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-espresso);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button, input, select, textarea {
    font-family: inherit;
    outline: none;
}

/* Layout Elements */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--color-espresso) 0%, #150B07 100%);
    color: var(--color-primary-light);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3.5rem;
}

.sidebar-logo img {
    height: 42px;
}

.sidebar-logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    font-size: 1rem;
    color: rgba(227, 213, 197, 0.7);
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: rgba(197, 168, 128, 0.15);
    color: var(--color-primary);
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.sidebar-footer {
    border-top: 1px solid rgba(197, 168, 128, 0.15);
    padding-top: 1.5rem;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: var(--color-espresso);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid var(--color-primary-light);
}

.user-profile-info {
    display: flex;
    flex-direction: column;
}

.user-profile-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-white);
}

.user-profile-role {
    font-size: 0.75rem;
    color: var(--color-primary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 2.5rem 3.5rem;
    background-color: var(--color-linen);
    min-height: 100vh;
}

/* Top Navbar Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 800;
}

.page-subtitle {
    font-size: 0.95rem;
    color: #7E7065;
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Auth Pages Styling */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, var(--color-espresso) 0%, #150B07 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Decorative Background element resembling batik pattern */
.auth-bg-overlay {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(197, 168, 128, 0.08) 0%, transparent 70%);
    top: -10%;
    left: -10%;
    z-index: 1;
    pointer-events: none;
}
.auth-bg-overlay-bottom {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(197, 168, 128, 0.06) 0%, transparent 70%);
    bottom: -20%;
    right: -20%;
    z-index: 1;
    pointer-events: none;
}

.auth-card {
    background: rgba(30, 26, 23, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(197, 168, 128, 0.25);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 3.5rem;
    z-index: 10;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    color: var(--color-primary-light);
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: rgba(227, 213, 197, 0.6);
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(197, 168, 128, 0.2);
    border-radius: var(--border-radius-md);
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    color: var(--color-white);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--color-primary);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(197, 168, 128, 0.15);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23C5A880'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 18px;
    padding-right: 3rem;
}

.form-control-light {
    background-color: var(--color-white);
    border: 1px solid #E3D5C5;
    color: var(--color-charcoal);
}
.form-control-light:focus {
    border-color: var(--color-primary-dark);
    box-shadow: 0 0 0 4px rgba(197, 168, 128, 0.1);
}

/* Interactive Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1.75rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-espresso);
}
.btn-primary:hover {
    background-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(197, 168, 128, 0.3);
}

.btn-espresso {
    background-color: var(--color-espresso);
    color: var(--color-primary-light);
}
.btn-espresso:hover {
    background-color: #372115;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 22, 15, 0.2);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}
.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-espresso);
}

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

.btn-success {
    background-color: var(--color-success);
    color: var(--color-white);
}
.btn-success:hover {
    background-color: #1e8449;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--border-radius-sm);
}

/* Dashboard Statistic Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 3.5rem;
}

.stat-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(197, 168, 128, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.stat-card::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 40px;
    background-color: var(--color-primary);
    left: 0;
    top: calc(50% - 20px);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.stat-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #7E7065;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--color-espresso);
    line-height: 1;
}

.stat-icon {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    opacity: 0.08;
    color: var(--color-espresso);
}

.stat-icon svg {
    width: 64px;
    height: 64px;
}

/* Dynamic Alert Messaging */
.alert {
    padding: 1.25rem 1.75rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(39, 174, 96, 0.08);
    border-color: rgba(39, 174, 96, 0.2);
    color: #1E8449;
}

.alert-danger {
    background-color: rgba(192, 57, 43, 0.08);
    border-color: rgba(192, 57, 43, 0.2);
    color: #943126;
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.08);
    border-color: rgba(243, 156, 18, 0.2);
    color: #B9770E;
}

/* Grid & Card Containers */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3.5rem;
}

.dashboard-row-equal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3.5rem;
}

.panel-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(197, 168, 128, 0.15);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #FAF6F0;
    padding-bottom: 1.25rem;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Polished Tables */
.table-container {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    font-weight: 700;
    font-size: 0.9rem;
    color: #7E7065;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid #FAF6F0;
}

.table td {
    padding: 1.25rem;
    border-bottom: 1px solid #FAF6F0;
    font-size: 0.95rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #FAF9F6;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background-color: rgba(243, 156, 18, 0.12);
    color: var(--color-warning);
}

.badge-processing {
    background-color: rgba(41, 128, 185, 0.12);
    color: var(--color-info);
}

.badge-completed {
    background-color: rgba(39, 174, 96, 0.12);
    color: var(--color-success);
}

.badge-cancelled {
    background-color: rgba(192, 57, 43, 0.12);
    color: var(--color-danger);
}

.badge-paid {
    background-color: rgba(39, 174, 96, 0.12);
    color: var(--color-success);
}

.badge-unpaid {
    background-color: rgba(192, 57, 43, 0.12);
    color: var(--color-danger);
}

.badge-stock-in {
    background-color: rgba(39, 174, 96, 0.12);
    color: var(--color-success);
}

.badge-stock-out {
    background-color: rgba(192, 57, 43, 0.12);
    color: var(--color-danger);
}

.badge-primary {
    background-color: rgba(197, 168, 128, 0.15);
    color: var(--color-primary-dark);
}

/* Product Storefront Catalog */
.storefront-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

.catalog-filters {
    background-color: var(--color-white);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(197, 168, 128, 0.15);
    margin-bottom: 2.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(197, 168, 128, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.product-card-img {
    height: 220px;
    background-color: #EAE6DF;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-img svg {
    width: 80px;
    height: 80px;
    color: rgba(37, 22, 15, 0.15);
}

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.product-card-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.product-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: var(--color-espresso);
}

.product-card-desc {
    font-size: 0.85rem;
    color: #7E7065;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.product-card-footer {
    margin-top: auto;
    border-top: 1px solid #FAF6F0;
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card-prices {
    display: flex;
    flex-direction: column;
}

.price-retail {
    font-size: 0.75rem;
    text-decoration: line-through;
    color: #9D8E81;
}

.price-partner {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-espresso);
}

/* Sidebar Cart Panel */
.cart-sidebar {
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(197, 168, 128, 0.15);
    padding: 2rem;
    position: sticky;
    top: 2.5rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 5rem);
}

.cart-title {
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #FAF6F0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.cart-items {
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.cart-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    border-bottom: 1px dashed #FAF6F0;
    padding-bottom: 1rem;
}

.cart-item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-espresso);
    line-height: 1.3;
}

.cart-item-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-top: 0.25rem;
}

.cart-item-qty-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cart-item-qty-input {
    width: 50px;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid #E3D5C5;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.cart-summary {
    border-top: 1px solid #FAF6F0;
    padding-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-espresso);
}

/* Shipping Invoice Printable Layout */
.invoice {
    background-color: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(197, 168, 128, 0.15);
    padding: 4rem;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid var(--color-primary-light);
    padding-bottom: 2rem;
    margin-bottom: 3rem;
}

.invoice-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-espresso);
}

.invoice-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.invoice-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.invoice-col-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #9D8E81;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #FAF6F0;
    padding-bottom: 0.5rem;
}

.invoice-col-content {
    font-size: 1rem;
    line-height: 1.6;
}

/* Dropship label styling */
.dropship-label-box {
    background: linear-gradient(135deg, #FFFDF9 0%, #FAF5ED 100%);
    border: 2px dashed var(--color-primary);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    margin-bottom: 4rem;
    position: relative;
}

.dropship-label-badge {
    position: absolute;
    top: -12px;
    left: 2rem;
    background-color: var(--color-primary);
    color: var(--color-espresso);
    padding: 0.25rem 1rem;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 50px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Utility classes */
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }

.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
        padding: 2rem 0.5rem;
        align-items: center;
    }
    .sidebar-logo-text, .user-profile-info {
        display: none;
    }
    .sidebar-logo {
        justify-content: center;
        margin-bottom: 2.5rem;
    }
    .sidebar-link {
        justify-content: center;
        padding: 1rem;
    }
    .sidebar-link span {
        display: none;
    }
    .main-content {
        margin-left: 70px;
        padding: 2rem;
    }
    .dashboard-row {
        grid-template-columns: 1fr;
    }
    .storefront-layout {
        grid-template-columns: 1fr;
    }
    .cart-sidebar {
        position: static;
        max-height: none;
    }
}
