:root {
    --primary: #002664; /* User requested main color */
    --primary-light: #1a4080;
    --primary-dark: #001538;
    --accent: #f59e0b; /* Accent for Waste */
    --success: #10b981;
    --danger: #ef4444;
    --bg-color: #f3f4f6;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* Header */
.app-header {
    background: var(--primary);
    color: white;
    padding: 1.5rem 1rem 1rem;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 38, 100, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.date-selector {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

.date-selector ion-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

.date-selector input {
    background: transparent;
    border: none;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

.date-selector input:disabled {
    color: white;
    opacity: 1;
    -webkit-text-fill-color: white;
    cursor: default;
}

.date-selector input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Toggles */
.toggle-container {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 10px;
}

.toggle-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.toggle-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Sub Toggles for Waste */
.sub-toggle-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.sub-toggle-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
}

.sub-toggle-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

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

/* States */
.loading-state, .empty-state {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
}

.loading-state p, .empty-state p {
    margin-top: 1rem;
    font-size: 1.1rem;
}

.empty-state ion-icon {
    font-size: 3rem;
    color: var(--border-color);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 38, 100, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* List Items */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.list-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 500;
}

.item-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Strikethrough & States */
.list-item.is-done {
    opacity: 0.6;
    background: #f9fafb;
    border-color: #f3f4f6;
}

.list-item.is-done .item-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Buttons & Controls */
.action-btn {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

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

.list-item.is-done .soldout-btn {
    background: var(--bg-color);
    color: var(--text-muted);
    pointer-events: none;
}

.stepper {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.stepper-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.8rem;
    font-size: 1.2rem;
    color: var(--primary);
    cursor: pointer;
    transition: background 0.2s;
}

.stepper-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

.stepper-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    pointer-events: none;
}

.item-qty-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    align-self: flex-start;
}

/* POS List Item clickability */
.waste-pos-item {
    cursor: pointer;
    user-select: none;
}

.waste-pos-item:active {
    transform: scale(0.98);
}
