/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Montserrat:wght@700&display=swap');

/* === CSS VARIABLES === */
:root {
    --header-height: 5rem;

    /* Colors */
    --primary-color: #0052D4;
    --primary-color-dark: #003a9a;
    --secondary-color: #65C7F7;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --text-color: #495057;
    --text-color-light: #6c757d;
    --body-color: #f0f2f5;
    --container-color: #ffffff;
    --border-color: #dee2e6;

    /* Typography */
    --body-font: 'Poppins', sans-serif;
    --heading-font: 'Montserrat', sans-serif;
    --h1-font-size: 3rem;
    --h2-font-size: 2.25rem;
    --h3-font-size: 1.75rem;
    --normal-font-size: 1rem;
    --small-font-size: 0.9rem;
    --smaller-font-size: 0.8rem;

    /* Font weight */
    --font-regular: 400;
    --font-medium: 500;
    --font-semi-bold: 600;
    --font-bold: 700;

    /* Margins */
    --mb-0-25: .25rem;
    --mb-0-5: .5rem;
    --mb-0-75: .75rem;
    --mb-1: 1rem;
    --mb-1-5: 1.5rem;
    --mb-2: 2rem;
    --mb-2-5: 2.5rem;
    --mb-3: 3rem;


    /* z-index */
    --z-tooltip: 10;
    --z-fixed: 100;

    /* Box shadow */
    --box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

html {
    scroll-behavior: smooth;
}

body, button, input, textarea {
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
}

body {
    background-color: var(--body-color);
    color: var(--text-color);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    color: var(--dark-color);
    font-weight: var(--font-bold);
    margin-bottom: var(--mb-1);
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* === REUSABLE CSS CLASSES === */
.container {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.5rem;
}

.section {
    padding: 6rem 0 2rem;
}

.section-title {
    font-size: var(--h2-font-size);
    text-align: center;
    margin-bottom: var(--mb-3);
    position: relative;
    padding-bottom: var(--mb-1);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}


/* === HEADER === */
header {
    width: 100%;
    background-color: transparent;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-fixed);
    transition: background-color .4s, box-shadow .4s;
}

header.scrolled {
    background-color: var(--container-color);
    box-shadow: var(--box-shadow);
}

header .container {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    transition: color .3s;
}

.site-logo {
    height: 50px;
    vertical-align: middle;
}

.main-header nav ul {
    display: flex;
    align-items: center;
    gap: var(--mb-2-5);
}

.main-header nav a {
    color: var(--dark-color);
    font-weight: var(--font-medium);
    transition: color .3s;
    position: relative;
    padding-bottom: .5rem;
}

.main-header nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-header nav a:hover::after, .main-header nav a.active::after {
    width: 100%;
}


.cart-icon {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--danger-color);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--smaller-font-size);
    font-weight: var(--font-bold);
    border: 2px solid var(--container-color);
}


/* === HERO === */
.hero {
    background: linear-gradient(to right, #0052D4, #4364F7, #65C7F7);
    padding: 8rem 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    border-bottom-left-radius: 50% 20%;
    border-bottom-right-radius: 50% 20%;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: var(--mb-1-5);
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: var(--mb-2-5);
    opacity: 0.9;
}

/* === BUTTONS === */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--container-color);
    padding: 0.9rem 2rem;
    border-radius: 50px;
    font-weight: var(--font-semi-bold);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all .3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--container-color);
}

/* Product card specific button sizes */
.product-card .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}


/* === PRODUCT CARD === */
.products-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.product-card {
    background-color: var(--container-color);
    border-radius: 1rem;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform .3s, box-shadow .3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.15);
}

.product-image {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: var(--mb-0-5);
}

.product-price {
    font-size: 2rem;
    font-weight: var(--font-bold);
    color: var(--primary-color);
    margin-bottom: var(--mb-1-5);
    margin-top: auto;
}


