/* Sydney Teleport Warehouse - SaaS Design System */

/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
    /* Neutral Palette */
    --stw-bg: #f6f7f9;
    --stw-surface: #ffffff;
    --stw-surface-hover: #f9fafb;
    --stw-border: #e5e7eb;
    --stw-border-light: #f0f1f3;
    
    /* Text Colors */
    --stw-text: #1f2937;
    --stw-text-secondary: #6b7280;
    --stw-text-muted: #9ca3af;
    
    /* Accent Color - Crisp Blue */
    --stw-accent: #3b82f6;
    --stw-accent-hover: #2563eb;
    --stw-accent-light: #eff6ff;
    --stw-accent-text: #1d4ed8;
    
    /* Status Colors */
    --stw-success: #10b981;
    --stw-success-bg: #ecfdf5;
    --stw-success-text: #065f46;
    --stw-warning: #f59e0b;
    --stw-warning-bg: #fffbeb;
    --stw-warning-text: #92400e;
    --stw-danger: #ef4444;
    --stw-danger-hover: #dc2626;
    --stw-danger-bg: #fef2f2;
    --stw-danger-text: #991b1b;
    
    /* Spacing Scale */
    --stw-space-xs: 4px;
    --stw-space-sm: 8px;
    --stw-space-md: 12px;
    --stw-space-lg: 16px;
    --stw-space-xl: 24px;
    --stw-space-2xl: 32px;
    --stw-space-3xl: 48px;
    
    /* Elevation (soft shadows) */
    --stw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --stw-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --stw-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --stw-shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --stw-radius-sm: 6px;
    --stw-radius-md: 8px;
    --stw-radius-lg: 12px;
    --stw-radius-full: 9999px;
    
    /* Transitions */
    --stw-transition: 150ms ease;
}

/* =============================================
   BASE STYLES
   ============================================= */
.stw-app {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--stw-bg);
    min-height: 600px;
    border-radius: var(--stw-radius-lg);
    overflow: hidden;
    box-shadow: var(--stw-shadow-md);
    border: 1px solid var(--stw-border);
}

/* =============================================
   HEADER
   ============================================= */
.stw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--stw-space-lg) var(--stw-space-xl);
    background: var(--stw-surface);
    border-bottom: 1px solid var(--stw-border);
    gap: var(--stw-space-lg);
    flex-wrap: wrap;
}

.stw-header-title {
    text-align: center;
    flex: 1;
}

.stw-header-title h1.stw-title-main {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--stw-text);
}

.stw-header-title h2.stw-title-accent {
    margin: 2px 0 0 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--stw-accent);
}

.stw-header-tagline {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: var(--stw-text-muted);
    font-weight: 400;
}

.stw-header-actions {
    display: flex;
    gap: var(--stw-space-md);
    align-items: center;
}

.stw-user-info {
    font-size: 13px;
    color: var(--stw-text-secondary);
    padding: var(--stw-space-sm) var(--stw-space-md);
    background: var(--stw-accent-light);
    border-radius: var(--stw-radius-full);
    font-weight: 500;
}

/* Section Titles */
.stw-section-header h2,
#stw-content h2 {
    color: var(--stw-text);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.01em;
}

/* =============================================
   LAYOUT
   ============================================= */
.stw-layout {
    display: flex;
    min-height: 550px;
}

/* =============================================
   SIDEBAR
   ============================================= */
.stw-sidebar {
    width: 260px;
    background: var(--stw-surface);
    border-right: 1px solid var(--stw-border);
    padding: var(--stw-space-lg) 0;
    flex-shrink: 0;
}

.stw-nav-section {
    padding: 0 var(--stw-space-md);
}

.stw-nav-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--stw-text-muted);
    padding: var(--stw-space-md) var(--stw-space-md) var(--stw-space-sm);
    letter-spacing: 0.05em;
}

.stw-nav-divider {
    height: 1px;
    background: var(--stw-border-light);
    margin: var(--stw-space-lg) var(--stw-space-md);
}

.stw-nav-item {
    display: flex;
    align-items: center;
    gap: var(--stw-space-md);
    padding: var(--stw-space-md) var(--stw-space-lg);
    margin: 2px 0;
    border-radius: var(--stw-radius-sm);
    cursor: pointer;
    color: var(--stw-text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--stw-transition);
    border: 1px solid transparent;
}

.stw-nav-item:hover {
    background: var(--stw-surface-hover);
    color: var(--stw-text);
}

.stw-nav-item.active {
    background: var(--stw-accent-light);
    color: var(--stw-accent-text);
    border-color: var(--stw-accent);
    border-left-width: 3px;
}

