@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Clean Café Color Palette */
    --bg-primary: #FAFAFA;
    --bg-secondary: #FFFFFF;
    --text-primary: #3E2723;
    --text-secondary: #6D4C41;
    --accent-primary: #8D6E63;
    --accent-caramel: #C19A6B;
    --border-color: #E0E0E0;
    --shadow: rgba(62, 39, 35, 0.08);
    --shadow-hover: rgba(62, 39, 35, 0.12);
    
    /* Mobile-specific */
    --mobile-touch-target: 48px;
    --mobile-input-height: 56px;
    
    /* Shift Colors */
    --shift-am: #FF9800;
    --shift-pm: #9C27B0;
    --shift-night: #3F51B5;
    
    /* Spacing */
    --gap-sm: 0.5rem;
    --gap-md: 1rem;
    --gap-lg: 1.5rem;
    --gap-xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    font-family: 'Lexend', sans-serif;
    
    /* Prevent iOS text size adjustment */
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: var(--gap-lg);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Header */
header {
    max-width: 1400px;
    margin: 0 auto var(--gap-xl);
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: var(--gap-lg);
    color: var(--text-primary);
    text-align: center;
}

/* Location Tabs */
.location-tabs {
    display: flex;
    gap: var(--gap-sm);
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 var(--gap-md);
}

.location-tabs::-webkit-scrollbar {
    display: none;
}

.location-tab {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Lexend', sans-serif;
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.location-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.location-tab.active {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

h2 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: var(--gap-lg);
    color: var(--text-secondary);
}

/* Main Grid Layout */
.contents {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-xl);
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .contents {
        grid-template-columns: 350px 1fr;
    }
    
    /* Global view - full width table only */
    .contents.global-view {
        grid-template-columns: 1fr;
    }
}

/* Log Section */
.log {
    background-color: var(--bg-secondary);
    padding: var(--gap-xl);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px var(--shadow);
    height: fit-content;
    position: sticky;
    top: var(--gap-lg);
}

/* Log Header with Toggle */
.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--gap-lg);
}

.log-header h2 {
    margin-bottom: 0;
}

.toggle-form-btn {
    display: none; /* Hidden on desktop */
    width: 40px;
    height: 40px;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    padding: 0;
    font-family: 'Lexend', sans-serif;
}

.toggle-form-btn:hover {
    border-color: var(--accent-primary);
    background-color: var(--bg-secondary);
}

.form-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.form-content.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

/* Bean Type Selector (Segmented Control) */
.bean-selector {
    display: flex;
    gap: 0;
    margin-bottom: var(--gap-lg);
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 4px;
}

.bean-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Lexend', sans-serif;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bean-btn:hover {
    color: var(--text-primary);
}

.bean-btn.active {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 4px var(--shadow);
}

/* Form Styling */
#brew-log {
    display: flex;
    flex-direction: column;
    gap: var(--gap-lg);
}

.weight, .time, .grind {
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="number"] {
    padding: 0.875rem 1rem;
    font-size: 1.125rem;
    font-family: 'Lexend', sans-serif;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.1);
}

input[type="number"]::placeholder {
    color: #BDBDBD;
}

/* Remove number input arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

.log-btn {
    margin-top: var(--gap-sm);
}

button[type="submit"] {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Lexend', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

button[type="submit"]:hover {
    background-color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--shadow-hover);
}

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px var(--shadow);
}

/* History Section */
.history {
    background-color: var(--bg-secondary);
    padding: var(--gap-xl);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px var(--shadow);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: var(--gap-sm);
    margin-bottom: var(--gap-lg);
    border-bottom: 2px solid var(--border-color);
}

.filter-tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: 'Lexend', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    font-weight: 600;
}

/* Table Styling */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    border-radius: var(--radius-md);
    max-height: 600px; /* Prevents infinite page growth */
    position: relative;
}

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