/* === FORMS === */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    height: 45px;
    border: 1px solid var(--border-color);
    border-radius: .5rem;
    background-color: var(--light-color);
    font-size: var(--normal-font-size);
    transition: border-color .3s, box-shadow .3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px hsla(214, 100%, 50%, .1);
}

/* === FOOTER === */
footer {
    background-color: #1a202c;
    color: var(--text-color-light);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    color: var(--container-color);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.footer-bottom {
    border-top: 1px solid #3a3f4b;
    padding-top: 2rem;
    text-align: center;
}

/* === FEATURES SECTION === */
.features {
    padding: 4rem 0;
}

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

.feature {
    background: var(--container-color);
    border-radius: 1rem;
    box-shadow: var(--box-shadow);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.15);
}

.feature-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1.5rem;
}

.feature h3 {
    font-size: 1.5rem;
    margin-bottom: var(--mb-1);
}

.feature p {
    font-size: var(--normal-font-size);
    color: var(--text-color-light);
}

/* Add other specific styles or adjustments as needed */

.action-card h3 {
    margin-bottom: 1rem;
}

.action-card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}




/* Product Analysis Page */
.analysis-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.analysis-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.analysis-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}
.analysis-content {
    line-height: 1.6;
}

/* === AUTH PAGES === */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

body.auth-page {
    background-image: linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%);
}

.auth-container {
    max-width: 420px;
    width: 100%;
    padding: 3rem;
    background-color: var(--container-color);
    border-radius: 1.5rem;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2.25rem;
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-color);
}

.auth-container .form-group {
    margin-bottom: 1.75rem;
    position: relative;
}

.auth-container .form-group label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--text-color-light);
    font-size: var(--normal-font-size);
    padding: 0 .5rem;
    margin: 0;
    background-color: var(--container-color);
    transition: all .2s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

.auth-container .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    height: 45px;
    border: 1px solid var(--border-color);
    border-radius: .5rem;
    background-color: var(--container-color);
    font-size: var(--normal-font-size);
    transition: border-color .3s, box-shadow .3s;
    position: relative;
    z-index: 2;
}

.auth-container .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px hsla(214, 100%, 50%, .1);
}

.auth-container .form-control:focus + label,
.auth-container .form-control:not(:placeholder-shown) + label {
    top: 0;
    left: .75rem;
    font-size: var(--small-font-size);
    color: var(--primary-color);
    font-weight: var(--font-medium);
}


.auth-container .btn {
    width: 100%;
    padding: 1rem;
    border-radius: .5rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: var(--font-bold);
    background: var(--primary-color);
    border: none;
}

.auth-container .btn:hover {
    background: var(--primary-color-dark);
}

.auth-switch {
    text-align: center;
    margin-top: 2rem;
}

.auth-switch a {
    color: var(--primary-color);
    font-weight: var(--font-semi-bold);
}

.admin-login-link {
    text-align: center;
    margin-top: 1rem;
}

.admin-login-link a {
    color: var(--text-color-light);
    font-size: var(--small-font-size);
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: .5rem;
    border: 1px solid transparent;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* === PROFILE PAGE === */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--container-color);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.profile-container h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-details {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.orders-section {
    margin-bottom: 3rem;
}

.orders-section h3 {
    margin-bottom: 2rem;
    font-size: 1.75rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
    display: inline-block;
}

.order-card {
    margin-bottom: 2rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background-color: #fdfdfd;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.order-card-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.order-items-heading {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.order-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--border-color);
}

.order-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.order-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 1.5rem;
    border-radius: .5rem;
}

.btn-logout {
    width: 100%;
    margin-top: 2rem;
}

/* === TABS === */
.orders-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 1rem 1.5rem;
    cursor: pointer;
    background-color: transparent;
    border: none;
    font-size: 1.1rem;
    font-weight: var(--font-medium);
    color: var(--text-color-light);
    position: relative;
    transition: color .3s;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.orders-section {
    display: none;
}

.orders-section.active {
    display: block;
}

/* === RATING === */
.rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.rating input {
    display: none;
}