.stw-nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stw-nav-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

.stw-nav-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform var(--stw-transition);
    color: var(--stw-text-muted);
}

.stw-nav-arrow.open {
    transform: rotate(180deg);
}

.stw-nav-submenu {
    display: none;
    padding-left: var(--stw-space-2xl);
}

.stw-nav-submenu.open {
    display: block;
}

.stw-nav-submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--stw-space-sm) var(--stw-space-lg);
    margin: 2px 0;
    border-radius: var(--stw-radius-sm);
    cursor: pointer;
    color: var(--stw-text-secondary);
    font-size: 13px;
    transition: all var(--stw-transition);
}

.stw-nav-submenu-item:hover {
    background: var(--stw-surface-hover);
    color: var(--stw-text);
}

.stw-nav-submenu-item.active {
    background: var(--stw-accent-light);
    color: var(--stw-accent-text);
}

.stw-stock-count {
    font-size: 11px;
    background: var(--stw-bg);
    padding: 2px 8px;
    border-radius: var(--stw-radius-full);
    color: var(--stw-text-muted);
    font-weight: 500;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.stw-main {
    flex: 1;
    padding: var(--stw-space-xl);
    overflow-x: auto;
    background: var(--stw-bg);
}

/* =============================================
   TOOLBAR
   ============================================= */
.stw-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--stw-space-xl);
    gap: var(--stw-space-lg);
    flex-wrap: wrap;
}

.stw-search-box {
    flex: 1;
    max-width: 400px;
}

.stw-search-input {
    width: 100%;
    padding: var(--stw-space-md) var(--stw-space-lg);
    border: 1px solid var(--stw-border);
    border-radius: var(--stw-radius-md);
    font-size: 14px;
    background: var(--stw-surface);
    color: var(--stw-text);
    transition: all var(--stw-transition);
}

.stw-search-input::placeholder {
    color: var(--stw-text-muted);
}

.stw-search-input:focus {
    outline: none;
    border-color: var(--stw-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.stw-toolbar-actions {
    display: flex;
    gap: var(--stw-space-md);
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.stw-input,
.stw-select,
.stw-textarea {
    padding: var(--stw-space-md) var(--stw-space-lg);
    border: 1px solid var(--stw-border);
    border-radius: var(--stw-radius-md);
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    background: var(--stw-surface);
    color: var(--stw-text);
    transition: all var(--stw-transition);
}

.stw-input::placeholder,
.stw-textarea::placeholder {
    color: var(--stw-text-muted);
}

.stw-input:focus,
.stw-select:focus,
.stw-textarea:focus {
    outline: none;
    border-color: var(--stw-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.stw-form-group {
    margin-bottom: var(--stw-space-lg);
}

.stw-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--stw-space-sm);
    font-size: 14px;
    color: var(--stw-text);
}

.stw-form-row {
    display: flex;
    gap: var(--stw-space-lg);
}

.stw-form-half {
    flex: 1;
}

/* =============================================
   BUTTONS
   ============================================= */
.stw-btn {
    padding: var(--stw-space-md) var(--stw-space-lg);
    border: 1px solid transparent;
    border-radius: var(--stw-radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--stw-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--stw-space-sm);
    line-height: 1.4;
}

.stw-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

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

.stw-btn-primary:hover {
    background: var(--stw-accent-hover);
    border-color: var(--stw-accent-hover);
    box-shadow: var(--stw-shadow-sm);
}

.stw-btn-secondary {
    background: var(--stw-surface);
    color: var(--stw-text);
    border-color: var(--stw-border);
}

.stw-btn-secondary:hover {
    background: var(--stw-surface-hover);
    border-color: var(--stw-text-muted);
}

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

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

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

.stw-btn-success:hover {
    background: #059669;
    border-color: #059669;
}

.stw-btn-outline {
    background: transparent;
    border-color: var(--stw-border);
    color: var(--stw-text-secondary);
}

.stw-btn-outline:hover {
    background: var(--stw-surface-hover);
    border-color: var(--stw-text-muted);
    color: var(--stw-text);
}

.stw-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--stw-text-secondary);
}

.stw-btn-ghost:hover {
    background: var(--stw-surface-hover);
    color: var(--stw-text);
}

.stw-btn-sm {
    padding: var(--stw-space-sm) var(--stw-space-md);
    font-size: 13px;
}

.stw-btn-sm svg {
    width: 14px;
    height: 14px;
}

.stw-btn-full {
    width: 100%;
    margin-top: var(--stw-space-md);
}

.stw-btn-header {
    background: var(--stw-accent);
    color: white;
    border-color: var(--stw-accent);
}

.stw-btn-header:hover {
    background: var(--stw-accent-hover);
    border-color: var(--stw-accent-hover);
}

/* =============================================
   CARDS GRID
   ============================================= */
.stw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--stw-space-xl);
}

