* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #ffffff;
    color: #333;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    border: 2px solid #2196F3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-tabs {
    display: flex;
    border-bottom: 2px solid #2196F3;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.tab-btn.active {
    background: #2196F3;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #E3F2FD;
}

#loginForm {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #2196F3;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #2196F3;
    color: white;
    border: 2px solid #1976D2;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #1976D2;
}

/* POS Screen */
.pos-container {
    display: grid;
    grid-template-columns: 350px 1fr 400px;
    grid-template-rows: 1fr auto;
    height: 100vh;
    background: white;
}

.left-panel {
    background: #00897B;
    padding: 15px;
    color: white;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logout-btn {
    background: #E53935;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.logout-btn:hover {
    background: #C62828;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 8px;
    align-items: center;
}

.form-row label {
    font-size: 13px;
    font-weight: bold;
}

.form-row input,
.form-row select {
    padding: 8px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
}

.btn-icon,
.btn-add {
    padding: 8px 12px;
    background: #0288D1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-add {
    background: #FFA726;
}

.bet-input-section {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.bet-row {
    display: grid;
    grid-template-columns: 120px 1fr auto auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.bet-row label {
    font-size: 13px;
}

.bet-row input[type="text"],
.bet-row input[type="number"] {
    padding: 8px;
    border: none;
    border-radius: 4px;
}

.stats-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-item label {
    font-size: 12px;
    margin-bottom: 4px;
}

.stat-item input {
    padding: 8px;
    border: none;
    border-radius: 4px;
    text-align: center;
}

.device-info {
    margin-top: 10px;
}

.device-info input {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    text-align: center;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    margin-top: 15px;
}

.btn-buy {
    background: #E53935;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.btn-buy:hover {
    background: #C62828;
}

.btn-icon-large {
    background: #757575;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 4px;
    font-size: 24px;
    cursor: pointer;
}

/* Center Panel */
.center-panel {
    background: #E0E0E0;
    overflow-y: auto;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table thead {
    background: white;
    position: sticky;
    top: 0;
}

.summary-table th,
.summary-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #bbb;
}

.summary-table th {
    font-weight: bold;
    background: #2196F3;
    color: white;
}

/* Right Panel */
.right-panel {
    background: white;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-left: 2px solid #00897B;
}

.quick-bet {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
}

.quick-bet input {
    padding: 10px;
    border: 2px solid #2196F3;
    border-radius: 4px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

.refresh-btn,
.buy-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.refresh-btn {
    background: #66BB6A;
    color: white;
}

.buy-btn {
    background: #2196F3;
    color: white;
}

.number-buttons {
    text-align: center;
}

.num-btn {
    padding: 10px 20px;
    background: #00897B;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
}

.bet-list {
    flex: 1;
    overflow-y: auto;
    border: 2px solid #00897B;
    border-radius: 4px;
}

.bet-table {
    width: 100%;
    border-collapse: collapse;
}

.bet-table thead {
    background: #00897B;
    color: white;
    position: sticky;
    top: 0;
}

.bet-table th,
.bet-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.bet-table .green-row {
    background: #4CAF50;
    color: white;
    font-weight: bold;
}

.bet-table .gray-row {
    background: #9E9E9E;
    color: white;
}

.percentage-display {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    gap: 5px;
}

.percentage-display input {
    width: 80px;
    padding: 5px;
    text-align: center;
    border: 2px solid #2196F3;
    border-radius: 4px;
}

.percentage-display span {
    font-size: 18px;
    font-weight: bold;
}

.total-display {
    background: #00897B;
    color: white;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.total-unit,
.total-extra {
    font-size: 14px;
    font-weight: bold;
    margin: 5px 0;
}

.total-extra {
    color: #FF5252;
}

/* Bottom Toolbar */
.bottom-toolbar {
    grid-column: 1 / -1;
    background: #00897B;
    padding: 10px 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 2px solid #004D40;
}

.toolbar-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.toolbar-btn:hover {
    background: #1976D2;
}

.bottom-toolbar label {
    color: white;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.bottom-toolbar input[type="checkbox"] {
    cursor: pointer;
}

/* Responsive */
@media (max-width: 1400px) {
    .pos-container {
        grid-template-columns: 300px 1fr 350px;
    }
}

@media (max-width: 1024px) {
    .pos-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .left-panel,
    .center-panel,
    .right-panel {
        border: 2px solid #00897B;
        margin: 10px;
        border-radius: 8px;
    }
}
