:root {
    /* Professional "Corporate Dark" Palette (Slate/Indigo) */
    --bg-dark: #0f172a;
    /* Slate 900 */
    --bg-card: #1e293b;
    /* Slate 800 */
    --bg-hover: #334155;
    /* Slate 700 */

    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #94a3b8;
    /* Slate 400 */

    --accent: #6366f1;
    /* Indigo 500 */
    --accent-hover: #4f46e5;
    /* Indigo 600 */
    --accent-light: rgba(99, 102, 241, 0.1);

    --success: #10b981;
    /* Emerald 500 */
    --danger: #ef4444;
    /* Red 500 */
    --warning: #f59e0b;
    /* Amber 500 */

    --border: #334155;
    /* Slate 700 */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Branch Dropdown Styles */
.branch-dropdown-menu {
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.branch-dropdown-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--border);
}

.branch-dropdown-option:last-child {
    border-bottom: none;
}

.branch-dropdown-option:hover {
    background: var(--bg-hover);
}

.branch-dropdown-option.selected {
    background: var(--accent-light);
    color: var(--accent);
}

.branch-dropdown-option i {
    margin-right: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.branch-dropdown-option.selected i {
    color: var(--accent);
}

.branch-dropdown-option .branch-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.branch-dropdown-option .branch-check {
    color: var(--accent);
    font-size: 0.8rem;
    opacity: 0;
}

.branch-dropdown-option.selected .branch-check {
    opacity: 1;
}

.branch-dropdown-trigger:hover {
    border-color: var(--accent) !important;
}

.branch-dropdown.open .branch-dropdown-trigger {
    border-color: var(--accent) !important;
}

.branch-dropdown.open #branch-chevron {
    transform: rotate(180deg);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif;
    /* Prefer Inter for professional look */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    font-size: 0.925rem;
    /* Slightly smaller, tighter professional font size */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Module Grid Styles */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.module-card {
    background-color: transparent;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 1.25rem;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background-color: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), inset 0 0 10px rgba(99, 102, 241, 0.1);
}

.module-card .icon-wrapper {
    width: 90px;
    height: 90px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--accent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.module-card:hover .icon-wrapper {
    background-color: transparent;
    color: var(--accent-hover);
    transform: scale(1.1) rotate(3deg);
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 10px 15px rgba(99, 102, 241, 0.3));
}

.module-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-shadow: var(--shadow-md);
    z-index: 20;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0 0.5rem;
}

.logo i {
    color: var(--accent);
    font-size: 1.5rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 0.25rem;
}

.nav-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.nav-btn.active {
    background-color: var(--accent);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-arrow-btn {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
}

.nav-arrow-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-arrow-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-dark);
}

.top-bar {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
    z-index: 10;
}

#page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

#content-area {
    flex: 1;
    padding: 2rem 2rem 2rem 2rem;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

/* Tables */
.table-container {
    background-color: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #1e293b;
    /* Match card bg */
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: var(--bg-hover);
}

td {
    color: var(--text-primary);
    font-size: 0.925rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    /* Slightly sharper corners for professional look */
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.25rem;
}

.btn:active {
    transform: translateY(1px);
}

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

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

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

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

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid transparent;
}

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