.stw-card {
    background: var(--stw-surface);
    border: 1px solid var(--stw-border);
    border-radius: var(--stw-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--stw-transition);
}

.stw-card:hover {
    box-shadow: var(--stw-shadow-lg);
    border-color: var(--stw-accent);
}

.stw-card-image {
    width: 100%;
    height: 180px;
    background: var(--stw-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stw-text-muted);
    font-size: 48px;
}

.stw-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stw-card-body {
    padding: var(--stw-space-lg);
}

.stw-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--stw-space-sm);
    gap: var(--stw-space-md);
}

.stw-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--stw-text);
    letter-spacing: -0.01em;
}

.stw-card-sku {
    font-size: 11px;
    color: var(--stw-text-muted);
    background: var(--stw-bg);
    padding: 4px 10px;
    border-radius: var(--stw-radius-full);
    white-space: nowrap;
    font-weight: 500;
}

.stw-card-meta {
    font-size: 13px;
    color: var(--stw-text-secondary);
    margin-bottom: var(--stw-space-sm);
}

.stw-card-description {
    font-size: 14px;
    color: var(--stw-text-secondary);
    margin-bottom: var(--stw-space-md);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stw-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--stw-space-md);
    border-top: 1px solid var(--stw-border-light);
}

.stw-stock-label {
    font-size: 13px;
    color: var(--stw-text-secondary);
}

.stw-stock-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--stw-radius-full);
    font-size: 12px;
    font-weight: 600;
}

.stw-stock-available {
    background: var(--stw-success-bg);
    color: var(--stw-success-text);
}

.stw-stock-low {
    background: var(--stw-warning-bg);
    color: var(--stw-warning-text);
}

.stw-stock-out {
    background: var(--stw-danger-bg);
    color: var(--stw-danger-text);
}

/* =============================================
   TABLES
   ============================================= */
.stw-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--stw-surface);
    border-radius: var(--stw-radius-lg);
    overflow: hidden;
    box-shadow: var(--stw-shadow-sm);
    border: 1px solid var(--stw-border);
}

.stw-table th,
.stw-table td {
    padding: var(--stw-space-lg);
    text-align: left;
    border-bottom: 1px solid var(--stw-border-light);
}

.stw-table th {
    background: var(--stw-bg);
    font-weight: 600;
    color: var(--stw-text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stw-table tbody tr {
    cursor: pointer;
    transition: background var(--stw-transition);
}

.stw-table tbody tr:hover {
    background: var(--stw-surface-hover);
}

.stw-table tbody tr:nth-child(even) {
    background: rgba(246, 247, 249, 0.5);
}

.stw-table tbody tr:nth-child(even):hover {
    background: var(--stw-surface-hover);
}

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

.stw-actions {
    display: flex;
    gap: var(--stw-space-sm);
}

/* =============================================
   STATUS BADGES
   ============================================= */
.stw-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--stw-radius-full);
    font-size: 12px;
    font-weight: 500;
}

.stw-status-active {
    background: var(--stw-success-bg);
    color: var(--stw-success-text);
}

.stw-status-returned {
    background: var(--stw-bg);
    color: var(--stw-text-secondary);
}

/* =============================================
   MODALS
   ============================================= */
.stw-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.stw-modal.active {
    display: flex;
}

.stw-modal-content {
    background-color: var(--stw-surface);
    padding: var(--stw-space-xl);
    border-radius: var(--stw-radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--stw-shadow-xl);
    border: 1px solid var(--stw-border);
}

.stw-modal-lg {
    max-width: 700px;
}

.stw-modal-xl {
    max-width: 1000px;
    width: 95%;
}

.stw-modal-close {
    position: absolute;
    right: var(--stw-space-lg);
    top: var(--stw-space-lg);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: var(--stw-text-muted);
    background: var(--stw-bg);
    border-radius: var(--stw-radius-sm);
    transition: all var(--stw-transition);
    border: none;
}

.stw-modal-close:hover {
    color: var(--stw-text);
    background: var(--stw-border);
}

