/*
Theme Name: Warehouse Inventory Management
Description: A custom WordPress theme for warehouse inventory management system
Version: 1.3.13
Author: Your Name
*/

/* Theme CSS - Normal styling */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    color: #1f2937;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.warehouse-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Align theme toggle next to Logout/Login */
.user-menu .theme-toggle{
    position: static !important;
    margin-right: .25rem;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .4rem;
}
[data-theme="dark"] .user-menu .theme-toggle{
    border-color:#1f2937;
    background: transparent;
}

/* Warehouse App Layout */
.warehouse-app {
    min-height: calc(100vh - 120px);
}

/* Navigation Tabs */
.nav-tabs {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
    margin-bottom: 2rem;
}

.nav-list {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0 1rem;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.875rem;
}

.nav-tab:hover {
    color: #374151;
    text-decoration: none;
    background: #f9fafb;
}

.nav-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: #f8fafc;
}

.nav-tab i {
    font-size: 1rem;
}

/* Main Content */
.main-content {
    padding: 1rem 0 2rem 0;
}

/* Page Headers */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #6b7280;
    font-size: 1rem;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-icon.green { background: #f0fdf4; color: #22c55e; }
.stat-icon.yellow { background: #fffbeb; color: #f59e0b; }
.stat-icon.red { background: #fef2f2; color: #ef4444; }

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.inventory-item {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.inventory-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.item-header {
    display: flex;
    justify-content: between;
    align-items: start;
    margin-bottom: 1rem;
}

.item-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.item-id {
    color: #6b7280;
    font-size: 0.875rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f3f4f6;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 500;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-in-stock {
    background: #dcfce7;
    color: #166534;
}

.status-low-stock {
    background: #fef3c7;
    color: #92400e;
}

.status-out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f9fafb;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0; /* keep other modals perfectly centered by default */
}

.modal {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;            /* ensure footer stays at bottom */
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    flex: 1 1 auto;           /* body grows, footer sticks */
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Specific fix for inventory "Add Item" modal buttons overlapping */
#add-item-modal .modal > div:last-child {
    margin-top: 0;            /* reset any collapsing margins */
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Clear floats inside modal sections if any inline blocks introduce them */
.modal::after { content: ""; display: block; clear: both; }

/* Utility layout for two-column form rows inside modals */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }

/* Small hint text under labels */
.form-hint { display:block; margin-top: .25rem; font-size:.8125rem; color:#6b7280; }

/* Lot calculations panel */
.lot-calculations { display:none; margin-top: .75rem; padding: .75rem; background:#f9fafb; border:1px solid #e5e7eb; border-radius: 6px; }
.lot-calculations div { margin: .125rem 0; }

/* Sales summary panel (sell modal) */
.sale-summary { background:#f9fafb; border:1px solid #e5e7eb; border-radius:6px; padding:15px; margin-bottom:20px; }

/* Hierarchical Category Dropdown Styling */
select option[data-level="1"]{ padding-left:20px; color:#6b7280; font-style: italic; }
select option[data-level="0"]{ font-weight:600; color:#111827; }

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background-color: white;
}

/* Search and Filters */
.search-filters {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.search-row {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.search-input {
    position: relative;
    flex: 1;
}

.search-input input {
    padding-left: 2.5rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-tabs {
        overflow-x: auto;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .inventory-grid {
        grid-template-columns: 1fr;
    }
    
    .search-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .item-details {
        grid-template-columns: 1fr;
    }
}

/* Force content-style modal when inside our overlay */
.modal-overlay .modal {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    background: white;
    border-radius: 8px;
    width: min(600px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    margin: 0 auto;             /* ensure horizontal centering */
}

/* Location modal: add only a bit of vertical breathing room */
#add-location-modal.modal-overlay { padding: 5vh 1rem 3vh; }

/* Print Styles */
@media print {
    .btn, .modal-overlay, .search-filters {
        display: none !important;
    }
    
    .inventory-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Team Management Styles */
.team-management {
    padding: 2rem 0;
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.team-header h2 {
    margin: 0;
    color: #1f2937;
}

.team-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.team-table-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.table-header h3 {
    margin: 0;
    color: #1f2937;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 40px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 250px;
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

.team-table {
    width: 100%;
    border-collapse: collapse;
}

.team-table th,
.team-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.team-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.team-table tbody tr:hover {
    background: #f9fafb;
}

.member-info {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-weight: 600;
    color: #1f2937;
}

.member-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.warehouse_employee {
    background: #dbeafe;
    color: #1e40af;
}

.role-badge.warehouse_manager {
    background: #fef3c7;
    color: #d97706;
}

.role-badge.administrator {
    background: #fecaca;
    color: #dc2626;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.action-buttons {
    display: flex;
    gap: 4px;
}

.btn-icon.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.no-data {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.loading-spinner i {
    margin-right: 8px;
}

/* Extended Modal Styles for Team Management */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    background: none;
    border: none;
}

.close:hover {
    color: #374151;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 4px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.password-info {
    padding: 1.5rem;
}

.password-info p {
    margin-bottom: 1rem;
}

.password-info .note {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 1rem;
    color: #1e40af;
    font-size: 0.875rem;
}

.permission-denied {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.permission-denied p {
    font-size: 1.1rem;
}

/* Team Management Responsive */
@media (max-width: 768px) {
    .team-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .team-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-box input {
        width: 100%;
    }
    
    .team-table-container {
        overflow-x: auto;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
} 
