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

/* ==================== */
/* Auth Page Styles     */
/* ==================== */

.auth-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-page.hidden {
    display: none;
}

#clerk-auth {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    font-size: 1.25rem;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.auth-field input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-field .field-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #888;
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-google:hover {
    background: #f8f8f8;
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    padding: 0 1rem;
    color: #888;
    font-size: 0.85rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Email Confirmation Message */
.email-confirmation-message {
    text-align: center;
    padding: 1rem 0;
}

.email-confirmation-message .confirmation-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-confirmation-message .confirmation-icon i {
    font-size: 2rem;
    color: white;
}

.email-confirmation-message h3 {
    color: #1a1a1a;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.email-confirmation-message p {
    color: #666;
    margin-bottom: 0.5rem;
}

.email-confirmation-message .confirmation-hint {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1.5rem;
}

.email-confirmation-message .btn {
    margin-top: 1rem;
}

/* ==================== */
/* Header User Dropdown */
/* ==================== */

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #333;
    transition: all 0.2s;
}

.user-dropdown-btn:hover {
    background: #f8f8f8;
    border-color: #ccc;
}

.user-dropdown-btn i:first-child {
    font-size: 1.25rem;
    color: #666;
}

.user-dropdown-btn i:last-child {
    font-size: 0.7rem;
    color: #888;
    transition: transform 0.2s;
}