.stw-modal-content h3 {
    margin: 0 0 var(--stw-space-xl) 0;
    font-size: 18px;
    color: var(--stw-text);
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* =============================================
   DETAIL VIEW
   ============================================= */
.stw-detail {
    display: flex;
    gap: var(--stw-space-xl);
}

.stw-detail-image {
    width: 250px;
    flex-shrink: 0;
}

.stw-detail-image img {
    width: 100%;
    border-radius: var(--stw-radius-md);
}

.stw-detail-image .stw-no-image {
    width: 100%;
    height: 200px;
    background: var(--stw-bg);
    border-radius: var(--stw-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stw-text-muted);
    font-size: 48px;
    border: 1px solid var(--stw-border);
}

.stw-detail-info {
    flex: 1;
}

.stw-detail-title {
    font-size: 22px;
    margin: 0 0 var(--stw-space-lg);
    color: var(--stw-text);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.stw-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--stw-space-xl);
    margin-bottom: var(--stw-space-lg);
}

.stw-detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--stw-space-xs);
}

.stw-detail-meta-label {
    font-size: 11px;
    color: var(--stw-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stw-detail-meta-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--stw-text);
}

.stw-detail-description {
    margin-top: var(--stw-space-lg);
    padding-top: var(--stw-space-lg);
    border-top: 1px solid var(--stw-border-light);
    line-height: 1.6;
    color: var(--stw-text-secondary);
}

.stw-detail-loans {
    margin-top: var(--stw-space-xl);
}

.stw-detail-loans h4 {
    margin: 0 0 var(--stw-space-md);
    font-size: 15px;
    color: var(--stw-text);
    font-weight: 600;
}

/* =============================================
   IMAGE UPLOAD
   ============================================= */
.stw-image-upload {
    display: flex;
    align-items: center;
    gap: var(--stw-space-md);
    flex-wrap: wrap;
}

.stw-image-preview {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--stw-border);
    border-radius: var(--stw-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stw-bg);
    overflow: hidden;
    transition: border-color var(--stw-transition);
}

.stw-image-preview:hover {
    border-color: var(--stw-accent);
}

.stw-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =============================================
   LOGIN PANEL
   ============================================= */
.stw-login-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.stw-login-box {
    background: var(--stw-surface);
    padding: var(--stw-space-2xl);
    border-radius: var(--stw-radius-lg);
    width: 90%;
    max-width: 380px;
    box-shadow: var(--stw-shadow-xl);
    border: 1px solid var(--stw-border);
}

.stw-login-box h2 {
    margin: 0 0 var(--stw-space-xl);
    text-align: center;
    font-size: 20px;
    color: var(--stw-text);
    font-weight: 600;
}

.stw-login-error {
    background: var(--stw-danger-bg);
    color: var(--stw-danger-text);
    padding: var(--stw-space-md) var(--stw-space-lg);
    border-radius: var(--stw-radius-md);
    margin-bottom: var(--stw-space-lg);
    font-size: 14px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* =============================================
   LOADING & EMPTY STATES
   ============================================= */
.stw-loading {
    text-align: center;
    padding: var(--stw-space-3xl);
    color: var(--stw-text-secondary);
}

.stw-empty {
    text-align: center;
    padding: var(--stw-space-3xl) var(--stw-space-xl);
    color: var(--stw-text-secondary);
}

.stw-empty-icon {
    font-size: 48px;
    margin-bottom: var(--stw-space-lg);
    color: var(--stw-text-muted);
}

.stw-empty-icon svg {
    width: 48px;
    height: 48px;
    stroke-width: 1;
}

/* =============================================
   ITEM LIST FOR LOAN FORM
   ============================================= */
.stw-item-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--stw-border);
    border-radius: var(--stw-radius-md);
    background: var(--stw-bg);
}

.stw-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--stw-space-md) var(--stw-space-lg);
    background: var(--stw-surface);
    border-bottom: 1px solid var(--stw-border-light);
    cursor: pointer;
    transition: all var(--stw-transition);
}

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

.stw-item-row:hover {
    background: var(--stw-surface-hover);
}

.stw-item-row.selected {
    background: var(--stw-accent-light);
    border-left: 3px solid var(--stw-accent);
}

.stw-item-row-info {
    display: flex;
    flex-direction: column;
    gap: var(--stw-space-xs);
}

.stw-item-row-name {
    font-weight: 500;
    color: var(--stw-text);
}

.stw-item-row-sku {
    font-size: 12px;
    color: var(--stw-text-muted);
}

.stw-item-row-category {
    font-size: 11px;
    color: var(--stw-text-muted);
    background: var(--stw-bg);
    padding: 2px 8px;
    border-radius: var(--stw-radius-full);
    display: inline-block;
    width: fit-content;
    font-weight: 500;
}

.stw-item-row-stock {
    flex-shrink: 0;
}

