* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
    background: #f3f4f6;
    color: #1f2937;
}

[x-cloak] {
    display: none !important;
}

#main {
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

#wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin-top: 40px;
    margin-bottom: 40px;
}

#header {
    text-align: center;
    margin-bottom: 32px;
}

#header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1f2937;
}

#header .location-info {
    font-size: 16px;
    color: #6b7280;
}

#container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
}

#screen-1 {
    width: 100%;
}

#content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
}

#screen-1, #screen-2, #sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#sidebar {
    display: none;
    flex-direction: column;
}

#sidebar.active {
    display: flex;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

h1:hover {
    opacity: 0.7;
}

h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

#locations {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.location-btn {
    border: 2px solid #d1d5db;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.location-btn:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.location-btn.active {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

#selected-location {
    text-align: center;
    padding: 12px;
    background: #ecfdf5;
    border-radius: 6px;
    margin-bottom: 16px;
    font-weight: 500;
    color: #059669;
    min-height: 24px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-weight: 500;
    font-size: 14px;
}

input, select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.button-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

button {
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit {
    background: #10b981;
    color: #fff;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
}

.btn-submit:hover:not(:disabled) {
    background: #059669;
}

.btn-submit:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.btn-close {
    background:  #059669;
    color: #fff;
    padding: 18px;
    font-size: 18px;
    flex-shrink: 0;
    height: 60px;
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#orders-container {
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#orders-container h2 {
    margin-top: 0;
}

#orders-list {
    flex: 1;
    overflow-y: auto;
}

.order-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-left: 4px solid #d1d5db;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f9fafb;
    gap: 22px;
}

.order-item.open {
    border-left-color: #3b82f6;
}

.order-item.in-progress {
    border-left-color: #10b981;
}

.order-item.completed {
    border-left-color: #10b981;
    background: #f0fdf4;
    opacity: 0.7;
}

.order-status {
    font-size: 14px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

.order-status.open {
    background: #dbeafe;
    color: #1e40af;
}

.order-status.in-progress {
    background: #dcfce7;
    color: #166534;
}

.order-status.completed {
    background: #dcfce7;
    color: #166534;
}

.order-info {
    min-width: 0;
    overflow: hidden;
}

.order-details {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.order-room {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-meta {
    font-size: 16px;
    line-height: 1.25;
    color: oklch(44.6% 0.043 257.281);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 32px 16px;
    color: #9ca3af;
    min-height: 200px;
    flex: 1;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

#screen-2 {
    display: none;
}

#screen-2.active {
    display: block;
}

#sidebar {
    display: none;
}

#sidebar.active {
    display: flex;
}

@media (max-width: 1024px) {
    #content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #locations {
        grid-template-columns: 1fr;
    }
}

#error-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 8px;
    padding: 16px;
    margin-top: 24px;
    width: 100%;
}

.error-content {
    color: #dc2626;
    font-size: 14px;
    display: flex;
    gap: 8px;
}

.error-content strong {
    font-weight: 600;
}

.btn-error-close {
    background: transparent;
    color: #dc2626;
    padding: 8px;
    font-size: 16px;
    flex-shrink: 0;
}

.btn-error-close:hover {
    background: #fee2e2;
}
