
/* Woodmart Admin Dashboard CSS */



/* Custom hover color */
.export-po-btn:hover {
    background-color: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

/* Apply smaller font size to the whole admin page */
html, body {
  font-size: 15px;   /* you can try 12px if you want even smaller */
  line-height: 1.4;  /* keeps text readable */
}

/* CSS Variables - Woodmart Theme */
:root {
    --primary-color: #f59e0b;
    --secondary-color: #1f2937;
    --dark-color: #111827;
    --light-color: #f8fafc;
    --muted-color: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    /* Woodmart specific colors */
    --wood-brown: #8b5a3c;
    --wood-light: #deb887;
    --wood-dark: #654321;

    /* Sidebar */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 70px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-base: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-color);
    color: var(--secondary-color);
    line-height: 1.6;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(135deg, var(--wood-dark), var(--secondary-color));
    color: white;
    transition: var(--transition-base);
    z-index: 1000;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--wood-brown) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--wood-brown);
    border-radius: 3px;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    transition: var(--transition-base);
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 0.75rem;
}

.brand-text {
    transition: var(--transition-base);
}

.sidebar.collapsed .brand-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition-base);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
}

.nav-link.active {
    color: white;
    background-color: rgba(245, 158, 11, 0.2);
    border-left-color: var(--primary-color);
}

.nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

.nav-link span {
    transition: var(--transition-base);
}

.sidebar.collapsed .nav-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Submenu Styles */
.submenu {
    list-style: none;
    background-color: rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.has-submenu.active .submenu {
    max-height: 200px;
}

.submenu a {
    display: block;
    padding: 0.5rem 1.5rem 0.5rem 3rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition-base);
}

.submenu a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    transition: var(--transition-base);
    min-height: 100vh;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Bar */
.topbar {
    background: white;
    height: var(--topbar-height);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-content {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1.5rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--muted-color);
    margin-right: 1.5rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.sidebar-toggle:hover {
    color: var(--primary-color);
}

.search-box {
    flex: 1;
    max-width: 400px;
    margin-right: auto;
}

.search-box .form-control {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem 0 0 0.5rem;
}

.search-box .btn {
    border-radius: 0 0.5rem 0.5rem 0;
}

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

.topbar-actions .btn {
    border: none;
    background: none;
    color: var(--muted-color);
    transition: var(--transition-base);
}

.topbar-actions .btn:hover {
    color: var(--primary-color);
}

/* Notification Dropdown */
.notification-dropdown {
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

/* Content Area */
.content-area {
    padding: 2rem;
    min-height: calc(100vh - var(--topbar-height));
}

/* Card Styles */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: linear-gradient(135deg, white, var(--light-color));
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding: 1.25rem 1.5rem;
}

.card-title {
    margin: 0;
    font-weight: 600;
    color: var(--secondary-color);
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color), #d97706);
    color: white;
    border-radius: 1rem;
    transition: var(--transition-base);
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stats-card.success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.stats-card.danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.stats-card.info {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
}

.stats-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stats-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table {
    margin: 0;
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--secondary-color);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: rgba(245, 158, 11, 0.05);
}

/* Button Styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: var(--transition-base);
}

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

.btn-primary:hover {
    background-color: #d97706;
    border-color: #d97706;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* Form Styles */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: var(--transition-base);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    border-radius: 0.375rem;
}

.badge-success {
    background-color: var(--success-color);
}

.badge-warning {
    background-color: var(--warning-color);
}

.badge-danger {
    background-color: var(--danger-color);
}

.badge-info {
    background-color: var(--info-color);
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, white, var(--light-color));
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-title {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Photo Upload Styles */
.photo-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
    background-color: var(--light-color);
}

.photo-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(245, 158, 11, 0.05);
}

.photo-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(245, 158, 11, 0.1);
}

.upload-placeholder {
    color: var(--muted-color);
}

.photo-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 0.5rem;
}

/* Stock Movement Styles */
.stock-movements {
    max-height: 300px;
    overflow-y: auto;
}

.stock-movement-item {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: white;
}

.movement-inflow {
    border-left: 4px solid var(--success-color);
}

.movement-outflow {
    border-left: 4px solid var(--danger-color);
}

/* Pagination */
.pagination {
    justify-content: center;
}