.stw-empty-list {
    padding: var(--stw-space-xl);
    text-align: center;
    color: var(--stw-text-secondary);
    font-size: 14px;
}

.stw-selected-item-label {
    font-weight: 500;
    color: var(--stw-accent);
    font-size: 13px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .stw-layout {
        flex-direction: column;
    }
    
    .stw-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--stw-border);
        padding: var(--stw-space-md) 0;
    }
    
    .stw-nav-section {
        display: flex;
        flex-wrap: wrap;
        gap: var(--stw-space-sm);
        padding: 0 var(--stw-space-md);
    }
    
    .stw-nav-item {
        padding: var(--stw-space-sm) var(--stw-space-lg);
    }
    
    .stw-nav-divider {
        display: none;
    }
    
    .stw-nav-label {
        display: none;
    }
    
    .stw-nav-submenu {
        position: absolute;
        background: var(--stw-surface);
        box-shadow: var(--stw-shadow-lg);
        border-radius: var(--stw-radius-md);
        padding: var(--stw-space-sm) 0;
        z-index: 100;
        border: 1px solid var(--stw-border);
    }
    
    .stw-detail {
        flex-direction: column;
    }
    
    .stw-detail-image {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 600px) {
    .stw-header {
        padding: var(--stw-space-md) var(--stw-space-lg);
    }
    
    .stw-header-title h1 {
        font-size: 20px;
    }
    
    .stw-header-subtitle {
        font-size: 13px;
    }
    
    .stw-main {
        padding: var(--stw-space-lg);
    }
    
    .stw-grid {
        grid-template-columns: 1fr;
    }
    
    .stw-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .stw-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stw-search-box {
        max-width: none;
    }
    
    .stw-modal-content {
        padding: var(--stw-space-lg);
    }
}

/* =============================================
   NEW FEATURES - v3.0.0
   ============================================= */

/* Login Tabs */
.stw-login-tabs {
    display: flex;
    gap: var(--stw-space-sm);
    margin-bottom: var(--stw-space-lg);
}

.stw-login-tab {
    flex: 1;
    padding: var(--stw-space-sm) var(--stw-space-md);
    background: var(--stw-surface);
    border: 1px solid var(--stw-border);
    border-radius: var(--stw-radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--stw-text-secondary);
    transition: var(--stw-transition);
}

.stw-login-tab:hover {
    background: var(--stw-surface-hover);
}

.stw-login-tab.active {
    background: var(--stw-accent-light);
    border-color: var(--stw-accent);
    color: var(--stw-accent-text);
}

/* Overdue Badge & Nav Item */
.stw-nav-item-overdue {
    color: var(--stw-danger);
}

.stw-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--stw-radius-full);
}

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

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

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

/* Overdue Loan Row */
.stw-loan-row.overdue {
    background: var(--stw-danger-bg);
    border-left: 3px solid var(--stw-danger);
}

.stw-overdue-indicator {
    color: var(--stw-danger);
    font-weight: 600;
    font-size: 12px;
}

/* Due Date Display */
.stw-due-date {
    font-size: 12px;
    color: var(--stw-text-secondary);
}

.stw-due-date.overdue {
    color: var(--stw-danger);
    font-weight: 600;
}

.stw-due-date.due-soon {
    color: var(--stw-warning);
}

/* Multiple Images Container */
.stw-multi-image-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--stw-space-sm);
    margin-bottom: var(--stw-space-sm);
}

.stw-multi-image-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--stw-radius-sm);
    overflow: hidden;
    border: 1px solid var(--stw-border);
}

.stw-multi-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stw-multi-image-item .stw-remove-multi-image {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: var(--stw-danger);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--stw-transition);
}

.stw-multi-image-item:hover .stw-remove-multi-image {
    opacity: 1;
}

.stw-multi-image-item.primary::after {
    content: 'Primary';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--stw-accent);
    color: white;
    font-size: 9px;
    text-align: center;
    padding: 2px;
}

/* Image Gallery in Detail View */
.stw-image-gallery {
    display: flex;
    gap: var(--stw-space-sm);
    margin-bottom: var(--stw-space-md);
}

.stw-gallery-main {
    flex: 1;
    max-width: 300px;
}

.stw-gallery-main img {
    width: 100%;
    height: auto;
    border-radius: var(--stw-radius-md);
}

.stw-gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: var(--stw-space-xs);
}

.stw-gallery-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--stw-radius-sm);
    cursor: pointer;
    opacity: 0.6;
    transition: var(--stw-transition);
    border: 2px solid transparent;
    overflow: hidden;
}

