/* TWC POS — Mobile-first */
#twc-pos-app {
    max-width: 600px;
    margin: 0 auto;
    padding: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: #1e293b;
}

.pos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 16px;
}
.pos-title { margin: 0; font-size: 20px; }
.pos-user { font-size: 13px; color: #64748b; }

.pos-step {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}
.pos-step-label {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    color: #334155;
}

/* Company grid */
.pos-company-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.pos-company-card {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.pos-company-card.active {
    border-width: 3px;
    background: #f0f9ff;
}

/* Search */
.pos-search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.pos-search-box input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
}
.pos-dropdown {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 8px;
    background: #fff;
}
.pos-dropdown-item {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.pos-dropdown-item:active { background: #f0f9ff; }
.pos-dropdown-item strong { display: block; font-size: 15px; }
.pos-dropdown-item small { color: #64748b; font-size: 13px; }
.pos-source-tag {
    display: inline-block;
    font-size: 12px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
    vertical-align: middle;
}
.pos-hint {
    font-size: 13px;
    color: #64748b;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0;
}

.pos-selected-card {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
}
.pos-selected-card strong { display: block; margin-bottom: 4px; }

/* Form */
.pos-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.pos-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}
.pos-field input, .pos-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}
.pos-field-full { grid-column: 1 / -1; }

/* Items */
.pos-item-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}
.pos-item-row .pos-item-top {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.pos-item-row .pos-item-name {
    flex: 1;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
}
.pos-item-row .pos-item-nums {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
}
.pos-item-row .pos-item-nums input {
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    text-align: center;
}
.pos-item-row .pos-item-nums .pos-item-sub {
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
}
.pos-item-del {
    background: none;
    border: none;
    font-size: 20px;
    color: #ef4444;
    cursor: pointer;
    padding: 4px 8px;
    -webkit-tap-highlight-color: transparent;
}

/* Product search dropdown */
.pos-item-dropdown {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.pos-prod-pick {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.pos-prod-pick:active { background: #f0f9ff; }
.pos-prod-pick strong { display: block; font-size: 14px; }
.pos-prod-meta {
    font-size: 13px;
    color: #64748b;
}

/* Total bar */
.pos-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    margin-top: 12px;
    background: #0f172a;
    color: #fff;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
}
.pos-total-amount { font-size: 24px; }

/* Buttons */
.pos-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
}
.pos-btn-sm { padding: 8px 12px; font-size: 14px; }
.pos-btn-lg { padding: 16px; font-size: 18px; }
.pos-btn-block { width: 100%; }
.pos-btn-primary { background: #2563eb; color: #fff; }
.pos-btn-primary:active { background: #1d4ed8; }
.pos-btn-primary:disabled { background: #94a3b8; }
.pos-btn-outline {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
}
.pos-btn-outline:active { background: #f1f5f9; }

/* Radio group (payment) */
.pos-radio-group {
    display: flex;
    gap: 8px;
}
.pos-radio-btn {
    flex: 1;
    padding: 10px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
}
.pos-radio-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

/* Toggle */
.pos-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}
.pos-toggle input { width: 18px; height: 18px; }

.pos-invoice-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

/* Submit area */
.pos-submit-area {
    margin-top: 16px;
    margin-bottom: 40px;
}

/* Result */
.pos-result-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 10px;
    padding: 20px;
    margin-top: 12px;
    text-align: center;
}
.pos-result-success h3 {
    color: #16a34a;
    margin: 0 0 8px;
    font-size: 20px;
}
.pos-result-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 16px;
    margin-top: 12px;
    color: #dc2626;
    text-align: center;
}

.pos-print-btn {
    margin-top: 12px;
    background: #0f172a;
    color: #fff;
}
.pos-new-order-btn {
    margin-top: 8px;
}

/* Login */
.twc-pos-login {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
}
.twc-pos-login a { color: #2563eb; font-weight: 600; }

/* Print */
@media print {
    body * { display: none !important; }
    #pos-print-area, #pos-print-area * { display: block !important; }
    #pos-print-area {
        position: fixed;
        top: 0; left: 0;
        width: 80mm;
        font-family: monospace;
        font-size: 12px;
        color: #000;
        padding: 4mm;
    }
    .print-header { text-align: center; font-weight: bold; font-size: 14px; margin-bottom: 4px; }
    .print-line { border-top: 1px dashed #000; margin: 4px 0; }
    .print-row { display: flex !important; justify-content: space-between; }
    .print-total { font-weight: bold; font-size: 14px; }
}