.page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.page-link:hover {
    color: #d97706;
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Category tree and Material management styles */
.category-tree .tree-list { list-style: none; padding-left: 0; }
.category-tree .sub-tree { list-style: none; padding-left: 1.5rem; margin-top: 0.5rem; }
.category-tree li { padding: 0.5rem 0; }
.category-tree li:hover { background-color: rgba(0,123,255,0.1); cursor: pointer; }
.avatar { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.progress { background-color: rgba(0,0,0,0.1); }

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    transition: var(--transition-base);
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(245, 158, 11, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(245, 158, 11, 0.1);
}

/* Image Preview */
.image-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid var(--border-color);
}

/* Status Indicators */
.status-online {
    color: var(--success-color);
}

.status-offline {
    color: var(--muted-color);
}

.status-pending {
    color: var(--warning-color);
}

.status-error {
    color: var(--danger-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(245, 158, 11, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

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

    .sidebar.collapsed + .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 1rem;
    }

    .search-box {
        display: none;
    }

    .stats-card {
        margin-bottom: 1rem;
    }

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

@media (max-width: 576px) {
    .topbar-content {
        padding: 0 1rem;
    }

    .sidebar-toggle {
        margin-right: 1rem;
    }

    .topbar-actions {
        gap: 0.5rem;
    }

    .modal-dialog {
        margin: 1rem;
    }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--muted-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Utility Classes */
.text-wood {
    color: var(--wood-brown) !important;
}

.bg-wood {
    background-color: var(--wood-light) !important;
}

.border-wood {
    border-color: var(--wood-brown) !important;
}

.shadow-wood {
    box-shadow: 0 4px 12px rgba(139, 90, 60, 0.15) !important;
}

/* Admin Section Management */
.admin-section {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Avatar Styles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #d97706);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.avatar-circle-lg {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

/* Enhanced Photo Upload Styles */
.photo-upload-container {
    text-align: center;
}

.photo-preview img {
    max-width: 300px;
    max-height: 200px;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    object-fit: cover;
}

/* Enhanced Stock Movement Styles */
.stock-movements {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.stock-movement-item {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: white;
    transition: var(--transition-base);
}

.stock-movement-item:hover {
    box-shadow: var(--shadow-sm);
}

.movement-inflow {
    border-left: 4px solid var(--success-color);
    background-color: rgba(16, 185, 129, 0.05);
}

.movement-outflow {
    border-left: 4px solid var(--danger-color);
    background-color: rgba(239, 68, 68, 0.05);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--light-color);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--muted-color);
    margin-top: 0.25rem;
}

/* Enhanced Image Preview */
.image-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid var(--border-color);
    transition: var(--transition-base);
}

.image-preview:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

/* Category Tree Styles */
.category-tree {
    font-family: inherit;
}

.tree-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.tree-item:last-child {
    border-bottom: none;
}

.subcategories .tree-item {
    font-size: 0.9rem;
    color: var(--muted-color);
}

/* Conversation List Styles */
.conversation-list {
    max-height: 500px;
    overflow-y: auto;
}

.conversation-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-base);
}

.conversation-item:hover {
    background-color: var(--light-color);
}

.conversation-item.active {
    background-color: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--primary-color);
}

.conversation-item .avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversation-item .badge-sm {
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
}

/* Review Rating Styles */
.rating {
    display: flex;
    align-items: center;
}

.rating i {
    margin-right: 2px;
}

.review-excerpt {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
    color: var(--muted-color);
}

/* User Avatar Styles */
.avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar .badge {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* Print Styles */
@media print {
    .sidebar,
    .topbar,
    .btn,
    .pagination {
        display: none !important;
    }

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

    .content-area {
        padding: 0 !important;
    }

    .card {
        border: 1px solid var(--border-color) !important;
        box-shadow: none !important;
    }
}

/* ===============================
   SIDEBAR SUBMENU FIX
================================ */

.sidebar .submenu {
    list-style: none;
    padding-left: 1.5rem;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar .has-submenu.open > .submenu {
    max-height: 1000px; /* enough for nested menus */
}

.sidebar .has-submenu > a {
    cursor: pointer;
}

.sidebar .submenu li a {
    display: block;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #cbd5e1;
    text-decoration: none;
}

.sidebar .submenu li a:hover,
.sidebar .submenu li a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}

/* Chevron rotation */
.sidebar .has-submenu > a .fa-chevron-down {
    transition: transform 0.25s ease;
}

.sidebar .has-submenu.open > a .fa-chevron-down {
    transform: rotate(180deg);
}