.stw-gallery-thumb:hover,
.stw-gallery-thumb.active {
    opacity: 1;
    border-color: var(--stw-accent);
}

.stw-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Variants Section */
.stw-variants-section {
    margin-top: var(--stw-space-lg);
    padding-top: var(--stw-space-lg);
    border-top: 1px solid var(--stw-border);
}

.stw-variants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--stw-space-md);
}

.stw-variants-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--stw-text);
}

.stw-variant-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--stw-space-md);
    background: var(--stw-surface-hover);
    border-radius: var(--stw-radius-sm);
    margin-bottom: var(--stw-space-sm);
}

.stw-variant-info {
    flex: 1;
}

.stw-variant-name {
    font-weight: 500;
    color: var(--stw-text);
}

.stw-variant-sku {
    font-size: 12px;
    color: var(--stw-text-muted);
}

.stw-variant-stock {
    display: flex;
    align-items: center;
    gap: var(--stw-space-md);
}

.stw-variant-qty {
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

/* Activity Log */
.stw-activity-log {
    display: flex;
    flex-direction: column;
    gap: var(--stw-space-sm);
}

.stw-activity-item {
    display: flex;
    gap: var(--stw-space-md);
    padding: var(--stw-space-md);
    background: var(--stw-surface);
    border-radius: var(--stw-radius-sm);
    border: 1px solid var(--stw-border);
}

.stw-activity-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stw-accent-light);
    color: var(--stw-accent);
    border-radius: var(--stw-radius-full);
    flex-shrink: 0;
}

.stw-activity-icon.action-create { background: var(--stw-success-bg); color: var(--stw-success); }
.stw-activity-icon.action-update { background: var(--stw-warning-bg); color: var(--stw-warning); }
.stw-activity-icon.action-delete { background: var(--stw-danger-bg); color: var(--stw-danger); }
.stw-activity-icon.action-login { background: var(--stw-accent-light); color: var(--stw-accent); }
.stw-activity-icon.action-return { background: var(--stw-success-bg); color: var(--stw-success); }

.stw-activity-content {
    flex: 1;
}

.stw-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--stw-space-xs);
}

.stw-activity-action {
    font-weight: 500;
    color: var(--stw-text);
}

.stw-activity-time {
    font-size: 12px;
    color: var(--stw-text-muted);
}

.stw-activity-details {
    font-size: 13px;
    color: var(--stw-text-secondary);
}

.stw-activity-user {
    font-size: 12px;
    color: var(--stw-text-muted);
    margin-top: var(--stw-space-xs);
}

/* Users Table */
.stw-users-table {
    width: 100%;
    border-collapse: collapse;
}

.stw-users-table th,
.stw-users-table td {
    padding: var(--stw-space-md);
    text-align: left;
    border-bottom: 1px solid var(--stw-border);
}

.stw-users-table th {
    font-weight: 600;
    color: var(--stw-text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stw-user-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--stw-radius-full);
    font-size: 12px;
}

.stw-user-status.active {
    background: var(--stw-success-bg);
    color: var(--stw-success-text);
}

.stw-user-status.inactive {
    background: var(--stw-danger-bg);
    color: var(--stw-danger-text);
}

.stw-role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--stw-radius-full);
    font-size: 11px;
    font-weight: 500;
    background: var(--stw-accent-light);
    color: var(--stw-accent-text);
}

.stw-role-badge.admin {
    background: var(--stw-danger-bg);
    color: var(--stw-danger-text);
}

.stw-role-badge.manager {
    background: var(--stw-warning-bg);
    color: var(--stw-warning-text);
}

.stw-role-badge.staff {
    background: var(--stw-success-bg);
    color: var(--stw-success-text);
}

/* Activity Log Filters */
.stw-log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--stw-space-md);
    margin-bottom: var(--stw-space-lg);
    padding: var(--stw-space-md);
    background: var(--stw-surface);
    border-radius: var(--stw-radius-md);
    border: 1px solid var(--stw-border);
}

.stw-log-filters .stw-form-group {
    margin: 0;
    min-width: 150px;
}

.stw-log-filters label {
    font-size: 11px;
    color: var(--stw-text-muted);
    margin-bottom: 4px;
}

/* Form Hint */
.stw-form-hint {
    display: block;
    font-size: 12px;
    color: var(--stw-text-muted);
    margin-top: 4px;
}

/* Permissions List */
.stw-permissions-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--stw-space-sm);
    padding: var(--stw-space-md);
    background: var(--stw-surface-hover);
    border-radius: var(--stw-radius-sm);
    margin-top: var(--stw-space-sm);
}

