/* --- LAYOUT & TYPOGRAPHY --- */
#pew-locker-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

.pew-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* --- TABS --- */
.pew-tabs { margin-bottom: 20px; border-bottom: 1px solid #ddd; display: flex; gap: 5px; }
.pew-tabs a {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    background: #f4f4f4;
    border-radius: 5px 5px 0 0;
    font-weight: 500;
}
.pew-tabs a.active { background: #0073aa; color: white; }
.pew-tabs a:hover:not(.active) { background: #e0e0e0; }

/* --- GRID SYSTEM (THE CARDS) --- */
#pew-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.pew-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.pew-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.pew-card-img {
    height: 200px;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    border-bottom: 1px solid #eee;
}

.pew-card-body { padding: 15px; flex-grow: 1; cursor: pointer; }
.pew-card-body h3 { margin: 0 0 5px 0; font-size: 1.1em; font-weight: 700; color: #2c3e50; }
.pew-meta { color: #7f8c8d; font-size: 0.9em; margin: 0; }

.pew-card-actions {
    padding: 10px 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

/* --- FORMS & INPUTS --- */
.pew-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.pew-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; margin-bottom: 15px; }

input[type="text"], input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

#pew-add-form { background: #f8f9fa; padding: 25px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 30px; }

/* --- IMAGE CROPPER MODAL (High Z-Index for Elementor) --- */
#pew-crop-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 999999; /* Fix for Elementor */
    display: none;
    align-items: center;
    justify-content: center;
}
.pew-crop-content {
    background: white;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.pew-crop-actions { margin-top: 20px; text-align: right; display: flex; justify-content: flex-end; gap: 10px; }

/* --- TOAST NOTIFICATIONS (No More Alerts) --- */
#pew-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000000;
}
.pew-toast {
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out;
    min-width: 250px;
}
.pew-toast.success { border-left: 5px solid #2ecc71; }
.pew-toast.error { border-left: 5px solid #e74c3c; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- RANGE LOG --- */
.pew-log-section { margin-top: 30px; }
.pew-history-list { margin-top: 20px; border: 1px solid #eee; border-radius: 8px; overflow: hidden; }
.pew-log-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: white;
    align-items: flex-start;
}
.pew-log-item:last-child { border-bottom: none; }
.log-date { width: 100px; font-weight: bold; color: #555; font-size: 0.9em; padding-top: 2px; }
.log-details { flex-grow: 1; }
.log-details strong { color: #0073aa; display: block; margin-bottom: 4px; }
.log-details span { background: #eee; padding: 2px 6px; border-radius: 4px; font-size: 0.8em; color: #555; }
.log-details p { margin: 5px 0 0 0; color: #666; font-style: italic; font-size: 0.95em; }

/* --- BUTTONS --- */
.pew-btn-primary { background: #0073aa; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.pew-btn-primary:hover { background: #005177; }
.pew-btn-text { background: none; border: none; color: #666; cursor: pointer; text-decoration: underline; }
.btn-edit, .btn-archive, .btn-restore, .btn-edit-log {
    background: #fff; border: 1px solid #ccc; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 0.85em;
}
.btn-archive:hover { color: #e74c3c; border-color: #e74c3c; }
.pew-btn-save { background: #27ae60; color: white; border: none; padding: 12px; width: 100%; border-radius: 4px; font-weight: bold; cursor: pointer; }
.pew-btn-save:hover { background: #219150; }