/* Fours Butchery BOM - Modern Design System */
/* Developed for a premium, professional butchery experience */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Color Palette */
    --primary: #dc3545;            /* Crimson Red */
    --primary-dark: #b02a37;
    --primary-light: #e4606d;
    --secondary: #1a1a1a;          /* Deep Charcoal */
    --accent: #ffc107;             /* Amber for alerts/highlights */
    
    /* Neutral Colors */
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border-color: #dfe6e9;
    
    /* Dark Mode Variants */
    --dark-bg: #0f0f0f;
    --dark-card: #1e1e1e;
    --dark-text: #e0e0e0;
    --dark-border: #333333;
    
    /* Spacing & Sizes */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .font-heading {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--secondary);
}

/* Glassmorphism Classes */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dark-text);
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0 !important;
    left: 0 !important;
    background: var(--secondary);
    color: white;
    padding: 0; /* Removed padding to manage sub-elements better */
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    padding-top: 0.5rem;
}

/* Custom scrollbar for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}
.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: #b2bec3;
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.2rem;
    transition: var(--transition);
    font-size: 0.9rem;
}

.nav-link:hover, .nav-link.active {
    background: rgba(220, 53, 69, 0.15);
    color: var(--primary-light);
}

.nav-link i {
    width: 24px;
    font-size: 1.2rem;
}

/* Top Navbar */
.top-navbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 70px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    padding: 2.5rem;
    padding-top: 6.5rem; /* Explicit clearance for fixed header */
    min-height: 100vh;
}

/* Component: Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(220, 53, 105, 0.3);
}

/* Inventory Status Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-low { background: #fff3cd; color: #856404; }
.badge-ok { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Form Design System - PREMIUM */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: #ffffff;
    border: 2px solid #edf2f7;
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.form-control::placeholder {
    color: #a0aec0;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5568'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

/* Checkboxes */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Offcanvas Styles - PREMIUM */
.offcanvas {
    background: var(--bg-card);
    border: none !important;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition) !important;
    width: 450px !important;
}

@media (max-width: 576px) {
    .offcanvas { width: 100% !important; }
}

.offcanvas-header {
    background: var(--secondary) !important;
    color: white !important;
    padding: 1.5rem 2rem !important;
    border-bottom: 4px solid var(--primary) !important;
}

.offcanvas-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: white !important;
}

.offcanvas-body {
    padding: 2rem !important;
}

.inventory-scroll-area {
    height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 1.5rem;
    background: #fdfdfd;
}

.inventory-item {
    background: white;
    border: 1px solid #edf2f7;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inventory-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

.inventory-item .item-info strong {
    color: var(--secondary);
    font-size: 0.95rem;
    display: block;
}

.inventory-item .item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.inventory-item .badge {
    font-size: 0.7rem;
}

/* Permission Matrix */
.permission-row {
    padding: 1rem 0;
    border-bottom: 1px solid #edf2f7;
}

.permission-row:last-child {
    border-bottom: none;
}

.permission-row label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.perm-cb-wrapper {
    display: flex;
    gap: 10px;
}

.perm-cb-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-main);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
}

.perm-cb-item:hover {
    border-color: var(--primary-light);
    background: white;
}

.perm-cb-item input[type="checkbox"] {
    margin-bottom: 4px;
}

.perm-cb-item span {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* Modal Styling Enhancements */
[id*="Modal"] .card {
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

/* Select2 Premium Overrides */
.select2-container--default .select2-selection--single {
    height: 48px !important;
    border: 2px solid #edf2f7 !important;
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 1rem !important;
    display: flex !important;
    align-items: center !important;
    transition: var(--transition);
    background-color: #ffffff !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main) !important;
    padding-left: 0 !important;
    line-height: normal !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px !important;
    right: 12px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.select2-dropdown {
    border: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    z-index: 1061; /* Above modals */
}

.select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary) !important;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar { width: 80px; padding: 1rem; }
    .sidebar-logo span, .nav-link span { display: none; }
    .main-content { margin-left: 80px; }
    .top-navbar { left: 80px; }
}

@media (max-width: 576px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 1rem; padding-top: 6rem; }
    .top-navbar { left: 0; }
}

/* Footer Styling */
footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-left: 260px;
}

@media (max-width: 992px) {
    footer { margin-left: 80px; }
}

@media (max-width: 576px) {
    footer { margin-left: 0; }
}