.stw-permission-item {
    display: flex;
    align-items: center;
    gap: var(--stw-space-xs);
    font-size: 12px;
}

.stw-permission-item.granted {
    color: var(--stw-success);
}

.stw-permission-item.denied {
    color: var(--stw-text-muted);
}

/* =============================================
   ITEM STATUS STYLES
   ============================================= */
.stw-status-functional {
    background: var(--stw-success-bg);
    color: var(--stw-success-text);
}

.stw-status-defective {
    background: var(--stw-danger-bg);
    color: var(--stw-danger-text);
}

.stw-status-sold {
    background: var(--stw-warning-bg);
    color: var(--stw-warning-text);
}

.stw-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--stw-radius-full);
    font-size: 12px;
    font-weight: 500;
}

.stw-status-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: var(--stw-radius-sm);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Notes section in item detail */
.stw-detail-notes {
    margin-top: var(--stw-space-lg);
    padding: var(--stw-space-md);
    background: var(--stw-warning-bg);
    border-left: 3px solid var(--stw-warning);
    border-radius: var(--stw-radius-sm);
}

.stw-detail-notes h4 {
    margin: 0 0 var(--stw-space-sm) 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--stw-warning-text);
}

.stw-detail-notes p {
    margin: 0;
    font-size: 13px;
    color: var(--stw-text);
    white-space: pre-wrap;
}

/* Card image positioning for overlay */
.stw-card-image {
    position: relative;
}

/* =============================================
   UNITS TABLE STYLES
   ============================================= */
.stw-units-section {
    margin-top: var(--stw-space-xl);
    border-top: 1px solid var(--stw-border);
    padding-top: var(--stw-space-lg);
}

.stw-units-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--stw-space-md);
}

.stw-units-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--stw-text);
}

.stw-units-table {
    font-size: 13px;
}

.stw-units-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--stw-text-muted);
}

.stw-unit-notes {
    max-width: 200px;
    font-size: 12px;
    color: var(--stw-text-secondary);
}

.stw-unit-actions {
    white-space: nowrap;
}

.stw-unit-row-defective {
    background: var(--stw-danger-bg);
}

.stw-unit-row-sold {
    background: var(--stw-warning-bg);
    opacity: 0.7;
}

.stw-loan-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: var(--stw-radius-full);
    font-size: 10px;
    font-weight: 600;
    background: var(--stw-accent-light);
    color: var(--stw-accent-text);
    text-transform: uppercase;
}

/* Status badge in units table - smaller version */
.stw-units-table .stw-status-badge {
    padding: 2px 8px;
    font-size: 11px;
}

/* =============================================
   AUTOCOMPLETE STYLES
   ============================================= */
.stw-autocomplete-wrapper {
    position: relative;
}

.stw-autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--stw-surface);
    border: 1px solid var(--stw-border);
    border-top: none;
    border-radius: 0 0 var(--stw-radius-md) var(--stw-radius-md);
    box-shadow: var(--stw-shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.stw-autocomplete-dropdown.active {
    display: block;
}

.stw-autocomplete-item {
    padding: var(--stw-space-sm) var(--stw-space-md);
    cursor: pointer;
    border-bottom: 1px solid var(--stw-border-light);
    transition: background var(--stw-transition);
}

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

.stw-autocomplete-item:hover,
.stw-autocomplete-item.selected {
    background: var(--stw-accent-light);
}

.stw-autocomplete-item-name {
    font-weight: 500;
    color: var(--stw-text);
    font-size: 14px;
}

.stw-autocomplete-item-sku {
    font-size: 12px;
    color: var(--stw-text-muted);
    margin-left: 8px;
}

.stw-autocomplete-item-units {
    font-size: 11px;
    color: var(--stw-text-secondary);
    display: block;
    margin-top: 2px;
}

.stw-autocomplete-no-results {
    padding: var(--stw-space-sm) var(--stw-space-md);
    color: var(--stw-text-muted);
    font-size: 13px;
    font-style: italic;
}

/* Location breakdown in item detail */
.stw-location-breakdown .stw-detail-meta-value {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stw-location-count {
    display: inline-block;
    padding: 4px 10px;
    background: var(--stw-bg);
    border: 1px solid var(--stw-border);
    border-radius: var(--stw-radius-md);
    font-size: 13px;
    white-space: nowrap;
}
 10px;
    border-bottom: 1px solid var(--stw-border);
}

.stw-loan-items-list {
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--stw-border);
    border-radius: var(--stw-radius-md);
    padding: 10px;
    background: var(--stw-bg);
    margin-bottom: 15px;
}

.stw-empty-items {
    color: var(--stw-text-muted);
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
}

