* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.webphone-container {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.tenant-badge {
    font-size: 14px;
    opacity: 0.9;
    padding: 5px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    display: inline-block;
    margin-top: 5px;
}

.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dc3545;
    transition: all 0.3s;
}

.led.connected {
    background: #28a745;
    box-shadow: 0 0 10px #28a745;
}

.led.calling {
    background: #ffc107;
    animation: pulse 1s infinite;
}

.led.in-call {
    background: #17a2b8;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,193,7,0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255,193,7,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,193,7,0); }
}

.balance {
    font-weight: bold;
    color: #28a745;
    font-size: 18px;
}

.call-panel {
    padding: 20px;
}

.number-display {
    margin-bottom: 20px;
}

.number-display input {
    width: 100%;
    padding: 15px;
    font-size: 24px;
    text-align: center;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: monospace;
    background: #f8f9fa;
    outline: none;
}

.number-display input:focus {
    border-color: #667eea;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.key {
    aspect-ratio: 1;
    border: none;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.key:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.key:active {
    transform: translateY(0);
}

.key span {
    font-size: 12px;
    color: #adb5bd;
}

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

.btn-call {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-call:hover {
    background: #218838;
}

.btn-call:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-hangup {
    background: #dc3545;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-hangup:hover {
    background: #c82333;
}

.btn-hangup:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.call-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    display: none;
}

.call-info.active {
    display: block;
}

.timer {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    font-family: monospace;
    color: #495057;
}

.call-status {
    text-align: center;
    color: #6c757d;
    margin-top: 5px;
}

.history-panel {
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.history-panel h3 {
    margin-bottom: 15px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item .number {
    font-weight: bold;
    color: #495057;
}

.history-item .date {
    font-size: 12px;
    color: #6c757d;
}

.history-item .duration {
    font-size: 12px;
    color: #6c757d;
    margin-right: 10px;
}

.history-item .status-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}

.status-badge.answered {
    background: #d4edda;
    color: #155724;
}

.status-badge.missed {
    background: #f8d7da;
    color: #721c24;
}

.loading {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}