.rating label {
    width: 30px;
    height: 30px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z' fill='%23ccc'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: contain;
    transition: background-image .2s;
}

.rating input:checked ~ label,
.rating label:hover,
.rating label:hover ~ label {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z' fill='%23ffc107'/%3e%3c/svg%3e");
}

/* === TIMELINE === */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 18px;
    height: 100%;
    width: 4px;
    background: #e9ecef;
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
    padding-left: 50px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid #fff;
    z-index: 1;
}

.timeline-content {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* === CART PAGE === */
.cart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 2rem;
    background-color: var(--container-color);
    box-shadow: 0 8px 16px hsla(0,0%,0%,.05);
    border-radius: 1rem;
    overflow: hidden;
}

.cart-table th, .cart-table td {
    padding: 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.cart-table th {
    background-color: var(--light-color);
    font-weight: var(--font-semi-bold);
    color: var(--dark-color);
    text-transform: uppercase;
    font-size: var(--small-font-size);
}

.cart-table tbody tr:hover {
    background-color: var(--light-color);
}

.cart-table tbody tr:last-child td {
    border-bottom: none;
}

.cart-item-details {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cart-item-image img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: .75rem;
    box-shadow: 0 4px 8px hsla(0,0%,0%,.1);
}

.cart-customization-details {
    color: var(--text-color-light);
    display: block;
    margin-top: .5rem;
    font-size: var(--small-font-size);
}

.cart-stock-warning {
    color: var(--danger-color);
    font-size: var(--smaller-font-size);
    margin-top: .5rem;
    font-weight: var(--font-medium);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-control input[type="number"] {
    width: 50px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: .5rem;
    text-align: center;
    -moz-appearance: textfield; /* Firefox */
}
.quantity-control input[type="number"]::-webkit-outer-spin-button,
.quantity-control input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-actions-summary {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.cart-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-summary {
    background-color: var(--container-color);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 8px 16px hsla(0,0%,0%,.05);
    border: 1px solid var(--border-color);
}

.cart-summary h3 {
    margin-bottom: 2rem;
    text-align: center;
    color: var(--dark-color);
    font-size: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-row:last-of-type {
    border-bottom: none;
}

.summary-row.total {
    font-weight: var(--font-bold);
    font-size: 1.25rem;
    color: var(--dark-color);
}
.summary-row.total span:last-child {
    color: var(--primary-color);
}


.proceed-to-checkout-btn {
    width: 100%;
    text-align: center;
    display: block;
    margin-top: 2rem;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: .5rem;
}

.empty-cart-message {
    text-align: center;
    padding: 4rem;
    background: var(--container-color);
    border-radius: 1rem;
    box-shadow: 0 8px 16px hsla(0,0%,0%,.05);
}

.empty-cart-message h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.empty-cart-message p {
    color: var(--text-color-light);
    margin: 1.5rem 0;
}
@media (max-width: 992px) {
    .cart-actions-summary {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .cart-table thead {
        display: none;
    }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td {
        display: block;
        width: 100%;
    }
    .cart-table tr {
        margin-bottom: 1.5rem;
        border: 1px solid var(--border-color);
        border-radius: 1rem;
    }
    .cart-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: none;
    }
    .cart-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: calc(50% - 2rem);
        padding-right: 1rem;
        font-weight: var(--font-semi-bold);
        text-align: left;
    }
    .cart-item-details {
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .staff-actions {
        grid-template-columns: 1fr;
    }
}

/* === RECENT ACTIVITY === */
.recent-activity {
    margin-top: 4rem;
}

.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 18px;
    height: 100%;
    width: 4px;
    background: #e9ecef;
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
    padding-left: 50px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid #fff;
    z-index: 1;
}

.timeline-content {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.timeline-content p {
    margin-bottom: 0.5rem;
}

/* === Direct Chat Message Bubbles for Staff Panel === */
.direct-chat-messages {
    background-color: var(--body-color); /* Lighter background for chat area */
}

.direct-chat-msg {
    margin-bottom: 1.5rem;
}

.direct-chat-text {
    background-color: var(--container-color); /* Default message bubble */
    border: 1px solid var(--border-color);
    border-radius: .75rem;
    padding: .75rem 1rem;
    color: var(--text-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Sender's message (right aligned) */
.direct-chat-msg.right .direct-chat-text {
    background-color: var(--primary-color);
    color: var(--container-color);
    border-color: var(--primary-color-dark);
    margin-left: auto;
    border-bottom-right-radius: 0.2rem;
}

/* Receiver's message (left aligned) */
.direct-chat-msg:not(.right) .direct-chat-text {
    background-color: var(--light-color);
    color: var(--dark-color);
    border-color: var(--border-color);
    margin-right: auto;
    border-bottom-left-radius: 0.2rem;
}

.direct-chat-info { /* Timestamps and names */
    font-size: var(--smaller-font-size);
    margin-bottom: var(--mb-0-5);
}

.direct-chat-name {
    font-weight: var(--font-semi-bold);
    color: var(--dark-color);
}

.direct-chat-timestamp {
    color: var(--text-color-light);
}

/* Adjust timestamp color for sender's messages */
.direct-chat-msg.right .direct-chat-timestamp {
    color: rgba(255,255,255,0.7);
}

.direct-chat-img {
    border-radius: 50%;
    height: 35px;
    width: 35px;
    object-fit: cover;
}

/* === MESSAGE BUBBLES - GENERIC FOR MODALS / DISCUSSION === */
.message-item {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    max-width: 80%; /* Limit message width */
    position: relative;
    word-wrap: break-word; /* Ensure long words break */
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-item.bg-light { /* User messages */
    background-color: var(--primary-color);
    color: var(--container-color);
    margin-left: auto; /* Align to right */
    border-bottom-right-radius: 0.2rem; /* Sharpen bottom-right for a chat bubble look */
}

.message-item.bg-white { /* Staff messages */
    background-color: var(--light-color);
    color: var(--text-color);
    margin-right: auto; /* Align to left */
    border-bottom-left-radius: 0.2rem; /* Sharpen bottom-left */
    border: 1px solid var(--border-color);
}

.message-item small.text-muted {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.8) !important; /* Brighter for better contrast on primary-color background */
}

.message-item.bg-white small.text-muted {
    color: var(--text-color-light) !important; /* For staff messages */
}

.message-log {
    max-height: 400px; /* Standard height for communication logs */
    overflow-y: auto; /* Enable scrolling */
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: var(--body-color); /* Light background for message area */
}

/* === CUSTOM ADDITIONS FOR STAFF PORTAL === */

/* Loading State for Buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 1.2rem; height: 1.2rem;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Distinct Order Status Colors */
.badge-processing { background-color: #ffc107; color: #000; } /* Yellow */
.badge-shipped { background-color: #17a2b8; color: #fff; }    /* Cyan */
.badge-delivered { background-color: #28a745; color: #fff; }  /* Green */
.badge-cancelled { background-color: #dc3545; color: #fff; }  /* Red */

/* Mobile-Friendly Adjustments */
@media (max-width: 768px) {
    .form-control {
        height: 50px; /* Taller inputs for touch */
        font-size: 16px; /* Prevent zoom on iOS */
    }
    .btn {
        width: 100%; /* Full width buttons on mobile */
        margin-bottom: 10px;
    }
}

/* Sticky Table Headers */
.table-responsive {
    max-height: 500px;
    overflow-y: auto;
}
.table-responsive thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa; /* Light background for header */
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1);
}

/* === FIX: Restore AdminLTE Sidebar Styles overridden by generic styles === */
.main-sidebar a {
    color: #c2c7d0 !important;
}
.main-sidebar a:hover {
    color: #fff !important;
}
.nav-sidebar .nav-item > .nav-link.active {
    background-color: var(--primary-color);
    color: #fff !important;
}
.brand-link {
    color: rgba(255,255,255,.8) !important;
}
.brand-link:hover {
    color: #fff !important;
}