thead {
    background-color: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 1rem;
    text-align: center; /* Center header text */
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Desktop: Center all table body content */
tbody td {
    text-align: center;
    vertical-align: middle;
}

tbody tr {
    transition: background-color 0.15s ease;
    animation: fadeIn 0.3s ease;
}

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

/* DESKTOP: Display as traditional table */
tbody tr {
    display: table-row;
}

tbody tr td {
    display: table-cell;
    vertical-align: middle;
}

/* Desktop: Content wrapper - children become table cells */
.brew-content {
    display: contents;
}

/* Desktop: brew-badges wrapper disappears, badges become separate table cells */
.brew-badges {
    display: contents;
}

/* Desktop: Each badge is its own table cell with VERY compact styling */
tbody .brew-badges .shift-badge,
tbody .brew-badges .bean-badge,
tbody .brew-badges .location-badge {
    display: table-cell !important;
    vertical-align: middle !important;
    text-align: center !important;
    padding: 0.3rem 0.5rem !important; /* Small compact padding */
    font-size: 0.65rem !important; /* Small text */
    border-radius: 12px !important; /* Smaller radius */
    font-weight: 600 !important;
}

.brew-details {
    display: contents;
}

.brew-details span {
    display: table-cell;
    vertical-align: middle;
    padding: 0.75rem 1rem; /* Reduced vertical padding */
}

/* Desktop: Location cell (4th column in global view) */
.brew-location-desktop {
    display: table-cell;
    vertical-align: middle;
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* Desktop: Hide mobile vertical location marker */
.location-marker {
    display: none;
}

/* Desktop: Timestamp cell */
.brew-time {
    display: table-cell;
    vertical-align: middle;
    text-align: center;
}

/* Desktop: Ensure all detail spans are centered */
.brew-details span {
    text-align: center;
}

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

/* Shift Badge */
.shift-badge {
    display: inline-block !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: 16px !important;
    font-size: 0.7rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-sizing: border-box;
}

.shift-AM {
    background-color: rgba(255, 152, 0, 0.15);
    color: var(--shift-am);
}

.shift-PM {
    background-color: rgba(156, 39, 176, 0.15);
    color: var(--shift-pm);
}

.shift-Night {
    background-color: rgba(63, 81, 181, 0.15);
    color: var(--shift-night);
}

/* Bean Type Badge */
.bean-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem ;
    border-radius: 16px ;
    font-size: 0.7rem ;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-sizing: border-box;
}

.bean-House {
    background-color: rgba(141, 110, 99, 0.15);
    color: var(--accent-primary);
}

.bean-Decaf {
    background-color: rgba(76, 175, 80, 0.15);
    color: #388E3C;
}

/* Location Badge (Global View Only) */
.location-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem !important;
    border-radius: 16px !important;
    font-size: 0.7rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-sizing: border-box;
}

.location-Shoreditch {
    background-color: rgba(63, 81, 181, 0.15);
    color: #3F51B5;
}

.location-Tower {
    background-color: rgba(233, 30, 99, 0.15);
    color: #E91E63;
}