/* Icon Buttons */
.btn-icon {
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon.delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 16px; /* Prevents iOS zoom on focus - must be 16px or larger */
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none; /* Better mobile styling */
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    input, select, textarea {
        min-height: 44px;
    }
    
    .nav-btn, .nav-arrow-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    /* Darker backdrop */
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 600px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: scale(0.98);
    transition: transform 0.2s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.hidden {
    display: none;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.user-profile:hover {
    background-color: var(--bg-hover);
}

.user-profile span {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification-wrapper:hover {
    background-color: var(--bg-hover);
}

.notification-icon {
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.notification-wrapper:hover .notification-icon {
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 1px solid var(--bg-card);
    box-shadow: 0 0 0 1px var(--bg-card);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logout-btn {
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
    margin-left: 0.25rem;
}

.logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Profile Dropdown */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-profile span {
    cursor: pointer;
}



.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    width: 180px;
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.profile-dropdown.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.profile-dropdown a {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.profile-dropdown a:hover {
    background-color: var(--bg-hover);
}

.profile-dropdown a i {
    width: 16px;
    color: var(--text-secondary);
}

/* Notification Dropdown */
.notification-wrapper {
    position: relative;
    cursor: pointer;
    margin-right: 1rem;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    width: 320px;
    max-height: 400px;
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.notification-dropdown.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-hover);
}

.notification-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: var(--bg-hover);
}

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

.notification-item-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notification-item-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-item-stock {
    color: var(--danger);
    font-weight: 600;
}

.notification-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==================== ADDITIONAL PROFESSIONAL STYLES ==================== */

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.toast.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.toast.warning {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-info {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
}

/* Improved Table Styles */
.table-responsive {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

table tbody tr {
    transition: background-color 0.15s ease;
}

table tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

/* Action Buttons in Tables */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.action-buttons .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

/* Focus States */
input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Transitions for smoother interactions */
.btn,
.card,
.module-card,
input,
select,
textarea {
    transition: all 0.2s ease;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .module-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .module-card {
        padding: 1.5rem 1rem;
    }
    
    .module-card .icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    #content-area {
        padding: 1rem;
    }
    
    .top-bar {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .app-brand {
        display: none;
    }
    
    #page-title {
        font-size: 1.1rem;
    }
    
    /* Modal mobile styles */
    .modal-content {
        max-width: 95%;
        padding: 1rem;
        margin: 0.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-content.modal-wide {
        max-width: 98%;
        width: 98%;
    }
    
    .modal-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-bottom: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
        width: 100%;
    }
    
    .modal-header > div {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
    
    .modal-header .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Tables mobile */
    th, td {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 500px;
    }
    
    /* Form mobile */
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    input, select, textarea {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Product tabs mobile */
    .product-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
    
    .product-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .product-tab i {
        margin-right: 0.25rem;
    }
    
    .product-info-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .product-info-header .product-prices {
        text-align: left;
        display: flex;
        gap: 1rem;
    }
    
    .product-tab-content .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* Card adjustments */
    .card {
        padding: 1rem;
    }
    
    .stat-card .value {
        font-size: 1.5rem;
    }
    
    /* Navigation controls */
    .nav-controls {
        display: none !important;
    }
    
    /* Branch dropdown mobile */
    .branch-dropdown {
        margin-right: 0.5rem !important;
    }
    
    .branch-dropdown-trigger {
        min-width: 100px !important;
        padding: 0.4rem 0.5rem !important;
    }
    
    #branch-selected-text {
        font-size: 0.75rem !important;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* User profile mobile */
    .user-profile {
        gap: 0.5rem !important;
    }
    
    .user-profile > span {
        display: none;
    }
}

@media (max-width: 480px) {
    .module-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0.5rem;
    }
    
    .module-card {
        padding: 1rem 0.75rem;
    }
    
    .module-card .icon-wrapper {
        width: 50px;
        height: 50px;
        font-size: 1.75rem;
    }
    
    .module-card h3 {
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    #content-area {
        padding: 0.75rem;
    }
    
    .top-bar {
        padding: 0.5rem 0.75rem;
    }
    
    #page-title {
        font-size: 1rem;
    }
    
    /* Modal mobile small */
    .modal-content {
        padding: 0.75rem;
        border-radius: 0.5rem;
    }
    
    .modal-header h3 {
        font-size: 1rem;
    }
    
    .modal-header .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .modal-header .btn i {
        margin-right: 0;
    }
    
    .modal-header .btn span,
    .modal-header .btn:not(:has(i)) {
        /* Keep icon-only on very small screens */
    }
    
    /* Product tabs small screens */
    .product-tab {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .product-tab i {
        display: block;
        margin: 0 0 0.25rem 0;
        font-size: 1rem;
    }
    
    .product-info-header .product-name {
        font-size: 1rem;
    }
    
    .product-info-header .product-sku {
        font-size: 0.8rem;
    }
    
    .product-tab-content .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .product-tab-content .card {
        padding: 0.75rem;
    }
    
    .product-tab-content .card label {
        font-size: 0.75rem !important;
    }
    
    .product-tab-content .card > div:not(.table-container) {
        font-size: 1rem !important;
    }
    
    /* Table mobile very small */
    th, td {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Forms small screens */
    .stats-grid .form-group {
        margin-bottom: 0.5rem;
    }
    
    input, select, textarea {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Modal footer mobile */
    .modal-footer {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .modal-footer > div {
        width: 100%;
        justify-content: center;
    }
    
    /* Branch dropdown very small */
    .branch-dropdown-trigger {
        min-width: 80px !important;
    }
    
    #branch-selected-text {
        max-width: 60px;
    }
    
    /* Home button */
    .home-btn {
        width: 32px !important;
        height: 32px !important;
    }
}

/* Wide Product Modal with Tabs */
.modal-content.modal-wide {
    max-width: 900px;
    width: 95%;
}

.product-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.product-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    transition: all 0.2s;
}

.product-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.product-tab.active {
    color: var(--primary);
}

.product-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.product-tab-content {
    display: none;
    min-height: 300px;
}

.product-tab-content.active {
    display: block;
}

.product-info-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.product-info-header .product-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.product-info-header .product-sku {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.product-info-header .product-prices {
    text-align: right;
}

.product-info-header .price-cost {
    color: var(--warning);
    font-size: 0.9rem;
}

.product-info-header .price-sell {
    color: var(--success);
    font-size: 1.1rem;
    font-weight: 600;
}