.user-dropdown.open .user-dropdown-btn i:last-child {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-dropdown-header span:first-child {
    font-size: 0.85rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #e9ecef;
    color: #495057;
    width: fit-content;
}

.user-role-badge.admin {
    background: #667eea;
    color: white;
}

.user-role-badge.superadmin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.user-role-badge.employee {
    background: #e9ecef;
    color: #495057;
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #667eea;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength::after {
    content: '';
    display: block;
    height: 100%;
    width: var(--strength, 0%);
    background: var(--strength-color, #e0e0e0);
    transition: width 0.3s, background 0.3s;
}

.password-strength.weak::after {
    --strength: 25%;
    --strength-color: #dc3545;
}

.password-strength.fair::after {
    --strength: 50%;
    --strength-color: #ffc107;
}

.password-strength.good::after {
    --strength: 75%;
    --strength-color: #17a2b8;
}

.password-strength.strong::after {
    --strength: 100%;
    --strength-color: #28a745;
}

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: #888;
}

/* Auth Description */
.auth-description {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Forgot Password Link */
.auth-forgot-password {
    text-align: center;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.auth-forgot-password a {
    color: #888;
    font-size: 0.85rem;
    text-decoration: none;
}

.auth-forgot-password a:hover {
    color: #667eea;
    text-decoration: underline;
}

/* ==================== */
/* Users Management     */
/* ==================== */

.users-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.users-table th,
.users-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.users-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.users-table tbody tr:hover {
    background: #f8f9fa;
}

.users-table .user-name {
    font-weight: 500;
    color: #1a1a1a;
}

.users-table .user-email {
    color: #666;
    font-size: 0.85rem;
}

.users-table .user-stores {
    font-size: 0.85rem;
    color: #666;
}

.users-table .user-stores .no-stores {
    color: #999;
    font-style: italic;
}

.user-status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.user-status-badge.active {
    background: #d4edda;
    color: #155724;
}

.user-status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

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

.users-table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* User Edit Modal */
.user-edit-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.user-edit-info p {
    margin: 0.25rem 0;
    color: #495057;
}

.store-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.store-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.store-checkbox-item:hover {
    background: #f0f0f0;
}

.store-checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.store-checkbox-item label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}

/* Form Select */
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Section Card */
.section-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.user-dropdown-item:hover {
    background: #f8f8f8;
}

.user-dropdown-item i {
    width: 16px;
    color: #666;
}

.user-dropdown-item.logout {
    color: #dc3545;
    border-top: 1px solid #f0f0f0;
}

.user-dropdown-item.logout i {
    color: #dc3545;
}

.user-dropdown-item.logout:hover {
    background: #fff5f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #fafafa;
    min-height: 100vh;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.app-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 60px);
}

/* Header */
.header {
    background: white;
    color: #1a1a1a;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
    letter-spacing: -0.025em;
}

.header h1 i {
    margin-right: 0.5rem;
    color: #666;
    font-size: 1.1rem;
}

.store-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.store-selector label {
    font-weight: 500;
}

.store-selector select {
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    background: white;
    color: #333;
    font-size: 1rem;
    min-width: 150px;
}

/* Sidebar */
.sidebar {
    width: 200px;
    background: white;
    border-right: 1px solid #f0f0f0;
    padding: 1rem 0;
    flex-shrink: 0;
    position: relative;
    transition: width 0.3s ease, padding 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
    padding: 1rem 0.25rem;
}

.sidebar.collapsed .nav-tab span {
    display: none;
}

.sidebar.collapsed .nav-tab {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar-toggle {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 10;
}

.sidebar-toggle:hover {
    background: #f0f0f0;
    color: #1a1a1a;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 0.75rem;
}

.nav-tab {
    position: relative;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #666;
    transition: all 0.15s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    width: 100%;
}

.nav-tab:hover {
    background: #f8f8f8;
    color: #1a1a1a;
}

.nav-tab.active {
    background: #f8f8f8;
    color: #1a1a1a;
    font-weight: 600;
}

.nav-tab i {
    font-size: 0.875rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-tab.active i {
    opacity: 1;
}

.nav-tab span {
    flex: 1;
}

/* Role-based tooltips for navigation tabs */
.nav-tab[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    padding: 6px 10px;
    background: #1a1a1a;
    color: white;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-tab[data-tooltip]::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 4px;
    border-width: 4px;
    border-style: solid;
    border-color: transparent #1a1a1a transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.nav-tab[data-tooltip]:hover::after,
.nav-tab[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem;
    background: #fafafa;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.15s ease;
}

.stat-card:hover {
    border-color: #e0e0e0;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon { background: #1a1a1a; }
.stat-card:nth-child(2) .stat-icon { background: #666; }
.stat-card:nth-child(3) .stat-icon { background: #999; }
.stat-card:nth-child(4) .stat-icon { background: #333; }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.025em;
}

.stat-info p {
    color: #666;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 400;
}

/* Low Stock Alerts */
.low-stock-alerts {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.low-stock-alerts h2 {
    color: #2d3436;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.low-stock-alerts h2 i {
    margin-right: 0.5rem;
    color: #fdcb6e;
}

.low-stock-container {
    max-height: 300px;
    overflow-y: auto;
}

.low-stock-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.low-stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.low-stock-warning {
    border-left: 3px solid #fdcb6e;
}

.low-stock-critical {
    border-left: 3px solid #d63031;
}

.low-stock-icon {
    display: none;
}

.low-stock-details {
    flex: 1;
    min-width: 0;
}

.low-stock-flavor {
    font-weight: 600;
    color: #2d3436;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.low-stock-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.low-stock-count strong {
    color: #2d3436;
    font-size: 0.9rem;
}

.low-stock-breakdown {
    color: #636e72;
    font-size: 0.85rem;
}

.low-stock-breakdown::before {
    content: "•";
    margin: 0 0.3rem;
    color: #adb5bd;
}

.low-stock-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.low-stock-warning .low-stock-badge {
    background: #fdcb6e;
    color: #2d3436;
}

.low-stock-critical .low-stock-badge {
    background: #d63031;
    color: white;
}

.low-stock-empty {
    text-align: center;
    padding: 2rem;
    color: #00b894;
}

.low-stock-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.low-stock-empty p {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Recent Activity */
.recent-activity {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.recent-activity h2 {
    color: #2d3436;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.recent-activity h2 i {
    margin-right: 0.5rem;
    color: #ff6b6b;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.activity-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
}

.activity-delivery .activity-icon { background: #00b894; }
.activity-movement .activity-icon { background: #74b9ff; }
.activity-disposal .activity-icon { background: #fd79a8; }

.activity-details {
    flex: 1;
}

.activity-details strong {
    color: #2d3436;
}

.activity-time {
    color: #636e72;
    font-size: 0.85rem;
}

/* Forms */
.form-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Responsive form container */
@media (max-width: 768px) {
    .form-container {
        max-width: 600px;
        padding: 1.5rem;
    }
}

.form-container h2 {
    color: #2d3436;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-container h2 i {
    margin-right: 0.5rem;
    color: #ff6b6b;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    margin-bottom: 1rem;
}

.form-group.compact {
    padding: 1rem;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group h3 {
    margin: 0 0 0.75rem 0;
    color: #1a1a1a;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.form-group label {
    font-weight: 600;
    color: #2d3436;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.8125rem;
    transition: border-color 0.15s ease;
    background: white;
    color: #1a1a1a;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a1a1a;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 1);
}

.btn-primary {
    background: #1a1a1a;
    color: white;
    border: 1px solid #1a1a1a;
}

.btn-primary:hover {
    background: #333;
    border-color: #333;
}

.btn-secondary {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(253, 121, 168, 0.4);
}

/* Inventory */
.inventory-container {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.inventory-header h2 {
    color: #2d3436;
    font-size: 1.5rem;
}

.inventory-header h2 i {
    margin-right: 0.5rem;
    color: #ff6b6b;
}

.inventory-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.inventory-filters input,
.inventory-filters select {
    padding: 0.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
}

.inventory-filters input {
    flex: 1;
    min-width: 200px;
}

/* Loading and Toast */
.loading-overlay {
    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;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

.loading-spinner i {
    font-size: 2rem;
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

.toast.success { border-left-color: #00b894; }
.toast.error { border-left-color: #fd79a8; }
.toast.warning { border-left-color: #fdcb6e; }

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

/* Responsive Design - Mobile First Approach */

/* Tablet and Mobile Layout */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 0.75rem 0;
    }

    .nav-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 1rem;
        gap: 4px;
    }

    .nav-tab {
        flex-shrink: 0;
        padding: 0.75rem 1rem;
        white-space: nowrap;
        min-width: auto;
    }

    .nav-tab span {
        display: none;
    }

    .nav-tab i {
        margin: 0;
        width: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 1rem;
    }

    .form-col {
        width: 100%;
    }
}

/* Mobile First - Small devices (phones, 320px and up) */
@media (max-width: 480px) {

    .header {
        padding: 0.75rem;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .main-content {
        padding: 0.75rem;
    }

    .nav-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
    }

    .nav-tab {
        padding: 0.6rem 0.8rem;
        font-size: 0.75rem;
        min-width: 80px;
        flex-shrink: 0;
        text-align: center;
    }

    .nav-tab i {
        display: block;
        margin-bottom: 0.25rem;
        font-size: 1rem;
    }

    /* Movement Form Mobile Optimizations */
    .flavor-quick-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .flavor-btn {
        padding: 1rem 0.5rem;
        font-size: 0.8rem;
        text-align: center;
        min-height: 60px;
    }

    .location-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .location-btn {
        padding: 1.25rem 1.5rem;
        font-size: 0.9rem;
        min-height: 60px;
        justify-content: flex-start;
    }

    .location-btn i {
        font-size: 1.2rem;
        width: 20px;
    }

    .location-btn span {
        font-size: 0.95rem;
        font-weight: 600;
        text-align: left;
    }

    .quantity-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .quantity-controls input {
        width: 100px;
        font-size: 1.2rem;
        padding: 0.75rem;
    }

    .qty-control-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .quantity-presets {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        width: 100%;
        max-width: 300px;
    }

    .qty-btn {
        padding: 0.75rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .inventory-header {
        flex-direction: column;
        align-items: stretch;
    }

    .inventory-filters {
        flex-direction: column;
    }
}

/* Medium devices (tablets, 481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        margin: 1rem;
        border-radius: 12px;
    }

    .header {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .nav-tabs {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-tab {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: 120px;
    }

    /* Movement Form Tablet Optimizations */
    .flavor-quick-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .flavor-btn {
        padding: 1rem;
        font-size: 0.9rem;
        min-height: 60px;
    }

    .location-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .location-btn {
        padding: 1.25rem 1.5rem;
        font-size: 0.9rem;
        min-height: 60px;
        justify-content: flex-start;
    }

    .location-btn i {
        font-size: 1.2rem;
        width: 22px;
    }

    .location-btn span {
        font-size: 0.95rem;
        font-weight: 600;
        text-align: left;
    }

    .quantity-controls {
        justify-content: center;
        gap: 1rem;
    }

    .quantity-presets {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 0.5rem;
        max-width: 400px;
        margin: 0 auto;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large tablets and small laptops (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        margin: 2rem auto;
        max-width: 900px;
    }

    .nav-tabs {
        justify-content: center;
        gap: 1rem;
    }

    .nav-tab {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Movement Form Large Tablet Optimizations */
    .flavor-quick-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    .location-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .quantity-presets {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 0.75rem;
        max-width: 500px;
        margin: 0 auto;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop and large screens (1025px and up) */
@media (min-width: 1025px) {
    .container {
        margin: 2rem auto;
        max-width: 1200px;
    }

    .nav-tabs {
        justify-content: center;
        gap: 1.5rem;
    }

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

    /* Movement Form Desktop Optimizations */
    .flavor-quick-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
        max-width: 600px;
        margin: 0 auto;
    }

    .location-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .quantity-presets {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 1rem;
        max-width: 600px;
        margin: 0 auto;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra large screens (1440px and up) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .flavor-quick-buttons {
        max-width: 800px;
    }

    .quantity-presets {
        max-width: 700px;
    }

    .form-row {
        gap: 4rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .flavor-btn,
    .location-btn,
    .qty-btn,
    .qty-control-btn {
        min-height: 48px; /* Minimum touch target size */
        min-width: 48px;
    }

    .location-btn {
        min-height: 55px; /* Larger touch target for location buttons */
    }

    .nav-tab {
        min-height: 48px;
    }

    .btn {
        min-height: 48px;
        padding: 1rem 1.5rem;
    }

    /* Increase touch targets on small screens */
    @media (max-width: 768px) {
        .flavor-btn,
        .location-btn {
            min-height: 55px;
        }

        .qty-btn {
            min-height: 50px;
        }

        .qty-control-btn {
            min-height: 50px;
            min-width: 50px;
        }
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .flavor-btn,
    .location-btn,
    .qty-btn {
        border-width: 1px; /* Thinner borders on high DPI */
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .nav-tabs {
        overflow-x: auto;
        justify-content: flex-start;
    }

    .flavor-quick-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .location-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .quantity-presets {
        grid-template-columns: repeat(6, 1fr);
        max-width: 500px;
    }
}

/* Print styles */
@media print {
    .nav-tabs,
    .form-actions,
    .btn {
        display: none;
    }

    .container {
        margin: 0;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Flavor Selection Buttons */
.flavor-quick-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    width: 100%;
}

.flavor-btn {
    background: white;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
    font-size: 0.8125rem;
    text-align: center;
}

.flavor-btn.compact {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
}

.flavor-btn:hover {
    border-color: #ccc;
    background: #f8f8f8;
}

.flavor-btn.active {
    background: #f8f8f8;
    color: #1a1a1a;
    border-color: #1a1a1a;
    font-weight: 600;
}

.flavor-quick-buttons.compact {
    gap: 0.5rem;
}

.flavor-dropdown-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.flavor-dropdown-section label {
    font-size: 0.9rem;
    color: #636e72;
    margin-bottom: 0.5rem;
    display: block;
}

/* Location Selection Buttons */
.location-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.location-btn {
    background: white;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    font-weight: 500;
    min-height: 56px;
    text-align: left;
    word-wrap: break-word;
    overflow: hidden;
    width: 100%;
    font-size: 0.8125rem;
}

.location-btn.compact {
    padding: 0.75rem 1rem;
    min-height: 44px;
    gap: 0.5rem;
}

.location-buttons.compact {
    gap: 0.5rem;
}

.location-btn:hover {
    border-color: #ccc;
    background: #f8f8f8;
}

.location-btn.active {
    background: #f8f8f8;
    color: #1a1a1a;
    border-color: #1a1a1a;
    font-weight: 600;
}

.location-btn.disabled {
    background: #f8f8f8;
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
    border-color: #f0f0f0;
}

.location-btn.disabled:hover {
    background: #f8f8f8;
    border-color: #f0f0f0;
    color: #ccc;
}

.location-btn i {
    font-size: 1rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    opacity: 0.7;
}

.location-btn.active i {
    opacity: 1;
}

.location-btn span {
    font-size: 0.8125rem;
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
    text-align: left;
    flex: 1;
    font-weight: 500;
}

/* Pan Size Buttons */
.pan-size-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.pan-size-btn {
    background: white;
    border: 1px solid #e0e0e0;
    color: #666;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    min-height: 44px;
    flex: 1;
    font-size: 0.875rem;
}

.pan-size-btn:hover {
    border-color: #ccc;
    background: #f8f8f8;
}

.pan-size-btn.active {
    background: #f8f8f8;
    color: #1a1a1a;
    border-color: #1a1a1a;
    font-weight: 600;
}

.pan-size-btn i {
    font-size: 1rem;
    opacity: 0.7;
}

.pan-size-btn.active i {
    opacity: 1;
}

/* Lot Entry Rows */
.lot-entry-row {
    display: grid;
    grid-template-columns: 1fr 1fr 80px auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.lot-entry-row .form-group {
    margin-bottom: 0;
}

.lot-entry-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
}

.lot-entry-row input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
}

.lot-entry-row input[type="text"]:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.lot-entry-row .pan-size-buttons {
    display: flex;
    gap: 0.5rem;
}

.lot-entry-row .pan-size-btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.lot-entry-row .quantity-group {
    min-width: 70px;
}

.lot-entry-row .quantity-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: center;
}

.lot-entry-row .quantity-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.lot-entry-row .remove-lot-btn {
    padding: 0.5rem 1rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.lot-entry-row .remove-lot-btn:hover {
    background: #c82333;
}

.lot-entry-row .remove-lot-btn i {
    margin-right: 0.25rem;
}

#lotEntriesContainer {
    margin-bottom: 1rem;
}

#addLotEntryBtn {
    width: 100%;
}

/* Inventory Quick View */
.inventory-quick-view {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.inventory-quick-view h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3436;
}

.quick-inventory {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.inventory-item {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inventory-item:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.inventory-item.clickable:hover {
    background: #667eea;
    color: white;
}

.inventory-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.inventory-item-stock {
    font-size: 0.75rem;
    color: #636e72;
}

.inventory-item.clickable:hover .inventory-item-stock {
    color: rgba(255, 255, 255, 0.8);
}

/* Manual Form Section */
.manual-form {
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.manual-form h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3436;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.quantity-controls.compact {
    margin-bottom: 0.5rem;
    gap: 0.25rem;
}

.qty-control-btn {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    color: #495057;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.qty-control-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.quantity-controls input {
    width: 80px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem;
}

.quantity-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.quantity-presets.compact {
    gap: 0.25rem;
}

.qty-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #4a5568;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.qty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 1);
}

.qty-btn.active {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2d3748;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 237, 234, 0.3);
}

/* Flavor Stock Info */
.flavor-stock-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #636e72;
    display: none;
}

.flavor-stock-info.show {
    display: block;
}

.stock-location {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.stock-location:last-child {
    margin-bottom: 0;
}

/* Bulk Delivery Styles */
.form-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.bulk-flavors-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 1rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

/* More columns on larger screens for better space usage */
@media (min-width: 768px) {
    .bulk-flavors-container {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (min-width: 1024px) {
    .bulk-flavors-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (min-width: 1200px) {
    .bulk-flavors-container {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (min-width: 1400px) {
    .bulk-flavors-container {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

.flavor-quantity-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
}

.flavor-quantity-item label {
    margin: 0;
    font-weight: 500;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.2;
    word-wrap: break-word;
}

.flavor-quantity-item input {
    width: 100%;
    max-width: 100px;
    margin: 0 auto;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
}

.flavor-quantity-item input:focus {
    border-color: #1a1a1a;
    outline: none;
}

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

.bulk-actions .btn {
    font-size: 13px;
    padding: 0.5rem 0.75rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
}

/* Deliveries List Styles */
.deliveries-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.delivery-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delivery-item:hover {
    border-color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.delivery-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.delivery-date {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.delivery-summary {
    color: #666;
    font-size: 0.9rem;
}

.delivery-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.delivery-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #666;
    font-size: 0.85rem;
}

.delivery-stat i {
    color: #1a1a1a;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

.modal-header h3 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #1a1a1a;
}

.modal-body {
    padding: 1.5rem;
}

/* Account Settings Modal - Responsive Sizing */
#accountModal .modal-content {
    max-width: 700px;
    max-height: 90vh;
    width: 95%;
}

#clerk-user-profile {
    width: 100%;
}

/* Tablet and below */
@media (max-width: 768px) {
    #accountModal .modal-content {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        height: 100%;
        border-radius: 0;
        margin: 0;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    #accountModal .modal-body {
        padding: 1rem;
    }
}

.delivery-detail-section {
    margin-bottom: 1.5rem;
}

.delivery-detail-section h4 {
    margin: 0 0 0.75rem 0;
    color: #1a1a1a;
    font-size: 1rem;
    font-weight: 600;
}

.delivery-flavors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.delivery-flavor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
}

.delivery-flavor-name {
    font-weight: 500;
    color: #1a1a1a;
}

.delivery-flavor-quantity {
    font-weight: 600;
    color: #666;
}

/* Ensure modal content is non-editable */
.modal-body * {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Read-only inputs for delivery detail modal only */
#deliveryModal .modal-body input,
#deliveryModal .modal-body textarea,
#deliveryModal .modal-body select {
    pointer-events: none;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: #1a1a1a;
    font-size: 1.25rem;
}

.empty-state p {
    margin: 0;
    font-size: 0.9rem;
}

/* Reports Page */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.report-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.report-card:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.report-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.report-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.report-card p {
    margin: 0 0 1.5rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
}

.report-card .btn {
    width: 100%;
}

/* Report View */
#reportSelection,
#reportView {
    animation: fadeIn 0.3s ease-in-out;
}

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

.report-view-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

/* Row 1: Back button */
.report-back-row {
    display: flex;
    align-items: center;
}

.report-back-row #backToReports {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background: transparent;
    color: #636e72;
    border: 1px solid #dfe6e9;
    transition: all 0.2s ease;
}

.report-back-row #backToReports:hover {
    background: #f8f9fa;
    color: #2d3436;
    border-color: #b2bec3;
}

/* Row 2: Title and action buttons */
.report-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.report-title-row h2 {
    margin: 0;
    flex: 1;
    font-size: 1.5rem;
    color: #1a1a1a;
    min-width: 250px;
}

/* Row 3: Checkbox controls */
.report-controls-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Row 4: Date range controls */
.report-date-range-row {
    padding-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

.report-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.report-actions #downloadPdfReport {
    background: #6c757d;
    color: white;
}

.report-actions #downloadPdfReport:hover {
    background: #5a6268;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.report-content {
    padding: 0;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.report-table th,
.report-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.report-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1a1a1a;
    position: sticky;
    top: 0;
}

.report-table tr:hover {
    background: #f8f9fa;
}

.report-table td {
    color: #495057;
}

/* Print styles */
@media print {
    @page {
        margin: 0.5in;
        size: auto;
    }

    body {
        margin: 0;
    }

    .header,
    .sidebar,
    .report-actions,
    .report-card,
    .report-back-row,
    .report-controls-row,
    .report-date-range-row,
    .report-timestamp {
        display: none !important;
    }

    .report-preview {
        border: none;
        box-shadow: none;
    }

    .report-content {
        max-height: none;
        overflow: visible;
    }

    .report-table th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .bulk-flavors-container {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .flavor-quantity-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .flavor-quantity-item input {
        width: 60px;
    }

    .bulk-actions {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }

    .report-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .report-title-row h2 {
        font-size: 1.25rem;
        min-width: auto;
        width: 100%;
    }

    .report-actions {
        width: 100%;
        flex-direction: column;
    }

    .report-actions .btn {
        width: 100%;
    }

    .report-content {
        max-height: calc(100vh - 350px);
    }
}

/* Column Selection Modal Styles */
.column-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.column-checkbox-label:hover span {
    color: #1a1a1a;
}

.column-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    pointer-events: auto !important;
    background: white !important;
    border: 2px solid #adb5bd !important;
}

.column-checkbox-label span {
    font-size: 0.95rem;
    color: #495057;
}

.column-checkbox-label input[type="checkbox"]:checked {
    accent-color: #1a1a1a;
}

/* Outline button style */
.btn-outline {
    background: white;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    background: #1a1a1a;
    color: white;
}

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

/* Pallet Temperature Styles */
.pallet-temps-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.pallet-temp-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.pallet-label {
    font-weight: 600;
    font-size: 1rem;
    color: #1a1a1a;
    min-width: 40px;
    text-align: center;
    padding: 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
}

.pallet-temp-presets {
    display: flex;
    gap: 0.25rem;
}

.temp-preset-btn {
    padding: 0.4rem 0.6rem;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s ease;
}

.temp-preset-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.temp-preset-btn.active {
    background: #1a1a1a;
    color: white;
    border-color: #1a1a1a;
}

.pallet-temp-input {
    flex: 1;
    max-width: 80px;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: center;
}

.pallet-temp-input:focus {
    outline: none;
    border-color: #1a1a1a;
}

.pallet-temp-unit {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.remove-pallet-btn {
    padding: 0.4rem 0.75rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.remove-pallet-btn:hover {
    background: #c82333;
}

.remove-pallet-btn i {
    margin-right: 0.25rem;
}

#addPalletBtn {
    margin-top: 0.5rem;
}

/* Pallet temps in delivery modal */
.pallet-temps-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.pallet-temp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 20px;
    font-size: 0.9rem;
}

.pallet-temp-badge .pallet-name {
    font-weight: 600;
    color: #1565c0;
}

.pallet-temp-badge .pallet-value {
    color: #1a1a1a;
}

/* Empty pallet state */
.pallet-temps-empty {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 6px;
}

/* ==================== */
/* Superadmin Styles    */
/* ==================== */

/* Crown icon styling */
.superadmin-crown {
    color: #ffc107 !important;
}

.nav-tab .superadmin-crown {
    opacity: 1 !important;
}

.nav-tab.active .superadmin-crown {
    color: #ffc107 !important;
}

/* Superadmin header */
.superadmin-header {
    margin-bottom: 2rem;
}

.superadmin-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem 0;
    color: #1a1a1a;
    font-size: 1.5rem;
}

/* Superadmin form section */
.superadmin-form-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.superadmin-form-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    color: #1a1a1a;
    font-size: 1.1rem;
}

.superadmin-form-section h3 i {
    color: #667eea;
}

.superadmin-form-section .form-group {
    background: white;
    margin-bottom: 1rem;
}

.superadmin-form-section .form-group:last-of-type {
    margin-bottom: 1.5rem;
}

.superadmin-form-section .field-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Store code uppercase styling */
#newStoreCode {
    text-transform: uppercase;
}

#newStoreCode::placeholder {
    text-transform: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .pallet-temp-row {
        flex-wrap: wrap;
    }

    .pallet-temp-input {
        max-width: none;
        flex: 1;
        min-width: 80px;
    }

    .remove-pallet-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* ==================== */
/* Action Cards Grid    */
/* ==================== */

.superadmin-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-card:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.action-card-icon-inline {
    font-size: 1.1rem;
    color: #667eea;
}

.action-card-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #1a1a1a;
}

/* ==================== */
/* Flavor Management    */
/* ==================== */

.flavor-add-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.flavor-add-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 600;
}

.flavor-add-form {
    display: flex;
    gap: 0.75rem;
}

.flavor-add-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
}

.flavor-add-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.flavor-add-form .btn {
    flex-shrink: 0;
    padding: 0.75rem 1.25rem;
}

.flavor-message {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.flavor-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flavor-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flavor-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.flavor-message.warning .reactivate-prompt {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.flavor-message.warning .reactivate-prompt .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

.flavor-list-section {
    margin-bottom: 1.5rem;
}

.flavor-list-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flavor-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.flavor-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.flavor-list-item:hover {
    background: #f8f9fa;
}

.flavor-list-item .flavor-name {
    font-weight: 500;
    color: #1a1a1a;
}

.flavor-list-item .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.flavor-list-item .btn-deactivate {
    background: #6c757d;
    color: white;
    border: none;
}

.flavor-list-item .btn-deactivate:hover {
    background: #5a6268;
}

.flavor-list-item .btn-reactivate {
    background: #28a745;
    color: white;
    border: none;
}

.flavor-list-item .btn-reactivate:hover {
    background: #218838;
}

/* Deactivated Section (Collapsible) */
.deactivated-section {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.deactivated-header {
    cursor: pointer;
    user-select: none;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.deactivated-header:hover {
    background: #f8f9fa;
}

.deactivated-header h4 {
    margin: 0;
    color: #6c757d;
}

.deactivated-chevron {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

.deactivated-chevron.expanded {
    transform: rotate(90deg);
}

.deactivated-container {
    margin-top: 1rem;
}

.deactivated-container .flavor-list-item {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.deactivated-container .flavor-list-item .flavor-name {
    color: #6c757d;
}

.flavor-list-empty {
    text-align: center;
    padding: 1.5rem;
    color: #6c757d;
    font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
    .superadmin-actions-grid {
        flex-direction: column;
    }

    .action-card {
        width: 100%;
        justify-content: center;
    }

    .flavor-add-form {
        flex-direction: column;
    }

    .flavor-add-form .btn {
        width: 100%;
    }
}
