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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #88B0A4;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.5s ease;
}

body.bg-expired {
    background: #DD6E67;
}

body.bg-warning {
    background: #E87461;
}

body.bg-caution {
    background: #C9AF98;
}

body.bg-good {
    background: #88B0A4;
}

body.bg-fresh {
    background: #194A52;
}

.dashboard-container {
    width: 100%;
    max-width: 800px;
    position: relative;
    min-height: 400px;
}

.dashboard-container.landscape-layout {
    max-width: 100%;
    width: 95vw;
    height: 90vh;
}

.two-panel-layout {
    display: flex;
    gap: 20px;
    height: 100%;
    width: 100%;
}

.left-panel {
    flex: 0 0 45%;
    min-width: 0;
}

.right-panel {
    flex: 1;
    min-width: 0;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.settings-button {
    position: absolute;
    top: -60px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 24px;
    color: white;
    transition: all 0.3s;
}

.settings-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.inventory-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.debug-card {
    background: white !important;
    border: 5px solid #DD6E67 !important;
}

.item-header {
    text-align: center;
    margin-bottom: 30px;
}

.item-name {
    font-size: 36px;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.item-category {
    font-size: 18px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.item-size {
    font-size: 16px;
    color: #999;
    margin-top: 5px;
}

.expiry-section {
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    transition: all 0.3s;
}

.expiry-section.expired {
    background: rgba(221, 110, 103, 0.3);
    border: 3px solid #DD6E67;
}

.expiry-section.warning {
    background: rgba(232, 116, 97, 0.3);
    border: 3px solid #E87461;
}

.expiry-section.caution {
    background: rgba(201, 175, 152, 0.3);
    border: 3px solid #C9AF98;
}

.expiry-section.good {
    background: rgba(136, 176, 164, 0.3);
    border: 3px solid #88B0A4;
}

.expiry-section.fresh {
    background: rgba(25, 74, 82, 0.3);
    border: 3px solid #194A52;
}

.expiry-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    opacity: 0.7;
}

.expiry-date {
    font-size: 24px;
    font-weight: bold;
}

.quantities-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.quantity-box {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.quantity-label {
    font-size: 16px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.quantity-display {
    font-size: 48px;
    font-weight: bold;
    color: #1a1a1a;
    margin: 15px 0;
}

.quantity-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.quantity-button {
    background: #C9AF98;
    color: white;
    border: none;
    border-radius: 10px;
    width: 60px;
    height: 60px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.quantity-button:hover {
    background: #B89D85;
    transform: scale(1.05);
}

.quantity-button:active {
    transform: scale(0.95);
}

.last-update {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-top: 20px;
}

.update-confirmation {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #88B0A4;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: bold;
    animation: slideIn 0.3s, slideOut 0.3s 2.7s;
    z-index: 1000;
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.settings-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.settings-header {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    color: #333;
}

.settings-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.settings-input:focus {
    outline: none;
    border-color: #667eea;
}

.weight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.weight-item {
    display: flex;
    flex-direction: column;
}

.weight-label {
    font-size: 14px;
    margin-bottom: 5px;
    color: #666;
}

.weight-input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.settings-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.settings-button-action {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.save-button {
    background: #88B0A4;
    color: white;
}

.save-button:hover {
    background: #729688;
}

.cancel-button {
    background: #E5E7EB;
    color: #333;
}

.cancel-button:hover {
    background: #D1D5DB;
}

.loading-screen {
    text-align: center;
    color: white;
    font-size: 24px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.error-message {
    background: #FEE2E2;
    color: #991B1B;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin: 20px 0;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: #C9AF98;
    transition: width 0.1s linear;
    border-radius: 0 0 0 20px;
}

.help-text {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.login-screen {
    text-align: center;
}

.login-title {
    font-size: 32px;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.login-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.google-signin-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #88B0A4;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.google-signin-button:hover {
    background: #729688;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(136, 176, 164, 0.4);
}

.user-info {
    position: absolute;
    top: -60px;
    left: 0;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.signout-button {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 5px 12px;
    border-radius: 15px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.signout-button:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Inventory Table Styles */
.inventory-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.inventory-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 2.5fr 1.5fr 1.5fr 1.5fr;
    gap: 8px;
    padding: 12px 8px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-cell {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-row {
    display: grid;
    grid-template-columns: 2.5fr 1.5fr 1.5fr 1.5fr;
    gap: 8px;
    padding: 10px 8px;
    margin-bottom: 6px;
    border-radius: 8px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.table-row.row-expired {
    background: rgba(221, 110, 103, 0.15);
    border-color: #DD6E67;
}

.table-row.row-warning {
    background: rgba(232, 116, 97, 0.15);
    border-color: #E87461;
}

.table-row.row-caution {
    background: rgba(201, 175, 152, 0.15);
    border-color: #C9AF98;
}

.table-row.row-good {
    background: rgba(136, 176, 164, 0.15);
    border-color: #88B0A4;
}

.table-row.row-fresh {
    background: rgba(25, 74, 82, 0.15);
    border-color: #194A52;
}

.table-cell {
    display: flex;
    align-items: center;
    font-size: 13px;
}

.item-name-cell {
    font-weight: 600;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expiry-cell {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
}

.expiry-date-small {
    font-size: 12px;
    color: #333;
}

.expiry-days-small {
    font-size: 11px;
    color: #666;
    font-weight: 600;
}

.quantity-cell {
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.quantity-value {
    font-size: 16px;
    font-weight: bold;
    color: #1a1a1a;
}

.quantity-controls {
    display: flex;
    gap: 4px;
}

.table-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-btn.btn-minus {
    background: #E87461;
    color: white;
}

.table-btn.btn-minus:hover {
    background: #D65E4D;
    transform: scale(1.1);
}

.table-btn.btn-plus {
    background: #88B0A4;
    color: white;
}

.table-btn.btn-plus:hover {
    background: #729688;
    transform: scale(1.1);
}

.table-btn:active {
    transform: scale(0.95);
}

/* Adjust inventory card for landscape layout */
.left-panel .inventory-card {
    height: 100%;
    min-height: auto;
}