* { box-sizing: border-box; }
html, body { 
	margin: 0 !important; 
	padding: 0 !important; 
	width: 100% !important;
	height: 100% !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
	background-color: #f0f0f5 !important; 
	color: #333 !important; 
	-webkit-tap-highlight-color: transparent; 
}

/* Views - Forced to top z-index layer ONLY when active */
.login-screen, .app-screen { 
	display: none !important; 
}

.login-screen.active { 
	display: flex !important; 
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	z-index: 99999999 !important;
	background: #f4ead7 !important;
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch !important;
	box-sizing: border-box !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
}

.app-screen.active { 
	display: block !important; 
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	z-index: 99999999 !important;
	background: #f4ead7 !important;
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch !important;
	box-sizing: border-box !important;
}

.view { 
	display: none; 
	min-height: 100%; 
	flex-direction: column; 
	background: #f0f0f5;
}
.view.active { 
	display: flex !important; 
	animation: slideIn 0.3s ease; 
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Header */
.app-header { background: var(--primary); color: #fff; padding: 15px; display: flex; align-items: center; position: sticky; top: 0; z-index: 10; flex-shrink: 0; }
.app-header h1 { margin: 0; font-size: 18px; flex: 1; text-align: center; }
.btn-back { background: none; border: none; color: #fff; font-size: 20px; padding: 0 10px; cursor: pointer; }

/* Content */
.view-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 15px; padding-bottom: 90px; }

/* Login Keypad */
.login-box { text-align: center; width: 100%; max-width: 320px; margin: 0 auto; padding: 20px; background: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); }
#pin-input { font-size: 30px; letter-spacing: 10px; text-align: center; width: 100%; padding: 10px; border: 2px solid #ccc; border-radius: 8px; margin-bottom: 20px; outline: none; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 260px; margin: 0 auto; }
.keypad button { padding: 18px; font-size: 22px; font-weight: bold; border-radius: 50%; border: none; background: #f5f5f5; box-shadow: 0 2px 5px rgba(0,0,0,0.1); cursor: pointer; color: #333; }
.keypad button:active { background: #e0e0e0; transform: scale(0.95); }
.btn-enter { background: var(--primary) !important; color: #fff !important; }

/* Cards (Home) */
.card-btn { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 15px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05); cursor: pointer; }
.card-btn:active { transform: scale(0.98); }
.card-btn .icon { font-size: 40px; display: block; margin-bottom: 10px; }
.card-btn h3 { margin: 0 0 5px 0; color: var(--primary); }
.card-btn p { margin: 0; font-size: 14px; color: #666; }

/* Lists */
.list-view { display: flex; flex-direction: column; gap: 1px; background: #e0e0e0; border-radius: 8px; overflow: hidden; }
.list-item { background: #fff; padding: 15px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.list-item:active { background: #f9f9f9; }
.has-arrow::after { content: '>'; color: #aaa; font-weight: bold; }

/* Toggles */
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .3s; border-radius: 26px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: #d32f2f; }
input:checked + .slider:before { transform: translateX(24px); }

.item-soldout-row { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 15px; border-bottom: 1px solid #eee; }
.item-info strong { display: block; }
.item-info small { color: #888; }

/* Search */
#search-soldout { width: 100%; padding: 15px; font-size: 16px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 15px; }

/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: #fff; display: flex; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.bottom-nav button { flex: 1; border: none; background: none; font-size: 12px; color: #888; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.bottom-nav button.active { color: var(--primary); font-weight: bold; }

/* Mobile Dish Editor */
.item-edit-card { background: #fff; border-radius: 10px; padding: 12px 15px; margin-bottom: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.06); display: flex; flex-direction: column; gap: 8px; border: 1px solid #e5e5e5; }
.item-edit-card .row-top { display: flex; gap: 10px; align-items: center; }
.item-edit-card .inp-item-name { flex: 1; font-size: 15px; font-weight: 600; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; outline: none; }
.item-edit-card .inp-item-name:focus { border-color: var(--primary); }
.item-edit-card .row-middle { display: flex; gap: 10px; }
.item-edit-card .inp-item-price { width: 90px; font-size: 14px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; outline: none; }
.item-edit-card .inp-item-note { flex: 1; font-size: 14px; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; outline: none; }
.item-edit-card .row-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; border-top: 1px solid #f0f0f0; margin-top: 2px; }
.item-edit-card .btn-del-item-mob { background: #fff0f0; color: #d32f2f; border: 1px solid #ffcdd2; border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.btn-add-item-mob { width: 100%; padding: 14px; background: #e8f5e9; color: #2e7d32; border: 2px dashed #a5d6a7; border-radius: 10px; font-size: 15px; font-weight: bold; cursor: pointer; margin-top: 10px; margin-bottom: 12px; }
.btn-add-sec-mob { width: 100%; padding: 12px; background: #f5f5f5; color: #333; border: 1px dashed #ccc; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 10px; }
.btn-save-menu-mob { width: 100%; padding: 15px; background: var(--primary); color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: bold; cursor: pointer; margin-bottom: 25px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-save-menu-mob:active { transform: scale(0.98); }

/* Toast */
#toast { visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center; border-radius: 4px; padding: 16px; position: fixed; z-index: 1000; left: 50%; bottom: 80px; transform: translateX(-50%); font-size: 14px; }
#toast.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 80px; opacity: 1;} }
@keyframes fadeout { from {bottom: 80px; opacity: 1;} to {bottom: 0; opacity: 0;} }