.stw-loan-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--stw-surface);
    border-radius: var(--stw-radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--stw-border-light);
}

.stw-loan-item-row:last-child {
    margin-bottom: 0;
}

.stw-loan-item-info {
    flex: 1;
}

.stw-loan-item-name {
    font-weight: 500;
    color: var(--stw-text);
}

.stw-loan-item-details {
    font-size: 12px;
    color: var(--stw-text-muted);
    margin-top: 2px;
}

.stw-loan-item-qty {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--stw-text-secondary);
}

.stw-loan-item-remove {
    color: var(--stw-danger);
    cursor: pointer;
    padding: 5px;
    border-radius: var(--stw-radius-sm);
}

.stw-loan-item-remove:hover {
    background: rgba(220, 38, 38, 0.1);
}

.stw-loan-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--stw-surface);
    border: 1px solid var(--stw-border);
    border-radius: 0 0 var(--stw-radius-md) var(--stw-radius-md);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: var(--stw-shadow-lg);
}

.stw-loan-search-results.active {
    display: block;
}

.stw-add-loan-item {
    position: relative;
}

.stw-loan-search-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--stw-border-light);
    transition: background var(--stw-transition);
}

.stw-loan-search-item:last-child {
    border-bottom: none;
}

.stw-loan-search-item:hover {
    background: var(--stw-accent-light);
}

.stw-loan-search-item-name {
    font-weight: 500;
    color: var(--stw-text);
}

.stw-loan-search-item-meta {
    font-size: 12px;
    color: var(--stw-text-muted);
}

.stw-loan-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--stw-border);
}

.stw-available-units-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 15px 0;
}

.stw-unit-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--stw-border);
    border-radius: var(--stw-radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--stw-transition);
}

.stw-unit-checkbox-item:hover {
    border-color: var(--stw-accent);
    background: var(--stw-accent-light);
}

.stw-unit-checkbox-item.selected {
    border-color: var(--stw-accent);
    background: var(--stw-accent-light);
}

.stw-unit-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.stw-divider {
    text-align: center;
    color: var(--stw-text-muted);
    margin: 15px 0;
    position: relative;
}

.stw-divider::before,
.stw-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--stw-border);
}

.stw-divider::before {
    left: 0;
}

.stw-divider::after {
    right: 0;
}

/* =============================================
   LOCATION INVENTORY VIEW STYLES
   ============================================= */
.stw-location-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stw-summary-card {
    background: var(--stw-surface);
    border: 1px solid var(--stw-border);
    border-radius: var(--stw-radius-md);
    padding: 15px 20px;
    min-width: 120px;
    text-align: center;
}

.stw-summary-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--stw-text);
    line-height: 1.2;
}

.stw-summary-label {
    display: block;
    font-size: 12px;
    color: var(--stw-text-muted);
    text-transform: uppercase;
    margin-top: 4px;
}

.stw-summary-functional {
    border-color: var(--stw-success);
    background: rgba(16, 185, 129, 0.05);
}

.stw-summary-functional .stw-summary-number {
    color: var(--stw-success);
}

.stw-summary-defective {
    border-color: var(--stw-danger);
    background: rgba(239, 68, 68, 0.05);
}

.stw-summary-defective .stw-summary-number {
    color: var(--stw-danger);
}

.stw-summary-loan {
    border-color: var(--stw-accent);
    background: rgba(37, 99, 235, 0.05);
}

.stw-summary-loan .stw-summary-number {
    color: var(--stw-accent);
}

.stw-location-item-row {
    cursor: pointer;
    transition: background var(--stw-transition);
}

.stw-location-item-row:hover {
    background: var(--stw-accent-light);
}

.stw-location-item-row.expanded {
    background: var(--stw-accent-light);
}

.stw-location-item-row td:first-child::before {
    content: '▶';
    display: inline-block;
    margin-right: 8px;
    font-size: 10px;
    transition: transform var(--stw-transition);
}

.stw-location-item-row.expanded td:first-child::before {
    transform: rotate(90deg);
}

.stw-unit-detail-row td {
    padding: 0 !important;
}

.stw-unit-detail-row .stw-table {
    border: none;
    font-size: 12px;
}

.stw-unit-detail-row .stw-table th {
    background: #e5e7eb;
}

/* =============================================
   EXPORT MODAL STYLES
   ============================================= */
.stw-export-options {
    margin: 20px 0;
}

.stw-export-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.stw-btn-block {
    width: 100%;
    justify-content: center;
}

.stw-export-info {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--stw-border);
    text-align: center;
    color: var(--stw-text-muted);
}