.location-Bankside {
    background-color: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.location-Victoria {
    background-color: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

.location-Olympia {
    background-color: rgba(156, 39, 176, 0.15);
    color: #9C27B0;
}

/* Shift Group Headers */
.shift-group-header {
    background-color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 52px; /* Below table header */
    z-index: 5;
}

.shift-group-header td {
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
    text-align: left; /* Left-align shift group headers */
}

/* Stats Summary */
.stats-summary {
    display: flex;
    gap: var(--gap-md);
    margin-bottom: var(--gap-lg);
    padding: var(--gap-md);
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--gap-xl) 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--gap-md);
    opacity: 0.3;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state .hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Smooth Transitions (Global) */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* Enhanced Focus States */
*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Success Toast */
.toast {
    position: fixed;
    bottom: var(--gap-lg);
    right: var(--gap-lg);
    background-color: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px var(--shadow-hover);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Error Toast */
.toast.error {
    background-color: #D32F2F;
    color: white;
}

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #FF9800;
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-banner:not(.hidden) {
    transform: translateY(0);
}

/* Pull-to-Refresh Indicator */
.refresh-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: 50%;
    box-shadow: 0 4px 12px var(--shadow-hover);
    z-index: 9998;
    transition: transform 0.3s ease;
}

.refresh-indicator:not(.hidden) {
    transform: translateX(-50%) translateY(0);
}

.refresh-spinner {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

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

/* Celebration Animation */
.celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 8rem;
    z-index: 2000;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.celebration.show {
    transform: translate(-50%, -50%) scale(1);
    animation: celebrationPulse 0.6s ease-in-out;
}

.celebration.hidden {
    display: none;
}

@keyframes celebrationPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Confirmation Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--gap-xl);
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.modal-content h3 {
    margin-bottom: var(--gap-md);
    color: var(--text-primary);
    font-size: 1.25rem;
}

.modal-content p {
    margin-bottom: var(--gap-lg);
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: var(--gap-md);
    justify-content: flex-end;
}

.btn-secondary,
.btn-primary {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: 'Lexend', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

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

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

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

.btn-primary:hover {
    background-color: var(--text-primary);
    transform: translateY(-1px);
}

/* Loading Skeleton */
.loading-skeleton {
    padding: var(--gap-md);
}

.skeleton-card {
    height: 80px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
    margin-bottom: var(--gap-sm);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Form Validation Hints */
.input-hint {
    display: block;
    font-size: 0.75rem;
    color: #D32F2F;
    margin-top: 0.25rem;
}

input:invalid:not(:placeholder-shown) {
    border-color: #D32F2F;
    background-color: rgba(211, 47, 47, 0.05);
}

input:invalid:not(:placeholder-shown) + .input-hint {
    display: block;
}

input:valid:not(:placeholder-shown) {
    border-color: #4CAF50;
}

/* Button Loading State */
.btn-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
    body {
        padding: 0;
        padding-bottom: calc(var(--mobile-touch-target) + env(safe-area-inset-bottom, 0px)); /* Space for bottom tabs */
    }
    
    /* Header - Compact */
    header {
        padding: var(--gap-md) var(--gap-md) 0;
        margin-bottom: var(--gap-md);
    }
    
    h1 {
        font-size: 1.75rem;
        margin-bottom: var(--gap-md);
    }
    
    /* BOTTOM STICKY LOCATION TABS */
    .location-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--bg-secondary);
        border-top: 2px solid var(--border-color);
        box-shadow: 0 -2px 8px var(--shadow);
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
        z-index: 100;
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
        justify-content: stretch;
    }
    
    .location-tab {
        padding: 0;
        height: var(--mobile-touch-target);
        min-width: 0;
        font-size: 0.75rem;
        font-weight: 700;
        border-radius: var(--radius-sm);
        white-space: normal;
        word-break: break-word;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        letter-spacing: 0;
    }
    
    /* Show abbreviations on mobile */
    .location-tab::before {
        content: attr(data-short);
    }
    
    /* Hide full text on mobile */
    .location-tab {
        font-size: 0; /* Hide original text */
    }
    
    .location-tab::before {
        font-size: 0.75rem; /* Show abbreviation */
    }
    
    /* Content Area */
    .contents {
        padding: 0 var(--gap-md);
    }
    
    .log {
        position: static;
        margin-bottom: var(--gap-lg);
    }
    
    /* Show toggle button on mobile */
    .toggle-form-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Larger Touch Targets */
    .bean-btn {
        height: var(--mobile-input-height);
        font-size: 0.9rem;
    }
    
    input[type="number"] {
        height: var(--mobile-input-height);
        font-size: 16px; /* Prevents iOS zoom */
        padding: 1rem;
    }
    
    button[type="submit"] {
        height: var(--mobile-input-height);
        font-size: 1rem;
    }
    
    label {
        font-size: 0.8rem;
    }
    
    /* Filter Tabs */
    .filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: var(--gap-md);
    }
    
    .filter-tab {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Stats Summary - Single Row on Mobile */
    .stats-summary {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--gap-sm);
        padding: var(--gap-md);
        margin-bottom: var(--gap-md);
        text-align: center;
    }
    
    .stat-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
        white-space: nowrap;
    }
    
    .stat-value {
        font-size: 1.125rem;
        font-weight: 700;
    }
    
    /* Celebration */
    .celebration {
        font-size: 5rem;
    }
    
    /* CARD-BASED BREW HISTORY (Mobile Only) */
    .history {
        margin-bottom: var(--gap-lg);
    }
    
    .table-container {
        max-height: none; /* Remove height limit on mobile */
    }
    
    /* Convert table to block layout for cards */
    table {
        display: block !important;
        border-collapse: collapse;
    }
    
    /* Hide table header on mobile */
    thead {
        display: none;
    }
    
    #brew-table-body {
        display: block;
    }
    
    /* Shift Group Header - Card Style */
    .shift-group-header {
        display: block;
        position: static;
        background-color: var(--bg-primary);
        padding: var(--gap-sm) var(--gap-md);
        margin-bottom: var(--gap-sm);
        border-radius: var(--radius-md);
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-secondary);
    }
    
    .shift-group-header td {
        display: block;
        padding: 0;
        border: none;
    }
    
    /* Brew Cards - Location-specific: Two columns */
    tbody tr:not(.shift-group-header):not(.has-location) {
        display: flex !important;
        gap: var(--gap-md);
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: var(--gap-md);
        margin-bottom: var(--gap-sm);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        align-items: center;
    }
    
    /* Brew Cards - Global view: Three columns (marker + time + content) */
    tbody tr.has-location {
        display: grid !important;
        grid-template-columns: 24px auto 1fr;
        gap: 0 var(--gap-sm);
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: var(--gap-md);
        margin-bottom: var(--gap-sm);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        align-items: center;
    }
    
    tbody tr:not(.shift-group-header):active {
        background-color: var(--bg-primary);
    }
    
    tbody tr td {
        border: none;
        padding: 0;
    }
    
    /* LOCATION MARKER (Global view only) - Show and style on mobile */
    .location-marker {
        display: flex !important;
        grid-column: 1;
        grid-row: 1;
        writing-mode: vertical-rl !important;
        text-orientation: upright !important;
        font-size: 0.65rem !important;
        font-weight: 700;
        letter-spacing: 1px;
        border-radius: var(--radius-sm);
        color: white;
        width: 24px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0.5rem 0 !important;
    }
    
    /* Location marker colors - Muted café palette */
    .location-marker[data-location="Shoreditch"] {
        background-color: #7986CB;
        color: #FFFFFF;
    }
    
    .location-marker[data-location="Tower"] {
        background-color: #C19A6B;
        color: #FFFFFF;
    }
    
    .location-marker[data-location="Bankside"] {
        background-color: #81C784;
        color: #FFFFFF;
    }
    
    .location-marker[data-location="Victoria"] {
        background-color: #FFB74D;
        color: #FFFFFF;
    }
    
    .location-marker[data-location="Olympia"] {
        background-color: #BA68C8;
        color: #FFFFFF;
    }
    
    /* TIMESTAMP (location-specific cards) - Override desktop */
    tbody tr:not(.has-location) .brew-time {
        flex: 0 0 auto !important;
        font-size: 1.5rem !important;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1.2;
    }
    
    /* TIMESTAMP (global view cards with marker) - Override desktop */
    tbody tr.has-location .brew-time {
        grid-column: 2;
        grid-row: 1;
        flex: 0 0 auto !important;
        font-size: 1.5rem !important;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1.2;
        align-self: center;
    }
    
    /* CONTENT WRAPPER - Override desktop for mobile cards */
    tbody tr:not(.has-location) .brew-content {
        flex: 1;
        display: flex !important;
        flex-direction: column;
        gap: 0.25rem;
        align-items: center;
        text-align: center;
    }
    
    tbody tr.has-location .brew-content {
        grid-column: 3;
        grid-row: 1;
        display: flex !important;
        flex-direction: column;
        gap: 0.25rem;
        align-items: center;
        text-align: center;
    }
    
    /* Badges container - shift more to center */
    .brew-badges {
        display: flex !important;
        gap: var(--gap-sm);
        flex-wrap: wrap;
        justify-content: center;
        margin-left: 1.5rem;
    }
    
    /* Details container */
    .brew-details {
        display: flex !important;
        gap: 1rem;
        flex-wrap: nowrap;
        justify-content: center;
        font-size: 0.875rem;
        color: var(--text-secondary);
        white-space: nowrap;
    }
    
    /* Mobile: Hide desktop location cell */
    .brew-location-desktop {
        display: none !important;
    }
    
    /* Mobile: Override desktop and restore ORIGINAL larger pills */
    .brew-badges {
        display: flex !important;
    }
    
    .brew-badges .shift-badge,
    .brew-badges .bean-badge,
    .brew-badges .location-badge {
        display: inline-block !important;
        padding: 0.25rem 0.75rem !important; /* ORIGINAL larger size */
        font-size: 0.75rem !important; /* ORIGINAL larger text */
        border-radius: 20px !important; /* ORIGINAL larger radius */
        margin: 0;
    }
    
    /* Empty State */
    .empty-state {
        display: block;
        padding: var(--gap-xl);
    }
}
