/* CSS Variables */
:root {
    --color-bg: #f5f5f5;
    --color-surface: #ffffff;
    --color-text: #1a1a1a;
    --color-text-secondary: #666666;
    --color-border: #e0e0e0;
    --color-primary: #2563eb;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-warning: #f59e0b;

    /* Aggregator colors */
    --color-wolt: #00c2e8;
    --color-foodora: #d70f64;
    --color-uber: #000000;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --header-height: 60px;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Screens */
.screen {
    height: 100vh;
    width: 100vw;
}

/* Login Screen */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}

.login-container {
    background: var(--color-surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    width: 100%;
    max-width: 360px;
}

.login-container h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.login-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

.pin-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: transparent;
    transition: all 0.2s;
}

.pin-dot.filled {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.pin-error {
    color: var(--color-danger);
    font-size: 14px;
    min-height: 20px;
    margin-bottom: 16px;
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 280px;
    margin: 0 auto;
}

.pin-key {
    aspect-ratio: 1;
    font-size: 24px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.15s;
}

.pin-key:hover {
    background: var(--color-border);
}

.pin-key:active {
    transform: scale(0.95);
}

.pin-key-empty {
    background: transparent;
    cursor: default;
}

.pin-key-empty:hover {
    background: transparent;
}

.pin-key-delete {
    font-size: 20px;
}

/* Main Screen */
#main-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: all 0.15s;
}

.icon-btn:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.venue-name {
    font-size: 14px;
    color: var(--color-text-secondary);
    padding: 6px 12px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
}

/* Connection Banner */
.connection-banner {
    background: var(--color-warning);
    color: white;
    padding: 8px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Kanban Board */
.kanban-board {
    flex: 1;
    display: flex;
    gap: 16px;
    padding: 16px;
    overflow-x: auto;
    overflow-y: hidden;
}

.kanban-column {
    flex: 1;
    min-width: 320px;
    max-width: 400px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.column-header {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.column-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.column-count {
    background: var(--color-bg);
    color: var(--color-text-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

#column-pending .column-count {
    background: var(--color-warning);
    color: white;
}

.column-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Order Card */
.order-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.order-card:hover {
    box-shadow: var(--shadow-md);
}

.order-card.new-order {
    animation: slideIn 0.3s ease-out;
}

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

.order-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.order-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aggregator-badge {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.aggregator-badge.wolt {
    background: var(--color-wolt);
}

.aggregator-badge.foodora {
    background: var(--color-foodora);
}

.aggregator-badge.uber {
    background: var(--color-uber);
}

.order-number {
    font-size: 18px;
    font-weight: 600;
}

.order-type-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    text-transform: capitalize;
}

.order-type-badge.delivery {
    background: #e0f2fe;
    color: #0369a1;
}

.order-type-badge.pickup {
    background: #dcfce7;
    color: #166534;
}

.customer-name {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.order-items {
    margin-bottom: 12px;
    font-size: 14px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.item-name {
    display: flex;
    gap: 6px;
}

.item-quantity {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.item-modifiers {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-left: 24px;
    font-style: italic;
}

.order-comment {
    background: #fef3c7;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 12px;
    border-left: 3px solid var(--color-warning);
}

.order-total {
    font-size: 16px;
    font-weight: 600;
    text-align: right;
    margin-bottom: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}

.order-time {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

/* Time Selection */
.time-selection {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.time-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.time-btn:hover {
    border-color: var(--color-primary);
}

.time-btn.selected {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

/* Action Buttons */
.order-actions {
    display: flex;
    gap: 8px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-accept {
    background: var(--color-success);
    color: white;
}

.btn-accept:hover {
    background: #15803d;
}

.btn-reject {
    background: var(--color-bg);
    color: var(--color-danger);
    max-width: 60px;
}

.btn-reject:hover {
    background: #fee2e2;
}

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

.btn-ready:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
}

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

.btn-close-store {
    background: var(--color-danger);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-close-store:hover {
    background: #b91c1c;
}

/* Ready Card (compact) */
.order-card.ready-card {
    padding: 12px;
}

.ready-card .order-header {
    margin-bottom: 0;
}

.ready-card .order-items,
.ready-card .order-comment,
.ready-card .order-total,
.ready-card .time-selection {
    display: none;
}

/* Settings Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.sidebar.visible {
    transform: translateX(0);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.setting-item label {
    font-size: 15px;
}

.setting-value {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--color-border);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.visible {
    display: block;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-border);
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: var(--color-success);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Responsive */
@media (max-width: 1024px) {
    .kanban-column {
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .kanban-board {
        padding: 12px;
        gap: 12px;
    }

    .kanban-column {
        min-width: 260px;
    }

    .header-title {
        font-size: 16px;
    }

    .venue-name {
        display: none;
    }
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--color-text-secondary);
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}
