* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f0f2f5;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Screens */
.screen {
    display: none;
}

    .screen.active {
        display: block;
    }

/* Login Card */
.login-card {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.logo {
    font-size: 3rem;
    margin-bottom: 15px;
}

.login-card h2 {
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e94560;
}

.btn-logout {
    background: none;
    border: none;
    color: #e94560;
    cursor: pointer;
    font-size: 1rem;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: bold;
    color: #e94560;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: white;
    padding: 5px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

    .tab-btn.active {
        background: #e94560;
        color: white;
    }

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 12px;
}

    .tab-content.active {
        display: block;
    }

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Buttons */
.btn, .btn-primary, .btn-secondary, .btn-danger, .btn-small {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: #e94560;
    color: white;
}

    .btn-primary:hover {
        background: #d63a54;
    }

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-small {
    background: #e94560;
    color: white;
    font-size: 0.8rem;
    padding: 5px 12px;
}

/* Tables */
.data-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background: #fafafa;
}

/* Input Groups */
.input-group {
    margin-bottom: 15px;
}

    .input-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: 500;
    }

    .input-group input, .input-group select, .input-group textarea {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 6px;
    }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

    .modal.hidden {
        display: none;
    }

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

    .modal-footer .btn {
        flex: 1;
    }

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.error-message {
    background: #ffe0e0;
    color: #e94560;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
}

.hidden {
    display: none;
}

/* Ports Editor */
.port-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.port-label {
    width: 50px;
    font-weight: bold;
}

.port-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.button-card {
    background: #f8f9fa;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

    .button-card:hover {
        background: #e94560;
        color: white;
    }

.admin-badge {
    background: #e94560;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
}
